/* =========================================================
   SIM-FRONT — stylesheet utama
   Tanpa build step. Dimuat dari layouts/app & auth/login.
   ========================================================= */

:root {
    --navy: #0b2a6b;
    --navy-2: #12388a;
    --blue: #2563eb;
    --blue-700: #1d4ed8;
    --blue-50: #eff4ff;
    --blue-100: #e0e9ff;
    --navy-3: #0b2a6b;
    --navy-4: #ff0101;

    --bg: #f0f0f0;
    --surface: #fff;
    --line: #d3d3d3;
    --line-2: #eef1f6;
    --text: #0f1b33;
    --muted: #64748b;
    --muted-2: #94a3b8;

    --ok: #15803d;
    --ok-bg: #dcfce7;
    --err: #b91c1c;
    --err-bg: #fee2e2;
    --warn: #b45309;
    --warn-bg: #fef3c7;

    --radius: 12px;
    --radius-sm: 9px;
    --shadow-sm: 0 1px 2px #63718f;
    --shadow-pop: 0 18px 40px -12px #63718f;
    --ring: 0 0 0 3px rgba(37, 99, 235, .28);
    --ease: cubic-bezier(.2, .8, .2, 1);

    --sidebar: 230px;
    --topbar: 60px;
    --font: "Plus Jakarta Sans", Inter, system-ui, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 12px); }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
[hidden] { display: none !important; }
button { font-family: inherit; }
body:has(dialog[open]) { overflow: hidden; }

.sr-only {
    position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important;
    overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}
.skip {
    position: fixed; left: 12px; top: -60px; z-index: 100;
    background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm);
    transition: top .15s;
}
.skip:focus { top: 12px; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ---------- Ikon ---------- */
.i {
    width: 1.2em; height: 1.2em; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Progress bar atas (navigasi / loading) ---------- */
.topbar-progress {
    position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 200; pointer-events: none;
    opacity: 0; transition: opacity .25s;
}
.topbar-progress.on { opacity: 1; }
.topbar-progress i {
    display: block; height: 100%; width: 0; background: linear-gradient(90deg, #60a5fa, var(--blue));
    border-radius: 0 3px 3px 0; box-shadow: 0 0 8px rgba(37, 99, 235, .6);
    transition: width .25s ease-out;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar);
    background: var(--navy); color: #fff; padding: 16px 12px;
    display: flex; flex-direction: column; overflow-y: auto; z-index: 40;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 22px; }
.brand .logo {
    width: 34px; height: 34px; border-radius: 9px; background: var(--blue);
    display: grid; place-items: center; font-weight: 800; font-size: 14px;
}
.brand b { display: block; font-size: 15px; letter-spacing: .3px; line-height: 1.2; }
.brand small { font-size: 11px; opacity: .65; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a, .logout button {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: #cbd5f5; font-size: 13.5px; font-weight: 500;
    background: none; border: 0; cursor: pointer; text-align: left;
    transition: background .15s, color .15s;
}
.nav a:hover, .logout button:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.nav a.active { background: var(--blue); color: #fff; box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .8); }
.sidebar :focus-visible { box-shadow: 0 0 0 3px rgba(147, 197, 253, .55); }
.logout { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 12px; }

.scrim {
    position: fixed; inset: 0; background: rgba(8, 20, 50, .5); z-index: 35;
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s;
}

/* =========================================================
   KONTEN & TOPBAR
   ========================================================= */
.main { margin-left: var(--sidebar); min-height: 100vh; }
.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--topbar);
    background: #fff; backdrop-filter: blur(8px);
    border-bottom: 2px solid var(--navy-3);
    display: flex; justify-content: space-between; align-items: center; padding: 0 28px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 40px; height: 40px; display: none; place-items: center;
    border: 2px solid var(--navy-3); background: #ffffff; border-radius: 10px; cursor: pointer; color: var(--text);
    transition: background .15s;
}
.icon-btn:hover { background: var(--blue-50); }
.icon-btn .i { width: 20px; height: 20px; }s
.topbar-brand { display: none; font-weight: 800; color: var(--navy); }

.dropdown { position: relative; }
.me {
    display: flex; align-items: center; gap: 10px; text-align: right;
    background: none; border: 2px solid transparent; padding: 4px 8px 4px 12px; border-radius: 12px; cursor: pointer; color: inherit;
    transition: background .15s, border-color .15s;
}
.me:hover, .me[aria-expanded="true"] { background: var(--bg); border-color: var(--line); }
.me b { display: block; font-size: 12.5px; line-height: 1.25; }
.me small { color: var(--muted); font-size: 11.5px; }
.me .i { color: var(--muted); transition: transform .2s; }
.me[aria-expanded="true"] .i { transform: rotate(180deg); }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--blue-100);
    display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #1e3a8a; flex: none;
}
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }

.menu {
    position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 50;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-pop); padding: 6px; animation: pop .16s var(--ease);
    transform-origin: top right;
}
.menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.menu-head b { display: block; font-size: 13px; }
.menu-head small { color: var(--muted); }
.menu button {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px;
    background: none; border: 0; border-radius: var(--radius-sm); cursor: pointer;
    font-size: 13px; color: var(--text); text-align: left;
}
.menu button:hover { background: var(--bg); }
.menu button.danger { color: var(--err); }
.menu button.danger:hover { background: var(--err-bg); }

.content { padding: 28px; max-width: 1480px; margin: 0 auto; }
h1 { margin: 0; font-size: 22px; line-height: 1.3; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 4px 0 20px; font-size: 12.5px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }

/* =========================================================
   FORM & TOMBOL
   ========================================================= */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; align-items: stretch; }
.filters .grow { flex: 1 1 220px; min-width: 0; }
.filters .grow-2 { flex: 2 1 280px; min-width: 0; }

select, input[type=text], input[type=email], input[type=password], input[type=file] {
    width: 100%; padding: 10px 12px; border: 1px solid #d5dbe8; border-radius: var(--radius-sm);
    background: #fff; font-family: inherit; font-size: 13.5px; color: var(--text);
    transition: border-color .15s, box-shadow .15s, background .15s;
}
select {
    appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer; text-overflow: ellipsis;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
select:hover, input[type=text]:hover, input[type=email]:hover, input[type=password]:hover { border-color: #b8c2d8; }
select:focus, input:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
select.is-active { border-color: var(--blue); background-color: var(--blue-50); color: var(--navy); font-weight: 600; }
input[aria-invalid="true"] { border-color: #ef4444; background: #fff7f7; }
::placeholder { color: var(--muted-2); }

.input-wrap { position: relative; }
.input-wrap > .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.input-wrap input { padding-left: 38px; }
.input-wrap:focus-within > .i { color: var(--blue); }
.input-end {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 30px; height: 30px; border: 0; background: none;
    color: var(--muted); border-radius: 8px; cursor: pointer;
}
.input-end:hover { background: var(--bg); color: var(--text); }
.search input { padding-right: 38px; }
kbd {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    font: 600 11px/1 var(--font); color: var(--muted); border: 1px solid #d5dbe8; border-bottom-width: 2px;
    border-radius: 5px; padding: 3px 6px; background: #fff; pointer-events: none;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--blue); color: #fff; border: 1px solid transparent; padding: 10px 18px;
    border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; font-weight: 600;
    transition: background .15s, transform .08s, box-shadow .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: var(--blue-700); }
.btn:active { transform: translateY(1px); }
.btn-ghost { background: #fff; color: var(--text); border-color: #d5dbe8; }
.btn-ghost:hover { background: var(--bg); border-color: #b8c2d8; }
.btn-danger { background: #dc2626; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: .8; cursor: progress; pointer-events: none; }
.spinner {
    width: 16px; height: 16px; border-radius: 50%; flex: none;
    border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-ghost .spinner { border-color: rgba(15, 27, 51, .2); border-top-color: var(--text); }

/* =========================================================
   KARTU, STATISTIK, GRAFIK
   ========================================================= */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 14px; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card h3 a, .link-btn { white-space: nowrap; flex: none; font-size: 12px; color: var(--blue); font-weight: 600; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
.card h3 a:hover, .link-btn:hover { background: var(--blue-50); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { display: flex; align-items: center; gap: 14px; }
.stat .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat .ic .i { width: 22px; height: 22px; }
.ic-blue { background: #e0e9ff; color: #0857C3; }
.ic-green { background: #dcf5e6; color: #15803d; }
.ic-orange { background: #ffeacc; color: #c2410c; }
.ic-violet { background: #ece4ff; color: #6d28d9; }
.stat-body { min-width: 0; flex: 1; }
.stat small { color: var(--muted); font-size: 12px; display: block; }
.stat strong { font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.01em; display: block; }
.neg { color: #dc2626 !important; }

.mini { height: 5px; background: var(--blue-100); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.mini i { display: block; height: 100%; background: var(--blue); border-radius: 99px; animation: fillIn .8s var(--ease) both; }

.grid2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; margin-bottom: 16px; }
.grid2 > * { min-width: 0; }
.grid-equal { grid-template-columns: 1fr 1fr; }

/* grafik batang */
.chart-scroll { overflow-x: auto; overflow-y: hidden; margin: 0 -4px; padding: 0 4px; }
.chart {
    display: flex; align-items: stretch; justify-content: space-around; gap: 14px;
    padding-top: 44px; min-width: calc(var(--n, 1) * 74px);
}
.col {
    flex: 1; max-width: 120px; min-width: 56px; display: flex; flex-direction: column; align-items: center;
    cursor: pointer; border-radius: 8px; color: inherit;
}
.col .plot {
    width: 100%; height: 190px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
    border-bottom: 1px solid var(--line);
}
.col .v { font-size: 12px; font-weight: 700; margin-bottom: 4px; font-variant-numeric: tabular-nums; animation: fadeIn .4s .45s both; }
.col .bar {
    position: relative; width: 100%; max-width: 64px; background: linear-gradient(180deg, #2f6fe0, #1f5fc4);
    border-radius: 6px 6px 0 0; min-height: 3px; transform-origin: bottom;
    animation: grow .75s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
    transition: filter .15s;
}
.col:hover .bar, .col:focus-visible .bar { filter: brightness(1.12); }
.col .bar::after {
    content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 26px);
    transform: translate(-50%, 4px); background: var(--text); color: #fff; font-size: 11.5px; line-height: 1.35;
    padding: 6px 10px; border-radius: 8px; white-space: pre; text-align: center; pointer-events: none; opacity: 0; z-index: 3;
    transition: opacity .15s, transform .15s;
}
.col:hover .bar::after, .col:focus-visible .bar::after { opacity: 1; transform: translate(-50%, 0); }
/* kolom di tepi: tooltip dirapatkan ke dalam agar tidak terpotong kontainer scroll */
.col:first-child .bar::after { left: 0; transform: translate(0, 4px); }
.col:last-child:not(:first-child) .bar::after { left: auto; right: 0; transform: translate(0, 4px); }
.col:first-child:hover .bar::after, .col:first-child:focus-visible .bar::after,
.col:last-child:not(:first-child):hover .bar::after, .col:last-child:not(:first-child):focus-visible .bar::after { transform: none; }
.col:hover .lbl, .col:focus-visible .lbl { color: var(--blue-700); }
.col .lbl {
    margin-top: 8px; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word;
}

/* daftar kekurangan formasi */
.list { max-height: 440px; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; transition: background .15s; }
.row:hover { background: var(--bg); }
a.row-link { color: inherit; cursor: pointer; }
a.row-link:hover .t b { text-decoration: underline; text-underline-offset: 2px; }
.row .go { width: 16px; height: 16px; color: var(--muted-2); flex: none; transition: transform .15s, color .15s; margin-left: -4px; }
a.row-link:hover .go, a.row-link:focus-visible .go { transform: translateX(3px); color: var(--blue); }
.row .ab {
    width: 34px; height: 34px; border-radius: 50%; background: #e8eefc; color: var(--blue-700);
    font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none;
}
.row .t { flex: 1; min-width: 0; }
.row .t b { color: var(--blue-700); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .t small { color: var(--muted); font-size: 11.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gap-pill { background: var(--err-bg); color: var(--err); font-weight: 700; font-size: 12.5px; padding: 3px 10px; border-radius: 99px; font-variant-numeric: tabular-nums; }

.prog { display: flex; align-items: center; gap: 12px; margin: 14px 0; font-size: 12.5px; }
.prog > span:first-child { width: 150px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog .track { flex: 1; height: 8px; background: #e8eefc; border-radius: 99px; overflow: hidden; }
.prog .fill { height: 100%; background: #1f5fc4; border-radius: 99px; animation: fillIn .8s var(--ease) both; }
.prog .n { width: 44px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* empty state */
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .em-ic {
    width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center;
    background: var(--blue-50); color: var(--blue);
}
.empty .em-ic .i { width: 24px; height: 24px; }
.empty .em-ic.ok { background: var(--ok-bg); color: var(--ok); }
.empty b { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.empty p { margin: 0 auto 14px; max-width: 360px; font-size: 12.5px; }
.empty.compact { padding: 14px 8px; }
.empty-card { padding: 40px 20px; margin-bottom: 16px; }

/* =========================================================
   TABEL & PAGINASI
   ========================================================= */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
    background: #f8fafc; text-align: left; padding: 11px 14px; font-size: 12px; font-weight: 600;
    color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted-2); }
mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--blue-50); color: var(--blue-700); white-space: nowrap; }
.badge.gray { background: #eef1f6; color: #475569; }

.copy {
    display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 2px 4px; margin: -2px -4px;
    font: inherit; font-variant-numeric: tabular-nums; color: inherit; cursor: copy; border-radius: 6px;
}
.copy .i { width: 14px; height: 14px; color: var(--muted-2); opacity: 0; transition: opacity .15s; }
.copy:hover, .copy:focus-visible { background: var(--blue-50); }
@media (hover: none) { .copy .i { opacity: .55; } }
.copy:hover .i, .copy:focus-visible .i { opacity: 1; }

.result-info { font-size: 12.5px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.pager-nav { display: flex; gap: 4px; align-items: center; }
.pg {
    min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    border: 1px solid transparent; border-radius: 9px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums;
    transition: background .15s, border-color .15s;
}
a.pg:hover { background: #fff; border-color: var(--line); }
.pg.is-current { background: var(--blue); color: #fff; }
.pg.is-disabled { color: var(--muted-2); cursor: not-allowed; }
.pg-gap { color: var(--muted-2); padding: 0 4px; }

/* region yang diperbarui tanpa reload */
[data-live] { transition: opacity .15s; outline: none; scroll-margin-top: calc(var(--topbar) + 12px); }
[data-live].is-loading { opacity: .5; pointer-events: none; }

/* =========================================================
   ALERT, TOAST, MODAL
   ========================================================= */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13px; animation: pop .25s var(--ease); }
.alert > .i { margin-top: 1px; width: 18px; height: 18px; }
.alert .alert-body { flex: 1; min-width: 0; }
.alert-x { background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; padding: 2px; border-radius: 6px; display: grid; }
.alert-x:hover { opacity: 1; }
.alert.ok { background: var(--ok-bg); color: #166534; }
.alert.err { background: var(--err-bg); color: #991b1b; }
.alert.warn { background: var(--warn-bg); color: #92400e; }

#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; pointer-events: none; max-width: calc(100vw - 32px); }
.toast {
    pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px;
    background: var(--text); color: #fff; padding: 11px 12px 11px 14px; border-radius: 12px; font-size: 13px;
    box-shadow: var(--shadow-pop); animation: toastIn .3s var(--ease);
}
.toast.out { animation: toastOut .2s ease-in forwards; }
.toast .i { width: 18px; height: 18px; }
.toast.success .i:first-child { color: #4ade80; }
.toast.error .i:first-child { color: #f87171; }
.toast.info .i:first-child { color: #93c5fd; }
.toast span { flex: 1; }
.toast button { background: none; border: 0; color: #cbd5e1; cursor: pointer; padding: 4px; border-radius: 6px; display: grid; }
.toast button:hover { color: #fff; background: rgba(255, 255, 255, .1); }

dialog.modal {
    border: 0; padding: 0; margin: auto; border-radius: 16px; width: min(440px, calc(100vw - 32px));
    box-shadow: var(--shadow-pop); color: var(--text); background: #fff;
}
dialog.modal::backdrop { background: rgba(8, 20, 50, .5); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: pop .22s var(--ease); }
dialog.modal[open]::backdrop { animation: fadeIn .22s; }
.modal-body { padding: 24px 24px 8px; display: flex; gap: 14px; }
.modal-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--warn-bg); color: var(--warn); }
.modal-ic.danger { background: var(--err-bg); color: var(--err); }
.modal-ic.info { background: var(--blue-50); color: var(--blue); }
.modal-body h2 { margin: 2px 0 6px; font-size: 16px; }
.modal-body p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 24px 22px; }

/* =========================================================
   UPLOAD
   ========================================================= */
.dropzone {
    position: relative; display: block; border: 2px dashed #c3cde3; border-radius: var(--radius); padding: 28px 18px; text-align: center;
    background: #fafbfe; cursor: pointer; transition: border-color .15s, background .15s; margin: 4px 0 16px;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--blue); background: var(--blue-50); }
.dropzone:focus-within { border-color: var(--blue); box-shadow: var(--ring); }
.dropzone.is-over { transform: scale(1.01); }
.dropzone.has-error { border-color: #ef4444; background: #fff7f7; }
.dropzone .dz-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--blue-100); color: var(--blue); display: grid; place-items: center; margin: 0 auto 10px; }
.dropzone .dz-ic .i { width: 22px; height: 22px; }
.dropzone b { display: block; font-size: 14px; }
.dropzone small { color: var(--muted); font-size: 12px; }
.dz-file { display: flex; align-items: center; gap: 12px; text-align: left; }
.dz-file .dz-ic { margin: 0; background: var(--ok-bg); color: var(--ok); flex: none; }
.dz-file .info { flex: 1; min-width: 0; }
.dz-file .info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-error { color: var(--err); font-size: 12.5px; margin: -6px 0 14px; display: flex; gap: 6px; align-items: center; }
.stored { display: flex; gap: 12px; margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line-2); }
.stored div { flex: 1; }
.stored small { color: var(--muted); display: block; font-size: 12px; }
.stored b { font-size: 18px; font-variant-numeric: tabular-nums; }
.processing { margin-top: 16px; padding: 14px; border-radius: var(--radius-sm); background: var(--blue-50); color: var(--navy); font-size: 12.5px; animation: pop .25s var(--ease); }
.processing b { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.processing .spinner { border-color: rgba(37, 99, 235, .25); border-top-color: var(--blue); }
.indet { height: 5px; background: var(--blue-100); border-radius: 99px; overflow: hidden; position: relative; margin-bottom: 8px; }
.indet::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; background: var(--blue); border-radius: 99px; animation: indet 1.2s ease-in-out infinite; }
.sheet-group + .sheet-group { margin-top: 14px; }
.sheet-group > b { display: block; font-size: 12.5px; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #eef1f6; color: #334155; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px; }
.chip.blue { background: var(--blue-50); color: var(--blue-700); }
.notes { margin: 16px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: #475569; display: grid; gap: 10px; }
.notes li { display: flex; gap: 10px; }
.notes .i { width: 16px; height: 16px; margin-top: 2px; color: var(--muted-2); }
.notes li.important { color: #92400e; background: var(--warn-bg); padding: 10px 12px; border-radius: var(--radius-sm); }
.notes li.important .i { color: var(--warn); }
.grid2.grid-equal > .card:last-child { height: fit-content;min-height: 0; align-self: start; box-sizing: border-box; }

/* =========================================================
   PROFIL
   ========================================================= */
.profile { max-width: 760px; padding: 0; overflow: hidden; }
.profile-head { display: flex; align-items: center; gap: 16px; padding: 22px 24px; background: linear-gradient(135deg, var(--blue-50), #fff); border-bottom: 1px solid var(--line); }
.profile-head h2 { margin: 0 0 6px; font-size: 18px; line-height: 1.3; }
.profile-head .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0; }
.detail-grid > div { padding: 16px 24px; border-bottom: 1px solid var(--line-2); }
.detail-grid > div:last-child { border-bottom: 0; }
.detail-grid dt { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.detail-grid dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.detail-grid .full { grid-column: 1 / -1; }

/* =========================================================
   LOGIN
   ========================================================= */
body.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 1fr); background: #fff; }
.auth-brand {
    position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, var(--navy-2), var(--navy) 60%);
    color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-brand .brand { padding: 0; }
.auth-brand h2 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; letter-spacing: -.02em; max-width: 14em; }
.auth-brand p { margin: 0; color: #b9c7ee; max-width: 30em; font-size: 14.5px; }
.auth-bars { display: flex; align-items: flex-end; gap: 10px; height: 130px; margin-top: 36px; }
.auth-bars i { flex: 1; max-width: 34px; border-radius: 6px 6px 0 0; background: rgba(255, 255, 255, .12); transform-origin: bottom; animation: grow 1s var(--ease) both; animation-delay: calc(var(--i) * 80ms + .15s); }
.auth-bars i.hi { background: #60a5fa; }
.auth-form-side { display: grid; place-items: center; padding: 32px 24px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { font-size: 24px; }
.auth-box > p { margin: 6px 0 24px; color: var(--muted); font-size: 13.5px; }
.auth-box label { display: block; font-size: 12.5px; font-weight: 600; margin: 16px 0 6px; color: #334155; }
.auth-box .alert { animation: shake .4s; }
.auth-box .btn { margin-top: 22px; padding: 12px; font-size: 14px; }
.caps { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--warn); margin-top: 6px; }
.caps .i { width: 14px; height: 14px; }
.field-error { display: flex; gap: 6px; align-items: center; font-size: 12.5px; color: var(--err); margin-top: 6px; }
.auth-foot { margin-top: 28px; font-size: 12px; color: var(--muted-2); }

/* =========================================================
   ANIMASI
   ========================================================= */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fillIn { from { width: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.96); } }
@keyframes indet { 0% { left: -35%; } 100% { left: 100%; } }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

/* =========================================================
   RESPONSIF
   ========================================================= */
@media (max-width: 1180px) {
    .grid2, .grid-equal { grid-template-columns: 1fr; }
}

/* Tablet & mobile: sidebar menjadi drawer */
@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%); visibility: hidden; width: min(290px, 85vw);
        transition: transform .28s var(--ease), visibility 0s .28s; box-shadow: none;
    }
    body.nav-open .sidebar { transform: none; visibility: visible; transition-delay: 0s; box-shadow: var(--shadow-pop); }
    body.nav-open .scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
    body.nav-open { overflow: hidden; }
    .main { margin-left: 0; }
    .icon-btn { display: grid; }
    .topbar-brand { display: block; }
    .topbar { padding: 0 16px; }
    .content { padding: 20px 16px 32px; }
    .stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    h1 { font-size: 19px; }
    .stat { gap: 10px; }
    .stat .ic { width: 38px; height: 38px; }
    .stat strong { font-size: 22px; }
    .card { padding: 16px; }
    .prog > span:first-child { width: 96px; }
    .col .plot { height: 160px; }

    /* tabel menjadi kartu bertumpuk */
    .table-wrap { overflow: visible; }
    table, tbody { display: block; }
    thead { display: none; }
    tbody tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
    tbody tr:last-child { border-bottom: 0; }
    td { display: flex; justify-content: space-between; gap: 16px; padding: 5px 0; border: 0; text-align: right; }
    td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
    td.cell-name { font-weight: 700; font-size: 14px; }
    td.cell-name::before { font-weight: 400; font-size: 12px; }
    tr.empty-row td { display: block; text-align: center; }
    tr.empty-row td::before { content: none; }

    .pager { justify-content: center; }
    .pager-info { width: 100%; text-align: center; }
    .pg-num:not(.is-current) { display: none; }
    .pg-gap { display: none; }

    .detail-grid { grid-template-columns: 1fr; }
    .detail-grid > div { padding: 12px 18px; }
    .profile-head { padding: 18px; }

    kbd { display: none; }
    #toasts { right: 16px; left: 16px; bottom: 16px; align-items: stretch; }
    .toast { max-width: none; }

    dialog.modal { margin: auto 0 0; width: 100%; max-width: none; border-radius: 18px 18px 0 0; }
    dialog.modal[open] { animation: sheetUp .28s var(--ease); }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
    .stats { gap: 10px; }
    .stat { flex-direction: column; align-items: flex-start; gap: 10px; }
    .stat-body { width: 100%; }
    .stat strong { font-size: 24px; }
    .me > div:not(.avatar) { display: none; }
    .me { padding: 4px 6px; }
    .filters .btn { flex: 1; }
}

/* Login: panel brand menjadi header ringkas di layar kecil */
@media (max-width: 860px) {
    body.auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
    .auth-brand { padding: 22px 24px; }
    .auth-brand h2, .auth-brand p, .auth-bars { display: none; }
    .auth-form-side { align-items: start; padding-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* =========================================================
   HALAMAN DETAIL
   ========================================================= */
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--blue); margin: 0 0 12px -4px; padding: 4px 8px 4px 4px; border-radius: 8px; transition: background .15s; }
.crumb:hover { background: var(--blue-50); }
.result-info { font-size: 12px; font-weight: 500; color: var(--muted); }
.tlink { color: var(--blue-700); font-weight: 600; border-radius: 4px; }
.tlink:hover { text-decoration: underline; text-underline-offset: 2px; }
.gap-pill.ok { background: var(--ok-bg); color: var(--ok); }
.gap-pill.over { background: var(--blue-50); color: var(--blue-700); }
.pcell { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.pcell .num { width: 46px; text-align: right; font-weight: 600; flex: none; }
.pcell .mini { flex: 1; margin: 0; }
@media (max-width: 720px) { .pcell { min-width: 0; width: 60%; } }

/* =========================================================
   DATA TIDAK SESUAI (ditandai warna)
   ========================================================= */
tbody tr.row-warn td { background: #fff8e1; }
tbody tr.row-bad td { background: #fff0f0; }
tbody tr.row-warn:hover td { background: #fff0c2; }
tbody tr.row-bad:hover td { background: #ffe2e2; }
tbody tr.row-warn td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
tbody tr.row-bad td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.note { display: flex; gap: 5px; align-items: flex-start; margin-top: 2px; font-size: 11.5px; font-weight: 500; line-height: 1.4; color: #92400e; }
.note .i { width: 13px; height: 13px; margin-top: 2px; }
.row-bad .note { color: #b91c1c; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.sw.warn { background: #fde9a6; border: 1px solid #f59e0b; }
.sw.bad { background: #ffd0d0; border: 1px solid #ef4444; }

.toggle {
    display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; min-height: 40px; cursor: pointer; user-select: none;
    border: 1px solid #d5dbe8; border-radius: var(--radius-sm); background: #fff; font-size: 13px; font-weight: 600; color: var(--text);
    transition: background .15s, border-color .15s, color .15s;
}
.toggle:hover { border-color: #b8c2d8; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .i { width: 16px; height: 16px; color: var(--warn); }
.toggle .count { background: var(--warn-bg); color: var(--warn); border-radius: 99px; padding: 0 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.toggle:has(input:checked) { background: var(--warn-bg); border-color: #f59e0b; color: #92400e; }
.toggle:has(input:focus-visible) { box-shadow: var(--ring); }

a.alert-link { color: inherit; transition: filter .15s; }
a.alert-link:hover { filter: brightness(.97); }
a.alert-link .alert-body { font-weight: 500; }
a.alert-link > .i:last-child { margin-top: 1px; transition: transform .15s; }
a.alert-link:hover > .i:last-child { transform: translateX(3px); }

@media (max-width: 720px) {
    /* di mobile tiap baris menjadi kartu: warna diberikan ke kartu, bukan ke sel */
    tbody tr.row-warn { background: #fff8e1; box-shadow: inset 4px 0 0 #f59e0b; }
    tbody tr.row-bad { background: #fff0f0; box-shadow: inset 4px 0 0 #ef4444; }
    tbody tr.row-warn td, tbody tr.row-bad td, tbody tr.row-warn:hover td, tbody tr.row-bad:hover td { background: transparent; box-shadow: none !important; }
    .note { justify-content: flex-end; text-align: right; }
}

/* Halaman error (403) */
.err-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.err-page .card { max-width: 440px; width: 100%; padding: 36px 24px; }

/* Form daftar: lebih padat karena banyak kolom */
.auth-box .field-error { margin-top: 6px; }
.auth-box .auth-foot { margin-top: 18px; text-align: center; }
@media (min-width: 861px) { body.auth:has(.auth-box h1) .auth-form-side { padding-block: 40px; } }

/* =========================================================
   KARTU STATISTIK BISA DIKLIK + RINCIAN
   ========================================================= */
a.stat-link { position: relative; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.stat-link:hover { border-color: #b9c9ee; box-shadow: 0 8px 20px -10px rgba(37, 99, 235, .45); transform: translateY(-1px); }
a.stat-link:active { transform: none; }
a.stat-link:focus-visible { border-radius: var(--radius); }
a.stat-link.is-active { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.stat .go { position: absolute; top: 14px; right: 14px; width: 16px; height: 16px; color: var(--muted-2); transition: transform .15s, color .15s; }
a.stat-link:hover .go { transform: translateX(3px); color: var(--blue); }
a.row-link:focus-visible { border-radius: 10px; }
a.col:focus-visible { border-radius: 8px; }

.detail-stack { display: grid; gap: 16px; }
.detail-stack > * { min-width: 0; }
.detail-stack > .btn { justify-self: start; }
.detail-stack .grid2 { margin-bottom: 0; }
th.col-hi, td.col-hi { background: var(--blue-50); }
td.col-hi.num { font-weight: 700; }
tbody tr:hover td.col-hi { background: var(--blue-100); }
.sub-line { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; }
@media (max-width: 720px) {
    th.col-hi, td.col-hi, tbody tr:hover td.col-hi { background: transparent; }
    td.col-hi { font-weight: 700; }
    .sub-line { text-align: right; }
}

/* peringatan di bawah tombol upload */
.alert.warn-upload { margin: 14px 0 0; }
.warn-upload ul { margin: 6px 0 8px; padding-left: 18px; }
.warn-upload li + li { margin-top: 2px; }
.alert .tlink { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Peringatan data tidak sesuai di bawah menu Upload Data (sidebar) */
.nav a.nav-warn {
    margin: -2px 0 4px 14px; padding: 6px 10px 6px 12px; width: auto; gap: 7px; align-items: flex-start;
    font-size: 12px; font-weight: 600; line-height: 1.35; color: #fcd34d; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    border-left: 2px solid rgba(252, 211, 77, .55); background: rgba(252, 211, 77, .08);
}
.nav a.nav-warn .i { width: 14px; height: 14px; margin-top: 2px; }
.nav a.nav-warn:hover { background: rgba(252, 211, 77, .16); color: #fde68a; }
