/* =====================================================================
   RSChat — sistem desain v2
   Teal klinis sebagai warna utama, indigo untuk modul komunikasi/pemasaran.
   Font IBM Plex Sans (lokal, OFL). Mendukung mode gelap & reduced motion.
   ===================================================================== */
@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f2f5f7; --panel: #ffffff; --panel-2: #f8fafb; --line: #e2e8ec; --line-2: #eef2f4;
  --ink: #0f2530; --ink-2: #566874; --ink-3: #8696a0;
  --primary: #0f766e; --primary-2: #0d9488; --primary-soft: #e3f4f1; --on-primary: #fff;
  --accent: #4f46e5; --accent-soft: #eceefe;
  --amber: #b45309; --amber-soft: #fef3c7; --rose: #be123c; --rose-soft: #ffe4e6; --sky: #0369a1; --sky-soft: #e0f2fe;
  --c1: #0d9488; --c2: #6366f1; --c3: #f59e0b; --c4: #f43f5e; --c5: #0ea5e9; --c6: #94a3b8;
  --rail: #0b2027; --rail-2: #12303a; --rail-ink: #b9cdd2; --rail-mute: #6f8a92;
  --shadow: 0 1px 2px rgba(15,37,48,.05), 0 6px 18px rgba(15,37,48,.05);
  --r-l: 14px; --r-m: 10px; --r-s: 7px;
  --wa-bg: #efe7dd; --wa-in: #ffffff; --wa-out: #d9fdd3; --wa-head: #075e54;
  --font: "Plex", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark;
    --bg: #0c171c; --panel: #13232a; --panel-2: #172a32; --line: #243a43; --line-2: #1b3038;
    --ink: #e3edf0; --ink-2: #9db0b8; --ink-3: #6f8790;
    --primary: #2dd4bf; --primary-2: #5eead4; --primary-soft: #133a37; --on-primary: #062723;
    --accent: #a5b4fc; --accent-soft: #23264a;
    --amber: #fbbf24; --amber-soft: #3a2d10; --rose: #fb7185; --rose-soft: #3d1a22; --sky: #7dd3fc; --sky-soft: #0f2d3d;
    --rail: #081418; --rail-2: #10252c; --shadow: 0 1px 2px rgba(0,0,0,.3);
    --wa-bg: #0b141a; --wa-in: #202c33; --wa-out: #005c4b; --wa-head: #1f2c34; }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: 24px; font-weight: 600; margin: 0; letter-spacing: -.015em; line-height: 1.25; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
small, .muted { color: var(--ink-2); }
.ic { flex: none; vertical-align: -3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- kerangka ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.rail { background: var(--rail); color: var(--rail-ink); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 18px; color: #fff; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(140deg, #14b8a6, #0f766e); display: grid; place-items: center; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.brand b { display: block; font-size: 15px; letter-spacing: .01em; }
.brand small { color: var(--rail-mute); font-size: 12px; }
.rail nav { flex: 1; }
.rail .group { font-size: 11.5px; color: var(--rail-mute); margin: 16px 10px 6px; }
.rail nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--rail-ink); text-decoration: none; margin-bottom: 1px; font-size: 13.5px; }
.rail nav a:hover { background: var(--rail-2); color: #fff; }
.rail nav a.active { background: var(--rail-2); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.rail nav a .ic { opacity: .85; }
.rail nav a .count { margin-left: auto; background: #e11d48; color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; font-weight: 600; }
.rail .me { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--rail-2); padding: 14px 8px 2px; margin-top: 12px; font-size: 13px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #1e4d57; color: #c7f0e8; display: grid; place-items: center; font-weight: 600; font-size: 12.5px; flex: none; }
.rail .me a { color: var(--rail-mute); } .rail .me a:hover { color: #fff; }
.rail .me small { color: var(--rail-mute); display: block; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .search { flex: 1; max-width: 460px; position: relative; }
.topbar .search .ic { position: absolute; left: 11px; top: 9px; color: var(--ink-3); }
.topbar .search input { padding-left: 34px; background: var(--panel); border-radius: 9px; }
.topbar .spacer { flex: 1; }
.health-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); text-decoration: none; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.health-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--c1); }
.health-dot.warn i { background: var(--c3); } .health-dot.fail i { background: var(--c4); }
.content { padding: 24px 28px 56px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); max-width: 76ch; }
.crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 4px; }

