/* =========================================================================
   eSignMP — antarmuka web
   CSS ditulis tangan tanpa framework agar tidak memerlukan build step.
   ========================================================================= */

:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-soft: #94a3b8;

    --brand: #26497D;
    --brand-hover: #1c3760;
    --brand-soft: #eef3fa;
    --accent: #46AC8B;
    --accent-soft: #e9f7f1;

    --success: #2f8a6b;
    --success-soft: #e9f7f1;
    --warning: #b45309;
    --warning-soft: #fffbeb;
    --danger: #b91c1c;
    --danger-soft: #fef2f2;
    --info: #0369a1;
    --info-soft: #f0f9ff;

    --radius: 10px;
    --radius-sm: 7px;
    /* Tinggi seragam untuk input, select, dan tombol supaya sebaris rata. */
    --control-h: 36px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
    --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, .35);
    --sidebar-w: 252px;
    --sidebar-rail: 64px;
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root[data-theme="auto"] {
        --bg: #0b1120;
        --surface: #111827;
        --surface-2: #0f172a;
        --border: #1f2937;
        --border-strong: #334155;
        --text: #e5e7eb;
        --text-muted: #94a3b8;
        --text-soft: #64748b;
        --brand: #7ba7e0;
        --brand-hover: #a8c6ee;
        --brand-soft: #16293f;
        --accent: #5ec9a4;
        --accent-soft: #10312a;
        --success: #5ec9a4;
        --success-soft: #10312a;
        --warning: #fbbf24;
        --warning-soft: #2e1e04;
        --danger: #f87171;
        --danger-soft: #2b1111;
        --info: #38bdf8;
        --info-soft: #082f49;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
        --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
    }
}

