/* =====================================================================
   Sistem Antrian Apotek — gaya farmasi hijau/teal, bersih & terang
   ===================================================================== */

:root {
    --accent: #0d9488;
    --accent-2: #10b981;
    --accent-dark: #0f766e;
    --accent-soft: #e6f7f4;
    --ink: #0f2e2a;
    --ink-2: #1d4740;
    --muted: #5f7c78;
    --line: #d5e8e4;
    --bg: #f1fbf8;
    --card: rgba(255, 255, 255, .82);
    --card-line: rgba(255, 255, 255, .9);
    --shadow: 0 18px 40px -22px rgba(13, 90, 80, .38), 0 4px 14px -8px rgba(13, 90, 80, .18);
    --radius: 16px;
    --radius-sm: 11px;
    --danger: #dc2626;
    --warn: #b45309;
}

* { box-sizing: border-box; }

/* Elemen dengan atribut hidden HARUS benar-benar tersembunyi. Tanpa aturan ini, kelas seperti
   `.tip-senyap { display: flex }` mengalahkan gaya bawaan [hidden] sehingga elemen yang
   seharusnya tersembunyi tetap tampil (bug nyata: tip cetak senyap & pop-up halaman lacak). */
[hidden] { display: none !important; }

/* Hanya untuk pembaca layar: teks tidak terlihat, tetap ada di struktur halaman. */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

html, body { margin: 0; padding: 0; }

body {
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 620px at 8% -6%, rgba(16, 185, 129, .20), transparent 62%),
        radial-gradient(760px 560px at 102% 2%, rgba(13, 148, 136, .18), transparent 60%),
        radial-gradient(820px 620px at 52% 108%, rgba(45, 212, 191, .16), transparent 62%);
    background-attachment: fixed;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; line-height: 1.22; }
h1 { font-size: 1.6rem; letter-spacing: -.02em; }
h2 { font-size: 1.06rem; letter-spacing: -.01em; }
h3 { font-size: .98rem; }
p { margin: 0; }

svg { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }

.muted, .hint { color: var(--muted); font-size: .82rem; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .84rem; word-break: break-all; }
.warn-text { color: var(--warn); font-weight: 600; display: block; margin-top: 4px; }

/* ---------------- Kerangka halaman petugas ---------------- */

.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px clamp(16px, 3vw, 34px);
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(18px) saturate(170%);
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    border-bottom: 1px solid var(--card-line);
    position: sticky;
    top: 0;
    z-index: 40;
    flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark {
    display: grid; place-items: center;
    width: 42px; height: 42px; border-radius: 13px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    color: #fff; font-size: 1.3rem;
    box-shadow: 0 10px 22px -12px rgba(13, 148, 136, .8);
}
/* Logo pada header aplikasi (semua menu). Dibuat tidak melebihi tinggi topbar
   supaya baris menu tidak berubah tinggi saat logo dipasang. */