/* ---------- kartu ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 20px 0; }
.card-head h2 { margin: 0; }
.card-head + .card-body, .card-body { padding: 14px 20px 18px; }
.card.flush > .table-wrap { border-top: 1px solid var(--line-2); margin-top: 12px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.grid > .card { margin-bottom: 0; }
.stack > * + * { margin-top: 18px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 2px; position: relative; overflow: hidden; }
.kpi .top { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.chip { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.chip.indigo { background: var(--accent-soft); color: var(--accent); } .chip.amber { background: var(--amber-soft); color: var(--amber); }
.chip.rose { background: var(--rose-soft); color: var(--rose); } .chip.sky { background: var(--sky-soft); color: var(--sky); }
.kpi .v { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin-top: 6px; }
.kpi .t { font-size: 12px; color: var(--ink-3); }
.kpi .spark { position: absolute; right: 14px; top: 46px; width: 84px; height: 26px; }
.kpi .v { padding-right: 90px; }
.delta { font-size: 12px; font-weight: 500; }
.delta.up { color: var(--primary); } .delta.down { color: var(--rose); }

/* Jalur pasien */
.journey { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); margin-bottom: 18px; overflow: hidden; }
.journey .step { padding: 16px 18px 14px 24px; position: relative; border-right: 1px solid var(--line-2); }
.journey .step:first-child { padding-left: 18px; }
.journey .step:last-child { border-right: 0; }
.journey .step::after { content: ""; position: absolute; right: -8px; top: 50%; width: 14px; height: 14px; background: var(--panel); border-top: 1px solid var(--line-2); border-right: 1px solid var(--line-2); transform: translateY(-50%) rotate(45deg); z-index: 1; }
.journey .step:last-child::after { display: none; }
.journey .n { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.journey .k { font-weight: 500; }
.journey .bar { height: 5px; border-radius: 3px; background: var(--line-2); margin-top: 10px; }
.journey .bar i { display: block; height: 100%; border-radius: 3px; background: var(--c1); }
.journey .step.warn .n { color: var(--rose); } .journey .step.warn .bar i { background: var(--c4); }

/* tabel */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th { text-align: left; font-weight: 500; color: var(--ink-2); font-size: 12.5px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--panel-2); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 34px 20px; color: var(--ink-2); text-align: center; }
.empty .ic { display: block; margin: 0 auto 8px; color: var(--ink-3); }

/* pill status */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.pill.BOOKED, .pill.DIJADWALKAN, .pill.info { background: var(--sky-soft); color: var(--sky); }
.pill.CONFIRMED, .pill.ok, .pill.SENT, .pill.SELESAI, .pill.MENGIRIM { background: var(--primary-soft); color: var(--primary); }
.pill.CHECKED_IN, .pill.IN_SERVICE { background: var(--primary); color: var(--on-primary); }
.pill.COMPLETED { background: var(--line-2); color: var(--ink-2); }
.pill.CANCELLED, .pill.RESCHEDULED, .pill.DIBATALKAN { background: transparent; color: var(--ink-3); border: 1px dashed var(--line); }
.pill.NO_SHOW, .pill.FAILED, .pill.bad, .pill.fail { background: var(--rose-soft); color: var(--rose); }
.pill.warn, .pill.PENDING, .pill.MENUNGGU_PERSETUJUAN, .pill.DIJEDA { background: var(--amber-soft); color: var(--amber); }
.pill.DRAFT { background: var(--line-2); color: var(--ink-2); }
.pill.mkt { background: var(--accent-soft); color: var(--accent); }