:root[data-theme="dark"] {
    --bg: #0b1120;
    --surface: #111827;
    --surface-2: #0f172a;
    --border: #1f2937;
    --border-strong: #334155;
    --text: #e5e7eb;
    --text-muted: #94a3b8;
    --text-soft: #64748b;
    --brand: #7ba7e0;
    --brand-hover: #a8c6ee;
    --brand-soft: #16293f;
    --accent: #5ec9a4;
    --accent-soft: #10312a;
    --success: #5ec9a4;
    --success-soft: #10312a;
    --warning: #fbbf24;
    --warning-soft: #2e1e04;
    --danger: #f87171;
    --danger-soft: #2b1111;
    --info: #38bdf8;
    --info-soft: #082f49;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -.012em; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code, .mono { font-family: var(--mono); font-size: .86em; }

/* ---------------------------------------------------------------- boot --- */

.boot {
    min-height: 100dvh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 14px;
    color: var(--text-muted);
}

.boot__spinner, .spinner {
    width: 26px; height: 26px;
    border: 2.5px solid var(--border-strong);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.spinner--sm { width: 13px; height: 13px; border-width: 2px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- login --- */

.auth {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
    padding: 24px;
}

@media (min-width: 900px) {
    .auth { grid-template-columns: 1.05fr .95fr; }
}

.auth__pitch { display: none; max-width: 460px; }

@media (min-width: 900px) {
    .auth__pitch { display: block; }
}

.auth__pitch h1 { font-size: 30px; line-height: 1.25; margin-bottom: 14px; }
.auth__pitch p { color: var(--text-muted); margin-bottom: 22px; }

.auth__points { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.auth__points li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-muted); }
.auth__points svg { flex: none; margin-top: 2px; color: var(--brand); }

.auth__card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.auth__card h2 { font-size: 20px; margin-bottom: 4px; }
.auth__card > p { color: var(--text-muted); margin-bottom: 20px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 680; letter-spacing: -.02em; }
.brand__mark {
    width: 32px; height: 32px; flex: none;
    display: grid; place-items: center;
    border-radius: 9px;
    background: var(--brand); color: #fff;
}
:root[data-theme="dark"] .brand__mark, :root[data-theme="auto"] .brand__mark { color: #0b1120; }
@media (prefers-color-scheme: light) { :root[data-theme="auto"] .brand__mark { color: #fff; } }

/* -------------------------------------------------------------- layout --- */

/*
 * Kolom sidebar dibiarkan `auto`; lebarnya ditentukan elemen .sidebar sendiri
 * agar transisi cukup dipasang pada satu properti (`width`) alih-alih pada
 * daftar track grid.
 */
.layout { display: grid; grid-template-columns: auto 1fr; min-height: 100dvh; }

/*
 * Mode ringkas: sidebar menyusut menjadi rel ikon.
 *
 * Hanya berlaku di layar besar — pada layar kecil sidebar sudah berupa laci
 * yang bisa ditutup penuh, sehingga menyusutkannya lagi tidak ada gunanya.
 */
@media (min-width: 901px) {
    .layout[data-collapsed="true"] .sidebar {
        width: var(--sidebar-rail);
        padding-inline: 8px;
        align-items: center;
    }
    .layout[data-collapsed="true"] .nav__item span,
    .layout[data-collapsed="true"] .nav__label,
    .layout[data-collapsed="true"] .sidebar__foot,
    .layout[data-collapsed="true"] .sidebar__toggle span,
    .layout[data-collapsed="true"] .brand > span { display: none; }
    .layout[data-collapsed="true"] .nav__item { justify-content: center; padding-inline: 0; }
    .layout[data-collapsed="true"] .sidebar__brand { padding: 4px 0 14px; }
}

@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
}

.sidebar {
    width: var(--sidebar-w);
    transition: width .16s ease;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 14px;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed; inset: 0 auto 0 0; z-index: 60;
        width: 260px;
        transform: translateX(-100%);
        transition: transform .18s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar[data-open="true"] { transform: none; }
}

.sidebar__brand { padding: 4px 8px 14px; }

.nav { display: grid; gap: 2px; }
.nav__label {
    font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--text-soft); padding: 14px 10px 6px; font-weight: 600;
}

.nav__item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 520;
    cursor: pointer;
    border: 0; background: none; width: 100%; text-align: left;
    font-family: inherit; font-size: 14px;
}
.nav__item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav__item[aria-current="page"] { background: var(--brand-soft); color: var(--brand); }
.nav__item svg { flex: none; }

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}

.topbar__title { font-size: 15px; font-weight: 620; }
.topbar__spacer { flex: 1; }

/* Lonceng notifikasi: jumlah belum dibaca menempel di sudut ikon. */
.bell__button { position: relative; }
.bell__count {
    position: absolute; top: -3px; right: -3px;
    min-width: 16px; height: 16px; padding: 0 4px;
    display: grid; place-items: center;
    border-radius: 99px; background: var(--danger); color: #fff;
    font-size: 10.5px; font-weight: 680; line-height: 1;
}
.bell__panel { width: min(360px, calc(100vw - 32px)); padding-bottom: 4px; }
.bell__list { max-height: 320px; overflow-y: auto; }
.bell__item {
    display: grid; gap: 2px; width: 100%;
    padding: 9px 10px; border: 0; border-radius: var(--radius-sm);
    background: none; font: inherit; text-align: left; cursor: pointer; color: inherit;
}
.bell__item:hover { background: var(--surface-2); text-decoration: none; }
.bell__item--unread { background: var(--brand-soft); }
.bell__item--unread:hover { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.bell__empty { padding: 18px 10px; text-align: center; color: var(--text-muted); font-size: 13px; }

/*
 * Setiap halaman memakai lebar penuh dengan padding yang sama, sehingga
 * perpindahan menu tidak menggeser posisi judul maupun tepi kartu.
 */
.content {
    padding: 22px clamp(16px, 2.2vw, 32px) 72px;
    width: 100%;
    min-width: 0;
    animation: page-in .22s ease both;
}

@keyframes page-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .content { animation: none; }
}

.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head__text { flex: 1; min-width: 240px; }
.page-head h1 { font-size: 21px; }
.page-head p { color: var(--text-muted); margin-top: 3px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------- cards --- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card__head {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.card__head h3 { font-size: 14px; }
.card__head p { color: var(--text-muted); font-size: 12.5px; }
/* Tindakan di kepala kartu didorong ke kanan, terpisah dari judulnya. */
.card__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card__body { padding: 16px; }
.card__foot { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.grid { display: grid; gap: 14px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stat { padding: 16px; }
.stat__label { color: var(--text-muted); font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.stat__value { font-size: 27px; font-weight: 680; letter-spacing: -.02em; margin-top: 6px; }
.stat__hint { color: var(--text-soft); font-size: 12px; margin-top: 2px; }

.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.meter__fill { height: 100%; background: var(--brand); border-radius: 99px; }

/* --------------------------------------------------------------- table --- */

/*
 * Tabel lebar harus menggulir di dalam wadahnya sendiri, bukan mendorong
 * seluruh halaman. Itu baru terjadi bila setiap wadah induknya diizinkan
 * menyusut: item grid/flex bawaannya `min-width: auto`, yang menolak mengecil
 * di bawah lebar isinya.
 */
.table-wrap { overflow-x: auto; min-width: 0; max-width: 100%; }
.stack, .stack > *, .grid > *, .card, .card__body { min-width: 0; }

table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty { padding: 44px 20px; text-align: center; color: var(--text-muted); }
.empty svg { color: var(--text-soft); margin-bottom: 10px; }
.empty h4 { font-size: 15px; margin-bottom: 4px; color: var(--text); }

/* --------------------------------------------------------- form & button */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    min-height: var(--control-h);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit; font-size: 13.5px; font-weight: 560;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { flex: none; }

.btn--primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
:root[data-theme="dark"] .btn--primary { color: #0b1120; }

.btn--danger { color: var(--danger); border-color: var(--danger); background: transparent; }
.btn--danger:hover { background: var(--danger-soft); }

.btn--ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }

.btn--sm { min-height: 28px; padding: 5px 10px; font-size: 12.5px; }
.btn--block { width: 100%; }

/*
 * `align-content: start` menahan baris agar tidak diregangkan.
 * Tanpa itu, satu field berpetunjuk di sebelah field tanpa petunjuk membuat
 * isian tetangganya ikut memanjang — persis yang terjadi pada NIK vs Email.
 */
.field { display: grid; gap: 6px; margin-bottom: 14px; align-content: start; }
.field > label { font-weight: 560; font-size: 13px; }
.field__hint { color: var(--text-muted); font-size: 12px; }
.field__error { color: var(--danger); font-size: 12.5px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="url"], input[type="search"],
input[type="tel"], select, textarea {
    width: 100%;
    min-height: var(--control-h);
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit; font-size: 13.5px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) {
    border-color: color-mix(in srgb, var(--brand) 45%, var(--border-strong));
}
select { appearance: none; padding-right: 32px; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
        linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 17px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
input[type="search"] { appearance: none; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
/*
 * Isian berkas bawaan peramban tampil beda sendiri di antara isian lain.
 * Tombolnya digayakan seperti `.btn` agar satu formulir terlihat satu keluarga.
 */
input[type="file"] {
    font: inherit; font-size: 13px;
    width: 100%;
    padding: 7px 10px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: pointer;
}
input[type="file"]:hover { border-color: var(--brand); background: var(--brand-soft); }
input[type="file"]::file-selector-button {
    font: inherit; font-size: 12.5px; font-weight: 560;
    margin-right: 10px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--surface-2); }
textarea { min-height: 84px; resize: vertical; }
.check input, input[type="file"] { min-height: 0; }

.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 16px; height: 16px; }

.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; min-width: 190px; }
/* Tombol di baris alat mengikuti tinggi kendali, bukan tinggi tombol tabel. */
.toolbar .btn { min-height: var(--control-h); padding-block: 8px; font-size: 13.5px; }
.toolbar__spacer { flex: 1; }

/* --------------------------------------------------------------- badge --- */

.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2.5px 8px;
    border-radius: 99px;
    font-size: 12px; font-weight: 580;
    background: var(--surface-2); color: var(--text-muted);
    border: 1px solid var(--border);
    white-space: nowrap;
}
.badge--success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge--warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge--danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge--info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge--brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ------------------------------------------------------------- dropdown --- */

.menu { position: relative; }
.menu__panel {
    position: absolute; right: 0; top: calc(100% + 6px);
    min-width: 230px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 40;
}
.menu__item {
    display: flex; align-items: center; gap: 9px;
    width: 100%; padding: 8px 10px;
    border: 0; background: none; border-radius: var(--radius-sm);
    font: inherit; font-size: 13.5px; color: var(--text); text-align: left; cursor: pointer;
}
.menu__item:hover { background: var(--surface-2); text-decoration: none; }
.menu__sep { height: 1px; background: var(--border); margin: 5px 0; }
.menu__head { padding: 8px 10px; color: var(--text-muted); font-size: 12px; }

/* ---------------------------------------------------------------- modal --- */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 80;
    background: rgba(15, 23, 42, .5);
    display: grid; place-items: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: var(--shadow-lg);
    width: min(640px, 100%);
    max-height: min(86dvh, 900px);
    display: flex; flex-direction: column;
}
.modal--wide { width: min(880px, 100%); }
/* Ruang penuh untuk penampil PDF pratinjau. */
.modal--xl { width: min(1180px, 100%); }
.modal--xl .modal__body { padding: 0; }

.pdf-preview { display: grid; grid-template-rows: auto 1fr; height: min(78vh, 920px); }
.pdf-preview__bar {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.pdf-preview__frame { width: 100%; height: 100%; border: 0; background: #525659; }

/*
 * Kanvas penempatan: halaman digambar sesuai proporsi PDF, kotak tanda tangan
 * digeser dan diubah ukurannya langsung di atasnya.
 */
.pcanvas { display: grid; gap: 8px; }
/*
 * Lebar halaman harus pasti: dengan `justify-items: center` elemennya menyusut
 * ke lebar konten (kotak yang diposisikan mutlak tidak menyumbang lebar), lalu
 * `width: 100%` mengecil — kanvas sempat tergambar hanya 57 px, sehingga satu
 * geseran kecil melompat ratusan titik.
 */
.pcanvas__stage {
    display: block;
    padding: 12px; border-radius: var(--radius-sm);
    background: var(--surface-2); border: 1px solid var(--border);
}
.pcanvas__page {
    position: relative; width: 100%; max-width: 380px; margin-inline: auto;
    background: var(--surface); border: 1px solid var(--border-strong);
    box-shadow: var(--shadow); overflow: hidden;
}
.pcanvas__box {
    position: absolute; box-sizing: border-box;
    border: 1.5px dashed var(--brand);
    background: color-mix(in srgb, var(--brand) 14%, transparent);
    cursor: grab; touch-action: none;
}
.pcanvas__box:active { cursor: grabbing; }
.pcanvas__box:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pcanvas__box--outside { border-color: var(--warning); background: color-mix(in srgb, var(--warning) 18%, transparent); }
.pcanvas__label {
    position: absolute; left: 50%; top: 50%; translate: -50% -50%;
    font-size: 10.5px; font-weight: 600; color: var(--brand); white-space: nowrap;
}
.pcanvas__handle {
    position: absolute; width: 10px; height: 10px;
    background: var(--surface); border: 1.5px solid var(--brand); border-radius: 2px;
}
.pcanvas__handle--nw { left: -5px; top: -5px; cursor: nwse-resize; }
.pcanvas__handle--ne { right: -5px; top: -5px; cursor: nesw-resize; }
.pcanvas__handle--sw { left: -5px; bottom: -5px; cursor: nesw-resize; }
.pcanvas__handle--se { right: -5px; bottom: -5px; cursor: nwse-resize; }
.pcanvas__marker {
    position: absolute; width: 9px; height: 9px; translate: -50% -50%;
    border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px var(--surface);
}
.pcanvas__marker--fuzzy { background: var(--warning); }
.pcanvas__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Isian rahasia: bertipe text agar tidak dikenali pengelola kata sandi. */
.secret-input { position: relative; display: flex; align-items: center; }
.secret-input .secret-input__field { padding-right: 40px; font-family: var(--mono); letter-spacing: .04em; }
.secret-input__field.is-masked { -webkit-text-security: disc; }
.secret-input__toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }

/* Isian kata sandi dengan tombol tampilkan/sembunyikan. */
.password-input { position: relative; display: flex; align-items: center; }
.password-input > input { padding-right: 44px; }
.password-input > input::-ms-reveal, .password-input > input::-ms-clear { display: none; }
.password-input__toggle {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 32px; height: 32px;
    border: 0; border-radius: var(--radius-sm); background: transparent;
    color: var(--text-muted); cursor: pointer;
    transition: color .15s ease, background .15s ease;
}
.password-input__toggle:hover { color: var(--text); background: var(--surface-2); }
.password-input__toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.password-input__toggle[aria-pressed="true"] { color: var(--brand); }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal__head h3 { font-size: 16px; }
.modal__body { padding: 18px; overflow-y: auto; }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--border); }

/* --------------------------------------------------------------- toasts --- */

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }

.toast {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 11px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    animation: toast-in .16s ease;
}
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-weight: 600; font-size: 13.5px; }
.toast__text { color: var(--text-muted); font-size: 13px; overflow-wrap: anywhere; }

