/* QR-GUARD — gaya utama (scan, login, dashboard, monitoring, user admin, log WhatsApp,
 * pengaturan Fonnte, halaman QR). Halaman Data Petugas memakai data-petugas.css sendiri,
 * warna di sini disamakan agar seluruh QR-GUARD tampil seragam.
 * Mobile-first: dasar untuk ponsel, lalu diperlebar untuk tablet (>= 720px) dan PC (>= 1024px).
 */
:root {
    --qg-bg: #f3f5fa;
    --qg-surface: #ffffff;
    --qg-surface-2: #f7f9fc;
    --qg-border: #e3e8f0;
    --qg-border-strong: #c9d2df;
    --qg-text: #0f172a;
    --qg-muted: #64748b;
    --qg-navy: #0b1b3f;
    --qg-navy-2: #132a5c;
    --qg-primary: #155eef;
    --qg-primary-dark: #0f4bc4;
    --qg-primary-50: #eef4ff;
    --qg-success: #079455;
    --qg-success-50: #ecfdf3;
    --qg-danger: #d92d20;
    --qg-danger-50: #fef3f2;
    --qg-warning: #b54708;
    --qg-warning-50: #fffaeb;
    --qg-radius: 16px;
    --qg-radius-sm: 10px;
    --qg-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
    --qg-font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --qg-gutter: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
    font-family: var(--qg-font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--qg-text);
    background: var(--qg-bg);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--qg-primary); }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; color: var(--qg-text); }