/* form */
label { display: block; font-weight: 500; margin-bottom: 5px; font-size: 13px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=tel], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 11px; transition: border-color .12s, box-shadow .12s; }
select[multiple] { min-height: 108px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary-2); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 3px; accent-color: var(--primary); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { margin: 0; min-width: 150px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit; font-weight: 500; font-size: 13.5px; border-radius: var(--r-s); padding: 8px 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; line-height: 1.3; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); background: var(--panel-2); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn.accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { color: var(--rose); border-color: color-mix(in srgb, var(--rose) 35%, var(--line)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; }
.seg a { padding: 5px 12px; border-radius: 7px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 13px; }
.seg a.on { background: var(--primary-soft); color: var(--primary); }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--r-m); margin-bottom: 16px; border: 1px solid; background: var(--panel); }
.flash.success { border-color: color-mix(in srgb, var(--primary) 40%, transparent); background: var(--primary-soft); }
.flash.warning { border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: var(--amber-soft); }
.flash.error { border-color: color-mix(in srgb, var(--rose) 40%, transparent); background: var(--rose-soft); }
.callout { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 var(--r-s) var(--r-s) 0; font-size: 13px; margin-bottom: 14px; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { padding: 11px 0; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.list-plain li:last-child { border-bottom: 0; }
.meter { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; min-width: 80px; }
.meter i { display: block; height: 100%; background: var(--c1); border-radius: 3px; }
.meter.indigo i { background: var(--c2); }

/* grafik */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--font); }
.c1 { fill: var(--c1); background: var(--c1); stroke: var(--c1); } .c2 { fill: var(--c2); background: var(--c2); stroke: var(--c2); }
.c3 { fill: var(--c3); background: var(--c3); stroke: var(--c3); } .c4 { fill: var(--c4); background: var(--c4); stroke: var(--c4); }
.c5 { fill: var(--c5); background: var(--c5); stroke: var(--c5); } .c6 { fill: var(--c6); background: var(--c6); stroke: var(--c6); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 0; margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend.v { flex-direction: column; gap: 8px; margin: 0; }
.legend.v b { color: var(--ink); font-weight: 600; margin-left: 4px; }
.donut-wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; flex: none; }
.donut .track { fill: none; stroke: var(--line-2); stroke-width: 18; }
.donut .seg { fill: none; stroke-width: 18; }
.donut-c { font-size: 20px; font-weight: 600; fill: var(--ink); font-family: var(--font); }
.spark polyline { fill: none; stroke: var(--c1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: .8; }
.funnel { display: flex; flex-direction: column; gap: 10px; }
.f-row { display: grid; grid-template-columns: 170px 1fr 64px 56px; gap: 12px; align-items: center; font-size: 13px; }
.f-track { background: var(--line-2); border-radius: 6px; height: 26px; overflow: hidden; }
.f-bar { height: 100%; border-radius: 6px; }
.f-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.f-conv { color: var(--ink-3); font-size: 12px; }

/* login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side { background: radial-gradient(1200px 600px at -10% -20%, #134e4a 0%, transparent 60%), linear-gradient(160deg, #0b2027, #0f3a3f); color: #d8ecea; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { font-size: 30px; line-height: 1.2; color: #fff; font-weight: 600; letter-spacing: -.02em; max-width: 18ch; margin: 22px 0 12px; }
.auth-side p { color: #a9c6c4; max-width: 44ch; }
.auth-side .preview { margin-top: 26px; max-width: 360px; display: flex; flex-direction: column; gap: 8px; }
.auth-side .preview .b { background: #12343a; border-radius: 12px 12px 12px 3px; padding: 9px 12px; font-size: 13px; color: #e2f2f0; max-width: 85%; }
.auth-side .preview .b.me { align-self: flex-end; background: #0f766e; border-radius: 12px 12px 3px 12px; }
.auth-side .preview .opt { align-self: flex-start; display: flex; gap: 6px; flex-wrap: wrap; }
.auth-side .preview .opt span { border: 1px solid #2a5a5f; border-radius: 8px; padding: 4px 10px; font-size: 12.5px; color: #9fe3d6; }
.auth-form { display: grid; place-items: center; padding: 32px; background: var(--bg); }
.auth-form .card { width: min(400px, 100%); padding: 30px; }
.auth-form h1 { margin-bottom: 4px; }

/* chat inbox */
.chat { background: var(--panel-2); border-radius: var(--r-m); padding: 16px; height: 520px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line-2); }
.bubble { max-width: 78%; padding: 8px 11px 6px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.bubble.in { background: var(--panel); align-self: flex-start; border-top-left-radius: 3px; border: 1px solid var(--line-2); }
.bubble.out { background: var(--primary-soft); align-self: flex-end; border-top-right-radius: 3px; }
.bubble .meta { font-size: 11px; color: var(--ink-3); text-align: right; margin-top: 3px; }
.bubble .tpl { font-size: 11px; color: var(--accent); margin-bottom: 3px; font-weight: 500; }
.bubble.failed { outline: 1px dashed var(--rose); }
.composer { display: flex; gap: 8px; margin-top: 10px; }
.composer input { flex: 1; }
.inbox { display: grid; grid-template-columns: 320px 1fr; gap: 18px; }
.threads a { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
.threads a:hover { background: var(--panel-2); }
.threads a.active { background: var(--primary-soft); }
.threads .t-body { min-width: 0; flex: 1; }
.threads .t-body small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sla { font-size: 12px; font-weight: 600; }
.sla.late { color: var(--rose); }

/* simulator — bingkai ponsel ala WhatsApp */
.phone { width: 380px; max-width: 100%; border-radius: 34px; padding: 10px; background: #0f1a1f; box-shadow: 0 20px 50px rgba(11,32,39,.25), inset 0 0 0 2px #23343b; }
.phone-screen { border-radius: 26px; overflow: hidden; display: flex; flex-direction: column; height: 680px; background: var(--wa-bg); }
.wa-head { background: var(--wa-head); color: #fff; display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.wa-head .avatar { background: #25d366; color: #063; width: 36px; height: 36px; }
.wa-head b { display: block; font-size: 14.5px; } .wa-head small { color: #cfe9e3; font-size: 12px; }
.wa-body { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 6px;
  background-image: radial-gradient(color-mix(in srgb, var(--ink-3) 18%, transparent) 1px, transparent 1px); background-size: 18px 18px; }
.wa { max-width: 84%; padding: 6px 9px 4px; border-radius: 9px; font-size: 13.8px; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px .5px rgba(0,0,0,.13); color: var(--ink); }
.wa.in { background: var(--wa-in); align-self: flex-start; border-top-left-radius: 0; }
.wa.out { background: var(--wa-out); align-self: flex-end; border-top-right-radius: 0; }
.wa .meta { font-size: 10.5px; color: var(--ink-3); text-align: right; margin-top: 2px; }
.wa .tpl { font-size: 10.5px; color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.wa-btns { display: flex; flex-direction: column; gap: 4px; align-self: flex-start; width: 84%; margin-top: -2px; }
.wa-btns button { font: inherit; font-size: 13.5px; color: #0a84c2; background: var(--wa-in); border: 0; border-radius: 9px; padding: 8px; cursor: pointer; box-shadow: 0 1px .5px rgba(0,0,0,.13); }
.wa-btns button:hover { filter: brightness(.97); }
.wa-btns button small { display: block; color: var(--ink-3); font-size: 11.5px; }
.wa-list summary { list-style: none; cursor: pointer; font-size: 13.5px; color: #0a84c2; background: var(--wa-in); border-radius: 9px; padding: 8px; text-align: center; box-shadow: 0 1px .5px rgba(0,0,0,.13); }
.wa-list summary::-webkit-details-marker { display: none; }
.wa-list[open] summary { border-radius: 9px 9px 0 0; }
.wa-list .rows { background: var(--wa-in); border-radius: 0 0 9px 9px; display: flex; flex-direction: column; }
.wa-list .rows button { text-align: left; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line-2); color: var(--ink); }
.wa-foot { display: flex; gap: 8px; padding: 8px; background: color-mix(in srgb, var(--wa-bg) 70%, #000 0%); }
.wa-foot input { border-radius: 20px; border: 0; padding: 10px 14px; }
.wa-foot button { border-radius: 50%; width: 42px; height: 42px; padding: 0; background: #00a884; border-color: #00a884; color: #fff; }

/* check-in */
#reader { border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; background: var(--panel-2); min-height: 60px; }
.result-box { padding: 16px; border-radius: var(--r-m); border: 1px solid var(--line); margin-top: 14px; }
.result-box.ok { border-color: color-mix(in srgb, var(--primary) 40%, transparent); background: var(--primary-soft); }
.result-box.err { border-color: color-mix(in srgb, var(--rose) 40%, transparent); background: var(--rose-soft); }
.queue-no { font-size: 38px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; }

/* halaman QR pasien */
.qr-page { max-width: 380px; margin: 0 auto; padding: 28px 18px; text-align: center; }
.qr-card { background: var(--panel); border-radius: 20px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 26px 22px; }
.qr-page #qr { background: #fff; display: inline-block; padding: 14px; border-radius: 12px; border: 1px solid var(--line); }
.qr-page #qr svg { display: block; width: 230px; height: 230px; }
#totp-qr svg { width: 196px; height: 196px; background: #fff; padding: 8px; border-radius: 8px; }

/* kesehatan sistem */
.hc { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.hc:last-child { border-bottom: 0; }
.hc .dot { width: 10px; height: 10px; border-radius: 50%; margin-left: 4px; }
.hc .dot.ok { background: var(--c1); } .hc .dot.warn { background: var(--c3); } .hc .dot.fail { background: var(--c4); }
.hc small { display: block; }

code, .mono { font-family: Consolas, "Cascadia Mono", ui-monospace, monospace; font-size: 12.5px; }
.copy { display: flex; gap: 6px; } .copy input { font-family: Consolas, monospace; font-size: 12.5px; }
hr.sep { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }

@media (max-width: 1100px) { .g-2-1 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; }
  .rail nav { display: flex; flex-wrap: wrap; gap: 2px; } .rail .group, .rail .me { display: none; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .journey { grid-template-columns: 1fr 1fr; } .journey .step::after { display: none; }
  .inbox { grid-template-columns: 1fr; } .auth { grid-template-columns: 1fr; } .auth-side { display: none; }
  .f-row { grid-template-columns: 110px 1fr 48px; } .f-conv { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .rail, .topbar, .filters, .actions, .btn { display: none !important; } .shell { display: block; } .card { box-shadow: none; } }

/* alias kompatibilitas untuk halaman v1 */
.topline { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.topline .lead, p.lead { margin: 4px 0 0; color: var(--ink-2); max-width: 76ch; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > h2 { padding: 16px 20px 4px; margin: 0; }
.panel.flush > p.muted { padding: 0 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid > .panel { margin-bottom: 0; }
.scanner { max-width: 460px; }