.brand-logo { max-height: 42px; max-width: 170px; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 1.02rem; letter-spacing: -.01em; }
.brand-sub { font-size: .74rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.nav-link {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 13px; border-radius: 999px;
    color: var(--ink-2); font-size: .88rem; font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}
.nav-link:hover { background: rgba(13, 148, 136, .1); text-decoration: none; }
.nav-link.is-active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 10px 20px -14px rgba(13, 148, 136, .9); }
.nav-link.is-locked { color: #9db3b0; cursor: not-allowed; }
.nav-link svg { font-size: 1.05rem; }
.nav-display { border-color: rgba(13, 148, 136, .35); color: var(--accent-dark); }
.nav-user {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 14px; border-radius: 999px;
    background: rgba(13, 148, 136, .1); color: var(--accent-dark);
    font-size: .84rem; font-weight: 700;
}
.nav-user em { display: block; font-style: normal; font-size: .7rem; color: var(--muted); font-weight: 600; }
.nav-logout { color: var(--danger); }
.nav-toggle { display: none; }

.wrap { padding: clamp(20px, 2.4vw, 34px) clamp(16px, 3vw, 34px) 48px; max-width: 1500px; margin: 0 auto; }
.footer-app {
    display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 18px clamp(16px, 3vw, 34px) 34px;
    color: var(--muted); font-size: .8rem;
    max-width: 1500px; margin: 0 auto; width: 100%;
}

/* ---------------- Kartu & tata letak ---------------- */

.card {
    background: var(--card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--card-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(18px, 2vw, 24px);
    display: flex; flex-direction: column; gap: 18px;
}
.card-danger { border-color: rgba(220, 38, 38, .28); }

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.card-head h2 { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); }
.card-head h2 svg { color: var(--accent); font-size: 1.15rem; }
.card-hint { font-size: .78rem; color: var(--muted); }
.card-note { font-size: .84rem; color: var(--muted); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; }
.card-note-wide { margin-top: 22px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 22px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { display: inline-flex; align-items: center; gap: 11px; }
.page-head h1 svg { color: var(--accent); }
.page-head p { color: var(--muted); font-size: .9rem; max-width: 78ch; margin-top: 8px; }
.page-head-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.grid-ambil { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.grid-panggil { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 22px; align-items: start; }
.col-stack { display: flex; flex-direction: column; gap: 22px; }

@media (max-width: 1080px) {
    .grid-2, .grid-ambil, .grid-panggil { grid-template-columns: minmax(0, 1fr); }
}

/* ---------------- Tombol ---------------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px 18px; border-radius: 12px;
    font: inherit; font-weight: 700; font-size: .9rem;
    border: 1px solid transparent; cursor: pointer;
    transition: transform .12s ease, box-shadow .18s ease, background .18s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 14px 26px -16px rgba(13, 148, 136, .95); }
.btn-accent { background: linear-gradient(135deg, #0f766e, #059669); color: #fff; box-shadow: 0 14px 26px -16px rgba(6, 95, 70, .9); }
.btn-ghost { background: rgba(255, 255, 255, .8); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.btn-danger:hover { background: #fecaca; }
.btn-mini { padding: 7px 12px; font-size: .8rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-call {
    background: #e8eeed; color: #8aa5a1; border-color: #d9e5e3; width: 100%;
    font-size: 1rem; padding: 14px 18px;
}
.btn-call:not(:disabled) {
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
    border-color: transparent; box-shadow: 0 16px 30px -18px rgba(13, 148, 136, 1);
    animation: denyut 2.6s ease-in-out infinite;
}
.btn-call:disabled { cursor: not-allowed; }
@keyframes denyut {
    0%, 100% { box-shadow: 0 16px 30px -18px rgba(13, 148, 136, 1); }
    50% { box-shadow: 0 18px 40px -14px rgba(16, 185, 129, .95); }
}
.inline-form { display: inline; }
.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* ---------------- Formulir ---------------- */

.form-grid { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.field > span { color: var(--ink-2); }
.field em { color: var(--muted); font-style: normal; font-weight: 500; }
.field input[type="text"], .field input[type="password"], .field input[type="number"],
.field input[type="date"], .field input[type="month"], .field input[type="search"],
.field input[type="file"], .field select, .field textarea, .input-search, .input-inline {
    font: inherit; font-weight: 500; color: var(--ink);
    padding: 11px 13px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: #fff;
    width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus, .input-search:focus, .input-inline:focus {
    outline: 2px solid rgba(13, 148, 136, .35); outline-offset: 1px; border-color: var(--accent);
}
.field textarea { resize: vertical; }
.field input[type="color"] { width: 70px; height: 42px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.field-row-3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.field-btn { justify-content: flex-end; }
.input-inline { padding: 8px 10px; font-size: .86rem; }
.input-num { max-width: 92px; }
.input-search { max-width: 260px; }
.check { display: flex; align-items: center; gap: 9px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.check-tight { font-size: .8rem; font-weight: 600; }
.radio-row { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-pill { display: inline-flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .87rem; font-weight: 700; cursor: pointer; }
.radio-pill input { accent-color: var(--accent); }
.radio-pill:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

/* ---------------- Pil, tag, status ---------------- */

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .85); border: 1px solid var(--line); font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.pill-teal { background: var(--accent-soft); border-color: rgba(13, 148, 136, .28); color: var(--accent-dark); }
.tag { display: inline-block; padding: 3px 9px; border-radius: 999px; background: #eef2f2; color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.tag-teal { background: var(--accent-soft); color: var(--accent-dark); }
.tag-ready { background: #dcfce7; color: #15803d; }

.kode-chip { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 9px; border-radius: 10px; background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; }
.kode-chip-lg { min-width: 46px; height: 46px; font-size: 1.3rem; border-radius: 13px; }

.status-pill { display: inline-block; padding: 5px 11px; border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .02em; }
.status-resep-masuk { background: #e0f2fe; color: #075985; }
.status-disiapkan { background: #fef3c7; color: #92400e; }
.status-siap { background: #d1fae5; color: #065f46; }
.status-diterima { background: #e5e7eb; color: #374151; }

.flash { border-radius: var(--radius-sm); padding: 13px 16px; font-size: .88rem; font-weight: 600; margin-bottom: 20px; }
.flash-ok { background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; }
.flash-err { background: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }
.flash-warn { background: #fef3c7; color: #78350f; border: 1px solid #fde68a; }
.flash-warn ul { margin: 8px 0 0; padding-left: 20px; }
.empty { color: var(--muted); font-size: .87rem; padding: 12px 2px; }

/* ---------------- Tabel ---------------- */

.table-scroll { overflow-x: auto; border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: .87rem; background: rgba(255, 255, 255, .6); }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { background: var(--accent-soft); color: var(--accent-dark); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table tbody tr:hover { background: rgba(230, 247, 244, .6); }
.table .num { text-align: right; white-space: nowrap; }
.table-tall { max-height: 620px; overflow-y: auto; }
.aksi { white-space: nowrap; }

/* ---------------- Dashboard ---------------- */

.hero {
    display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(240px, 1fr); gap: 22px;
    background: var(--card); border: 1px solid var(--card-line); border-radius: 20px;
    box-shadow: var(--shadow); padding: clamp(20px, 2.4vw, 30px); margin-bottom: 24px;
    backdrop-filter: blur(20px) saturate(180%);
}
.hero-main { display: flex; flex-direction: column; gap: 12px; }
.hero-main h1 { font-size: clamp(1.4rem, 2vw, 1.85rem); }
.hero-main p { color: var(--muted); font-size: .9rem; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.hero-side { display: grid; }
.call-now {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    background: linear-gradient(140deg, #0f766e, #10b981); color: #fff;
    border-radius: 18px; padding: 22px; text-align: center;
    box-shadow: 0 22px 40px -26px rgba(6, 95, 70, .95);
}
.call-now-big { padding: 26px 22px; }
.call-label { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.call-number { font-size: clamp(2.1rem, 4.4vw, 3.1rem); font-weight: 900; letter-spacing: .02em; line-height: 1; }
.call-number.is-empty { opacity: .5; }
.call-meta { font-size: .8rem; opacity: .92; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card {
    background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px;
    backdrop-filter: blur(18px) saturate(180%);
}
.stat-card-siap { border-color: rgba(16, 185, 129, .4); }
.stat-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.stat-value { font-size: clamp(1.5rem, 2.6vw, 2.05rem); font-weight: 900; color: var(--accent-dark); letter-spacing: -.02em; }
.stat-sub { font-size: .76rem; color: var(--muted); }

.list-antre { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.antre-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .78); border: 1px solid var(--line); }
.antre-kode { font-weight: 800; letter-spacing: .02em; }
.antre-waktu { font-size: .82rem; font-weight: 700; color: var(--accent-dark); font-variant-numeric: tabular-nums; }

.quick-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; margin-top: 26px; }
.quick-card {
    display: flex; flex-direction: column; gap: 8px; padding: 20px;
    background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius);
    box-shadow: var(--shadow); color: inherit; text-decoration: none;
    backdrop-filter: blur(18px) saturate(180%);
    transition: transform .16s ease, box-shadow .2s ease;
}
.quick-card:hover { transform: translateY(-3px); text-decoration: none; box-shadow: 0 26px 48px -26px rgba(13, 90, 80, .5); }
.quick-card strong { font-size: .98rem; }
.quick-card > span:last-child { color: var(--muted); font-size: .82rem; }
.quick-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent-dark); font-size: 1.35rem; }
.quick-card.is-locked { opacity: .6; }

/* ---------------- Ambil antrian ---------------- */

.kode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.kode-btn {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 20px 16px; border-radius: 16px; cursor: pointer;
    background: #fff; border: 1px solid var(--line);
    font: inherit; color: var(--ink);
    transition: transform .14s ease, box-shadow .2s ease, border-color .2s ease;
}
.kode-btn:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 20px 34px -22px rgba(13, 148, 136, .85); }
.kode-btn.is-pressed { transform: scale(.97); border-color: var(--accent); }
.kode-btn.is-off { opacity: .5; cursor: not-allowed; }
.kode-btn-huruf {
    display: grid; place-items: center; width: 62px; height: 62px; border-radius: 18px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff;
    font-size: 2rem; font-weight: 900;
}
.kode-btn-nama { font-size: .85rem; font-weight: 700; color: var(--ink-2); text-align: center; }
.kode-btn-next { font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.kode-btn-next strong { font-size: 1.05rem; color: var(--accent-dark); letter-spacing: .04em; }
.kode-btn-mode { font-style: normal; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; }
.kode-btn-info { font-size: .74rem; color: var(--muted); }

/* Kotak pencarian pasien SIMRS di halaman Ambil Antrian */
.simrs-box {
    display: flex; flex-direction: column; gap: 14px;
    background: var(--accent-soft); border: 1px solid rgba(13, 148, 136, .28);
    border-radius: var(--radius-sm); padding: 16px;
}
.simrs-baris { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.simrs-rm { flex: 1; min-width: 180px; }
.simrs-cari { justify-content: flex-end; }
.simrs-status { display: flex; align-items: flex-start; gap: 9px; font-size: .82rem; color: var(--ink-2); }
.simrs-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; background: #9ca3af; }
.simrs-dot.is-ok { background: var(--accent-2); box-shadow: 0 0 0 4px rgba(16, 185, 129, .18); }
.simrs-dot.is-proses { background: #f59e0b; animation: denyutTitik 1.2s ease-in-out infinite; }
.simrs-dot.is-err { background: var(--danger); }
@keyframes denyutTitik { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.simrs-hasil {
    display: flex; flex-direction: column; gap: 2px;
    background: #fff; border-radius: var(--radius-sm); padding: 12px 14px;
    border-left: 4px solid var(--accent);
}
.simrs-hasil strong { font-size: 1.05rem; color: var(--ink); }
.simrs-hasil span { font-size: .82rem; color: var(--muted); }
.simrs-hasil-kecil { font-size: .76rem !important; }
.simrs-hasil-ok { border-left-color: var(--accent-2); }
.simrs-hasil-err { border-left-color: var(--danger); }
.tiket-pasien { font-size: .78rem; font-weight: 700; color: var(--accent-dark); }
.antre-pasien { font-size: .8rem; color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-pasien { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: var(--ink-2); }
.track-pasien b { font-weight: 700; }
.track-pasien em { font-style: normal; font-size: .78rem; color: var(--muted); }
.nama-pasien { font-weight: 700; }

/* Daftar tiket terakhir: digulir MANUAL (bukan otomatis) bila lebih dari ±8 baris,
   supaya panel tidak memanjang mengikuti jumlah tiket. */
.list-tiket { display: flex; flex-direction: column; gap: 10px; max-height: 34rem; overflow-y: auto; padding-right: 4px; }
.list-tiket::-webkit-scrollbar { width: 8px; }
.list-tiket::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.list-tiket::-webkit-scrollbar-track { background: transparent; }
.tiket-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(255, 255, 255, .8); }
.tiket-nomor { font-weight: 900; font-size: 1.02rem; }
.tiket-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tiket-jam { font-size: .78rem; color: var(--muted); }
.alur-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; font-size: .87rem; color: var(--ink-2); }
.alur-list li { display: flex; gap: 11px; align-items: flex-start; }
.dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex: none; }
.dot-1 { background: #38bdf8; } .dot-2 { background: #f59e0b; } .dot-3 { background: #10b981; } .dot-4 { background: #6b7280; }

/* ---------------- Panggil antrian ---------------- */

.panggil-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.panggil-card {
    display: flex; flex-direction: column; gap: 12px;
    padding: 18px; border-radius: 16px;
    background: rgba(255, 255, 255, .88); border: 1px solid var(--line);
}
.panggil-card.is-ready { border-color: rgba(16, 185, 129, .55); box-shadow: 0 18px 32px -24px rgba(16, 185, 129, .95); }
.panggil-card.is-off { opacity: .55; }
.panggil-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.panggil-huruf {
    display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; font-size: 1.6rem; font-weight: 900;
}
.panggil-nama { font-weight: 700; font-size: .88rem; color: var(--ink-2); }
.badge-siap {
    display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px;
    border-radius: 999px; background: #d1fae5; color: #065f46; font-weight: 900; font-size: .95rem;
}
.badge-siap.is-zero { background: #eef2f2; color: #98a8a6; }
.panggil-info { font-size: .82rem; color: var(--muted); }
.panggil-next.is-ready { color: var(--accent-dark); }
.panggil-queue { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.queue-label { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.btn-queue { background: var(--accent-soft); color: var(--accent-dark); border-color: rgba(13, 148, 136, .25); }
.btn-queue em { font-style: normal; font-variant-numeric: tabular-nums; opacity: .75; }
.panggil-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 11px; }
.panggil-stat { font-size: .76rem; color: var(--muted); }

.voice-state { display: flex; align-items: center; gap: 9px; font-size: .8rem; color: var(--muted); }
.voice-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 0 4px rgba(16, 185, 129, .18); }

.list-log { display: flex; flex-direction: column; gap: 9px; max-height: 320px; overflow-y: auto; }
.log-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 13px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .8); border: 1px solid var(--line); font-size: .82rem; }
.log-nomor { font-weight: 800; }
.log-info { color: var(--muted); }

/* ---------------- Tracking ---------------- */

.track-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 20px; align-items: start; }
.track-col { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-height: 220px; }
.track-col-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.track-col-note { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.badge-count { display: grid; place-items: center; min-width: 32px; height: 32px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 900; }
.track-list { display: flex; flex-direction: column; gap: 12px; max-height: 620px; overflow-y: auto; }
.track-card { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); }
.track-card.is-selesai { background: rgba(248, 250, 250, .9); }
.track-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.track-nomor { font-weight: 900; font-size: 1.12rem; letter-spacing: .03em; display: inline-flex; align-items: center; gap: 6px; }
.tick { color: var(--accent-2); font-style: normal; }
.track-badge { font-size: .72rem; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.track-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); }
.track-meta b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.track-tunggu { color: var(--accent-dark) !important; }
.track-keterangan { font-size: .8rem; color: var(--ink-2); background: #f6fafa; border-radius: 9px; padding: 7px 10px; }
.track-steps { display: flex; gap: 6px; }
.step { flex: 1; height: 6px; border-radius: 999px; background: #e6efee; }
.step-done { background: var(--accent-2); }
.step-now { background: var(--accent); box-shadow: 0 0 0 3px rgba(13, 148, 136, .18); }
.track-kaki { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.track-siap { font-size: .76rem; color: var(--muted); }
.track-aksi { display: flex; gap: 8px; align-items: center; }

/* ---------------- Toast ---------------- */

.toast-wrap { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 90; max-width: min(420px, 88vw); }
.toast { padding: 13px 17px; border-radius: 13px; font-size: .87rem; font-weight: 700; box-shadow: 0 20px 36px -22px rgba(15, 46, 42, .7); transition: opacity .5s ease, transform .5s ease; }
.toast-ok { background: #065f46; color: #ecfdf5; }
.toast-err { background: #991b1b; color: #fef2f2; }
.toast.is-hilang { opacity: 0; transform: translateY(10px); }

/* ---------------- Login ---------------- */

.auth-body { display: grid; place-items: center; padding: 30px 18px; }
/* Kartu login tunggal, terpusat di tengah layar (panel "alur layanan" sudah dihapus). */
.auth-shell { display: flex; justify-content: center; align-items: center; width: 100%; max-width: 430px; }
.auth-card {
    background: var(--card); border: 1px solid var(--card-line); border-radius: 22px;
    box-shadow: var(--shadow); padding: clamp(24px, 3vw, 34px); backdrop-filter: blur(20px) saturate(180%);
}
.auth-card { display: flex; flex-direction: column; gap: 20px; }
.auth-brand { display: flex; flex-direction: column; gap: 8px; text-align: center; align-items: center; }
.auth-brand h1 { font-size: 1.3rem; }
.auth-brand p { color: var(--muted); font-size: .84rem; }
.auth-mark { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; font-size: 1.7rem; }
.auth-logo { max-height: 64px; max-width: 190px; object-fit: contain; }
.auth-note { font-size: .8rem; color: var(--muted); text-align: center; }
.auth-card { width: 100%; }

/* ---------------- Pengaturan: tab ---------------- */

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px; border-radius: 999px;
    background: rgba(255, 255, 255, .8); border: 1px solid var(--line);
    font-size: .85rem; font-weight: 700; color: var(--ink-2);
}
.tab:hover { text-decoration: none; border-color: var(--accent); }
.tab.is-active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; }
.tab-panel { display: none; flex-direction: column; gap: 22px; }
.tab-panel.is-active { display: flex; }

.logo-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 20px; align-items: start; }
.logo-preview { display: grid; place-items: center; height: 150px; border-radius: var(--radius-sm); background: #fff; border: 1px dashed var(--line); padding: 12px; }
.logo-preview img { max-width: 100%; max-height: 124px; object-fit: contain; }
.logo-placeholder { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.logo-placeholder svg { font-size: 1.8rem; color: #b6cbc8; }
.logo-placeholder em { font-style: normal; font-size: .76rem; }
.logo-control { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
@media (max-width: 700px) { .logo-row { grid-template-columns: minmax(0, 1fr); } }

.kode-editor { display: flex; flex-direction: column; gap: 10px; }
.kode-editor-head { display: grid; grid-template-columns: 60px minmax(0, 1.2fr) 100px minmax(180px, 1.2fr) 120px 100px 150px; gap: 12px; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 0 4px; }
.kode-row { display: grid; grid-template-columns: 60px minmax(0, 1.2fr) 100px minmax(180px, 1.2fr) 120px 100px 150px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .82); border: 1px solid var(--line); }
.kode-row-stat { font-size: .8rem; color: var(--muted); }
/* Baris aksi pada tabel akun: tombol teks + tombol ikon gear untuk membuka panel ubah. */
.aksi-baris { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.btn-gear { padding: 7px 10px; }
.btn-gear svg { width: 1.05em; height: 1.05em; }
.btn-gear.is-aktif { background: var(--accent); color: #fff; border-color: transparent; }
.btn-tutup-panel { margin-left: auto; }

.kode-kolom { display: flex; align-items: center; gap: 8px; }
.kode-warna { width: 34px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.kode-row-aksi { display: flex; gap: 8px; }
@media (max-width: 1020px) {
    .kode-editor-head { display: none; }
    .kode-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.cek-alamat summary { cursor: pointer; font-weight: 700; font-size: .86rem; color: var(--accent-dark); padding: 6px 0; }
.cek-alamat .db-grid { margin: 12px 0; }

.db-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.db-item { display: flex; flex-direction: column; gap: 5px; padding: 13px 15px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .82); border: 1px solid var(--line); }
.db-item span { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.db-item strong { font-size: .9rem; }

/* =====================================================================
   HALAMAN CETAK TIKET
   ===================================================================== */

.print-body { background: #eef5f4; padding: 22px 0 40px; }
.print-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; max-width: 820px; margin: 0 auto 18px; padding: 14px 18px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.print-toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rangkap-info { display: flex; flex-direction: column; gap: 4px; max-width: 820px; margin: 0 auto 14px; padding: 12px 16px;
    background: var(--accent-soft); border: 1px solid rgba(13, 148, 136, .3); border-radius: var(--radius-sm); font-size: .84rem; color: var(--ink-2); }
.rangkap-info strong { color: var(--accent-dark); }
.rangkap-status { font-weight: 700; }
.tiket-paper { background: #fff; margin: 0 auto; box-shadow: 0 20px 40px -26px rgba(15, 46, 42, .5); }
.print-thermal .tiket-paper { width: 76mm; padding: 3mm 3mm; }
.print-a4 .tiket-paper { width: 190mm; padding: 12mm; }

/* ---- Isi tiket: dibuat RAPAT agar hasil cetak tidak panjang ----
   Hanya NOMOR TIKET yang tetap besar; semua tulisan lain dikecilkan. */
.tiket-head { text-align: center; display: flex; flex-direction: column; gap: 1px; align-items: center; }
.tiket-logo { max-height: 42px; max-width: 120px; object-fit: contain; margin-bottom: 2px; }
.tiket-rs { font-weight: 900; font-size: .92rem; letter-spacing: .01em; line-height: 1.2; }
.tiket-alamat { font-size: .62rem; color: var(--muted); line-height: 1.25; }
.tiket-judul { margin-top: 3px; font-size: .64rem; font-weight: 800; letter-spacing: .1em; color: var(--accent-dark); line-height: 1.25; }
.tiket-sep { border-top: 1px dashed #b9cbc8; margin: 6px 0; }

.tiket-nomor-besar { display: flex; align-items: baseline; justify-content: center; gap: 5px; padding: 2px 0; }
.tiket-prefix { font-size: 3rem; font-weight: 900; color: var(--accent); line-height: .95; }
.tiket-angka { font-size: 3rem; font-weight: 900; letter-spacing: .05em; line-height: .95; }
.print-a4 .tiket-prefix, .print-a4 .tiket-angka { font-size: 4.4rem; }
.tiket-layanan { text-align: center; font-size: .72rem; font-weight: 700; color: var(--ink-2); line-height: 1.25; }

.tiket-tabel { width: 100%; border-collapse: collapse; font-size: .68rem; }
.tiket-tabel td { padding: 1.5px 0; vertical-align: top; line-height: 1.28; }
.tiket-tabel td:first-child { color: var(--muted); width: 40%; }
.tiket-tabel td:last-child { font-weight: 700; text-align: right; }

.tiket-qr { display: flex; gap: 9px; align-items: center; }
.tiket-qr-gambar { flex: none; background: #fff; }
.tiket-qr-gambar svg { width: 100%; height: 100%; display: block; }
.tiket-qr-teks { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tiket-qr-teks strong { font-size: .68rem; line-height: 1.25; }
.tiket-qr-teks span { font-size: .6rem; color: var(--muted); line-height: 1.3; }
.tiket-qr-kode { font-style: normal; font-size: .62rem; font-weight: 800; letter-spacing: .06em; color: var(--accent-dark); }
.print-a4 .tiket-qr { gap: 16px; }
.print-a4 .tiket-qr-teks strong { font-size: .85rem; }
.print-a4 .tiket-qr-teks span { font-size: .74rem; }

/* ---- Saklar cetak 2 rangkap di halaman Ambil Antrian ---- */
.saklar-form { display: inline; }
.saklar {
    display: inline-flex; align-items: center; gap: 10px;
    background: rgba(255, 255, 255, .9); border: 1px solid var(--line); border-radius: 999px;
    padding: 7px 14px 7px 8px; cursor: pointer; font: inherit;
    transition: border-color .18s ease, background .18s ease;
}
.saklar:hover { border-color: var(--accent); }
.saklar-rel {
    position: relative; width: 44px; height: 24px; border-radius: 999px; flex: none;
    background: #d6e3e1; transition: background .2s ease;
}
.saklar-knob {
    position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 2px 6px -2px rgba(15, 46, 42, .6);
    transition: transform .2s ease;
}
.saklar.is-on { background: var(--accent-soft); border-color: var(--accent); }
.saklar.is-on .saklar-rel { background: var(--accent); }
.saklar.is-on .saklar-knob { transform: translateX(20px); }
.saklar-teks { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.saklar-teks { font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.saklar-teks em { font-style: normal; font-size: .7rem; color: var(--muted); }
.saklar.is-on .saklar-teks em { color: var(--accent-dark); }

/* ---- Rangkap 2: potongan ±30 mm sebagai penanda resep ---- */
.tiket-potongan {
    width: 76mm; height: 30mm;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2mm;
    text-align: center; overflow: hidden;
}
.print-a4 .tiket-potongan { width: 120mm; }
.potongan-kode { font-size: 22mm; font-weight: 900; line-height: 1; letter-spacing: .04em; color: #000; }
.potongan-catatan { font-size: .8rem; color: var(--ink-2); max-width: 100%; word-break: break-word; }
/* Saat dikirim ke printer, hanya SATU rangkap yang tampil (satu lembar per cetakan). */
body.mode-cetak-1 #cetak-2 { display: none; }
body.mode-cetak-2 #cetak-1 { display: none; }
@media print {
    /* Setiap kali mencetak hanya SATU rangkap yang tampil → satu lembar per cetakan
       (dua kali cetak = dua lembar terpisah, dipotong printer di antaranya). */
    body.mode-cetak-1 #cetak-2 { display: none !important; }
    body.mode-cetak-2 #cetak-1 { display: none !important; }
}

.tiket-pesan-qr { font-size: .66rem; color: var(--warn); background: #fef3c7; border-radius: 8px; padding: 6px 8px; line-height: 1.35; }
.tiket-baris-kosong { height: 8px; }

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .print-body { padding: 0; }
    .tiket-paper { box-shadow: none; width: auto; margin: 0; }
    .print-thermal .tiket-paper { width: auto; padding: 0 2mm; }
    .print-a4 .tiket-paper { padding: 0; }
}

/* =====================================================================
   LAYAR DISPLAY (TV)

   Seluruh tampilan digambar pada kanvas tetap 1920x1080 lalu DIPERKECIL/
   DIPERBESAR dengan transform: scale() agar pas di layar apa pun (HD, 4K,
   ultra-wide, 4:3, jendela kecil). Cara ini menjamin tidak ada bagian yang
   terpotong — dulu ukuran memakai satuan vh/vw sehingga pada beberapa layar
   baris terakhir keluar dari layar.
   ===================================================================== */

.display-body {
    background-color: #eefaf7;
    background-image:
        radial-gradient(1100px 700px at 6% -10%, rgba(16, 185, 129, .26), transparent 60%),
        radial-gradient(1000px 720px at 104% 0%, rgba(13, 148, 136, .22), transparent 58%);
    background-attachment: fixed;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
}

/* Kanvas: tinggi acuan tetap 1080 satuan desain, lebarnya menyesuaikan rasio layar
   (dihitung display.js). Dengan begitu layar terisi PENUH — tidak ada pita kosong
   di atas/bawah pada monitor non-16:9 — dan sisa ruang otomatis menambah tinggi panel. */
.display-stage {
    position: absolute;
    left: 0;
    top: 0;
    width: 1920px;
    height: 1080px;
    transform-origin: top left;
    transform: scale(var(--skala, 1));
    will-change: transform;
}

.display-shell {
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1.25fr) minmax(0, 1fr) auto auto;
    gap: 16px;
    /* Padding tipis: konten rapat ke tepi layar (kanvas sudah mengisi penuh). */
    padding: 10px 22px 8px;
    overflow: hidden;
}
.display-shell > * { min-width: 0; min-height: 0; }

.display-head {
    display: flex; justify-content: space-between; align-items: center; gap: 24px;
    background: rgba(255, 255, 255, .86); border: 1px solid var(--card-line);
    border-radius: 20px; padding: 14px 24px; box-shadow: var(--shadow);
}
.display-brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.display-logo { max-height: 76px; max-width: 210px; object-fit: contain; }
.display-mark { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 20px; background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; font-size: 2.2rem; }
.is-hidden { display: none !important; }
.display-ident { min-width: 0; }
.display-ident h1 { font-size: 34px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.display-ident p { color: var(--muted); font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.display-side { display: flex; flex-direction: column; align-items: flex-end; gap: 9px; text-align: right; flex: none; }
.display-judul { font-size: 23px; color: var(--accent-dark); letter-spacing: .1em; text-transform: uppercase; }
.display-actions { display: flex; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; align-items: center; }
.dbtn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 17px; border-radius: 12px;
    background: #fff; border: 1px solid var(--line); color: var(--ink-2);
    font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none;
}
/* Tombol display: hanya ikon — persegi, rapat, sejajar dalam satu baris ke kanan. */
.dbtn.dbtn-ikon { width: 46px; height: 46px; padding: 0; justify-content: center; font-size: 1.35rem; }
.dbtn.dbtn-ikon svg { width: 1.15em; height: 1.15em; }

.dbtn:hover { text-decoration: none; border-color: var(--accent); }
.dbtn.is-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }

.display-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    grid-template-areas: "call clock" "riwayat riwayat";
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 16px;
    min-height: 0;
}

/*
 * Bila panel video aktif: tambah satu kolom di KIRI panel panggilan.
 * Panel video diletakkan pada baris yang sama dengan panel panggilan sehingga tingginya
 * sejajar; baris riwayat membentang penuh di bawahnya.
 */
.display-shell.has-video .display-main {
    grid-template-columns: clamp(340px, 26%, 640px) minmax(0, 1fr) 300px;
    grid-template-areas: "video call clock" "riwayat riwayat riwayat";
}

/* --- Panel video: BINGKAI VIDEO PENUH (tanpa padding, judul, atau label) --- */
.video-panel {
    grid-area: video;
    position: relative;
    min-width: 0; min-height: 0;
    padding: 0;                 /* video menempel penuh ke tepi panel */
    overflow: hidden;           /* sudut membulat memotong video, bukan memberi margin */
    border-radius: 24px;
    background: #071f1c;        /* warna gelap: menyatu bila video sedang memuat */
    /* Tanpa garis tepi: garis 1px akan membuat bingkai video 2px lebih kecil dari panel. */
    box-shadow: 0 30px 60px -34px rgba(6, 60, 52, .95);
}
/* Bingkai video mengisi seluruh panel */
.video-frame { position: absolute; inset: 0; overflow: hidden; }
/* Semua video ditumpuk; hanya yang aktif terlihat. object-fit: cover = mengisi penuh panel
   (bagian tepi video yang tidak sepadan rasio akan dipotong, gambar tidak gepeng). */
.video-item {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; background: #000;
    opacity: 0; pointer-events: none;
    transition: opacity .35s ease;
}
.video-item.is-aktif { opacity: 1; }
.video-foot {
    display: flex; justify-content: space-between; gap: 10px; flex: none;
    font-size: 12px; color: rgba(215, 245, 238, .8); white-space: nowrap; overflow: hidden;
}
.video-foot span { overflow: hidden; text-overflow: ellipsis; }

.call-panel {
    grid-area: call;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    background: linear-gradient(140deg, #0f766e 0%, #10b981 100%);
    color: #fff; border-radius: 26px; padding: 24px 28px;
    box-shadow: 0 30px 60px -34px rgba(6, 95, 70, .95);
    position: relative; overflow: hidden; min-height: 0;
}
.call-panel.is-called { animation: kilat 1.6s ease-out 3; }
/* NOMOR TIKET yang berkedip halus 5 kali setiap ada panggilan baru (labelnya tetap terang). */
.call-panel-number.is-kedip { animation: kedipHalus .9s ease-in-out 5; }
@keyframes kedipHalus {
    0%, 100% { opacity: 1; }
    50% { opacity: .2; }
}
@keyframes kilat {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .85), 0 30px 60px -34px rgba(6, 95, 70, .95); }
    100% { box-shadow: 0 0 0 46px rgba(255, 255, 255, 0), 0 30px 60px -34px rgba(6, 95, 70, .95); }
}
.call-panel-label { font-size: 18px; letter-spacing: .22em; text-transform: uppercase; opacity: .92; flex: none; }
.call-panel-number { display: flex; align-items: baseline; justify-content: center; gap: 18px; max-width: 100%; min-height: 0; }
.call-panel-kode { font-size: 150px; font-weight: 900; line-height: .95; }
.call-panel-angka { font-size: 168px; font-weight: 900; line-height: .95; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.call-panel-loket { font-size: 36px; font-weight: 800; text-align: center; flex: none; }
.call-panel-status { font-size: 21px; background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .38); padding: 6px 20px; border-radius: 999px; font-weight: 700; flex: none; }
.call-panel-meta { display: flex; gap: 16px; font-size: 18px; opacity: .95; flex: none; }

.display-clock {
    grid-area: clock;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: rgba(255, 255, 255, .9); border: 1px solid var(--card-line); border-radius: 22px;
    padding: 20px; box-shadow: var(--shadow); min-height: 0; overflow: hidden;
}
.clock-jam { font-size: 62px; font-weight: 900; color: var(--accent-dark); letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1; }
.clock-tgl { font-size: 17px; color: var(--muted); text-align: center; }

.display-riwayat {
    grid-area: riwayat;
    display: flex; align-items: center; gap: 16px;
    background: rgba(255, 255, 255, .86); border: 1px solid var(--card-line); border-radius: 18px;
    padding: 10px 20px; box-shadow: var(--shadow); overflow: hidden;
}
.riwayat-label { font-size: 15px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; white-space: nowrap; flex: none; }
.riwayat-list { display: flex; gap: 10px; flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.riwayat-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 15px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; font-size: 21px; white-space: nowrap; }
.riwayat-chip em { font-style: normal; font-size: .78em; font-weight: 600; color: var(--muted); }

.display-status { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; min-height: 0; overflow: hidden; }
.status-panel {
    display: flex; flex-direction: column; gap: 10px;
    background: rgba(255, 255, 255, .88); border: 1px solid var(--card-line);
    border-left: 6px solid var(--accent); border-radius: 18px;
    padding: 14px 16px; box-shadow: var(--shadow); min-height: 0; overflow: hidden;
}
.status-panel-resep-masuk { border-left-color: #38bdf8; }
.status-panel-disiapkan { border-left-color: #f59e0b; }
.status-panel-siap { border-left-color: #10b981; }
.status-panel-head { display: flex; align-items: center; gap: 10px; flex: none; }
.status-panel-no { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 900; font-size: 18px; flex: none; }
.status-panel-head h3 { font-size: 22px; text-transform: uppercase; letter-spacing: .05em; flex: 1; min-width: 0; }
.status-panel-count { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 999px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 900; font-size: 19px; flex: none; }
/* Isi kolom: SEMUA tiket ditampilkan, digulir otomatis bila melebihi tinggi panel
   (tidak ada lagi tulisan "+N tiket lainnya"). */
.status-chips { position: relative; overflow: hidden; min-height: 0; flex: 1; }
/* flex: none WAJIB: tanpa ini isi kolom bisa "diperas" oleh flexbox sehingga tinggi yang
   diukur tidak sama dengan tinggi yang tampil — itu membuat gulir tidak menyambung. */
.chips-gulir { display: flex; flex-direction: column; gap: 8px; will-change: transform; }
.chips-gulir > .chips-isi { flex: none; align-self: flex-start; }
.status-chips[data-arah="mendatar"] .chips-gulir { flex-direction: row; gap: 10px; }
.chips-isi { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.status-chips[data-arah="mendatar"] .chips-isi { flex-wrap: nowrap; }
.chips-gulir.is-gulir[data-arah="menurun"] { animation: gulirTurun var(--durasi, 24s) linear infinite; }
.chips-gulir.is-gulir[data-arah="mendatar"] { animation: gulirKiri var(--durasi, 24s) linear infinite; }
@keyframes gulirTurun { from { transform: translateY(0); } to { transform: translateY(calc(-1 * var(--geser, 0px))); } }
@keyframes gulirKiri { from { transform: translateX(0); } to { transform: translateX(calc(-1 * var(--geser, 0px))); } }
.chip-status {
    display: inline-flex; align-items: baseline; gap: 9px;
    padding: .3em .68em; border-radius: 12px;
    background: #fff; border: 1px solid var(--line);
    font-weight: 800; font-size: 1em; letter-spacing: .04em; color: var(--ink);
    font-variant-numeric: tabular-nums; white-space: nowrap;
    transition: background .2s ease, border-color .2s ease;
}
.chip-status .chip-waktu { font-size: .66em; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip-empty { color: #b6cbc8; font-size: 20px; }

.display-selesai {
    display: flex; flex-direction: column; gap: 9px;
    background: rgba(244, 248, 248, .94); border: 1px solid var(--card-line); border-radius: 18px;
    padding: 12px 16px; box-shadow: var(--shadow); min-height: 0; overflow: hidden;
}
.selesai-head { display: flex; align-items: center; gap: 10px; flex: none; }
.selesai-head h3 { font-size: 20px; text-transform: uppercase; letter-spacing: .06em; color: #4b6561; flex: 1; min-width: 0; }
.selesai-head h3 em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--muted); font-size: .82em; }
.selesai-check { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #d1fae5; color: #065f46; font-weight: 900; flex: none; }
.chips-selesai { flex: 1; }
.chips-selesai .chip-status { background: #eef2f2; border-color: #dfe8e7; color: #4b6561; }
.chips-selesai .chip-status::before { content: "\2713"; color: #059669; font-size: .9em; }

.display-foot { display: flex; align-items: center; gap: 18px; min-width: 0; }
/* Teks berjalan: track-nya diposisikan absolut supaya tidak ikut menentukan lebar
   (sebelumnya padding-left:100% + nowrap membuat baris ini jadi >3700px sehingga
   seluruh grid melebar dan terpotong di layar). */
/* Panel teks berjalan: tinggi dalam minimal 36px supaya baris huruf 25px (line-height 33px)
   tampil utuh, tidak terpotong oleh overflow:hidden. */
.marquee { position: relative; flex: 1; min-width: 0; overflow: hidden; background: rgba(255, 255, 255, .9); border: 1px solid var(--card-line); border-radius: 999px; padding: 18px 0; box-shadow: var(--shadow); }
/* Dua salinan teks + jarak di ujung membuat gulir menyambung tanpa lompatan:
   animasi menggeser tepat selebar satu salinan (translateX(-50%)) lalu diulang. */
.marquee-track { position: absolute; top: 0; left: 0; height: 100%; display: inline-flex; align-items: center; gap: 80px; padding-right: 80px; white-space: nowrap; line-height: 1.3; font-size: 25px; color: var(--accent-dark); font-weight: 600; animation-name: jalan; animation-timing-function: linear; animation-iteration-count: infinite; will-change: transform; }
.marquee-track > span { flex: none; }
@keyframes jalan { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.display-stamp { font-size: 17px; color: var(--muted); white-space: nowrap; flex: none; }
.display-stamp.is-error { color: var(--danger); font-weight: 700; }


/* Tip cetak senyap di halaman tiket (tidak pernah ikut tercetak) + panduan di Pengaturan */
.tip-senyap {
    display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
    max-width: 820px; margin: 0 auto 18px; padding: 16px 18px;
    background: var(--accent-soft); border: 1px solid rgba(13, 148, 136, .3); border-radius: var(--radius);
}
.tip-senyap-teks { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.tip-senyap-teks strong { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--accent-dark); }
.tip-senyap-teks span { font-size: .8rem; color: var(--ink-2); line-height: 1.5; }
.tip-senyap-kode { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; margin-top: 4px; }
.tip-senyap-kode label { font-size: .74rem; font-weight: 700; color: var(--muted); }
.tip-senyap-kode textarea {
    font-family: "SFMono-Regular", Consolas, monospace; font-size: .74rem; width: 100%; min-width: min(560px, 72vw);
    padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; resize: vertical;
}
.tip-senyap-aksi { display: flex; gap: 8px; flex-wrap: wrap; }

/* Kotak pengaturan video di tab Identitas & Tampilan */
.video-progress {
    margin-top: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .9); border: 1px solid var(--line);
    font-size: .84rem; font-weight: 600; color: var(--ink-2); min-height: 1em;
}
.video-progress.is-proses { border-color: rgba(13, 148, 136, .45); color: var(--accent-dark); }
.video-progress.is-ok { background: #dcfce7; border-color: #bbf7d0; color: #14532d; }
.video-progress.is-err { background: #fee2e2; border-color: #fecaca; color: #7f1d1d; }

.video-setelan {
    display: flex; flex-direction: column; gap: 14px;
    background: var(--accent-soft); border: 1px solid rgba(13, 148, 136, .28);
    border-radius: var(--radius-sm); padding: 16px;
}
.video-setelan .card-head h2 { font-size: 1rem; }

.unduh-agen { border-color: rgba(13, 148, 136, .45); background: rgba(230, 247, 244, .92); }

.simrs-token { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.simrs-token textarea {
    flex: 1; min-width: min(520px, 70vw); font-family: "SFMono-Regular", Consolas, monospace;
    font-size: .8rem; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff;
    resize: vertical; word-break: break-all;
}
.simrs-token-aksi { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.simrs-uji { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 6px; }
.simrs-uji .field { min-width: 200px; }

.panduan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.panduan-item {
    background: rgba(255, 255, 255, .82); border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
}
.panduan-item h3 { font-size: .95rem; color: var(--accent-dark); }
.panduan-item ol { margin: 0; padding-left: 20px; font-size: .84rem; color: var(--ink-2); display: flex; flex-direction: column; gap: 6px; }
.panduan-item code { font-family: "SFMono-Regular", Consolas, monospace; background: #eef4f3; padding: 1px 6px; border-radius: 6px; font-size: .84em; }
.panduan-kode { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.panduan-kode span { font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.panduan-kode textarea {
    font-family: "SFMono-Regular", Consolas, monospace; font-size: .74rem; width: 100%;
    padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; resize: vertical;
}

/* =====================================================================
   HALAMAN LACAK OBAT (dibuka dari QR pada tiket)
   ===================================================================== */

.lacak-body {
    min-height: 100vh;
    padding: clamp(14px, 3vw, 30px) clamp(12px, 3vw, 22px) 40px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}
.lacak-wrap { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 18px; }

.lacak-head {
    display: flex; align-items: center; gap: 14px;
    background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 18px;
    backdrop-filter: blur(20px) saturate(180%);
}
.lacak-logo { max-height: 52px; max-width: 150px; object-fit: contain; }
.lacak-head h1 { font-size: 1.06rem; }
.lacak-head p { font-size: .78rem; color: var(--muted); }

.lacak-nomor {
    display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
    background: linear-gradient(140deg, #0f766e, #10b981); color: #fff;
    border-radius: 20px; padding: 20px 18px;
    box-shadow: 0 26px 46px -30px rgba(6, 95, 70, .95);
}
.lacak-nomor-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .16em; opacity: .92; }
.lacak-nomor-besar { display: flex; align-items: baseline; gap: 8px; }
.lacak-nomor-besar span { font-size: 3rem; font-weight: 900; line-height: 1; }
.lacak-nomor-besar strong { font-size: 3.5rem; font-weight: 900; line-height: 1; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.lacak-nomor-sub { font-size: .82rem; opacity: .95; }

.lacak-status {
    background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 16px;
    backdrop-filter: blur(20px) saturate(180%);
}
.lacak-status.is-selesai { border-color: rgba(16, 185, 129, .45); }
.lacak-status.is-sorot { animation: sorotKartu 1.8s ease-out 2; }
@keyframes sorotKartu {
    0% { box-shadow: 0 0 0 0 rgba(13, 148, 136, .55), var(--shadow); }
    100% { box-shadow: 0 0 0 22px rgba(13, 148, 136, 0), var(--shadow); }
}
.lacak-status-sekarang { display: flex; flex-direction: column; gap: 4px; }
.lacak-status-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.lacak-status-nilai { font-size: 1.45rem; font-weight: 900; color: var(--accent-dark); line-height: 1.2; }
.lacak-status-waktu { font-size: .74rem; color: var(--muted); }

.lacak-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.lacak-step { display: flex; gap: 13px; padding: 11px 4px; position: relative; }
.lacak-step:not(:last-child)::after {
    content: ""; position: absolute; left: 15px; top: 38px; bottom: -2px; width: 2px; background: var(--line);
}
.lacak-step.is-done:not(:last-child)::after { background: var(--accent-2); }
.lacak-step-bullet {
    display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
    background: #eef4f3; color: var(--muted); font-weight: 800; font-size: .86rem; position: relative; z-index: 1;
    border: 2px solid #e3ecea;
}
.lacak-step.is-done .lacak-step-bullet { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.lacak-step.is-now .lacak-step-bullet {
    background: var(--accent); color: #fff; border-color: #fff;
    box-shadow: 0 0 0 4px rgba(13, 148, 136, .22);
}
.lacak-step-isi { display: flex; flex-direction: column; gap: 1px; padding-top: 3px; }
.lacak-step-isi strong { font-size: .93rem; color: var(--ink-2); }
.lacak-step-isi em { font-style: normal; font-size: .76rem; color: var(--muted); }
.lacak-step-jam { font-size: .74rem; color: var(--accent-dark); font-weight: 700; font-variant-numeric: tabular-nums; }
.lacak-step.is-now .lacak-step-isi strong { color: var(--accent-dark); }

.lacak-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 12px; }
.lacak-meta strong { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.lacak-notif {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
    background: var(--accent-soft); border: 1px solid rgba(13, 148, 136, .25); border-radius: var(--radius);
    padding: 15px 17px;
}
.lacak-notif-teks { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.lacak-notif-teks strong { font-size: .92rem; color: var(--accent-dark); }
.lacak-notif-teks span { font-size: .78rem; color: var(--ink-2); }
.lacak-notif.is-selesai { opacity: .75; }
.btn.is-done { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }

.lacak-catatan { font-size: .76rem; color: var(--muted); line-height: 1.55; }
.lacak-nav { display: flex; gap: 10px; flex-wrap: wrap; }

.lacak-kosong { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 40px 26px; }
.lacak-kosong h1 { font-size: 1.15rem; }
.lacak-kosong p { font-size: .86rem; color: var(--muted); max-width: 42ch; }
.lacak-icon-warn {
    display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
    background: #fee2e2; color: #b91c1c; font-size: 1.7rem; font-weight: 900;
}

/* Pop-up pemberitahuan status (muncul tiap status berubah) */
.lacak-popup {
    position: fixed; left: 50%; top: 14px; transform: translateX(-50%);
    display: flex; align-items: center; gap: 13px;
    width: min(520px, calc(100vw - 24px));
    background: #0f766e; color: #fff; border-radius: 16px; padding: 14px 16px;
    box-shadow: 0 26px 50px -24px rgba(6, 95, 70, .95); z-index: 70;
}
.lacak-popup.is-baru { animation: popTurun .5s ease-out; }
.lacak-popup.is-selesai { background: #065f46; }
.lacak-popup.is-kembali { background: #b45309; }
@keyframes popTurun {
    from { opacity: 0; transform: translateX(-50%) translateY(-26px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.lacak-popup-ikon { font-size: 1.5rem; flex: none; }
.lacak-popup > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lacak-popup strong { font-size: .92rem; }
.lacak-popup span { font-size: .8rem; opacity: .95; }
.lacak-popup-tutup {
    background: rgba(255, 255, 255, .18); border: none; color: #fff; font-size: 1.3rem; line-height: 1;
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer; flex: none;
}

/* ---------------- Responsif halaman petugas ---------------- */

@media (max-width: 900px) {
    .brand-logo { max-height: 34px; max-width: 120px; }
    .nav-toggle { display: inline-flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 12px; background: #fff; border: 1px solid var(--line); cursor: pointer; margin-left: auto; }
    .nav-toggle span { width: 20px; height: 2px; background: var(--ink-2); display: block; }
    .nav { display: none; width: 100%; margin-left: 0; }
    body.nav-open .nav { display: flex; flex-direction: column; align-items: stretch; }
    .nav-link { justify-content: flex-start; border-radius: 12px; }
    .track-cols { grid-template-columns: minmax(0, 1fr); }
}
