:root{--navy:#172554;--blue:#2b3990;--red:#ed1c24;--ink:#172033;--muted:#667085;--line:#e7eaf1;--surface:#fff;--bg:#f5f7fb}
*{box-sizing:border-box}
body{font-family:'DM Sans',system-ui,sans-serif;background:var(--bg);color:var(--ink);overflow-wrap:break-word}
.topbar{background:#fff;border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:12px}
.brand-mark{width:42px;height:42px;border-radius:13px;background:var(--red);color:#fff;display:grid;place-items:center;font-weight:800;font-size:22px;flex-shrink:0}
.brand strong{display:block;font-size:18px;letter-spacing:.04em}
.brand small{display:block;color:var(--muted);font-size:11px}
.auth-wrap{max-width:480px;padding-top:4vh}
.auth-card,.panel,.stat-card,.dashboard-choice{background:var(--surface);border:1px solid var(--line);border-radius:20px;box-shadow:0 8px 30px rgba(24,39,75,.045)}
.auth-card{padding:clamp(24px,5vw,42px)}
.eyebrow{font-size:11px;font-weight:800;letter-spacing:.13em;color:var(--blue)}
.form-control,.form-select{border-color:#dfe3ec;border-radius:11px}
.btn{border-radius:11px;font-weight:600;min-block-size:44px}
.btn-sm{min-block-size:34px}
.btn-primary{background:var(--blue);border-color:var(--blue)}
.btn:focus-visible,.form-control:focus-visible,.form-select:focus-visible,.counter-card:focus-visible{outline:3px solid #0b57d0;outline-offset:2px}
.dashboard-choice{padding:28px;min-height:245px;transition:.18s ease}
.dashboard-choice:hover{transform:translateY(-3px);box-shadow:0 14px 36px rgba(24,39,75,.09);border-color:#b8c1ee}
.choice-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:13px;background:#eef1ff;color:var(--blue);font-size:24px}
.choice-link{display:inline-block;margin-top:22px;color:var(--blue);font-weight:700}
.admin-choice .choice-icon{background:#fff0f0;color:var(--red)}
.page-head{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:22px}
.panel{padding:24px}
.stat-card{padding:18px 20px}
.stat-card span{display:block;color:var(--muted);font-size:13px}
.stat-card strong{display:block;font-size:26px;margin-top:4px;font-variant-numeric:tabular-nums}
.setting-row,.service-item{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.setting-row span{color:var(--muted);font-size:13px}
.setting-row strong{font-size:13px;text-align:right}
.service-item{font-size:13px}
.service-item:last-child{border-bottom:0}
.qr-area{min-height:250px;border:1px dashed #ccd2e1;border-radius:16px;background:#fafbff;display:flex;align-items:center;justify-content:center;flex-direction:column;padding:14px}
.qr-area canvas,.qr-area img{max-width:100%;height:auto}
.ticket-number{font-size:clamp(60px,9vw,92px);font-weight:800;letter-spacing:.06em;color:var(--blue);line-height:1.1;margin:12px 0;font-variant-numeric:tabular-nums}
.current-ticket{min-height:320px}
.text-success{color:#16804a!important}

/* Network pill & counter pill */
.network-pill{display:inline-flex;align-items:center;gap:8px;font-size:12px;font-weight:700;padding:6px 12px;border-radius:999px;border:1px solid var(--line);background:#fff;color:var(--ink);white-space:nowrap}
.network-pill .status-dot{width:9px;height:9px;border-radius:50%;background:#16804a}
.network-pill.is-offline{background:#fff6e5;border-color:#f2cf88;color:#9a5b00}
.network-pill.is-offline .status-dot{background:#d97706}
.counter-pill{display:inline-flex;align-items:center;padding:3px 10px;border-radius:999px;font-size:12px;font-weight:700;background:#eef1ff;color:var(--blue)}
.counter-pill.is-unset{background:#fff3cd;color:#856404}

/* Counter Picker */
.counter-picker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px}
.counter-card{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:14px 16px;border-radius:16px;border:2px solid #dfe3ec;background:#fff;text-align:left;cursor:pointer;transition:border-color .15s ease,background-color .15s ease;min-block-size:86px}
.counter-card:hover{border-color:#9fb0ea;background:#f8faff}
.counter-card.is-selected{border-color:var(--blue);background:#eef1ff}
.counter-card-code{font-size:12px;font-weight:800;letter-spacing:.08em;color:var(--blue)}
.counter-card-name{font-size:16px;font-weight:700;color:var(--ink)}

/* Current Ticket Meta & Services */
.current-meta{background:#f8faff;border:1px solid var(--line);border-radius:14px;padding:10px 14px}
.meta-line{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:4px 0;font-size:14px}
.meta-line strong{text-align:right}
.service-pills{display:flex;flex-wrap:wrap;gap:6px}
.service-pill{display:inline-flex;align-items:center;padding:5px 11px;border-radius:999px;font-size:13px;font-weight:600;background:#eef1ff;color:#1e2c73;border:1px solid #d5ddfb}

/* Staff Queue Actions */
.staff-actions-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.staff-actions-grid .action-primary{grid-column:1 / -1;min-block-size:54px;font-size:1.05rem}

/* Waiting Queue Responsive Table */
.table-wrapper{overflow:auto;max-inline-size:100%;max-block-size:min(480px,62vh);container-type:inline-size;border:1px solid var(--line);border-radius:14px}
.waiting-table{width:100%;border-collapse:separate;border-spacing:0;font-size:14px}
.waiting-table thead th{position:sticky;inset-block-start:0;z-index:1;background:#f8faff;color:var(--muted);font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;padding:11px 12px;border-bottom:1px solid var(--line);white-space:nowrap}
.waiting-table tbody td,.waiting-table tbody th{padding:11px 12px;border-bottom:1px solid var(--line);vertical-align:middle}
.waiting-table tbody tr:last-child td,.waiting-table tbody tr:last-child th{border-bottom:0}
.waiting-ticket-num{font-weight:800;font-size:16px;color:var(--blue);font-variant-numeric:tabular-nums;white-space:nowrap}

@container (width < 520px){
  .waiting-table,.waiting-table thead,.waiting-table tbody,.waiting-table tr,.waiting-table th,.waiting-table td{display:block}
  .waiting-table thead{display:none}
  .waiting-table tbody tr{padding:10px 12px;border-bottom:1px solid var(--line)}
  .waiting-table tbody td,.waiting-table tbody th{padding:4px 0;border:0}
  .waiting-table tbody td[data-label]::before{content:attr(data-label) ": ";font-weight:700;color:var(--muted);font-size:12px}
}

/* Native Dialog Modals */
dialog.pqs-dialog{border:1px solid var(--line);border-radius:20px;padding:24px;width:min(460px,calc(100vw - 24px));max-height:90dvh;box-shadow:0 22px 60px rgba(15,23,42,.24);background:#fff;color:var(--ink)}
dialog.pqs-dialog.pqs-dialog-lg{width:min(560px,calc(100vw - 24px))}
dialog.pqs-dialog:modal{overscroll-behavior:contain}
dialog.pqs-dialog::backdrop{background:rgba(15,23,42,.48);overflow:hidden;overscroll-behavior:contain}

.manual-services-list{display:grid;gap:8px;max-height:240px;overflow:auto;padding:2px}
.manual-svc-item{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1.5px solid #dfe3ec;border-radius:12px;cursor:pointer;min-block-size:46px}
.manual-svc-item:has(input:checked){border-color:var(--blue);background:#eef1ff}
.manual-svc-item input{width:18px;height:18px;accent-color:var(--blue);flex-shrink:0}

@media(max-width:600px){
  .page-head{align-items:start;flex-direction:column}
  .panel{padding:18px}
  .dashboard-choice{min-height:210px}
  .staff-actions-grid{grid-template-columns:1fr}
}

/* Bootstrap display utilities must not override the native hidden attribute. */
[hidden]{display:none!important}
button:disabled{cursor:not-allowed}
.counter-card:disabled{opacity:.6;cursor:not-allowed}

/* Admin reporting */
[hidden]{display:none!important}.report-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:10px}.report-metric{padding:15px;border:1px solid var(--line);border-radius:14px;background:#f8faff}.report-metric span{display:block;color:var(--muted);font-size:.8rem}.report-metric strong{display:block;font-size:clamp(1.55rem,3vw,2.1rem);color:var(--blue);font-variant-numeric:tabular-nums;line-height:1.2;margin-top:5px}.report-subpanel{border:1px solid var(--line);border-radius:14px;padding:16px}.report-bars{display:grid;gap:10px}.report-bar-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px;font-size:.84rem}.report-track{height:9px;background:#e8edf5;border-radius:8px;overflow:hidden;margin-top:5px}.report-fill{height:100%;background:var(--blue);border-radius:8px}.report-status-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.report-status-item{display:flex;justify-content:space-between;gap:5px;font-size:.85rem;padding:6px;border-bottom:1px solid var(--line)}.report-table th,.report-table td{font-size:.8rem;white-space:normal;padding:.45rem}.report-table thead th{background:#eff3f9;color:var(--navy)}#admin-settings-details summary{cursor:pointer}.report-document-head{border-bottom:1px solid var(--line);margin-bottom:15px}.report-panel .table-responsive{max-width:100%;overflow-x:auto}
@media(max-width:420px){.report-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.report-panel{padding:14px}#report-form>div{flex:1 1 130px}#report-form>button{flex:1 1 auto}}
@media print{body.report-printing{background:white;color:black}body.report-printing .topbar,body.report-printing footer,body.report-printing #global-offline-banner,body.report-printing #admin-view>.page-head,body.report-printing #admin-view>.no-report-print,body.report-printing #admin-settings-details,body.report-printing #report-panel>.no-report-print,body.report-printing #report-message{display:none!important}body.report-printing main.container{max-width:none!important;width:100%;padding:0!important}body.report-printing #report-panel{border:0;box-shadow:none;padding:0}body.report-printing .report-metrics{grid-template-columns:repeat(4,1fr)}body.report-printing .report-metric,body.report-printing .report-subpanel,body.report-printing tr{break-inside:avoid}body.report-printing .table-responsive{overflow:visible}body.report-printing .report-fill{-webkit-print-color-adjust:exact;print-color-adjust:exact}body.report-printing .report-table{width:100%}body.report-printing .report-table td,body.report-printing .report-table th{font-size:9pt}}