h1 { font-size: clamp(22px, 5vw, 30px); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: clamp(17px, 3.6vw, 20px); font-weight: 750; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 10px; }
code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .88em;
    background: var(--qg-surface-2);
    border: 1px solid var(--qg-border);
    border-radius: 6px;
    padding: 1px 6px;
    word-break: break-all;
}
.muted { color: var(--qg-muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- Bilah atas & navigasi ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px var(--qg-gutter);
    padding-top: max(10px, env(safe-area-inset-top));
    background: var(--qg-navy);
    color: #fff;
    box-shadow: 0 2px 12px rgba(11, 27, 63, .25);
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    letter-spacing: .04em;
    min-width: 0;
}
.logo strong { font-size: 16px; white-space: nowrap; }
.brand-mark {
    display: inline-flex;
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 10px;
    background: #fff;
    padding: 3px;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 7px; }
.nav-toggle {
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex: none;
}
.nav-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.topnav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 8px var(--qg-gutter) 14px;
    background: var(--qg-navy);
    border-top: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 12px 24px rgba(11, 27, 63, .3);
    max-height: calc(100vh - 64px);
    overflow-y: auto;
}
.topnav.is-open { display: flex; }
.topnav a {
    color: #c8d3ee;
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
}
.topnav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.topnav a.active { background: var(--qg-primary); color: #fff; }
.topnav a.danger-link { color: #fda29b; }
.topnav a.danger-link:hover { background: rgba(217, 45, 32, .18); color: #fff; }
html.no-js .topnav { position: static; display: flex; flex-direction: row; flex-wrap: wrap; box-shadow: none; padding: 0; border: 0; }
html.no-js .nav-toggle { display: none; }

/* ---------- Kerangka halaman ---------- */
.container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 18px var(--qg-gutter) 28px;
    flex: 1 0 auto;
}
.page-shell { animation: qg-fade-in .25s ease-out both; }
@keyframes qg-fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.footer {
    padding: 16px var(--qg-gutter);
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    text-align: center;
    font-size: 13px;
    color: var(--qg-muted);
    border-top: 1px solid var(--qg-border);
    background: var(--qg-surface);
}

/* ---------- Splash: hilang sendiri walau JS gagal dimuat ---------- */
.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: var(--qg-navy);
    color: #fff;
    animation: qg-splash-out .35s ease-in 1.1s forwards;
}
.splash-screen.is-hidden { animation: qg-splash-out .3s ease-in forwards; }
@keyframes qg-splash-out { to { opacity: 0; visibility: hidden; pointer-events: none; } }
.splash-inner { text-align: center; padding: 24px; }
.splash-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    background: #fff;
    border-radius: 24px;
    padding: 8px;
    animation: qg-pulse 1.2s ease-in-out infinite;
}
.splash-title { margin-top: 14px; font-size: 24px; font-weight: 800; letter-spacing: .08em; }
.splash-subtitle { color: #c8d3ee; font-size: 14px; }
@keyframes qg-pulse { 50% { transform: scale(.94); } }

/* ---------- Hero ---------- */
.hero {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
    padding: 20px;
    border-radius: var(--qg-radius);
    background: linear-gradient(135deg, var(--qg-navy) 0%, var(--qg-navy-2) 100%);
    color: #fff;
    box-shadow: var(--qg-shadow);
}
.hero h1 { color: #fff; }
.hero .muted { color: #c8d3ee; margin: 0; }
.hero b { color: #fff; }
.eyebrow {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #9db7ff;
}
.brand-badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #fff;
    padding: 4px;
    margin-bottom: 10px;
}
.brand-badge img { width: 100%; height: 100%; object-fit: contain; border-radius: 12px; display: block; }
.time-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .14);
    flex: none;
}
.time-card span { font-size: 12px; color: #c8d3ee; text-transform: uppercase; letter-spacing: .06em; }
.time-card strong { font-size: 18px; color: #fff; }
.time-card small { font-size: 12px; color: #c8d3ee; }
@media (max-width: 719.98px) {
    /* Ponsel: hero lebih ringkas agar kamera/isi utama cepat terlihat */
    .hero { padding: 16px; gap: 10px; }
    .scan-hero .brand-badge { display: none; }
    .time-card { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 12px; }
    .time-card strong { font-size: 15px; }
}

/* ---------- Kartu ---------- */
.card {
    background: var(--qg-surface);
    border: 1px solid var(--qg-border);
    border-radius: var(--qg-radius);
    box-shadow: var(--qg-shadow);
    padding: 16px;
    margin-bottom: 16px;
    min-width: 0;
}
.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.section-head h2 { margin-bottom: 2px; }
.section-head p { margin: 0; }
.qr-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--qg-primary-50);
    color: var(--qg-primary);
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}

/* ---------- Tombol ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--qg-border-strong);
    border-radius: var(--qg-radius-sm);
    background: var(--qg-surface);
    color: var(--qg-text);
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--qg-surface-2); border-color: var(--qg-muted); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(21, 94, 239, .35); outline-offset: 2px; }
.btn[disabled], .btn.is-loading { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn.primary { background: var(--qg-primary); border-color: var(--qg-primary); color: #fff; }
.btn.primary:hover { background: var(--qg-primary-dark); border-color: var(--qg-primary-dark); }
.btn.success, .btn.ok { background: var(--qg-success); border-color: var(--qg-success); color: #fff; }
.btn.success:hover, .btn.ok:hover { background: #067647; border-color: #067647; }
.btn.danger { background: var(--qg-danger); border-color: var(--qg-danger); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.btn.full { width: 100%; }
.btn.ok { font-size: 18px; min-height: 54px; letter-spacing: .06em; }

/* ---------- Pesan ---------- */
.alert {
    padding: 12px 14px;
    border-radius: var(--qg-radius-sm);
    border: 1px solid transparent;
    margin-bottom: 14px;
    font-size: 14px;
    overflow-wrap: anywhere;
}
.alert.success { background: var(--qg-success-50); border-color: #abefc6; color: #067647; }
.alert.danger { background: var(--qg-danger-50); border-color: #fecdca; color: #b42318; }
.alert.info { background: var(--qg-primary-50); border-color: #c7d7fe; color: #1849a9; }
.alert.warning { background: var(--qg-warning-50); border-color: #fedf89; color: var(--qg-warning); }

/* ---------- Formulir ---------- */
label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 650;
    color: #344054;
    min-width: 0;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--qg-border-strong);
    border-radius: var(--qg-radius-sm);
    background: var(--qg-surface);
    color: var(--qg-text);
    font: inherit;
    font-size: 16px; /* 16px mencegah zoom otomatis di iPhone */
    font-weight: 400;
}
input[readonly] { background: var(--qg-surface-2); color: var(--qg-muted); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--qg-primary);
    box-shadow: 0 0 0 3px rgba(21, 94, 239, .18);
}
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--qg-primary); flex: none; margin: 0; }
label small { font-weight: 400; }
.checkline {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    min-height: 44px;
}
.stack-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.form-grid, .filter-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-actions, .filter-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-actions .btn, .form-actions .btn { flex: 1 1 auto; }
.form-progress {
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--qg-primary);
    font-weight: 600;
}
.form-progress.is-active { display: flex; }
.form-progress.is-active::before {
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--qg-primary-50);
    border-top-color: var(--qg-primary);
    animation: qg-spin .8s linear infinite;
}
@keyframes qg-spin { to { transform: rotate(360deg); } }
.inline-form { display: inline-flex; margin: 0; }

