/* ============ Server Kantor — tampilan ============ */
:root {
  --bg: #f4f6f8; --panel: #ffffff; --panel-2: #f8fafb; --ink: #0f1c1b; --muted: #5f6b6a; --faint: #8a9695;
  --line: #e3e8ea; --line-2: #eef1f2;
  --accent: #0f766e; --accent-hover: #0b5f58; --accent-ink: #ffffff; --accent-soft: #e4f3f1; --accent-soft-2: #f1f9f8;
  --in: #ffffff; --out: #dcf2ec; --chat-bg: #eef2f1;
  --danger: #c0362c; --danger-soft: #fdecea; --warn: #b4570a; --warn-soft: #fdf1e3; --ok: #127a4a; --ok-soft: #e5f5ec;
  --radius: 12px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.05); --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
  --nav-w: 244px; --tab-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1413; --panel: #141d1c; --panel-2: #18221f; --ink: #e8efee; --muted: #9aa8a6; --faint: #74827f;
    --line: #25312f; --line-2: #1d2826;
    --accent: #2bb3a3; --accent-hover: #3cc6b5; --accent-ink: #04201d; --accent-soft: #163632; --accent-soft-2: #132a27;
    --in: #1b2725; --out: #13403a; --chat-bg: #101918;
    --danger: #f2776d; --danger-soft: #3a1c1a; --warn: #f3b04f; --warn-soft: #36290f; --ok: #4fd08d; --ok-soft: #12321f;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1413; --panel: #141d1c; --panel-2: #18221f; --ink: #e8efee; --muted: #9aa8a6; --faint: #74827f;
  --line: #25312f; --line-2: #1d2826;
  --accent: #2bb3a3; --accent-hover: #3cc6b5; --accent-ink: #04201d; --accent-soft: #163632; --accent-soft-2: #132a27;
  --in: #1b2725; --out: #13403a; --chat-bg: #101918;
  --danger: #f2776d; --danger-soft: #3a1c1a; --warn: #f3b04f; --warn-soft: #36290f; --ok: #4fd08d; --ok-soft: #12321f;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 12px; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 24px; } h2 { font-size: 19px; } h3 { font-size: 16px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 28px; height: 28px; }

