/* =========================================================
   Organizational Dependency Assessment — Stylesheet
   Palet: navy-slate + teal accent, dirancang untuk konteks
   dashboard risiko organisasi (bukan tema SaaS generik).
   ========================================================= */

:root {
    --navy-900: #101A2B;
    --navy-800: #16233A;
    --navy-700: #1E3050;
    --slate-600: #4A5A6E;
    --slate-400: #7C8A9C;
    --slate-200: #D9DEE6;
    --bg-app: #EEF1F6;
    --bg-card: #FFFFFF;
    --ink: #1B2430;
    --teal-600: #2F7A6B;
    --teal-700: #246054;
    --teal-100: #E1F0EC;

    --risk-critical: #B23A2E;
    --risk-critical-bg: #FBE8E5;
    --risk-high: #C97A2C;
    --risk-high-bg: #FBEEE0;
    --risk-medium: #A98A1F;
    --risk-medium-bg: #FAF3DC;
    --risk-low: #2F7A4F;
    --risk-low-bg: #E4F3E9;

    --radius: 8px;
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-data: 'IBM Plex Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-ui);
    background: var(--bg-app);
    color: var(--ink);
    font-size: 14.5px;
    line-height: 1.5;
}

a { color: var(--teal-700); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; color: var(--slate-600); }

/* ---------- App Shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--navy-800);
    color: #E8ECF2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.5rem 1.25rem 1rem;
}
.brand-mark {
    width: 36px; height: 36px;
    background: var(--teal-600);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-data);
    font-weight: 600;
    font-size: .85rem;
    color: white;
}
.brand-text {
    font-size: .8rem;
    font-weight: 600;
    color: #C9D2DE;
    line-height: 1.3;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: .5rem .75rem;
    gap: .1rem;
    overflow-y: auto;
}
.sidebar-nav a {
    color: #B7C1CF;
    padding: .6rem .75rem;
    border-radius: 6px;
    font-size: .9rem;
    font-weight: 500;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.sidebar-nav a.active { background: var(--teal-600); color: #fff; }
.sidebar-divider {
    margin: .9rem .75rem .3rem;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--slate-400);
}

.sidebar-footer {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.08);
}
.user-chip { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--teal-600); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .85rem;
}
.user-name { font-size: .85rem; font-weight: 600; color: #fff; }
.user-role { font-size: .75rem; color: var(--slate-400); }
.logout-link { font-size: .8rem; color: var(--slate-400); }
.logout-link:hover { color: #fff; }

.main-content {
    flex: 1;
    padding: 2rem 2.5rem;
    max-width: 1200px;
}

/* ---------- Auth (login) ---------- */
.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--navy-900);
    background-image: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 100%);
}
.auth-card {
    background: var(--bg-card);
    padding: 2.5rem 2.25rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.auth-brand {
    display: flex; align-items: center; gap: .6rem; margin-bottom: 1.75rem;
}
.auth-title { font-size: 1.15rem; margin-bottom: .25rem; }
.auth-subtitle { font-size: .85rem; color: var(--slate-400); margin-bottom: 1.5rem; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1.1rem; }
label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: .35rem; color: var(--slate-600); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
    width: 100%;
    padding: .65rem .75rem;
    border: 1px solid var(--slate-200);
    border-radius: 6px;
    font-family: var(--font-ui);
    font-size: .9rem;
    background: #fff;
    color: var(--ink);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--teal-600);
    box-shadow: 0 0 0 3px var(--teal-100);
}
textarea { resize: vertical; min-height: 80px; }

.btn {
    display: inline-block;
    padding: .65rem 1.25rem;
    border-radius: 6px;
    border: none;
    font-family: var(--font-ui);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.btn-primary { background: var(--teal-600); color: #fff; }
.btn-primary:hover { background: var(--teal-700); text-decoration: none; }
.btn-secondary { background: #fff; color: var(--ink); border: 1px solid var(--slate-200); }
.btn-secondary:hover { border-color: var(--slate-400); text-decoration: none; }
.btn-danger { background: var(--risk-critical); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: .4rem .8rem; font-size: .8rem; }

/* ---------- Cards / Panels ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ---------- Stat grid ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
}
.stat-label { font-size: .78rem; color: var(--slate-400); margin-bottom: .3rem; }
.stat-value { font-family: var(--font-data); font-size: 1.7rem; font-weight: 600; color: var(--navy-800); }
.stat-sub { font-size: .75rem; color: var(--slate-400); margin-top: .2rem; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { padding: .7rem .8rem; text-align: left; border-bottom: 1px solid var(--slate-200); }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--slate-400); font-weight: 600; }
tr:hover td { background: #FAFBFD; }
td.num { font-family: var(--font-data); }

/* ---------- Badges / Risk ---------- */
.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
}
.risk-critical { background: var(--risk-critical-bg); color: var(--risk-critical); }
.risk-high { background: var(--risk-high-bg); color: var(--risk-high); }
.risk-medium { background: var(--risk-medium-bg); color: var(--risk-medium); }
.risk-low { background: var(--risk-low-bg); color: var(--risk-low); }

/* ---------- Score bar ---------- */
.score-bar-track {
    background: var(--slate-200);
    border-radius: 4px;
    height: 8px;
    width: 100%;
    overflow: hidden;
}
.score-bar-fill { height: 100%; border-radius: 4px; }
.score-bar-row { display: flex; align-items: center; gap: .75rem; margin-bottom: .6rem; }
.score-bar-label { width: 140px; font-size: .8rem; color: var(--slate-600); flex-shrink: 0; }
.score-bar-value { width: 36px; font-family: var(--font-data); font-size: .8rem; text-align: right; flex-shrink: 0; }

/* ---------- Flash messages ---------- */
.flash {
    padding: .8rem 1.1rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-size: .88rem;
}
.flash-success { background: var(--teal-100); color: var(--teal-700); }
.flash-error { background: var(--risk-critical-bg); color: var(--risk-critical); }
.flash-info { background: #E4EDF7; color: var(--navy-700); }

/* ---------- Likert scale (ODS response form) ---------- */
.likert-item {
    padding: 1.1rem 0;
    border-bottom: 1px solid var(--slate-200);
}
.likert-question { font-size: .92rem; margin-bottom: .8rem; color: var(--ink); }
.likert-options {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}
.likert-option {
    flex: 1;
    min-width: 90px;
    text-align: center;
}
.likert-option input { display: none; }
.likert-option label {
    display: block;
    padding: .6rem .4rem;
    border: 1px solid var(--slate-200);
    border-radius: 6px;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 500;
    color: var(--slate-600);
    margin: 0;
}
.likert-option input:checked + label {
    background: var(--teal-600);
    border-color: var(--teal-600);
    color: #fff;
}

/* ---------- Public respond page ---------- */
.respond-shell {
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}
.respond-header { margin-bottom: 2rem; }

/* ---------- Utility ---------- */
.text-muted { color: var(--slate-400); }
.text-sm { font-size: .82rem; }
.mt-1 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.filter-bar { display: flex; gap: .75rem; margin-bottom: 1.25rem; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .form-group { margin-bottom: 0; min-width: 180px; }
.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--slate-400); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; overflow-x: auto; }
    .sidebar-nav { flex-direction: row; }
    .sidebar-footer { display: none; }
    .main-content { padding: 1.25rem; }
}