@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ----------------------------------------------------------------- misc --- */

.stack { display: grid; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.small { font-size: 12.5px; }
.right { margin-left: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.hash { font-family: var(--mono); font-size: 11.5px; color: var(--text-muted); }

.dl { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 9px 16px; font-size: 13.5px; }
.dl dt { color: var(--text-muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

.timeline { display: grid; gap: 0; }
.timeline__item { display: grid; grid-template-columns: 22px 1fr; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline__item::before { content: ""; position: absolute; left: 10px; top: 20px; bottom: 0; width: 1.5px; background: var(--border); }
.timeline__item:last-child::before { display: none; }
.timeline__dot { width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); z-index: 1; }
.timeline__dot--done { background: var(--success-soft); border-color: transparent; color: var(--success); }
.timeline__dot--current { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.timeline__dot--failed { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.timeline__dot--skipped { color: var(--text-muted); opacity: .7; }
.timeline__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.timeline__meta { font-size: 12px; color: var(--text-muted); }
.timeline__context { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 11.5px; color: var(--text-muted); font-family: var(--mono); overflow-wrap: anywhere; }

.sigpad { border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); touch-action: none; width: 100%; height: 190px; display: block; cursor: crosshair; }

.pagination { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; height: 12px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.center-msg { display: grid; place-items: center; padding: 60px 20px; gap: 10px; text-align: center; color: var(--text-muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 13px; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); font-weight: 580; }

.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 50; }
@media (min-width: 901px) { .scrim { display: none; } }

/* ------------------------------------------------- tambahan antarmuka --- */

/* Tombol ringkas/lebar pada sidebar */
.sidebar__toggle {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 7px 10px; margin-top: 4px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--text-muted);
    font: inherit; font-size: 12.5px; cursor: pointer;
}
.sidebar__toggle:hover { color: var(--text); }

.sidebar__foot { margin-top: auto; padding: 10px 4px 0; }

/* Kartu pilihan (mode penempatan tanda tangan) */
.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.choice {
    display: grid; gap: 5px;
    padding: 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    background: var(--surface); cursor: pointer; text-align: left;
    font: inherit; color: var(--text);
}
.choice:hover { border-color: var(--border-strong); }
.choice[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }
.choice__title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.choice__desc { color: var(--text-muted); font-size: 12.5px; line-height: 1.45; }

/* Blok pengaturan berkelompok */
.section { display: grid; gap: 6px; margin-bottom: 18px; }
.section__title { font-size: 13px; font-weight: 640; }
.section__desc { color: var(--text-muted); font-size: 12.5px; }

/* Daftar ringkas key–value untuk status integrasi */
.status-list { display: grid; gap: 10px; }
.status-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.status-row:last-child { border-bottom: 0; }
.status-row__label { flex: 1; min-width: 0; }
.status-row__label strong { display: block; font-size: 13.5px; }
.status-row__label span { color: var(--text-muted); font-size: 12.5px; }

/* Panel pratinjau tag pada template */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 9px; border-radius: 99px;
    background: var(--surface-2); border: 1px solid var(--border);
    font-family: var(--mono); font-size: 12px; cursor: pointer;
}
.tag-chip:hover { border-color: var(--brand); color: var(--brand); }

/* Kartu penerima/peran yang dapat dilipat */
.builder-item { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); padding: 14px; }
.builder-item + .builder-item { margin-top: 10px; }
.builder-item__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

/* Bilah info */
.notice {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 11px 13px; border-radius: var(--radius-sm);
    background: var(--info-soft); color: var(--info);
    font-size: 13px; line-height: 1.5;
}
.notice--warning { background: var(--warning-soft); color: var(--warning); }
.notice--danger { background: var(--danger-soft); color: var(--danger); }
.notice svg { flex: none; margin-top: 2px; }
.notice strong { display: block; }

/* ------------------------------------------------------- tab halaman --- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.tab {
    position: relative;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px; border: 0; background: none; cursor: pointer;
    color: var(--text-muted); font: inherit; font-size: 13.5px; font-weight: 550;
    white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--brand); }
.tab[aria-selected="true"]::after {
    content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px;
    height: 2px; background: var(--brand); border-radius: 2px;
    animation: tab-underline .18s ease both;
}

@keyframes tab-underline {
    from { transform: scaleX(.4); opacity: 0; }
    to { transform: none; opacity: 1; }
}

/* ------------------------------------------------------------ dropzone --- */

.dropzone {
    display: grid; place-items: center; gap: 8px;
    padding: 26px 18px; text-align: center;
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
    background: var(--surface-2); cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.dropzone:hover { border-color: var(--brand); }
.dropzone[data-dragging="true"] { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.005); }
.dropzone[data-filled="true"] { border-style: solid; border-color: var(--success); background: var(--success-soft); }
.dropzone__icon { color: var(--text-soft); }
.dropzone[data-filled="true"] .dropzone__icon { color: var(--success); }
.dropzone__title { font-weight: 600; font-size: 14px; }
.dropzone__hint { color: var(--text-muted); font-size: 12.5px; }

/* -------------------------------------------------------- log tahapan --- */

.steps { display: grid; gap: 2px; }
.step {
    display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: start;
    padding: 9px 4px; position: relative;
}
.step + .step::before {
    content: ''; position: absolute; left: 12px; top: -8px; width: 2px; height: 14px;
    background: var(--border);
}
.step[data-state="done"] + .step::before { background: var(--success); }
.step__dot {
    width: 26px; height: 26px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface-2); color: var(--text-soft);
    border: 1px solid var(--border);
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.step[data-state="active"] .step__dot {
    background: var(--brand-soft); color: var(--brand); border-color: var(--brand);
    animation: step-pulse 1.4s ease-in-out infinite;
}
.step[data-state="done"] .step__dot { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.step[data-state="failed"] .step__dot { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.step__label { font-size: 13.5px; font-weight: 550; }
.step[data-state="idle"] .step__label { color: var(--text-soft); }
.step__detail { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.step__time { color: var(--text-soft); font-family: var(--mono); font-size: 11.5px; padding-top: 4px; }

@keyframes step-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(29, 78, 216, .35); }
    50% { box-shadow: 0 0 0 6px rgba(29, 78, 216, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .step[data-state="active"] .step__dot { animation: none; }
}

/* Bilah kemajuan unggahan */
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress__bar {
    height: 100%; width: 0; border-radius: 99px;
    background: linear-gradient(90deg, var(--brand), #60a5fa);
    transition: width .2s ease;
}
.progress--indeterminate .progress__bar {
    width: 40%; animation: progress-slide 1.1s ease-in-out infinite;
}

@keyframes progress-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(320%); }
}

/* --------------------------------------------------- pratinjau spesimen --- */

.specimen-preview {
    display: grid; place-items: center; padding: 14px;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 0 0 / 16px 16px;
    min-height: 120px;
}
.specimen-preview img { max-width: 100%; height: auto; border-radius: 4px; box-shadow: var(--shadow); }
/* QR berkanvas tegak: dibatasi agar tidak memenuhi kartu. */
.specimen-preview--qr img { max-width: 240px; }

/* Hasil akhir */
.result-card {
    border: 1px solid var(--success); border-radius: var(--radius);
    background: var(--success-soft); padding: 16px;
    animation: result-in .25s ease both;
}
.result-card--failed { border-color: var(--danger); background: var(--danger-soft); }

@keyframes result-in {
    from { opacity: 0; transform: translateY(8px) scale(.99); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .result-card { animation: none; }
}

.hash-pill {
    font-family: var(--mono); font-size: 11.5px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 6px; padding: 3px 7px; word-break: break-all;
}

/* ====================================================== identitas visual === */

.mark { display: block; flex: none; }

/* Lambang yang muncul dengan sedikit gerak — dipakai di halaman masuk. */
.mark--intro { animation: mark-intro .7s cubic-bezier(.2, .8, .2, 1) both; }

@keyframes mark-intro {
    from { opacity: 0; transform: translateY(8px) scale(.94); }
    to { opacity: 1; transform: none; }
}

/*
 * Lambang BSrE berlatar putih pekat (JPG, tanpa alpha). Sudutnya dibulatkan
 * agar tidak tampak seperti tempelan kotak di atas permukaan gelap.
 */
.mark--round { border-radius: 50%; }

/*
 * Di mode gelap, lambang bertulisan biru dongker nyaris tak terbaca dan berkas
 * JPG membawa kotak putihnya sendiri. Keduanya diberi alas putih yang rapi —
 * bukan dibalik warnanya, karena warna lambang bagian dari identitas resmi.
 */
:root[data-theme="dark"] .mark--lockup,
:root[data-theme="auto"] .mark--lockup { background: #fff; padding: 10px 14px; border-radius: 12px; }

:root[data-theme="dark"] .mark--round,
:root[data-theme="auto"] .mark--round { background: #fff; padding: 2px; }

@media (prefers-color-scheme: light) {
    :root[data-theme="auto"] .mark--lockup,
    :root[data-theme="auto"] .mark--round { background: none; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .mark--intro { animation: none; }
}

.partners { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.partners__item {
    display: flex; align-items: center; gap: 9px;
    color: var(--text-muted); font-size: 12px; line-height: 1.3;
    max-width: 200px;
}

/* ------------------------------------------------ halaman masuk moderen --- */

.auth {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1100px 700px at 12% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 60%),
        radial-gradient(900px 600px at 105% 110%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 60%),
        var(--bg);
}

/* Kisi halus yang bergerak perlahan — memberi kesan bidang teknis. */
.auth::before {
    content: '';
    position: absolute; inset: -50%;
    background-image:
        linear-gradient(to right, color-mix(in srgb, var(--brand) 12%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in srgb, var(--brand) 12%, transparent) 1px, transparent 1px);
    background-size: 46px 46px;
    animation: auth-grid 26s linear infinite;
    pointer-events: none;
    mask-image: radial-gradient(closest-side, #000 30%, transparent 78%);
}

@keyframes auth-grid {
    to { transform: translate3d(46px, 46px, 0); }
}

.auth > * { position: relative; z-index: 1; }

.auth__pitch h1 {
    background: linear-gradient(120deg, var(--brand), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth__logo { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.auth__logo-text { font-weight: 700; font-size: 15px; line-height: 1.25; letter-spacing: -.01em; }
.auth__logo-text span { display: block; font-weight: 500; font-size: 12.5px; color: var(--text-muted); }

.auth__points li {
    opacity: 0;
    animation: auth-rise .5s ease forwards;
}
.auth__points li:nth-child(1) { animation-delay: .35s; }
.auth__points li:nth-child(2) { animation-delay: .45s; }
.auth__points li:nth-child(3) { animation-delay: .55s; }
.auth__points li:nth-child(4) { animation-delay: .65s; }

@keyframes auth-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* Kartu masuk: berlapis, bukan datar. */
.auth__card {
    position: relative;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(14px);
    border: 1px solid color-mix(in srgb, var(--border-strong) 70%, transparent);
    box-shadow: var(--shadow-lg);
    animation: auth-card .55s cubic-bezier(.2, .8, .2, 1) both;
    overflow: hidden;
}

.auth__card::before {
    content: '';
    position: absolute; inset-inline: 0; top: 0; height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--accent), var(--brand));
    background-size: 200% 100%;
    animation: auth-sheen 4s linear infinite;
}

@keyframes auth-card {
    from { opacity: 0; transform: translateY(18px) scale(.985); }
    to { opacity: 1; transform: none; }
}

@keyframes auth-sheen {
    to { background-position: 200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .auth::before, .auth__card, .auth__card::before, .auth__points li { animation: none; }
    .auth__points li { opacity: 1; }
}

/* Isian yang memberi umpan balik saat difokuskan. */
.auth__card .field input {
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.auth__card .field input:focus {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent);
}

.auth__foot {
    margin-top: 22px; padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* Tombol dengan kilau saat ditekan. */
.btn--primary { position: relative; overflow: hidden; }
.btn--primary::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(120px 60px at var(--x, 50%) var(--y, 50%),
        rgba(255, 255, 255, .28), transparent 60%);
    opacity: 0;
    transition: opacity .2s ease;
}
.btn--primary:hover::after { opacity: 1; }

/* ========================================================== infografis === */

.chart { display: block; overflow: visible; }
.chart-wrap { display: grid; gap: 10px; }

.chart__line {
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: chart-draw 1.1s ease forwards;
}

@keyframes chart-draw { to { stroke-dashoffset: 0; } }

/*
 * Cincin tumbuh dengan memanjangkan garisnya, bukan lewat `transform`:
 * transform dari CSS akan menimpa atribut `rotate` pada elemen SVG dan
 * membuat cincin lepas dari pusat lingkaran.
 */
.chart__ring {
    animation: ring-in .8s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes ring-in {
    from { stroke-dasharray: 0 var(--keliling); }
    to { stroke-dasharray: var(--panjang) var(--keliling); }
}

@media (prefers-reduced-motion: reduce) {
    .chart__line { animation: none; stroke-dashoffset: 0; }
    .chart__ring { animation: none; }
}

.chart__legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--text-muted); }
.chart__legend--stack { flex-direction: column; gap: 6px; }
.chart__key { display: inline-flex; align-items: center; gap: 6px; }
.chart__key i { width: 10px; height: 10px; border-radius: 3px; flex: none; }

.donut { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.chart--donut { flex: none; }

/* Kartu angka */
.statcard {
    padding: 16px;
    display: grid;
    gap: 4px;
    position: relative;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease;
}
.statcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.statcard::before {
    content: '';
    position: absolute; inset: 0 auto 0 0; width: 3px;
    background: var(--brand);
}
.statcard--accent::before { background: var(--accent); }
.statcard--warning::before { background: var(--warning); }
.statcard--danger::before { background: var(--danger); }

.statcard__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text-muted); }
.statcard__label { font-size: 12.5px; font-weight: 550; }
.statcard__value { font-size: 27px; font-weight: 680; letter-spacing: -.02em; line-height: 1.15; }
.statcard__hint { font-size: 12px; color: var(--text-soft); }
.statcard__spark { margin-top: 6px; color: var(--brand); }
.statcard--accent .statcard__spark { color: var(--accent); }

/* Daftar batang */
.barlist { display: grid; gap: 12px; }
.barlist__row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(80px, 2fr) auto; gap: 12px; align-items: center; }
.barlist__label { display: grid; min-width: 0; }
.barlist__label strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barlist__track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.barlist__fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    animation: bar-grow .8s cubic-bezier(.2, .8, .2, 1) both;
}
.barlist__value { font-family: var(--mono); font-size: 12.5px; color: var(--text-muted); }

@keyframes bar-grow { from { width: 0 !important; } }

@media (prefers-reduced-motion: reduce) {
    .barlist__fill { animation: none; }
    .statcard:hover { transform: none; }
}

/* Sampul dashboard dengan lambang mitra */
.hero {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background:
        radial-gradient(700px 320px at 90% -30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%),
        linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, var(--surface)), var(--surface));
    padding: 20px 22px;
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.hero__text { flex: 1; min-width: 240px; }
.hero__text h1 { font-size: 21px; margin-bottom: 4px; }
.hero__text p { color: var(--text-muted); }
.hero .partners { margin-left: auto; }

/* ------------------------------------------------------------ sub-menu --- */

.nav__group { display: grid; }
.nav__group .nav__item { position: relative; padding-right: 30px; }

.nav__expand {
    position: absolute; right: 4px; top: 50%; translate: 0 -50%;
    display: grid; place-items: center;
    width: 22px; height: 22px; padding: 0;
    border: 0; border-radius: 6px; background: none; cursor: pointer;
    color: var(--text-soft);
    transition: transform .18s ease, color .15s ease, background .15s ease;
}
.nav__expand:hover { background: var(--surface-2); color: var(--text); }
.nav__group[data-open="true"] .nav__expand { transform: rotate(180deg); }

/*
 * Sub-menu membuka dengan tinggi yang benar-benar dianimasikan.
 *
 * Seluruh tautan dibungkus satu elemen: `grid-template-rows: 0fr` hanya
 * membatasi baris pertama, sehingga tautan yang berdiri sendiri-sendiri akan
 * tetap terlihat dan saling menimpa saat sub-menu tertutup.
 */
.nav__children {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .22s ease;
}
.nav__group[data-open="true"] .nav__children { grid-template-rows: 1fr; }

.nav__children-inner {
    min-height: 0;
    overflow: hidden;
    display: grid;
    gap: 2px;
}

/* Jarak ke induk dipasang pada anak pertama agar keadaan tertutup benar-benar nol. */
.nav__children-inner > :first-child { margin-top: 3px; }

.nav__child {
    display: flex; align-items: center; gap: 8px;
    margin-left: 26px;
    padding: 6px 10px;
    border-left: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12.8px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.nav__child:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav__child[aria-current="page"] {
    color: var(--brand); border-left-color: var(--brand); background: var(--brand-soft);
}

/* Mode ringkas: sub-menu ikut disembunyikan bersama labelnya. */
@media (min-width: 901px) {
    .layout[data-collapsed="true"] .nav__children,
    .layout[data-collapsed="true"] .nav__expand { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .nav__children { transition: none; }
    .nav__expand { transition: none; }
}

/* --------------------------------------------- gerak halus antar menu --- */

.nav__item {
    transition: background .15s ease, color .15s ease, transform .12s ease;
}
.nav__item:active { transform: scale(.985); }

.nav__item[aria-current="page"] {
    position: relative;
}
.nav__item[aria-current="page"]::before {
    content: '';
    position: absolute; left: -14px; top: 50%; translate: 0 -50%;
    width: 3px; height: 18px; border-radius: 0 3px 3px 0;
    background: var(--brand);
    animation: nav-mark .25s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes nav-mark {
    from { height: 0; opacity: 0; }
    to { height: 18px; opacity: 1; }
}

/* Kartu dan tabel yang sedikit terangkat saat disentuh kursor. */
.card { transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease; }
.grid--2 > .card:hover, .grid--stats > .card:hover { border-color: var(--border-strong); }

.table tbody tr { transition: background .14s ease; }

@media (prefers-reduced-motion: reduce) {
    .nav__item, .nav__item[aria-current="page"]::before, .card, .table tbody tr { transition: none; animation: none; }
}

/* ======================================================== buku manual === */

.manual { display: grid; grid-template-columns: 232px 1fr; gap: 20px; align-items: start; }

@media (max-width: 860px) {
    .manual { grid-template-columns: 1fr; }
    .manual__nav { flex-direction: row; overflow-x: auto; }
}

.manual__nav {
    display: flex; flex-direction: column; gap: 2px;
    position: sticky; top: 74px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    box-shadow: var(--shadow);
}

.manual__link {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 11px;
    border: 0; border-radius: var(--radius-sm);
    background: none; cursor: pointer;
    color: var(--text-muted); font: inherit; font-size: 13.2px; font-weight: 540;
    text-align: left; white-space: nowrap;
    transition: background .14s ease, color .14s ease, transform .12s ease;
}
.manual__link:hover { background: var(--surface-2); color: var(--text); }
.manual__link:active { transform: scale(.985); }
.manual__link[aria-current="true"] { background: var(--brand-soft); color: var(--brand); }

.manual__body { display: grid; gap: 16px; animation: page-in .22s ease both; }

/* Daftar langkah bernomor dengan lingkaran angka. */
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: langkah; }
.steps-list li {
    position: relative;
    padding-left: 38px;
    counter-increment: langkah;
}
.steps-list li::before {
    content: counter(langkah);
    position: absolute; left: 0; top: 0;
    width: 26px; height: 26px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: var(--brand-soft); color: var(--brand);
    font-size: 12.5px; font-weight: 680;
}
.steps-list li::after {
    content: '';
    position: absolute; left: 13px; top: 30px; bottom: -10px;
    width: 1px; background: var(--border);
}
.steps-list li:last-child::after { display: none; }
.steps-list strong { font-size: 13.5px; }

@media (prefers-reduced-motion: reduce) {
    .manual__body { animation: none; }
    .manual__link { transition: none; }
}