/* ---------- Tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn:focus-visible, a:focus-visible, .ci:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--line-2); color: var(--ink); }
.btn.sm { min-height: 34px; padding: 0 11px; font-size: 13px; }
.btn.icon { padding: 0; width: 40px; }
.btn.icon.sm { width: 34px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- Form ---------- */
input, select, textarea { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; min-height: 42px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 0; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); margin: 0; vertical-align: middle; }
input[type=file] { padding: 7px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
::placeholder { color: var(--faint); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.field { margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.grid2.grid-qr { grid-template-columns: 200px 1fr; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 38px; }

/* ---------- Label kecil & status ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 600; white-space: nowrap; line-height: 1.5; }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.gray { background: var(--line-2); color: var(--muted); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--faint); flex: none; }
.dot.connected { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.qr, .dot.connecting, .dot.reconnecting { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.logged_out { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.chips { display: flex; gap: 4px; background: var(--line-2); padding: 3px; border-radius: 10px; }
.chips button { flex: 1; border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.chips button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }

/* ---------- Kerangka ---------- */
.shell { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); height: 100vh; height: 100dvh; }
.nav { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 12px; gap: 2px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.logo .i { width: 21px; height: 21px; stroke-width: 2.2; }
.brand b { display: block; font-size: 16px; line-height: 1.2; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.nav-sec { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14.5px; text-decoration: none; }
.nav a:hover { background: var(--panel-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a .count { margin-left: auto; }
.me-card { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.me-card .who { min-width: 0; flex: 1; }
.me-card .who b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-card .who span { font-size: 12px; color: var(--muted); }
.main { overflow: auto; min-width: 0; min-height: 0; }
.page { padding: 28px 32px 40px; max-width: 1180px; }
.page-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .t { flex: 1; min-width: 220px; }
.page-head h1 { margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; max-width: 640px; }
.page-head .acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 200px; max-width: 380px; }
.toolbar select { width: auto; min-width: 150px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card > h3:first-child { margin-bottom: 4px; }
.card-desc { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; }
.section { margin-bottom: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { padding: 16px 18px; }
.stat .l { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat .v { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .s { font-size: 12.5px; color: var(--muted); }
.sec-title { font-size: 15px; font-weight: 700; margin: 6px 0 10px; }
.note { background: var(--accent-soft-2); border: 1px solid var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; color: var(--ink); margin-bottom: 16px; }
.note b { color: var(--accent); }

/* ---------- Tabel ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { font-size: 12.5px; color: var(--muted); font-weight: 700; background: var(--panel-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.acts { text-align: right; white-space: nowrap; }
td.acts .row { justify-content: flex-end; flex-wrap: nowrap; gap: 6px; }
tr.click { cursor: pointer; } tr.click:hover td { background: var(--accent-soft-2); }
.table-wrap, .card.table-wrap { overflow-x: auto; padding: 0; }
.table-wrap table { min-width: 100%; }
.cell-sub { font-size: 12.5px; color: var(--muted); }
td.empty-row { text-align: center; color: var(--muted); padding: 36px 16px; }

/* ---------- Keadaan kosong ---------- */
.empty { display: grid; place-items: center; align-content: center; height: 100%; color: var(--muted); text-align: center; padding: 28px 20px; gap: 8px; }
.empty .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 4px; }
.empty b { color: var(--ink); font-size: 16px; }
.empty p { margin: 0; max-width: 340px; font-size: 14px; }

/* ---------- Inbox ---------- */
.inbox { display: grid; grid-template-columns: 350px minmax(0, 1fr) 300px; height: 100%; }
.inbox:not(.has-chat) { grid-template-columns: 350px minmax(0, 1fr); }
.inbox:not(.has-chat) .side { display: none; }
.chatlist { border-right: 1px solid var(--line); display: flex; flex-direction: column; background: var(--panel); min-height: 0; min-width: 0; }
.chatlist .head { padding: 16px 14px 12px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.chatlist .head h1 { font-size: 20px; margin: 0; }
.chatlist .filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chatlist .filters select { min-width: 0; font-size: 13.5px; min-height: 38px; padding: 6px 10px; }
.chatlist .items { overflow-y: auto; flex: 1; }
.ci { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; position: relative; }
.ci:hover { background: var(--panel-2); }
.ci.active { background: var(--accent-soft); }
.ci.active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.ci .top { display: flex; gap: 6px; align-items: baseline; }
.ci .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci .time { margin-left: auto; font-size: 12px; color: var(--muted); flex: none; }
.ci.has-unread .time { color: var(--accent); font-weight: 700; }
.ci.has-unread .name { font-weight: 700; }
.ci .last { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci.has-unread .last { color: var(--ink); }
.ci .meta { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.ci .meta .badge { font-size: 11.5px; padding: 1px 8px; }
.unread { background: var(--accent); color: var(--accent-ink); border-radius: 99px; font-size: 12px; min-width: 21px; height: 21px; padding: 0 6px; font-weight: 700; flex: none; display: inline-grid; place-items: center; }
.list-hint { font-size: 12.5px; color: var(--muted); padding: 10px 14px; text-align: center; }

.conv { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); }
.conv-head { padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.head-name { min-width: 0; flex: 1; }
.head-name b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; }
.head-name .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-ctl { display: flex; gap: 8px; align-items: center; flex: none; }
.head-ctl select { width: 190px; min-height: 38px; font-size: 13.5px; }
.conv-bar { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 18px 7%; display: flex; flex-direction: column; gap: 4px; }
.msg { max-width: 68%; padding: 8px 11px 5px; border-radius: 12px; background: var(--in); box-shadow: var(--shadow); overflow-wrap: anywhere; align-self: flex-start; border-top-left-radius: 4px; }
.msg.me { background: var(--out); align-self: flex-end; border-top-left-radius: 12px; border-top-right-radius: 4px; }
.msg .body { white-space: pre-wrap; }
.msg .meta { font-size: 11.5px; color: var(--muted); text-align: right; margin-top: 2px; }
.msg img { max-width: 280px; max-height: 320px; border-radius: 8px; display: block; margin-bottom: 4px; }
.msg audio, .msg video { max-width: 280px; display: block; }
.msg .sender { font-size: 12.5px; font-weight: 700; color: var(--accent); }
.msg .file-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.msg .save-link { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; margin: 2px 0 4px; }
.day-sep { align-self: center; font-size: 12px; font-weight: 600; background: var(--panel); color: var(--muted); padding: 3px 12px; border-radius: 99px; margin: 10px 0; box-shadow: var(--shadow); }
.composer { background: var(--panel); border-top: 1px solid var(--line); padding: 10px 12px; display: flex; gap: 6px; align-items: flex-end; position: relative; }
.composer textarea { min-height: 42px; max-height: 160px; border-radius: 21px; padding: 9px 16px; }
.composer .send { border-radius: 50%; width: 42px; min-height: 42px; padding: 0; }
.composer-hint { font-size: 12px; color: var(--faint); padding: 0 16px 8px; background: var(--panel); }
.qr-pop { position: absolute; bottom: 100%; left: 12px; right: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); max-height: 240px; overflow-y: auto; }
.qr-pop div { padding: 10px 12px; cursor: pointer; } .qr-pop div:hover, .qr-pop div.sel { background: var(--accent-soft); }
.side { border-left: 1px solid var(--line); background: var(--panel); padding: 18px 16px; overflow-y: auto; }
.side-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.side-head h3 { margin: 0; flex: 1; }
.side .close-side { display: none; }
.inv-mini { display: flex; gap: 8px; align-items: center; font-size: 13.5px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }

/* ---------- Jendela (modal) ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(9,20,19,.5); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal { background: var(--panel); border-radius: 16px; width: min(780px, 100%); max-height: 92vh; overflow-y: auto; padding: 24px; position: relative; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal.narrow { width: min(460px, 100%); }
.modal > h2:first-of-type, .modal > .row:first-of-type { padding-right: 40px; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.modal .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.modal details.card { padding: 12px 16px; margin-bottom: 14px; box-shadow: none; background: var(--panel-2); }
.modal details summary { cursor: pointer; }
.items-table th, .items-table td { padding: 6px 6px; background: none; }
.items-table input { min-height: 38px; padding: 6px 9px; }
.totals .row { padding: 3px 0; }
.totals .grand { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.menu-list a { display: flex; align-items: center; gap: 14px; padding: 14px 6px; border-bottom: 1px solid var(--line-2); color: var(--ink); font-weight: 600; text-decoration: none; }
.menu-list a .i { color: var(--accent); }
.menu-list a span.sub { display: block; font-weight: 400; font-size: 13px; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 99; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
#toast div { background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; animation: pop .2s; }
#toast div.err { background: var(--danger); color: #fff; }

/* ---------- Login ---------- */
.login { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 20px; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent 70%), var(--bg); }
.login .card { width: min(400px, 100%); padding: 32px 28px; box-shadow: var(--shadow-lg); border: 0; }
.login .logo { width: 52px; height: 52px; border-radius: 14px; margin-bottom: 16px; }
.login .logo .i { width: 28px; height: 28px; }
.login h1 { margin-bottom: 4px; }
.login .foot { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 18px; }

.qrbox { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 10px; border: 1px solid var(--line); }
.steps { margin: 0 0 16px; padding-left: 20px; font-size: 14px; }
.steps li { margin-bottom: 4px; }
.bar { height: 10px; background: var(--accent); border-radius: 5px; min-width: 2px; }
.bar.out { background: var(--warn); }
.acc-card .acc-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.acc-card .acc-ico { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.acc-card .st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.acc-card .acc-meta { font-size: 13.5px; color: var(--muted); display: grid; gap: 3px; }
.acc-card .acc-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.qr-img { height: 110px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }

/* ---------- Bar navigasi HP ---------- */
.tabbar { display: none; }
.mobile-only { display: none !important; }
.info-btn { display: none !important; }

@media (max-width: 1100px) {
  .inbox { grid-template-columns: 320px minmax(0, 1fr); }
  .inbox .side { display: none; }
  .inbox.show-side .side { display: block; position: fixed; inset: 0 0 0 auto; width: min(380px, 100%); z-index: 40; box-shadow: var(--shadow-lg); }
  .side .close-side { display: inline-flex; }
  .info-btn { display: inline-flex !important; }
}

@media (max-width: 860px) {
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox.has-chat .chatlist { display: none; }
  .inbox:not(.has-chat) .conv { display: none; }
  .mobile-only { display: inline-flex !important; }
  .msgs { padding: 14px 12px; }
  .msg { max-width: 86%; }
  .msg img { max-width: 100%; }
  .head-ctl { display: none; }
  .conv-bar { display: flex; gap: 8px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
  .conv-bar select { flex: 1; min-height: 38px; font-size: 14px; }
  .conv-head { padding: 8px 10px; }
  .composer-hint { display: none; }
}

@media (max-width: 760px) {
  body { padding-top: env(safe-area-inset-top); }
  html, body { overscroll-behavior-y: none; }
  .shell { grid-template-columns: 1fr; height: calc(100dvh - env(safe-area-inset-top)); padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  .shell.chat-open { padding-bottom: 0; }
  .shell.chat-open .tabbar { display: none; }
  .nav { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--panel); border-top: 1px solid var(--line); height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; position: relative; }
  .tabbar a .i { width: 23px; height: 23px; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a .unread { position: absolute; top: 6px; left: calc(50% + 6px); font-size: 10.5px; min-width: 18px; height: 18px; }
  input, select, textarea { font-size: 16px; } /* cegah iOS auto-zoom */
  .page { padding: 18px 16px 28px; }
  .page-head { margin-bottom: 16px; gap: 12px; }
  .page-head h1 { font-size: 21px; }
  .page-head .acts { width: 100%; }
  .page-head .acts .btn { flex: 1; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .toolbar select { flex: 1; min-width: 0; }
  .grid2, .grid3, .grid2.grid-qr { grid-template-columns: 1fr; }
  .mobile-hide { display: none; }
  .rtable td.qr-text { display: block; padding-bottom: 4px; }
  .rtable td.qr-text::before { content: none; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .v { font-size: 19px; }
  .card { padding: 16px; }
  /* Tabel menjadi kartu */
  .rtable { min-width: 0 !important; }
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .rtable tbody tr:last-child { border-bottom: 0; }
  .rtable td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .rtable td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; flex: none; }
  .rtable td.lead { display: block; text-align: left; font-size: 15.5px; padding-bottom: 6px; }
  .rtable td.lead::before, .rtable td.acts::before, .rtable td.empty-row::before { content: none; }
  .rtable td.acts { justify-content: flex-start; padding-top: 10px; }
  .rtable td.acts .row { justify-content: flex-start; flex-wrap: wrap; }
  .rtable td.empty-row { display: block; text-align: center; }
  .modal-bg { place-items: end center; padding: 0; }
  .modal, .modal.narrow { width: 100%; max-height: 94dvh; border-radius: 18px 18px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); }
  .modal .actions .btn { flex: 1; }
  .items-table thead { display: none; }
  .items-table tr { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
  .items-table td { display: block; padding: 0; border: 0; }
  .items-table td:first-child { grid-column: 1 / -1; }
  .items-table td.num { grid-column: 1 / 3; text-align: left; font-weight: 600; color: var(--muted); font-size: 13.5px; }
  #toast { bottom: calc(var(--tab-h) + 14px + env(safe-area-inset-bottom)); }
}
