:root {
    --navy-900: #081c33;
    --navy-800: #0b2545;
    --navy-700: #13315c;
    --navy-600: #1e3a68;
    --blue: #1d4ed8;
    --blue-600: #2563eb;
    --blue-100: #e6edfb;
    --ink: #0f172a;
    --muted: #5b6b82;
    --line: #d6dee9;
    --bg: #eef2f7;
    --surface: #ffffff;
    --ok: #0f7b4f;
    --ok-bg: #e3f5ec;
    --warn: #9a6100;
    --warn-bg: #fdf1dc;
    --info: #1d4ed8;
    --info-bg: #e6edfb;
    --danger: #b42318;
    --danger-bg: #fdeceb;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(11, 37, 69, .08), 0 8px 24px rgba(11, 37, 69, .06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 13.5px;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--navy-800); }

.shell { display: flex; min-height: 100vh; }

/* ---------------------------------------------------------------- */
/* Sidebar                                                           */
/* ---------------------------------------------------------------- */

.sidebar {
    width: 252px;
    flex: 0 0 252px;
    background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
    color: #dbe4f0;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.brand-logo { width: 38px; height: 38px; border-radius: 6px; object-fit: contain; background: #fff; padding: 3px; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 6px;
    background: var(--blue-600); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.brand-text strong { color: #fff; font-size: 12.5px; }
.brand-text span { font-size: 10.5px; color: #93a6c0; text-transform: uppercase; letter-spacing: .04em; }

.nav { padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 6px;
    color: #cdd9ea; font-size: 13px; font-weight: 500;
    text-decoration: none;
}
.nav-link:hover { background: rgba(255, 255, 255, .07); text-decoration: none; color: #fff; }
.nav-link.active { background: var(--blue-600); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
.nav-ico { width: 16px; text-align: center; opacity: .85; font-size: 12px; }
.nav-count {
    margin-left: auto; background: #ef4444; color: #fff;
    border-radius: 999px; font-size: 10.5px; padding: 1px 6px; font-weight: 700;
}

.sidebar-foot {
    padding: 12px; border-top: 1px solid rgba(255, 255, 255, .09);
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.who { display: flex; flex-direction: column; line-height: 1.3; overflow: hidden; }
.who strong { color: #fff; font-size: 12.5px; }
.who span { font-size: 11px; color: #9db0c9; }
.who .muted { color: #7f93ae; font-size: 10.5px; }

/* ---------------------------------------------------------------- */
/* Main                                                              */
/* ---------------------------------------------------------------- */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 17px; }
.crumb { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }

.bell { position: relative; font-size: 20px; color: var(--navy-700); }
.bell-count {
    position: absolute; top: -6px; right: -8px; background: #ef4444; color: #fff;
    font-size: 10px; padding: 1px 5px; border-radius: 999px; font-weight: 700;
    font-family: Inter, sans-serif;
}

.content { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.foot {
    margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--line);
    background: var(--surface); font-size: 11.5px; color: var(--muted);
    display: flex; justify-content: space-between; gap: 12px;
}
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- */
/* Cards & grid                                                      */
/* ---------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-head {
    padding: 12px 16px; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: #f8fafc;
}
.card-head h2 { font-size: 14px; }
.card-head .sub { font-size: 11.5px; color: var(--muted); }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.stats { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; display: flex; flex-direction: column; gap: 3px;
    border-left: 4px solid var(--navy-700);
}
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat-value { font-size: 19px; color: var(--navy-800); }
.stat-sub { font-size: 11.5px; color: var(--muted); }
.stat.tone-ok { border-left-color: var(--ok); }
.stat.tone-warn { border-left-color: #d69e2e; }
.stat.tone-info { border-left-color: var(--blue-600); }
.stat.tone-danger { border-left-color: var(--danger); }

/* ---------------------------------------------------------------- */
/* Tables (rapat / padat data)                                       */
/* ---------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
    text-align: left; background: #f1f5f9; color: var(--navy-700);
    font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
    padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 8px 10px; border-bottom: 1px solid #eef2f7; vertical-align: middle; }
table.data tbody tr:hover { background: #f8fbff; }
table.data tfoot td { background: #f8fafc; font-weight: 700; border-top: 1px solid var(--line); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .ctr { text-align: center; }
table.data .empty { text-align: center; color: var(--muted); padding: 22px 10px; }
table.data tr.row-warn td { background: #fffbf3; }
table.data tbody tr.group-row td { background: #eaf0f9; font-weight: 700; color: var(--navy-800); }
.mono { font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; font-size: 12px; }

/* ---------------------------------------------------------------- */
/* Badges, buttons, forms                                            */
/* ---------------------------------------------------------------- */

.badge {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #eef2f7; color: var(--muted); }

.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 13px; border-radius: 6px; border: 1px solid transparent;
    font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none;
    background: #eef2f7; color: var(--navy-800); line-height: 1.2;
    font-family: inherit;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-dark { background: var(--navy-800); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warn { background: #d97706; color: #fff; }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .3); color: #dbe4f0; }
.btn-outline { background: #fff; border-color: var(--line); color: var(--navy-800); }
.btn-sm { padding: 4px 9px; font-size: 11.5px; }
.btn-lg { padding: 10px 18px; font-size: 13.5px; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

label.field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--navy-700); }
label.field span.req { color: var(--danger); }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email], input[type=tel], select, textarea {
    font-family: inherit; font-size: 13px; color: var(--ink);
    padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-100); border-color: var(--blue-600); }
textarea { min-height: 68px; resize: vertical; }
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .span-2 { grid-column: span 2; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.hint { font-size: 11.5px; color: var(--muted); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters label.field { min-width: 140px; }

.alert { padding: 10px 14px; border-radius: 6px; font-size: 12.5px; border: 1px solid transparent; }
.alert-ok, .alert-success { background: var(--ok-bg); color: var(--ok); border-color: #b9e3cd; }
.alert-warn { background: var(--warn-bg); color: var(--warn); border-color: #f0d9a8; }
.alert-danger, .alert-error { background: var(--danger-bg); color: var(--danger); border-color: #f5c3bf; }
.alert-info { background: var(--info-bg); color: var(--info); border-color: #c5d5f8; }

.stepper { display: flex; gap: 0; margin: 0; padding: 0; list-style: none; flex-wrap: wrap; }
.stepper li {
    display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 20px;
    background: #eef2f7; color: var(--muted); font-size: 12px; font-weight: 600;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%, 12px 50%);
    margin-right: 3px;
}
.stepper li:first-child { clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); padding-left: 14px; }
.stepper li.done { background: #d6e6da; color: var(--ok); }
.stepper li.current { background: var(--navy-700); color: #fff; }

.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 12.5px; }
.dl dt { color: var(--muted); font-weight: 600; }
.dl dd { margin: 0; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tabs a {
    padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted);
    border-bottom: 2px solid transparent; text-decoration: none;
}
.tabs a.active { color: var(--navy-800); border-bottom-color: var(--blue-600); }

.login-page {
    min-height: 100vh; display: grid; place-items: center; padding: 24px;
    background: radial-gradient(1000px 600px at 15% 10%, #1e3a68 0%, transparent 60%),
                radial-gradient(900px 600px at 85% 90%, #123a63 0%, transparent 55%),
                linear-gradient(160deg, #081c33 0%, #0b2545 55%, #122f52 100%);
}
.login-card {
    width: 100%; max-width: 940px; display: grid; grid-template-columns: 1.1fr 1fr;
    background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(3, 12, 27, .45);
}
.login-art { background: linear-gradient(160deg, var(--navy-800), var(--navy-600)); color: #fff; padding: 34px 32px; }
.login-art h2 { color: #fff; font-size: 22px; line-height: 1.3; margin-bottom: 10px; }
.login-art p { color: #b9c9de; font-size: 13px; line-height: 1.6; }
.login-art ul { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 8px; }
.login-art li { font-size: 12.5px; color: #d5e0ee; display: flex; gap: 8px; }
.login-form { padding: 32px 30px; }
.login-form h3 { font-size: 18px; margin-bottom: 4px; }
.cred-box { margin-top: 18px; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 11.5px; color: var(--muted); }
.cred-box table { width: 100%; border-collapse: collapse; }
.cred-box td { padding: 2px 0; font-family: "JetBrains Mono", monospace; font-size: 11px; }

.info-strip {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
    background: #f8fafc; border: 1px dashed var(--line); border-radius: var(--radius);
    padding: 10px 14px; font-size: 12px; color: var(--muted);
}
.info-strip strong { color: var(--navy-800); }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.timeline li { display: flex; gap: 10px; font-size: 12.5px; }
.timeline .dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--blue-600); margin-top: 5px; flex: 0 0 9px;
}
.timeline .t-body strong { display: block; color: var(--navy-800); }
.timeline .t-body span { color: var(--muted); font-size: 11.5px; }

.role-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fbfcfe; }

@media (max-width: 1000px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; flex: none; height: auto; position: relative; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .grid-side, .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .login-card { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- */
/* Cetak                                                             */
/* ---------------------------------------------------------------- */

@media print {
    .sidebar, .topbar, .foot, .no-print { display: none !important; }
    .content { padding: 0; }
    body { background: #fff; font-size: 12px; }
    .card { box-shadow: none; border: none; }
}
