/*
 * Sistem Akuntansi — antarmuka "Cap Basah".
 * Satu berkas CSS lokal: tanpa build, tanpa font/CDN luar (aplikasi berjalan offline).
 * Urutan: token, dasar, shell, komponen, halaman, cetak.
 */

/* Archivo (SIL OFL, berkas lokal di public/fonts): suara tampilan untuk judul dan cap; teks isi memakai font sistem. */
@font-face {
    font-family: "Archivo";
    src: url("../fonts/archivo-variable.woff2") format("woff2");
    font-weight: 100 900;
    font-stretch: 62% 125%;
    font-display: swap;
}

/* ───────────── Token ───────────── */
:root {
    color-scheme: light;

    --rail: #17237a;
    --rail-hover: #1f2f98;
    --rail-active: #2a44c8;
    --rail-ink: #eef1ff;
    --rail-mute: #b4bff2;
    --rail-line: #33449f;

    --ground: #f4f6fb;
    --paper: #ffffff;
    --line: #d9deee;
    --line-strong: #b4bdd9;
    --ink: #141b34;
    --ink-2: #3e4868;
    --ink-3: #5a6584;

    --stamp: #2a44c8;
    --stamp-wash: #e9edfc;
    --void: #b3261e;
    --void-wash: #fbeceb;
    --seal: #0b6b47;
    --seal-wash: #e6f4ed;
    --warn: #8a5300;
    --warn-wash: #fff4de;
    --warn-line: #e0b050;

    --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Archivo", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
    --font-stamp: "Archivo", "Bahnschrift", "Segoe UI Variable Display", "Segoe UI", "Arial Narrow", sans-serif;

    --rail-w: 232px;
    --radius: 6px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --ease-out: cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* ───────────── Dasar ───────────── */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }

body {
    margin: 0;
    background: var(--ground);
    color: var(--ink);
    font: 14px/1.5 var(--font);
    font-feature-settings: "tnum" 1, "lnum" 1;
    -webkit-font-smoothing: antialiased;
    accent-color: var(--stamp);
    caret-color: var(--stamp);
}

::selection { background: var(--stamp); color: #fff; }

a { color: var(--stamp); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--rail); text-decoration-thickness: 2px; }
a:has(> button) { text-decoration: none; }

:focus-visible { outline: 2px solid var(--stamp); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); margin: 0; text-wrap: balance; }
h1 { font-size: 25px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; word-spacing: 0.06em; font-stretch: 92%; }
h2 { font-size: 15.5px; line-height: 1.3; font-weight: 650; font-stretch: 94%; word-spacing: 0.08em; }
.show-sm { display: none; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 var(--space-3); }

.sub { color: var(--ink-3); margin: 4px 0 0; max-width: 96ch; }
.muted { color: var(--ink-3); }
.ok { color: var(--seal); }
.bad { color: var(--void); }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link { position: absolute; left: -999px; top: 8px; background: var(--paper); color: var(--ink); padding: 8px 12px; border-radius: var(--radius); z-index: 50; }
.skip-link:focus { left: 8px; }

/* ───────────── Shell ───────────── */
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }

.rail {
    background: var(--rail);
    color: var(--rail-ink);
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rail a { color: inherit; text-decoration: none; }

.rail__brand { padding: 18px 16px 14px; border-bottom: 1px solid var(--rail-line); }
.rail__company { display: block; font: 650 15px/1.25 var(--font-display); color: #fff; overflow-wrap: anywhere; }
.rail__period { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--rail-mute); }

.rail__nav { flex: 1; overflow-y: auto; padding: 8px 8px 16px; scrollbar-color: var(--rail-line) transparent; scrollbar-width: thin; }
.rail__group { margin-top: 14px; }
.rail__group:first-child { margin-top: 4px; }
.rail__label, .rail__group > summary {
    display: block;
    padding: 4px 10px;
    font: 600 11px/1.4 var(--font);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rail-mute);
}
.rail__group > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; border-radius: 4px; }
.rail__group > summary::-webkit-details-marker { display: none; }
.rail__group > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 140ms var(--ease-out); margin-right: 3px; }
.rail__group[open] > summary::after { transform: rotate(-135deg); }
.rail__group > summary:hover { color: #fff; }

.rail__link {
    display: block;
    padding: 6px 10px;
    margin: 1px 0;
    border-radius: 5px;
    font-size: 13.5px;
    line-height: 1.35;
    color: var(--rail-ink);
}
.rail__link:hover { background: var(--rail-hover); }
.rail__link[aria-current="page"] { background: var(--rail-active); color: #fff; font-weight: 600; }

.rail__foot { padding: 12px 16px; border-top: 1px solid var(--rail-line); font-size: 12.5px; }
.rail__user { color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.rail__role { color: var(--rail-mute); }
.rail__foot form { margin-top: 8px; }
.rail__foot button {
    background: transparent; color: var(--rail-ink); border: 1px solid var(--rail-line); height: 30px; padding: 0 12px; font-size: 12.5px;
}
.rail__foot button:hover { background: var(--rail-hover); color: #fff; border-color: var(--rail-mute); }

.rail__toggle { display: none; }

.main { min-width: 0; padding: var(--space-5) var(--space-6) 64px; }
.page { max-width: 1440px; margin: 0 auto; }
/* Laporan berkolom sedikit dibaca lebih baik pada lebar terbatas: angka tidak terpisah jauh dari labelnya. */
.page--reading { max-width: 1000px; margin-left: 0; }
.statement--compact table { max-width: 620px; }

@media (max-width: 1439px) {
    :root { --rail-w: 212px; }
    .main { padding: 20px 24px 56px; }
}

@media (max-width: 899px) {
    .shell { display: block; }
    .rail { position: relative; height: auto; }
    .rail__toggle { display: inline-flex; margin: 0 16px 12px; height: 32px; background: transparent; border: 1px solid var(--rail-line); color: var(--rail-ink); }
    .rail__nav, .rail__foot { display: none; }
    .rail--open .rail__nav, .rail--open .rail__foot { display: block; }
    .rail--open .rail__nav { max-height: 70vh; }
    .main { padding: 16px 16px 48px; }
}

/* ───────────── Kepala halaman ───────────── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-5); }
.page-head h1 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; }
.report-head__company { display: none; font: 600 12.5px/1.3 var(--font); color: var(--ink-3); margin-bottom: 4px; }
.crumb { display: inline-block; margin-bottom: 6px; font-size: 13px; color: var(--ink-3); text-decoration: none; }
.crumb:hover { color: var(--stamp); text-decoration: underline; }

/* ───────────── Panel ───────────── */
.panel, .card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    min-width: 0;
}
.panel--flush, .card.panel--flush { padding: 0; overflow-x: auto; }
.panel__title { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); min-height: 30px; }
.panel > strong:first-child, .card > strong:first-child { display: block; font: 650 15px/1.3 var(--font-display); margin-bottom: var(--space-3); }
.card { overflow-x: auto; }
.card > table, .panel > table { margin-top: -4px; }
.card.ok, .card.bad { background: var(--paper); }

/* ───────────── Tabel ───────────── */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { font: 600 12px/1.3 var(--font); color: var(--ink-2); background: var(--ground); border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
th.num, td.num { text-align: right; }
tbody tr:hover > td { background: #f7f8fd; }
tbody tr:last-child > td { border-bottom: 0; }
td input, td select { width: 100%; min-width: 96px; height: 32px; }
td form { display: inline-flex; gap: 6px; align-items: center; }
td .actions, td .row-actions { margin: 0; }

tr.group td { background: var(--ground); font-weight: 650; color: var(--ink); border-top: 1px solid var(--line-strong); }
tr.sub td { font-weight: 600; font-style: italic; color: var(--ink-2); padding-top: 10px; border-bottom-style: dotted; }
tr.subtotal td { color: var(--ink-2); font-size: 14px; font-weight: 600; border-top: 1px solid var(--line-strong); }
td.indent { padding-left: 28px; }
tr.sub:hover > td, tr.group:hover > td { background: inherit; }
tr.total td { font-weight: 700; border-top: 1px solid var(--ink); border-bottom: 4px double var(--ink); background: transparent; }
tr.total:hover > td { background: transparent; }
tfoot td { font-weight: 650; border-top: 1px solid var(--line-strong); border-bottom: 0; }
tfoot tr.total td { border-bottom: 4px double var(--ink); }

.table-scroll { overflow-x: auto; }
.empty { padding: var(--space-6) var(--space-4); text-align: center; color: var(--ink-3); }

/* ───────────── Formulir ───────────── */
label { display: flex; flex-direction: column; gap: 5px; font: 600 12.5px/1.3 var(--font); color: var(--ink-2); }
input, select, textarea, button { font: inherit; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    color: var(--ink);
    background: var(--paper);
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    font-weight: 400;
}
textarea { height: auto; padding: 8px 10px; line-height: 1.45; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 0.85; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--stamp); outline-offset: 0; border-color: var(--stamp); }
input[type="file"] { font-weight: 400; padding: 4px 0; height: auto; border: 0; }
input[type="file"]::file-selector-button {
    height: 34px; margin-right: 10px; padding: 0 14px;
    border: 1px solid var(--line-strong); border-radius: 5px;
    background: var(--paper); color: var(--ink);
    font: 600 13.5px/1 var(--font); cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--ground); border-color: var(--ink-3); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; flex: none; margin: 0; }
input:disabled, select:disabled, textarea:disabled { background: var(--ground); color: var(--ink-3); cursor: not-allowed; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.error { color: var(--void); font-size: 12.5px; font-weight: 500; }

.form-grid, .grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: var(--space-4); }
.stack { display: grid; gap: var(--space-4); }
.form-narrow { max-width: 640px; }

.filters {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.filters label { min-width: min(150px, 100%); }
@media (max-width: 899px) {
    .filters label, .filters .grow { flex: 1 1 100%; }
    .page-head__actions { width: 100%; }
}
.filters .grow { flex: 1 1 220px; }
form.filters.card, form.filters.panel { padding: var(--space-3) var(--space-4); }

/* ───────────── Tombol ───────────── */
button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 34px; padding: 0 14px;
    border: 1px solid var(--stamp); border-radius: 5px;
    background: var(--stamp); color: #fff;
    font: 600 13.5px/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color 120ms var(--ease-out), border-color 120ms var(--ease-out), color 120ms var(--ease-out);
}
button:hover, .btn:hover { background: var(--rail); border-color: var(--rail); color: #fff; }
button:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
button.secondary:hover, .btn.secondary:hover { background: var(--ground); border-color: var(--ink-3); color: var(--ink); }
button.danger, .btn.danger { background: var(--paper); color: var(--void); border-color: var(--void); }
button.danger:hover, button.danger:focus-visible, .btn.danger:hover { background: var(--void); color: #fff; border-color: var(--void); }
button.link { height: auto; padding: 0; background: none; border: 0; color: var(--stamp); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
button.link:hover { background: none; color: var(--rail); }
button:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
button.small, .btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; }

.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-3) 0 var(--space-4); }
.actions form { display: inline-flex; gap: var(--space-2); align-items: center; margin: 0; }
.actions input { width: auto; min-width: 180px; }
/* Tindakan tak-terbalikkan dipisah ruang kosong dari tindakan lain. */
.actions > * + :is(.danger, form:has(.danger)) { margin-left: 32px; }

/* ───────────── Cap (status) ───────────── */
.stamp {
    --c: var(--stamp);
    display: inline-block;
    padding: 0.3em 0.6em 0.22em;
    color: var(--c);
    border: 1.5px solid var(--c);
    outline: 1px solid var(--c);
    outline-offset: 2px;
    border-radius: 2px;
    font: 700 11.5px/1 var(--font-stamp);
    font-stretch: 78%;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    transform: rotate(-2deg);
    vertical-align: middle;
    margin: 3px;
    background: transparent;
}
.stamp--lg { font-size: 13px; }
.stamp--ink { --c: var(--stamp); }
.stamp--seal { --c: var(--seal); }
.stamp--void { --c: var(--void); }
.stamp--struck { text-decoration: line-through; text-decoration-thickness: 2px; }
.stamp--warn { --c: var(--warn); }
.stamp--draft { --c: var(--warn); border-style: dashed; outline: 0; margin: 0; background: var(--warn-wash); }
.stamp--locked { background: var(--ink); color: #fff; border-color: var(--ink); outline-color: var(--ink); }
.stamp--hatch { background: repeating-linear-gradient(135deg, var(--void-wash) 0 5px, transparent 5px 10px); }
.stamp--press { animation: stamp-press 200ms var(--ease-out) both; }

/* Di dalam tabel, keadaan normal (posted, terbuka, selesai) tampil tenang; hanya pengecualian yang memakai cap penuh. */
td .stamp--ink:not(.stamp--lg),
td .stamp--seal:not(.stamp--lg),
.claim__receipt .stamp--ink {
    outline: 0; transform: none; margin: 0;
    border-width: 1px; border-radius: 3px;
    padding: 0.32em 0.55em 0.22em;
    font-size: 10.5px;
    background: var(--stamp-wash);
}
td .stamp--seal:not(.stamp--lg) { background: var(--seal-wash); }
td .stamp { margin-block: 0; }

/* Cap di atas rail biru memakai tinta terang agar terbaca. */
.rail .stamp { --c: #ffffff; font-size: 10.5px; }
.rail .stamp--seal { --c: #8fe3bd; }
.rail .stamp--warn { --c: #ffd27a; }
.rail .stamp--locked { background: #fff; color: var(--rail); border-color: #fff; outline-color: #fff; }

/* Penanda tingkat perhatian: teks biasa, bukan cap. */
.tag { display: inline-block; min-width: 74px; font: 700 11.5px/1.2 var(--font-stamp); letter-spacing: 0.08em; text-transform: uppercase; color: var(--warn); }
.tag--bad { color: var(--void); }
.tag--info { color: var(--stamp); }

@keyframes stamp-press {
    from { opacity: 0; transform: scale(1.18) rotate(-6deg); }
    to { opacity: 1; transform: scale(1) rotate(-2deg); }
}

.badge { display: inline-block; padding: 1px 8px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12px; color: var(--ink-2); background: var(--paper); }
.badge.bad { color: var(--void); border-color: var(--void); }

/* ───────────── Paginasi ───────────── */
.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin: var(--space-3) 0 var(--space-4); color: var(--ink-3); font-size: 13px; }
.pager__nav { display: inline-flex; align-items: center; gap: var(--space-3); }

/* ───────────── Pemberitahuan ───────────── */
.flash { display: flex; gap: var(--space-3); align-items: baseline; padding: 10px 14px; margin-bottom: var(--space-4); border: 1px solid; border-radius: var(--radius); background: var(--paper); }
.flash--ok { border-color: var(--stamp); background: var(--stamp-wash); }
.flash--bad { border-color: var(--void); background: var(--void-wash); color: var(--ink); }
.flash strong { white-space: nowrap; }
.flash ul { margin: 4px 0 0; padding-left: 18px; }
.flash--ok strong { color: var(--stamp); }
.flash--bad strong { color: var(--void); }

/* ───────────── Pernyataan (dashboard) ───────────── */
.statements { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.statements .statement { margin: 0; }
.statement .panel__title { align-items: center; }
.statement table td { padding: 7px 0; border-bottom: 1px dotted var(--line-strong); }
.statement table tr:last-child td { border-bottom: 0; }
.statement td.num { padding-left: var(--space-4); }
.statement tr.total td { border-bottom: 4px double var(--ink); border-top: 1px solid var(--ink); }
.statement tbody tr:hover > td { background: transparent; }

.attention { list-style: none; margin: 0; padding: 0; }
.attention li { display: flex; gap: var(--space-3); align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.attention li:last-child { border-bottom: 0; }
.attention .stamp { flex: none; min-width: 74px; text-align: center; }
.attention a { font-weight: 500; }

.shortcuts { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ───────────── Aksi baris, zona berbahaya ───────────── */
.row-actions { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; }
.row-actions form { margin: 0; }
.row-actions .reopen { margin-left: 24px; }
.row-actions .reopen input { max-width: 220px; }
.period-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: var(--space-4); align-items: start; }

/* Tindakan dengan alasan wajib: tersembunyi sampai dibuka, supaya tabel tidak penuh kolom isian. */
.reason { display: inline-block; }
.reason > summary { list-style: none; cursor: pointer; }
.reason > summary::-webkit-details-marker { display: none; }
.reason > summary:hover { color: var(--void); border-color: var(--void); }
.reason[open] > summary { background: var(--void); color: #fff; border-color: var(--void); }
.actions > * + .reason { margin-left: 32px; }
.reason__form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-top: var(--space-2); padding: var(--space-3); background: var(--void-wash); border: 1px solid var(--void); border-radius: var(--radius); }
.reason__form input { min-width: 220px; width: auto; flex: 1 1 220px; }
.period-tools .filters { margin-bottom: var(--space-4); }
.danger-zone { border-color: var(--void); background: var(--paper); margin-top: var(--space-6); }
.danger-zone .panel__title h2 { color: var(--void); }

/* ───────────── Klaim (talangan) ───────────── */
.claim { padding: var(--space-4) 0; border-top: 1px solid var(--line); }
.claim:first-of-type { border-top: 0; padding-top: 0; }
.claim__head { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.claim__figures { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin-top: 8px; }
.claim__figures div { display: flex; gap: var(--space-3); align-items: baseline; }
.claim__figures dt { color: var(--ink-3); }
.claim__figures dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.claim__actions { margin-top: var(--space-4); }
.claim__actions .filters { margin-bottom: var(--space-3); }
.claim__reject { margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px dotted var(--line-strong); }
.claim__receipt { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; margin-top: 6px; color: var(--ink-2); }
.claim__receipt form { margin: 0; }
.claim__receipt input { max-width: 180px; }

/* ───────────── Indeks laporan ───────────── */
.index-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: var(--space-4); align-items: start; }
.index-list { list-style: none; margin: 0; padding: 0; }
.index-list li { border-bottom: 1px solid var(--line); }
.index-list li:last-child { border-bottom: 0; }
.index-list a { display: grid; grid-template-columns: minmax(140px, 0.9fr) 1.4fr; gap: var(--space-3); padding: 9px 0; text-decoration: none; color: var(--ink); }
.index-list a:hover .index-list__name { color: var(--stamp); text-decoration: underline; }
.index-list__name { font-weight: 600; }
.index-list__note { color: var(--ink-3); font-size: 13px; }

.menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.menu a { display: block; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); font-weight: 600; }
.menu a:hover { border-color: var(--stamp); }
.menu a span { display: block; color: var(--ink-3); font-size: 13px; font-weight: 400; }

/* ───────────── Bilah keseimbangan (form jurnal) ───────────── */
.balance-bar {
    position: sticky; bottom: var(--space-3); z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5);
    margin: 0; padding: 12px var(--space-4);
    background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.balance-bar dl { display: flex; gap: var(--space-5); margin: 0; flex-wrap: wrap; }
.balance-bar dt { font-size: 12px; color: var(--ink-3); }
.balance-bar dd { margin: 0; font: 650 16px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }

/* ───────────── Login ───────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(280px, 5fr) minmax(320px, 7fr); }
.auth__side { background: var(--rail); color: var(--rail-ink); padding: 48px 40px; display: flex; flex-direction: column; justify-content: space-between; }
.auth__side h1 { color: #fff; font-size: 26px; max-width: 14ch; margin-bottom: var(--space-3); }
.auth__side p { color: var(--rail-mute); max-width: 36ch; }
.auth__note { font-size: 12.5px; color: var(--rail-mute); }
.auth__form { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth__form form { width: min(380px, 100%); display: grid; gap: var(--space-4); }
@media (max-width: 760px) { .auth { grid-template-columns: 1fr; } .auth__side { padding: 28px 24px; } }

/* ───────────── Layar sempit ───────────── */
@media (max-width: 899px) {
    .hide-sm { display: none; }
    .show-sm { display: block; font-size: 12.5px; }
    .lines-table tr.line td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 3px; font: 600 12px/1.3 var(--font); color: var(--ink-2); }
    /* Baris isian jurnal/tagihan ditumpuk: akun penuh, debit dan kredit berdampingan. */
    .lines-table thead { display: none; }
    .lines-table, .lines-table tbody { display: block; }
    .lines-table tr.line { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
    .lines-table tr.line td { display: block; padding: 0; border: 0; }
    .lines-table tr.line td:nth-child(1), .lines-table tr.line td:nth-child(2) { grid-column: 1 / -1; }
    .lines-table tr.line td:last-child { grid-column: 3; grid-row: 3; align-self: end; }
}

/* ───────────── Penjaga: peramban ───────────── */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* ───────────── Gerak ───────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ───────────── Cetak ───────────── */
@media print {
    :root { --ground: #fff; }
    body { background: #fff; color: #000; font-size: 11pt; }
    .shell { display: block; }
    .rail, .no-print, .filters, .page-head__actions, .skip-link, .balance-bar, .crumb { display: none !important; }
    .main { padding: 0; }
    .panel, .card { border: 0; padding: 0; margin: 0 0 12pt; break-inside: avoid-page; overflow: visible; }
    th { background: #fff; border-bottom: 1.5pt solid #000; }
    td, th { border-bottom: 0.5pt solid #999; padding: 3pt 6pt; }
    tr.group td { background: #eee; }
    tr.total td { border-top: 1pt solid #000; border-bottom: 3pt double #000; }
    a { color: #000; text-decoration: none; }
    .stamp { transform: none; }
    .report-head__company { display: block; color: #000; font-size: 11pt; }
}


/* ───────────── Statistik laba rugi (dashboard) ───────────── */
.profit-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.profit-tile { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.profit-tile--main.ok { background: var(--seal-wash); border-color: var(--seal); }
.profit-tile--main.bad { background: var(--void-wash); border-color: var(--void); }
.profit-tile__label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.profit-tile__value { font: 650 20px/1.2 var(--font-display); font-feature-settings: "tnum", "lnum"; color: var(--ink); }
.profit-tile--main.ok .profit-tile__value { color: var(--seal); }
.profit-tile--main.bad .profit-tile__value { color: var(--void); }
.profit-tile__note { font-size: 12.5px; color: var(--ink-3); }
.profit-trend { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.profit-trend li { display: grid; grid-template-columns: 72px 1fr minmax(110px, auto); align-items: center; gap: var(--space-3); }
.profit-trend__label { font-size: 12.5px; color: var(--ink-3); }
.profit-trend__track { display: block; height: 10px; background: var(--ground); border-radius: 2px; overflow: hidden; }
.profit-trend__bar { display: block; height: 100%; }
.profit-trend__bar--ok { background: var(--seal); }
.profit-trend__bar--bad { background: var(--void); }
.profit-trend__value { text-align: right; }