/* ---------- Tabel: kartu di ponsel, tabel di tablet/PC ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--qg-muted);
    background: var(--qg-surface-2);
    padding: 10px 12px;
    border-bottom: 1px solid var(--qg-border);
    white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid var(--qg-border); vertical-align: top; overflow-wrap: anywhere; }
tbody tr:hover td { background: #fafbfd; }
td .btn.small + .inline-form { margin-left: 6px; }

@media (max-width: 719.98px) {
    .table-wrap.is-stacked { overflow: visible; }
    .is-stacked table, .is-stacked tbody, .is-stacked tr, .is-stacked td { display: block; width: 100%; }
    .is-stacked thead { display: none; }
    .is-stacked tr {
        border: 1px solid var(--qg-border);
        border-radius: 12px;
        margin-bottom: 10px;
        padding: 6px 12px;
        background: var(--qg-surface);
    }
    .is-stacked tbody tr:hover td { background: transparent; }
    .is-stacked td {
        display: grid;
        grid-template-columns: minmax(96px, 38%) 1fr;
        column-gap: 10px;
        row-gap: 0;
        align-items: start;
        padding: 8px 0;
        border-bottom: 1px dashed var(--qg-border);
    }
    .is-stacked td:last-child { border-bottom: 0; }
    /* Isi sel (teks, keterangan kecil, badge, tombol) selalu di kolom kanan */
    .is-stacked td > * { grid-column: 2; justify-self: start; }
    .is-stacked td::before {
        grid-column: 1;
        grid-row: 1 / span 6;
        content: attr(data-label);
        font-size: 12px;
        font-weight: 700;
        color: var(--qg-muted);
        text-transform: uppercase;
        letter-spacing: .03em;
    }
    .is-stacked td[colspan] { display: block; text-align: center; }
    .is-stacked td[colspan]::before { content: none; }
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--qg-surface-2);
    color: #344054;
    border: 1px solid var(--qg-border);
}
.pill.in { background: var(--qg-success-50); color: #067647; border-color: #abefc6; }
.pill.out { background: var(--qg-primary-50); color: #1849a9; border-color: #c7d7fe; }

/* Matriks hak akses: tetap tabel yang digeser, kolom role menempel di kiri */
.permission-table th, .permission-table td { text-align: center; white-space: nowrap; }
.permission-table th:first-child, .permission-table td:first-child {
    position: sticky;
    left: 0;
    text-align: left;
    background: var(--qg-surface);
    z-index: 1;
    box-shadow: 1px 0 0 var(--qg-border);
}
.permission-table th:first-child { background: var(--qg-surface-2); }
.permission-check {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
    cursor: pointer;
    min-height: 40px;
}
.permission-check span { font-size: 12px; color: var(--qg-muted); }

/* ---------- Statistik dashboard ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px;
    border-radius: var(--qg-radius);
    background: var(--qg-surface);
    border: 1px solid var(--qg-border);
    border-top: 4px solid var(--qg-border-strong);
    box-shadow: var(--qg-shadow);
    min-width: 0;
}
.stat-card span { font-size: 12px; font-weight: 700; color: var(--qg-muted); text-transform: uppercase; letter-spacing: .03em; }
.stat-card strong { font-size: clamp(26px, 7vw, 34px); font-weight: 800; line-height: 1.1; }
.stat-card small { font-size: 12px; color: var(--qg-muted); }
.stat-card.is-primary { border-top-color: var(--qg-primary); }
.stat-card.is-primary strong { color: var(--qg-primary); }
.stat-card.is-success { border-top-color: var(--qg-success); }
.stat-card.is-success strong { color: var(--qg-success); }
.stat-card.is-warning { border-top-color: #f79009; }
.stat-card.is-warning strong { color: var(--qg-warning); }
.dashboard-insight p { margin: 0; }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.status-grid > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Halaman scan ---------- */
.scanner-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.scanner-grid .card { margin-bottom: 0; }
#reader {
    width: 100%;
    min-height: 240px;
    border-radius: 12px;
    overflow: hidden;
    background: #0b1220 center / 72px no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M4 7V5a1 1 0 0 1 1-1h2M17 4h2a1 1 0 0 1 1 1v2M20 17v2a1 1 0 0 1-1 1h-2M7 20H5a1 1 0 0 1-1-1v-2M7 12h10'/%3E%3C/svg%3E");
}
#reader.is-active { background-image: none; }
#reader video { width: 100% !important; height: auto !important; display: block; border-radius: 12px; }
#reader img[alt="Info icon"], #reader img[alt="Camera based scan"] { display: none; }
.scan-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 8px; }
.scan-actions .btn { flex: 1 1 130px; white-space: nowrap; }
.status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    border: 1px solid var(--qg-border);
    background: var(--qg-surface-2);
    color: var(--qg-muted);
}
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; flex: none; }
.status.loading { background: var(--qg-primary-50); color: var(--qg-primary); border-color: #c7d7fe; }
.status.loading::before { width: 14px; height: 14px; background: none; border: 2px solid #c7d7fe; border-top-color: var(--qg-primary); animation: qg-spin .8s linear infinite; }
.status.masuk { background: var(--qg-success-50); color: #067647; border-color: #abefc6; }
.status.keluar { background: var(--qg-primary-50); color: #1849a9; border-color: #c7d7fe; }
.status.error { background: var(--qg-danger-50); color: #b42318; border-color: #fecdca; }
.result-card.flash-masuk { box-shadow: 0 0 0 3px rgba(7, 148, 85, .35), var(--qg-shadow); }
.result-card.flash-keluar { box-shadow: 0 0 0 3px rgba(21, 94, 239, .35), var(--qg-shadow); }
.result-card.flash-error { box-shadow: 0 0 0 3px rgba(217, 45, 32, .35), var(--qg-shadow); }
.result-list {
    display: grid;
    grid-template-columns: minmax(96px, 36%) 1fr;
    margin: 0 0 14px;
    font-size: 14px;
}
.result-list dt, .result-list dd { padding: 8px 0; border-bottom: 1px dashed var(--qg-border); margin: 0; }
.result-list dt { color: var(--qg-muted); font-weight: 600; padding-right: 10px; }
.result-list dd { font-weight: 600; overflow-wrap: anywhere; }
.scan-photo { display: block; max-width: 160px; max-height: 160px; border-radius: 10px; border: 1px solid var(--qg-border); object-fit: cover; }

/* ---------- Login ---------- */
body.auth-page {
    align-items: center;
    justify-content: center;
    padding: 24px var(--qg-gutter);
    background:
        radial-gradient(circle at 15% 10%, rgba(21, 94, 239, .35), transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(21, 94, 239, .25), transparent 45%),
        var(--qg-navy);
}
.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 28px 22px;
    border-radius: 20px;
    background: var(--qg-surface);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
    text-align: center;
}
.auth-card .brand-badge {
    width: 92px;
    height: 92px;
    margin: 0 auto 14px;
    border-radius: 22px;
    border: 1px solid var(--qg-border);
}
.auth-card h1 { font-size: 24px; }
.auth-card > p.muted { margin-bottom: 20px; }
.competition-spinner {
    width: 40px;
    height: 40px;
    margin: 16px auto;
    border-radius: 50%;
    border: 4px solid var(--qg-primary-50);
    border-top-color: var(--qg-primary);
    animation: qg-spin .9s linear infinite;
}

/* ---------- Halaman QR (generate & publik) ---------- */
.print-page { margin: 0 auto; padding: 16px var(--qg-gutter) 28px; text-align: center; }
.print-card { text-align: center; }
.qr-box { margin-bottom: 0; }
.qr-box .scan-actions { justify-content: center; }
.qr-box .scan-actions .btn, .qr-box .scan-actions form { flex: 1 1 160px; }
.qr-box .scan-actions form .btn { width: 100%; }
.public-qr-page { display: flex; justify-content: center; }
.public-qr-card {
    width: 100%;
    max-width: 440px;
    text-align: center;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.qr-public-logo { width: 72px; height: 72px; object-fit: contain; border-radius: 18px; }
.qr-public-code {
    width: min(280px, 100%);
    height: auto;
    margin: 10px auto;
    padding: 10px;
    background: #fff;
    border: 1px solid var(--qg-border);
    border-radius: 14px;
}
.qr-public-slot {
    display: inline-flex;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--qg-primary-50);
    color: var(--qg-primary);
    font-weight: 800;
    font-size: 13px;
}
.qr-public-name { font-size: 22px; margin: 6px 0 0; overflow-wrap: anywhere; }
.qr-public-device, .qr-public-unit { margin: 0; color: #344054; }
.qr-public-unit { color: var(--qg-muted); font-weight: 600; }
.qr-token-pill { margin: 8px 0; }
.qr-public-note { font-size: 12px; color: var(--qg-muted); margin: 6px 0 0; }

/* ---------- Dialog kirim QR WhatsApp (dibuat oleh admin.js) ---------- */
.qg-modal {
    width: min(460px, calc(100vw - 32px));
    border: 0;
    border-radius: var(--qg-radius);
    padding: 0;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
    color: var(--qg-text);
}
.qg-modal::backdrop { background: rgba(11, 27, 63, .55); }
.qg-modal-body { padding: 20px; text-align: left; }
.qg-modal-body h2 { margin-bottom: 6px; }
.qg-modal-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.qg-modal-list li { padding: 10px 12px; border-radius: 10px; background: var(--qg-surface-2); border: 1px solid var(--qg-border); font-size: 14px; }
.qg-modal-list li.is-ok { background: var(--qg-success-50); border-color: #abefc6; }
.qg-modal-list li.is-fail { background: var(--qg-danger-50); border-color: #fecdca; }
.qg-modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.qg-modal-actions .btn { flex: 1 1 140px; }

/* ---------- Tablet (>= 720px) ---------- */
@media (min-width: 720px) {
    :root { --qg-gutter: 24px; }
    .container { padding-top: 24px; }
    .hero { flex-direction: row; align-items: center; justify-content: space-between; padding: 24px 28px; }
    .hero > div:first-child { max-width: 760px; }
    .time-card { min-width: 190px; }
    .card { padding: 20px; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .status-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid .span-2, .form-grid .span-3 { grid-column: 1 / -1; }
    .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filter-grid .checkline, .filter-grid .filter-actions { grid-column: 1 / -1; }
    .filter-actions .btn, .form-actions .btn { flex: 0 0 auto; }
    .auth-card { padding: 36px 32px; }
    #reader { min-height: 320px; }
}

/* ---------- PC (>= 1024px) ---------- */
@media (min-width: 1024px) {
    .topbar { padding-left: 28px; padding-right: 28px; }
    .nav-toggle { display: none; }
    .topnav {
        position: static;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 4px;
        margin-left: auto;
        padding: 0;
        border: 0;
        box-shadow: none;
        background: transparent;
        max-height: none;
        overflow: visible;
    }
    .topnav a { padding: 8px 12px; font-size: 14px; border-radius: 999px; white-space: nowrap; }
    .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .form-grid .span-2 { grid-column: span 2; }
    .form-grid .span-3 { grid-column: 1 / -1; }
    .filter-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: end; }
    .filter-grid .checkline { grid-column: 1 / 3; }
    .filter-grid .filter-actions { grid-column: 3 / -1; justify-content: flex-end; }
    .scanner-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
    .result-card { position: sticky; top: 84px; }
    #reader { min-height: 380px; }
}

/* ---------- Cetak ---------- */
@media print {
    body { background: #fff; display: block; }
    .topbar, .footer, .no-print, .splash-screen { display: none !important; }
    .card { box-shadow: none; border: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
