/* ============ Arsip Surat ============ */
:root {
  --bg: #f4f2ed;
  --surface: #ffffff;
  --ink: #1b2233;
  --muted: #687083;
  --line: #e2ded4;
  --side: #1d2b4f;
  --side-ink: #c9d1e4;
  --side-hover: #2a3a63;
  --primary: #24407f;
  --primary-ink: #ffffff;
  --primary-soft: #e7ecf7;
  --accent: #c8733b;
  --accent-soft: #f8eadf;
  --ok: #2b7a4b; --ok-soft: #e2f2e8;
  --warn: #9a6200; --warn-soft: #fbefd3;
  --bad: #b33a2f; --bad-soft: #f8e0dc;
  --info: #24407f; --info-soft: #e7ecf7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 25, 45, .05), 0 6px 18px rgba(20, 25, 45, .05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sidebar-w: 248px;
  color-scheme: light; /* selalu tema terang, walau perangkat memakai mode gelap */
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; margin: 0 0 .15rem; letter-spacing: -.01em; line-height: 1.25; }
h2 { font-size: 1.05rem; margin: 0 0 .8rem; }
h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.3rem 0 .6rem; }
code { font-family: var(--mono); font-size: .88em; background: var(--primary-soft); padding: .05em .35em; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .92em; }
.upper { text-transform: uppercase; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.num { text-align: right; white-space: nowrap; }
.prewrap { white-space: pre-wrap; }
.ic { flex: none; vertical-align: -3px; }
[hidden] { display: none !important; }
.print-only { display: none; }
.inline { display: inline; margin: 0; }
button.link { background: none; border: 0; font: inherit; color: var(--primary); cursor: pointer; padding: 0; }
button.link.danger { color: var(--bad); }

/* ============ Sidebar layout ============ */
.has-sidebar .main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; z-index: 40; }
.sidebar .brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.1rem 1rem; color: #fff; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar .brand:hover { text-decoration: none; }
.sidebar .brand img { border-radius: 8px; flex: none; }
.sidebar .brand span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sidebar .brand strong { font-size: 1rem; }
.sidebar .brand small { color: var(--side-ink); font-size: .74rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { flex: 1; overflow-y: auto; padding: .6rem .6rem 1rem; }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #8090b5; margin: 1rem .7rem .35rem; }
.side-nav a { display: flex; align-items: center; gap: .7rem; color: var(--side-ink); padding: .55rem .7rem; border-radius: 8px; font-size: .92rem; margin-bottom: 1px; position: relative; }
.side-nav a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.side-nav a.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.side-nav a.active::before { content: ""; position: absolute; left: -.6rem; top: .45rem; bottom: .45rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.side-user { display: flex; align-items: center; gap: .3rem; padding: .7rem .7rem .8rem; border-top: 1px solid rgba(255,255,255,.07); }
.side-user > a { display: flex; align-items: center; gap: .6rem; flex: 1; min-width: 0; color: var(--side-ink); padding: .35rem .4rem; border-radius: 8px; }
.side-user > a:hover, .side-user > a.active { background: var(--side-hover); text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.who strong { color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { font-size: .74rem; opacity: .75; }
.icon-btn { background: none; border: 0; color: inherit; padding: .45rem; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.side-user .icon-btn:hover { background: var(--side-hover); color: #fff; }
.backdrop { display: none; }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: .8rem; height: 60px; padding: 0 1.6rem; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.nav-toggle { display: none; color: var(--ink); }
.topsearch { flex: 1; max-width: 520px; position: relative; display: flex; align-items: center; }
.topsearch .ic { position: absolute; left: .75rem; color: var(--muted); pointer-events: none; }
.topsearch input { padding-left: 2.2rem; background: var(--surface); border-radius: 999px; }
.today { margin-left: auto; white-space: nowrap; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 1.6rem 1.6rem 3.5rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.page-head p { margin: 0; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.back { display: inline-block; font-size: .85rem; margin-bottom: .3rem; }

/* ============ Cards & grids ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; box-shadow: var(--shadow); margin-bottom: 1.1rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.card-head h2 { margin-bottom: .7rem; }
.stack > .card, .stack > form { margin-bottom: 1.1rem; }
.stack > :last-child { margin-bottom: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem 1rem; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.form-cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
.form-cols > .card { margin-bottom: 0; }
.form-cols .span-cols { grid-column: 1 / -1; }
.detail-cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 1.1rem; align-items: start; }
.detail-cols > .card { margin-bottom: 0; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.dash-grid > .card { margin-bottom: 0; }
.span-all { grid-column: 1 / -1; }

/* ============ Stats ============ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-bottom: 1.1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); color: var(--ink); display: flex; flex-direction: column; border-left: 4px solid var(--primary); transition: transform .12s; }
.stat:hover { text-decoration: none; transform: translateY(-1px); }
.stat span { font-size: .8rem; color: var(--muted); }
.stat strong { font-size: 1.8rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat small { font-size: .78rem; color: var(--muted); }
.stat.warn { border-left-color: var(--accent); }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li + li { border-top: 1px solid var(--line); }
.mini-list a { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .6rem .2rem; color: var(--ink); }
.mini-list a:hover { text-decoration: none; background: color-mix(in srgb, var(--surface) 92%, var(--primary)); }
.ml-main { display: flex; flex-direction: column; min-width: 0; }
.ml-main strong { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-main small { font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ml-side { display: flex; gap: .3rem; flex: none; }

.legend { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.lg { width: 10px; height: 10px; border-radius: 2px; display: inline-block; margin-left: .4rem; }
.lg.in, .bc.in { background: var(--primary); }
.lg.out, .bc.out { background: var(--accent); }
.bars-chart { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; height: 180px; align-items: end; padding-top: 1rem; }
.bc-col { display: flex; flex-direction: column; height: 100%; }
.bc-bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid var(--line); }
.bc { width: min(28px, 40%); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; height: 2px; transition: height .4s; }
.bc em { position: absolute; top: -1.2rem; left: 50%; transform: translateX(-50%); font-style: normal; font-size: .72rem; color: var(--muted); }
.bc-lbl { text-align: center; font-size: .78rem; color: var(--muted); padding-top: .3rem; }

/* ============ Table ============ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: .75rem .9rem; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, var(--line)); white-space: nowrap; }
.table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--surface) 95%, var(--primary)); }
.table td.grow { min-width: 240px; }
.table td.empty { text-align: center; color: var(--muted); padding: 2.2rem 1rem; }
.table tr.inactive td { opacity: .55; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions a, .row-actions .link { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; color: var(--muted); }
.row-actions a:hover, .row-actions .link:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.clip { white-space: nowrap; }

/* ============ Badges & alerts ============ */
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 99px; font-size: .74rem; font-weight: 600; white-space: nowrap; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.dark { background: var(--ink); color: var(--surface); border-color: transparent; }
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-error { background: var(--bad-soft); color: var(--bad); }
.alert-info { background: var(--info-soft); color: var(--info); }

/* ============ Forms ============ */
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .86rem; font-weight: 600; margin-bottom: .9rem; }
.form .grid2 label, .form .grid3 label { margin-bottom: 0; }
.form .grid2, .form .grid3 { margin-bottom: .9rem; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 0; border-color: var(--primary); }
input[readonly], select:disabled { background: var(--bg); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--primary); }
textarea { resize: vertical; }
.hint { font-size: .78rem; color: var(--muted); font-weight: 400; margin: .1rem 0 0; }
label.check { flex-direction: row; align-items: center; gap: .55rem; font-weight: 400; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.1rem; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); padding: .8rem 0; border-top: 1px solid var(--line); z-index: 5; }
.filters { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; padding: .9rem; }
.filters input[type=search] { flex: 1 1 240px; }
.filters select { flex: 0 1 165px; width: auto; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 2.6rem; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; font-size: 1rem; opacity: .6; }
.inline-edit { display: flex; gap: .45rem; align-items: center; margin: 0 0 .5rem; flex-wrap: wrap; }
.inline-edit input, .inline-edit select { padding: .45rem .6rem; font-size: .88rem; flex: 1 1 160px; width: auto; }
.inline-edit.add { margin-top: .9rem; padding-top: .9rem; border-top: 1px dashed var(--line); }
.inline-edit .count { min-width: 4.5rem; text-align: right; color: var(--muted); font-size: .84rem; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
.segmented label { margin: 0; cursor: pointer; flex-direction: row; align-items: flex-start; gap: .6rem; border: 1.5px solid var(--line); border-radius: 10px; padding: .7rem .8rem; font-weight: 400; }
.segmented label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.segmented input { margin-top: .2rem; }
.segmented span { display: flex; flex-direction: column; line-height: 1.3; }
.segmented small { color: var(--muted); font-size: .78rem; }
.nomor-box { background: var(--bg); border: 1px dashed color-mix(in srgb, var(--primary) 35%, var(--line)); border-radius: 10px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .2rem; margin-bottom: .9rem; }
.nomor-preview { font-size: 1.25rem; font-weight: 700; color: var(--muted); word-break: break-all; }
.nomor-preview.ok, [data-f-sample], .nomor-hero strong { color: var(--primary); }
.nomor-hero { display: flex; flex-direction: column; gap: .15rem; border-left: 4px solid var(--accent); }
.nomor-hero strong { font-size: clamp(1.1rem, 3.4vw, 1.6rem); word-break: break-all; }
.tokens { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.chip { font: 600 .74rem var(--mono); background: var(--primary-soft); color: var(--primary); border: 0; border-radius: 999px; padding: .25rem .6rem; cursor: pointer; }
.chip:hover { filter: brightness(.95); }

.dropzone { position: relative; border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.3rem 1rem; text-align: center; cursor: pointer; background: var(--bg); align-items: center; font-weight: 400 !important; margin-bottom: 0 !important; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.tall { padding: 2.2rem 1rem; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone > span { display: flex; gap: .4rem; align-items: center; justify-content: center; color: var(--primary); }
.picked { list-style: none; margin: .5rem 0 0; padding: 0; text-align: left; font-size: .82rem; width: 100%; }
.picked li { padding: .25rem .5rem; background: var(--surface); border-radius: 6px; margin-top: .25rem; word-break: break-all; }

/* ============ Berkas ============ */
.files { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.file { display: flex; align-items: center; gap: .75rem; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; background: var(--surface); }
.file-thumb { width: 46px; height: 46px; border-radius: 6px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--bg); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb.icon, .cover-icon { font: 700 .72rem var(--mono); color: #fff; background: var(--muted); }
.i-pdf { background: #c0392b !important; } .i-doc { background: #2b5aa8 !important; } .i-xls { background: #217346 !important; } .i-ppt { background: #c55a11 !important; }
.file-thumb.icon:hover { text-decoration: none; }
.file-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-name { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-actions { display: flex; gap: .2rem; flex: none; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin-bottom: 1.2rem; }
.gallery a { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg); display: block; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.gallery a:hover img { transform: scale(1.04); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.arsip-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: var(--ink); display: flex; flex-direction: column; transition: transform .12s, box-shadow .12s; }
.arsip-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(20,25,45,.1); }
.arsip-card .cover { aspect-ratio: 16/10; background: var(--bg); position: relative; display: grid; place-items: center; overflow: hidden; }
.arsip-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-icon { width: 64px; height: 64px; border-radius: 12px; display: grid; place-items: center; font-size: .9rem; }
.cover-icon:not([class*="i-"]) { background: var(--primary-soft); color: var(--primary); }
.arsip-card .count { position: absolute; right: .5rem; bottom: .5rem; background: rgba(0,0,0,.6); color: #fff; font-size: .74rem; padding: .1rem .45rem; border-radius: 99px; display: flex; gap: .2rem; align-items: center; }
.arsip-card .body { padding: .75rem .9rem .9rem; display: flex; flex-direction: column; gap: .15rem; }
.arsip-card .body strong { font-size: .95rem; line-height: 1.3; }

/* ============ Buttons ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-size: .9rem; font-weight: 600; padding: .55rem 1rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; line-height: 1.3; }
.btn:hover { text-decoration: none; border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.btn.danger:hover { background: var(--bad); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--bg); color: var(--ink); }
.btn.ghost.danger:hover { color: var(--bad); }
.btn.sm { padding: .32rem .7rem; font-size: .82rem; }
.btn.block { width: 100%; }
.pager { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: center; margin-top: 1rem; }
.pager a, .pager span { min-width: 2.2rem; text-align: center; padding: .35rem .6rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); }
.pager .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pager .gap { border: 0; background: none; }

/* ============ Detail ============ */
.dl { display: grid; grid-template-columns: 160px 1fr; gap: .55rem 1rem; margin: 0; }
.dl dt { color: var(--muted); font-size: .86rem; }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.dl.single { grid-template-columns: 1fr; gap: .1rem; }
.dl.single dd { margin-bottom: .6rem; }
.meta { margin: 1.2rem 0 0; }
.danger-zone { padding-top: .2rem; }
.help ul { margin: 0; padding-left: 1.2rem; }
.help li { margin-bottom: .45rem; font-size: .9rem; }

/* ============ Auth ============ */
.auth-page { background: radial-gradient(ellipse at top, color-mix(in srgb, var(--primary) 16%, var(--bg)), var(--bg) 60%); min-height: 100vh; }
.auth-page .container { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; }
.auth-page .alert { width: 100%; max-width: 420px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 2rem 1.8rem 1.4rem; box-shadow: 0 12px 40px rgba(20, 30, 60, .12); }
.auth-card.wide { max-width: 640px; }
.auth-card .alert { max-width: none; }
.auth-head { text-align: center; margin-bottom: 1.4rem; }
.auth-head img { margin-bottom: .5rem; }
.auth-head h1 { font-size: 1.35rem; }
.auth-head p { margin: 0; }
.checklist { list-style: none; padding: .8rem 1rem; margin: 0 0 1.2rem; background: var(--bg); border-radius: 8px; font-size: .86rem; columns: 2; }
.checklist .ok { color: var(--ok); } .checklist .bad { color: var(--bad); font-weight: 600; }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-cols, .detail-cols, .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .has-sidebar .main { margin-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .nav-open .sidebar { transform: none; }
  .nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(10, 15, 30, .45); z-index: 35; }
  .nav-toggle { display: grid; }
  .topbar { padding: 0 .8rem; gap: .5rem; }
  .today { display: none; }
}
@media (max-width: 680px) {
  body { font-size: 15px; }
  .container { padding: 1rem .9rem 3rem; }
  h1 { font-size: 1.3rem; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-head .actions .btn { flex: 1; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .segmented { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 0; }
  .dl dd { margin-bottom: .55rem; }
  .filters select, .filters .btn { flex: 1 1 45%; }
  .checklist { columns: 1; }
  .card { padding: 1rem; }
  .bars-chart { gap: .3rem; }
  /* Tabel menjadi kartu di layar kecil */
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); position: relative; }
  .table.responsive tbody tr:last-child { border-bottom: 0; }
  .table.responsive td { border: 0; padding: .12rem 0; min-width: 0 !important; }
  .table.responsive td[data-label]::before { content: attr(data-label); display: inline-block; width: 6.2rem; color: var(--muted); font-size: .76rem; font-family: var(--font); font-weight: 400; }
  .table.responsive td.grow::before, .table.responsive td.grow { display: block; }
  .table.responsive td.grow::before { display: none; }
  .table.responsive td.grow { padding: .2rem 0 .35rem; }
  .table.responsive td.row-actions { position: absolute; top: .5rem; right: .5rem; width: auto; padding: 0; }
  .table.responsive td.empty { padding: 2rem 0; }
  .table.responsive tr:hover td { background: none; }
}

/* ============ Print (lembar disposisi) ============ */
@media print {
  @page { size: A4; margin: 16mm; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .sidebar, .topbar, .backdrop, .no-print, .alert { display: none !important; }
  .has-sidebar .main { margin: 0; }
  .container { padding: 0; max-width: none; }
  .print-only { display: block; }
  .disposisi-sheet { color: #000; }
  .ds-head { text-align: center; border-bottom: 2px solid #000; padding-bottom: 6pt; margin-bottom: 10pt; }
  .ds-head strong { font-size: 13pt; text-transform: uppercase; }
  .ds-head h2 { margin: 4pt 0 0; font-size: 14pt; letter-spacing: .1em; }
  .ds-table { width: 100%; border-collapse: collapse; }
  .ds-table th, .ds-table td { border: 1px solid #000; padding: 6pt 8pt; vertical-align: top; text-align: left; }
  .ds-table th { width: 22%; background: #f0f0f0; font-weight: 600; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ds-tall { height: 60pt; }
  .ds-taller { height: 110pt; }
  .ds-box { margin-right: 14pt; white-space: nowrap; }
  .ds-sign { margin-top: 30pt; display: flex; flex-direction: column; align-items: flex-end; gap: 50pt; }
  .ds-line { width: 160pt; border-bottom: 1px solid #000; }
}

/* --- perbaikan lebar di layar kecil --- */
.dash-grid > *, .form-cols > *, .detail-cols > *, .stats > * { min-width: 0; }
@media (max-width: 680px) {
  .mini-list a { flex-wrap: wrap; gap: .3rem .6rem; }
  .ml-main { flex: 1 1 100%; }
  .ml-main strong, .ml-main small { white-space: normal; }
  .stat strong { font-size: 1.5rem; }
}
