/* BranchFlow by DAM: demo stylesheet.
   Mobile first. Breakpoints: 600 (large phone / small tablet), 768 (tablet), 1024 (laptop), 1280, 1440 (desktop).
   Spacing scale on a 4px base: --sp-1 (4) ... --sp-10 (40). */

@font-face { font-family: "Archivo"; src: url("../fonts/archivo-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  /* brand: DAM navy + the blue sampled from the DAM logo */
  --navy: #001e45; --navy-2: #0a2a57; --navy-3: #143a70;
  --blue: #004aad; --blue-h: #003c8f; --blue-soft: #8fb4ee;
  /* neutrals */
  --ink: #142139; --body: #3b4a60; --muted: #5d6c82; --faint: #8796ab;
  --line: #dde3eb; --hair: #eaeef4; --bg: #f5f7fa; --surface: #ffffff; --tint: #edf2fb; --tint-2: #dfe8f7; --plate: #e2e6ec;
  /* status tones (text on bg pairs meet WCAG AA) */
  --amber: #8a5000; --amber-bg: #fff4de; --amber-line: #f0d8a6;
  --blue-t: #004aad; --blue-bg: #e8effa;
  --teal: #0b6660; --teal-bg: #e2f3f0;
  --green: #1b6e45; --green-bg: #e5f4eb;
  --red: #a3262d; --red-bg: #fcebec; --red-line: #efc7ca;
  --slate: #46556b; --slate-bg: #eff2f6;
  /* type */
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-h: "Archivo", "IBM Plex Sans", system-ui, sans-serif;
  --fs-xs: 12px; --fs-sm: 13.5px; --fs-base: 15px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 20px;
  /* spacing */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 28px; --sp-8: 32px; --sp-10: 40px;
  /* shape */
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 20px;
  --control: 46px; --control-sm: 38px; --control-lg: 52px;
  --sh-1: 0 1px 2px rgba(0, 30, 69, 0.05);
  --sh-pop: 0 16px 40px rgba(0, 30, 69, 0.18);
  /* layout */
  --gutter: var(--sp-4); --page-gap: var(--sp-6); --pad: var(--sp-5); --sidebar: 256px;
}
@media (min-width: 600px) { :root { --gutter: var(--sp-6); } }
@media (min-width: 1024px) { :root { --gutter: var(--sp-8); --page-gap: var(--sp-8); --pad: var(--sp-6); } }
@media (min-width: 1440px) { :root { --gutter: var(--sp-10); } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-base); line-height: 1.55; color: var(--body); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--font-h); color: var(--ink); margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -0.005em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.block { display: block; }
.fineprint { font-size: var(--fs-xs); color: var(--muted); }
.ic { display: inline-flex; width: 1.15em; height: 1.15em; flex: none; }
.ic svg { width: 100%; height: 100%; }
.skip-link { position: absolute; left: var(--sp-2); top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--r-sm); text-decoration: none; }
.skip-link:focus { top: var(--sp-2); }
.noscript { padding: var(--sp-6); background: var(--red-bg); color: var(--red); text-align: center; }

/* ================================================================ shell */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: min(86vw, 300px); z-index: 40; background: var(--navy); color: #dbe5f5;
  display: flex; flex-direction: column; transform: translateX(-100%); transition: transform 0.22s ease; overflow-y: auto;
}
.sidebar.is-open { transform: none; box-shadow: var(--sh-pop); }
.scrim { position: fixed; inset: 0; background: rgba(0, 16, 40, 0.5); z-index: 30; }
.brand { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-5) var(--sp-4) var(--sp-5) var(--sp-5); }
.brand-logo { width: 56px; height: auto; background: #fff; border-radius: var(--r-sm); padding: 5px 6px; }
.brand-text { min-width: 0; flex: 1; }
.brand-name { font-family: var(--font-h); font-weight: 700; font-size: var(--fs-lg); color: #fff; line-height: 1.2; }
.brand-sub { font-size: var(--fs-xs); color: var(--blue-soft); line-height: 1.35; margin-top: 2px; }
.nav-close { color: #fff; }
.nav-list { padding: 0 var(--sp-3) var(--sp-4); }
.nav-group { font-size: var(--fs-xs); font-weight: 600; color: #8ea3c2; padding: var(--sp-5) var(--sp-3) var(--sp-2); }
.nav-link { display: flex; align-items: center; gap: var(--sp-3); min-height: 44px; padding: 0 var(--sp-3); border-radius: 10px; color: #dbe5f5; text-decoration: none; font-weight: 500; font-size: var(--fs-base); }
.nav-link .ic { width: 20px; height: 20px; color: var(--blue-soft); }
.nav-link:hover { background: var(--navy-2); color: #fff; }
.nav-link[aria-current="page"] { background: var(--navy-3); color: #fff; }
.nav-link[aria-current="page"] .ic { color: #fff; }
.nav-link:focus-visible { outline-color: var(--blue-soft); }
.sidebar-foot { margin-top: auto; padding: var(--sp-5); font-size: var(--fs-xs); line-height: 1.5; color: #a9badb; border-top: 1px solid var(--navy-3); }
.sidebar-foot strong { color: #fff; }

.shell { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--sp-3); min-height: 60px;
  padding: var(--sp-2) var(--gutter); background: rgba(255, 255, 255, 0.97); border-bottom: 1px solid var(--hair);
}
.menu-btn { margin-left: calc(var(--sp-2) * -1); }
.top-title { display: flex; align-items: center; gap: var(--sp-2); font-family: var(--font-h); font-weight: 600; color: var(--ink); font-size: var(--fs-md); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.top-title > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.crumb, .crumb-sep { display: none; color: var(--muted); font-weight: 500; }
.top-meta { display: flex; align-items: center; gap: var(--sp-4); font-size: var(--fs-sm); color: var(--muted); }
.top-branch, .top-clock { display: none; align-items: center; gap: 6px; white-space: nowrap; }
.top-clock { font-variant-numeric: tabular-nums; }
.demo-badge { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 var(--sp-3); border-radius: 999px; border: 1px solid var(--amber-line); background: var(--amber-bg); color: var(--amber); font-weight: 600; font-size: var(--fs-xs); cursor: pointer; white-space: nowrap; }
.demo-badge:hover { background: #ffecc7; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; color: var(--ink); flex: none; }
.icon-btn .ic { width: 22px; height: 22px; }
.icon-btn:hover { background: var(--tint); }
.nav-close:hover { background: var(--navy-2); }

.main { padding: var(--sp-6) var(--gutter) var(--sp-10); outline: none; }
.page { max-width: 1360px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--page-gap); }

@media (min-width: 600px) { .top-branch { display: inline-flex; } }
@media (min-width: 768px) { .top-clock { display: inline-flex; } .crumb, .crumb-sep { display: inline; } }
@media (min-width: 1024px) {
  .sidebar { transform: none; width: var(--sidebar); box-shadow: none; }
  .nav-close, .menu-btn { display: none; }
  .scrim { display: none; }
  .shell { margin-left: var(--sidebar); }
  .main { padding: var(--sp-8) var(--gutter) 64px; }
}

/* ================================================================ page head */
.page-head { display: flex; flex-direction: column; gap: var(--sp-4); }
.page-title h1 { font-size: 24px; outline: none; }
.page-title .sub { margin-top: var(--sp-2); color: var(--muted); max-width: 68ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
@media (min-width: 768px) {
  .page-head { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: var(--sp-6); }
  .page-title h1 { font-size: 28px; }
  .page-actions { flex: none; }
}

/* ================================================================ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--control); padding: 0 var(--sp-5); border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: 14.5px; line-height: 1.2; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-h); }
.btn-primary:active { background: var(--navy-3); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: #b9c4d3; background: #fafbfd; }
.btn-ghost { background: transparent; color: var(--blue); padding: 0 var(--sp-3); }
.btn-ghost:hover { background: var(--tint); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #8a1f25; }
.btn-ghost-danger { background: transparent; color: var(--red); border-color: var(--red-line); }
.btn-ghost-danger:hover { background: var(--red-bg); }
.btn-sm { min-height: var(--control-sm); padding: 0 var(--sp-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-lg { min-height: var(--control-lg); padding: 0 var(--sp-6); font-size: var(--fs-md); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.link-btn { border: 0; background: none; padding: 0; cursor: pointer; color: var(--blue); font-weight: 600; font-size: var(--fs-sm); text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }

/* ================================================================ panels, notices, empty */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--pad); border-bottom: 1px solid var(--hair); min-height: 56px; }
.panel-head h2 { font-size: var(--fs-md); }
.panel-body { padding: var(--pad); }
.panel-body.flush { padding: 0; }
.panel-accent { box-shadow: 6px 6px 0 var(--plate); }
.notice { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); border-radius: var(--r); background: var(--tint); color: var(--ink); border: 1px solid var(--tint-2); }
.notice > .ic { width: 20px; height: 20px; color: var(--blue); margin-top: 2px; }
.notice > div { display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
.notice.tone-amber { background: var(--amber-bg); border-color: var(--amber-line); } .notice.tone-amber > .ic { color: var(--amber); }
.notice.tone-blue { background: var(--blue-bg); border-color: #c8d8f2; }
.notice.tone-teal { background: var(--teal-bg); border-color: #bce1db; } .notice.tone-teal > .ic { color: var(--teal); }
.notice.tone-green { background: var(--green-bg); border-color: #c2e3cf; } .notice.tone-green > .ic { color: var(--green); }
.notice.tone-red { background: var(--red-bg); border-color: var(--red-line); } .notice.tone-red > .ic { color: var(--red); }
.notice.tone-slate { background: var(--slate-bg); border-color: var(--hair); color: var(--body); } .notice.tone-slate > .ic { color: var(--slate); }
.is-pulse { animation: pulse 1.6s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(0, 74, 173, 0.15); } }
.demo-note { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); color: var(--amber); background: var(--amber-bg); padding: 10px var(--sp-3); border-radius: var(--r-sm); }
.demo-note .req { color: var(--red); font-weight: 600; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-8) var(--sp-4); }
.empty-ic { width: 32px; height: 32px; color: #a1afc3; margin-bottom: var(--sp-1); }
.empty-title { font-weight: 600; color: var(--ink); }
.empty .btn { margin-top: var(--sp-3); }

/* ================================================================ badges + chips */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tone-amber.badge { background: var(--amber-bg); color: var(--amber); }
.tone-blue.badge { background: var(--blue-bg); color: var(--blue-t); }
.tone-teal.badge { background: var(--teal-bg); color: var(--teal); }
.tone-green.badge { background: var(--green-bg); color: var(--green); }
.tone-red.badge { background: var(--red-bg); color: var(--red); }
.tone-slate.badge { background: var(--slate-bg); color: var(--slate); }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 var(--sp-2); border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chip-online { background: var(--tint); color: var(--blue); }
.chip-walkin { background: var(--slate-bg); color: var(--slate); }
.chips { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-1); scrollbar-width: thin; }
.chip-btn { display: inline-flex; align-items: center; gap: var(--sp-2); flex: none; min-height: 40px; padding: 0 var(--sp-4); border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--body); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; }
.chip-btn:hover { border-color: #b9c4d3; }
.chip-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--slate-bg); color: var(--slate); font-size: 11.5px; display: inline-grid; place-items: center; }
.chip-btn[aria-pressed="true"] .chip-count { background: var(--navy-3); color: #fff; }

/* ================================================================ forms */
.field { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.field > label { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.req { color: var(--red); }
.opt { color: var(--muted); font-weight: 400; }
input[type="text"], input[type="tel"], input[type="search"], input[type="number"], select, textarea {
  width: 100%; min-height: var(--control); padding: 10px 14px; border: 1px solid #c6cfdc; border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 16px; transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath fill='%235d6c82' d='M216.49 104.49l-80 80a12 12 0 01-17 0l-80-80a12 12 0 0117-17L128 159l71.51-71.52a12 12 0 0117 17z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 14px; }
input:hover, select:hover, textarea:hover { border-color: #a2b2c7; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 74, 173, 0.2); }
.has-error input, .has-error select, .has-error textarea, [aria-invalid="true"] { border-color: var(--red); background: #fffafa; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.hint.words { color: var(--blue); }
.hint.words:empty { display: none; }
.error { display: flex; gap: 6px; font-size: 13px; color: var(--red); font-weight: 500; line-height: 1.4; }
.error:empty { display: none; }
.form-grid { display: grid; gap: var(--sp-5) var(--sp-5); grid-template-columns: minmax(0, 1fr); }
.form-stack { display: flex; flex-direction: column; gap: var(--sp-5); }
@media (min-width: 768px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .span-2 { grid-column: span 2; } }
.form-sections { display: flex; flex-direction: column; gap: var(--sp-8); }
.form-section { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-section > legend { font-family: var(--font-h); font-weight: 700; font-size: var(--fs-md); color: var(--ink); padding: 0; }
.section-hint { margin: var(--sp-1) 0 var(--sp-5); }
.check { display: flex; gap: var(--sp-3); align-items: flex-start; cursor: pointer; color: var(--ink); line-height: 1.45; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--blue); flex: none; }
.check-sm { font-size: var(--fs-sm); gap: 10px; }
.check-sm input { width: 18px; height: 18px; }
.fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.fs legend { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); margin-bottom: var(--sp-3); padding: 0; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 10px var(--sp-4); }
.input-row { display: flex; gap: var(--sp-2); }
.input-row input { flex: 1; min-width: 0; }
.field-inline > label { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: var(--fs-sm); color: var(--ink); position: relative; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 26px; margin: 0; cursor: pointer; }
.switch-ui { width: 44px; height: 26px; border-radius: 999px; background: #c6cfdc; position: relative; transition: background 0.15s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.switch input:checked + .switch-ui { background: var(--blue); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ================================================================ definition lists */
.dl { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0; }
.dl dt { font-size: var(--fs-xs); color: var(--muted); margin-top: var(--sp-3); }
.dl dt:first-of-type { margin-top: 0; }
.dl dd { margin: 2px 0 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
@media (min-width: 600px) {
  .dl { grid-template-columns: minmax(140px, 0.55fr) minmax(0, 1.45fr); column-gap: var(--sp-5); }
  .dl dt, .dl dd { margin: 0; padding: 10px 0; border-top: 1px solid var(--hair); }
  .dl dt { font-size: var(--fs-sm); }
  .dl dt:first-of-type, .dl dd:first-of-type { border-top: 0; padding-top: 0; }
}
.dl-compact { grid-template-columns: minmax(0, 1fr) !important; }
.dl-compact dt { margin-top: var(--sp-3) !important; padding: 0 !important; border: 0 !important; font-size: var(--fs-xs) !important; }
.dl-compact dt:first-of-type { margin-top: 0 !important; }
.dl-compact dd { padding: 0 !important; border: 0 !important; margin-top: 2px !important; }

/* ================================================================ dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--sp-4); min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); box-shadow: var(--sh-1); }
.kpi-top { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-2); }
.kpi-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--tint); color: var(--blue); flex: none; }
.kpi-ic .ic { width: 18px; height: 18px; }
.kpi-label { font-size: var(--fs-sm); font-weight: 600; color: var(--body); line-height: 1.3; }
.kpi-value { font-family: var(--font-h); font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: var(--fs-xs); color: var(--muted); }
.kpi-warn .kpi-ic { background: var(--amber-bg); color: var(--amber); }
.kpi-warn .kpi-sub { color: var(--amber); font-weight: 600; }
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-5); } .kpi { padding: var(--sp-5) var(--sp-6); } .kpi-value { font-size: 34px; } }

.stat-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: calc(var(--page-gap) * -0.5); }
.stat { padding: var(--sp-4); min-width: 0; border-top: 1px solid var(--hair); }
.stat:nth-child(-n + 2) { border-top: 0; }
.stat:nth-child(odd) { border-right: 1px solid var(--hair); }
.stat-label { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.stat-value { font-family: var(--font-h); font-weight: 700; font-size: var(--fs-xl); color: var(--ink); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: var(--fs-xs); color: var(--muted); }
@media (min-width: 900px) {
  .stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat { padding: var(--sp-4) var(--sp-6); border-top: 0; border-right: 1px solid var(--hair); }
  .stat:last-child { border-right: 0; }
}

.dash-grid { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-span { grid-column: span 2; } }
@media (min-width: 1280px) { .dash-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-6); } }

.counter-list { display: flex; flex-direction: column; }
.counter-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--sp-2) var(--sp-4); padding: var(--sp-4) var(--pad); border-top: 1px solid var(--hair); align-items: center; }
.counter-row:first-child { border-top: 0; }
.cr-main { min-width: 0; }
.cr-name { font-weight: 600; color: var(--ink); }
.cr-main .muted { font-size: var(--fs-sm); }
.cr-cur { display: flex; align-items: center; gap: var(--sp-2); justify-self: end; flex-wrap: wrap; justify-content: flex-end; }
.cr-num { font-family: var(--font-h); font-weight: 700; font-size: var(--fs-lg); color: var(--ink); font-variant-numeric: tabular-nums; }
.cr-cur .muted { font-size: var(--fs-sm); }
.cr-stats { grid-column: 1 / -1; display: flex; gap: var(--sp-5); font-size: var(--fs-sm); color: var(--muted); }
.cr-stats strong { color: var(--ink); }
.counter-row.is-closed .cr-name, .counter-row.is-closed .cr-stats { opacity: 0.65; }
@media (min-width: 600px) { .counter-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; } .cr-stats { grid-column: auto; justify-content: flex-end; } .cr-cur { justify-self: start; justify-content: flex-start; } }

.hbars { display: flex; flex-direction: column; gap: var(--sp-4); }
.hb-label { display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--ink); margin-bottom: 6px; }
.hb-label .muted { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hb-track { height: 8px; background: var(--tint); border-radius: 999px; overflow: hidden; }
.hb-fill { height: 100%; background: var(--blue); border-radius: 999px; }
.vbars { display: flex; align-items: flex-end; gap: var(--sp-2); height: 184px; padding-top: var(--sp-5); }
.vb { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 6px; }
.vb-bar { width: 100%; max-width: 36px; background: var(--tint-2); border-radius: 6px 6px 2px 2px; transition: background 0.15s; }
.vb:hover .vb-bar { background: var(--blue-soft); }
.vb-val { font-size: 11.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.vb-x { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.vb.is-today .vb-bar { background: var(--blue); }
.vb.is-today .vb-x { color: var(--blue); font-weight: 600; }
.activity li { display: flex; gap: var(--sp-3); padding: var(--sp-3) var(--pad); border-top: 1px solid var(--hair); font-size: var(--fs-sm); }
.activity li:first-child { border-top: 0; }
.activity time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; width: 44px; }

/* ================================================================ portal */
.portal-grid { display: grid; gap: var(--sp-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .portal-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
.portal-aside { display: flex; flex-direction: column; gap: var(--sp-5); }
@media (min-width: 1100px) { .portal-aside { position: sticky; top: 84px; } }
@media (max-width: 1099px) { .aside-sel { display: none; } }
@media (min-width: 1100px) { .req-inline { display: none !important; } }
.portal-flow > .panel-body { display: flex; flex-direction: column; gap: var(--sp-6); padding: var(--sp-5); }
@media (min-width: 768px) { .portal-flow > .panel-body { padding: var(--sp-7) var(--sp-8) var(--sp-8); } }
.flow-body { display: flex; flex-direction: column; gap: var(--sp-6); }
.flow-intro { display: flex; flex-direction: column; gap: var(--sp-2); }
.flow-title { font-size: var(--fs-xl); outline: none; }
@media (min-width: 768px) { .flow-title { font-size: 22px; } }
.flow-lead { color: var(--muted); max-width: 64ch; }
.flow-progress { display: flex; flex-direction: column; gap: var(--sp-3); padding-bottom: var(--sp-5); border-bottom: 1px solid var(--hair); }
.step-mobile { font-size: var(--fs-sm); color: var(--muted); }
.step-mobile strong { color: var(--ink); }
.stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.stepper li { display: flex; flex-direction: column; font-size: var(--fs-xs); color: var(--muted); }
.stepper li::before { content: ""; height: 4px; border-radius: 4px; background: var(--hair); }
.stepper .is-done::before, .stepper .is-current::before { background: var(--blue); }
.st-n, .st-l { display: none; }
@media (min-width: 600px) {
  .step-mobile { display: none; }
  .flow-progress { padding-bottom: var(--sp-6); }
  .stepper { gap: var(--sp-3); }
  .stepper li { flex-direction: row; align-items: center; gap: 10px; font-size: var(--fs-sm); }
  .stepper li::before { display: none; }
  .st-n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); font-weight: 700; font-size: 13px; flex: none; color: var(--muted); background: var(--surface); }
  .st-n .ic { width: 15px; height: 15px; }
  .st-l { display: inline; font-weight: 600; line-height: 1.25; }
  .stepper .is-current { color: var(--ink); }
  .is-current .st-n { border-color: var(--blue); background: var(--blue); color: #fff; }
  .is-done .st-n { border-color: var(--blue); color: var(--blue); }
}
.search-box { position: relative; }
.search-box > .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 44px; }
.svc-results { display: flex; flex-direction: column; gap: var(--sp-4); }
.list-meta { font-size: var(--fs-sm); color: var(--muted); }
.cat-grid { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); } }
.cat-tile { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); text-align: left; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; min-width: 0; transition: border-color 0.15s, box-shadow 0.15s; }
.cat-tile:hover { border-color: var(--blue); box-shadow: 4px 4px 0 var(--plate); }
.cat-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r); background: var(--tint); color: var(--blue); flex: none; }
.cat-ic .ic { width: 24px; height: 24px; }
.cat-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cat-name { font-family: var(--font-h); font-weight: 700; color: var(--ink); font-size: var(--fs-md); }
.cat-sub { font-size: var(--fs-sm); color: var(--muted); }
.cat-go { color: var(--faint); }
.cat-tile:hover .cat-go { color: var(--blue); }
.cat-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
.cat-head h3 { font-size: var(--fs-lg); outline: none; }
.back-link { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: var(--sp-1) 0; color: var(--blue); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; min-height: 32px; }
.back-link:hover { text-decoration: underline; }
.svc-grid { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); } }
.svc-card { display: flex; gap: var(--sp-4); align-items: flex-start; text-align: left; padding: var(--sp-4) var(--sp-5); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; min-width: 0; transition: border-color 0.15s, box-shadow 0.15s; }
.svc-card:hover { border-color: var(--blue); box-shadow: 4px 4px 0 var(--plate); }
.svc-card.is-selected { border-color: var(--blue); background: #f8faff; }
.svc-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r); background: var(--tint); color: var(--blue); flex: none; }
.svc-ic .ic { width: 22px; height: 22px; }
.svc-text { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; flex: 1; }
.svc-name { font-family: var(--font-h); font-weight: 700; color: var(--ink); font-size: var(--fs-md); }
.svc-desc { font-size: var(--fs-sm); color: var(--body); line-height: 1.5; }
.svc-meta { font-size: var(--fs-xs); color: var(--muted); margin-top: var(--sp-1); }
.svc-go { color: var(--faint); margin-top: 12px; }
.svc-card:hover .svc-go { color: var(--blue); }

.req-box { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); background: var(--bg); border: 1px solid var(--hair); border-radius: var(--r); padding: var(--sp-4) var(--sp-5); }
@media (min-width: 768px) { .req-box { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.req-box.req-stack { grid-template-columns: minmax(0, 1fr); background: none; border: 0; border-top: 1px solid var(--hair); border-radius: 0; padding: var(--sp-5) 0 0; margin-top: var(--sp-5); gap: var(--sp-5); }
.req-col h3 { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
.req-col h3 .ic { color: var(--blue); }
.req-rules h3 .ic { color: var(--amber); }
.req-col li, .req-rules-inline li, .bullets li { position: relative; padding-left: var(--sp-4); font-size: var(--fs-sm); line-height: 1.5; margin-top: 6px; }
.req-col li:first-child, .req-rules-inline li:first-child { margin-top: 0; }
.req-col li::before, .req-rules-inline li::before, .bullets li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 6px; height: 6px; border-radius: 50%; background: var(--blue-soft); }
.flow-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; border-top: 1px solid var(--hair); padding-top: var(--sp-6); }
.flow-actions .spacer { flex: 1; min-width: 0; }
@media (max-width: 599px) { .flow-actions .btn-primary { flex: 1 1 100%; order: 3; } .flow-actions .spacer { display: none; } }
.label-h { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); font-family: var(--font); margin: 0; }
.flow-body > .label-h { margin-bottom: calc(var(--sp-3) * -1); }
.branch-grid { display: grid; gap: var(--sp-3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .branch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.branch-card { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; min-width: 0; }
.branch-card:hover { border-color: #a2b2c7; }
.branch-card[aria-checked="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: #f8faff; }
.bc-name { font-family: var(--font-h); font-weight: 700; color: var(--ink); }
.bc-addr, .bc-meta span { display: inline-flex; align-items: flex-start; gap: 6px; font-size: var(--fs-xs); color: var(--muted); line-height: 1.4; }
.bc-addr .ic, .bc-meta .ic { margin-top: 1px; }
.bc-meta { display: flex; flex-wrap: wrap; gap: 2px var(--sp-4); }
.day-row { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-1); }
.day { flex: none; width: 76px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px var(--sp-1); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; }
.day:hover:not(:disabled) { border-color: #a2b2c7; }
.day[aria-checked="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.day:disabled { cursor: not-allowed; background: var(--bg); color: var(--faint); }
.d-w { font-size: var(--fs-xs); font-weight: 600; }
.d-n { font-family: var(--font-h); font-weight: 700; font-size: var(--fs-xl); line-height: 1.2; }
.d-s { font-size: 11.5px; }
.day[aria-checked="true"] .d-s { color: var(--blue-soft); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-2); }
.slot { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--sp-2); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; min-height: 58px; }
.slot:hover:not(:disabled) { border-color: var(--blue); }
.slot[aria-checked="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.slot:disabled { cursor: not-allowed; background: var(--bg); color: var(--faint); }
.s-t { font-weight: 600; font-variant-numeric: tabular-nums; }
.s-c { font-size: 11.5px; }
.review { display: flex; flex-direction: column; gap: var(--sp-3); }
.review-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.review-head h3 { font-size: var(--fs-md); }
.dl-summary { background: var(--bg); border-radius: var(--r); padding: var(--sp-4) var(--sp-5); }
.my-tickets a { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--pad); border-top: 1px solid var(--hair); text-decoration: none; color: inherit; }
.my-tickets li:first-child a { border-top: 0; }
.my-tickets a:hover { background: #fafbfd; }
.mt-num { font-family: var(--font-h); font-weight: 700; color: var(--ink); width: 56px; flex: none; }
.mt-info { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: var(--fs-sm); }
.how { display: flex; flex-direction: column; gap: var(--sp-4); }
.how li { display: flex; gap: var(--sp-3); align-items: flex-start; font-size: var(--fs-sm); }
.how li > span:last-child { display: flex; flex-direction: column; }
.how strong { color: var(--ink); }
.how-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--tint); color: var(--blue); flex: none; }

/* ================================================================ ticket */
.ticket-layout { display: grid; gap: var(--sp-6); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 700px) and (max-width: 1199px) { .ticket-layout { max-width: 640px; } }
@media (min-width: 1200px) { .ticket-layout { grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: var(--sp-8); } }
.ticket-side { display: flex; flex-direction: column; gap: var(--sp-5); }
.ticket-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--sp-6); box-shadow: 6px 6px 0 var(--plate); display: flex; flex-direction: column; gap: var(--sp-6); }
.tc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); padding-bottom: var(--sp-5); border-bottom: 1px dashed var(--line); }
.tc-head .muted { font-size: var(--fs-sm); }
.tc-bank { font-family: var(--font-h); font-weight: 700; color: var(--ink); }
.tc-main { display: flex; flex-direction: column; gap: var(--sp-5); align-items: center; text-align: center; }
@media (min-width: 480px) { .tc-main { flex-direction: row; justify-content: space-between; text-align: left; } }
.tc-num { display: flex; flex-direction: column; gap: var(--sp-1); }
.num-xl { font-family: var(--font-h); font-weight: 700; font-size: 52px; line-height: 1.05; color: var(--navy); font-variant-numeric: tabular-nums; }
.tc-svc { font-weight: 600; color: var(--ink); }
.tc-qr { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.qr { background: #fff; padding: 6px; border: 1px solid var(--hair); border-radius: 10px; line-height: 0; }
.qr svg { width: 168px; height: auto; display: block; }
.tc-ref { font-family: var(--font-h); font-weight: 600; font-size: 14px; letter-spacing: 1px; color: var(--ink); }
.dl-inline { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; background: var(--bg); border-radius: var(--r); padding: var(--sp-3) var(--sp-4); gap: 2px var(--sp-3) !important; }
.dl-inline dt { grid-row: 1; border: 0 !important; padding: 0 !important; margin: 0 !important; font-size: var(--fs-xs) !important; }
.dl-inline dd { grid-row: 2; border: 0 !important; padding: 0 !important; margin: 0 !important; }
.tc-docs .label-h { margin-bottom: var(--sp-2); }
.tc-docs li { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: var(--fs-sm); margin-top: 6px; }
.tc-docs .ic { color: var(--green); margin-top: 2px; }
.next-steps { display: flex; flex-direction: column; gap: var(--sp-4); }
.next-steps li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.ns-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tint); color: var(--blue); font-weight: 700; font-size: 13px; flex: none; }
.ns-text { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-sm); }
.ns-text strong { color: var(--ink); font-size: var(--fs-base); }
.timeline li { display: flex; gap: var(--sp-3); padding: 10px 0; border-top: 1px solid var(--hair); font-size: var(--fs-sm); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline li:last-child { padding-bottom: 0; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; width: 44px; flex: none; }

/* ================================================================ counter console */
.seg { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-1); }
.seg-btn { flex: 1 0 auto; min-width: 150px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: var(--sp-3) var(--sp-4); border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; }
.seg-btn:hover { border-color: #a2b2c7; }
.seg-btn[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.seg-name { font-weight: 600; font-size: var(--fs-base); }
.seg-sub { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.seg-btn[aria-selected="true"] .seg-sub { color: var(--blue-soft); }
.counter-grid { display: grid; gap: var(--sp-6); grid-template-columns: minmax(0, 1fr); align-items: start; margin-top: calc(var(--page-gap) * -0.4); }
.cg-main, .cg-side { display: flex; flex-direction: column; gap: var(--sp-6); min-width: 0; }
@media (min-width: 1024px) { .counter-grid { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); } }
.cur { display: flex; flex-direction: column; gap: var(--sp-2); }
.cur-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.cur-timer { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.num-xxl { font-family: var(--font-h); font-weight: 700; font-size: 60px; line-height: 1.05; color: var(--navy); margin-top: var(--sp-3); font-variant-numeric: tabular-nums; }
@media (min-width: 768px) { .num-xxl { font-size: 72px; } }
.cur-svc { font-family: var(--font-h); font-weight: 700; color: var(--ink); font-size: var(--fs-lg); }
.cur > .muted { font-size: var(--fs-sm); }
.cur .btn-row { margin-top: var(--sp-5); padding-top: var(--sp-5); border-top: 1px solid var(--hair); }
@media (max-width: 599px) { .cur .btn-row .btn-lg { flex: 1 1 100%; } }
.cur-idle { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-2) 0; }
.cur-idle .btn { margin-top: var(--sp-4); }
.idle-ic { width: 32px; height: 32px; color: var(--blue); margin-bottom: var(--sp-1); }
.dl-handoff { margin-bottom: var(--sp-5); }
.checklist { display: flex; flex-direction: column; gap: var(--sp-3); margin: var(--sp-3) 0 var(--sp-5); }
.req-rules-inline { background: var(--amber-bg); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); }
.req-rules-inline .label-h { margin: 0 0 var(--sp-2); color: var(--amber); }
.queue-list li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--pad); border-top: 1px solid var(--hair); }
.queue-list li:first-child { border-top: 0; }
.q-num { font-family: var(--font-h); font-weight: 700; color: var(--ink); font-size: var(--fs-md); min-width: 56px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; font-size: var(--fs-sm); }
.q-info .chip { margin-right: 6px; }
.lookup { display: flex; flex-direction: column; gap: var(--sp-2); }
.lookup > label { font-weight: 600; font-size: var(--fs-sm); color: var(--ink); }
.lookup-out { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-4); }
.lookup-out:empty { display: none; }
.lookup-card { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--r); flex-wrap: wrap; }

/* ================================================================ queue list */
.toolbar { display: flex; flex-direction: column; gap: var(--sp-4); }
.filters { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters .grow { grid-column: 1 / -1; }
@media (min-width: 900px) { .filters { grid-template-columns: 210px 230px minmax(0, 1fr); gap: var(--sp-4); } .filters .grow { grid-column: auto; } }
.field-inline { gap: 6px; }
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); padding: var(--sp-3) var(--sp-4); background: #f9fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th:first-child { border-top-left-radius: var(--r-lg); padding-left: var(--sp-6); }
.table th:last-child { border-top-right-radius: var(--r-lg); }
.table td { padding: 14px var(--sp-4); border-bottom: 1px solid var(--hair); vertical-align: middle; color: var(--ink); }
.table td:first-child { padding-left: var(--sp-6); }
.table td:last-child { padding-right: var(--sp-5); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table .st-dipanggil { background: #f6f9ff; }
.td-act { text-align: right; }
.table td[data-label="Loket"], .table td[data-label="Kanal"] { white-space: nowrap; }
@media (max-width: 1199px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tbody { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-3) var(--sp-4); padding: var(--sp-5); border-bottom: 1px solid var(--hair); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td, .table td:first-child, .table td:last-child { padding: 0; border: 0; font-size: var(--fs-sm); min-width: 0; }
  .table td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
  .table td:first-child::before, .table td[data-label="Status"]::before { display: none; }
  .table td[data-label="Status"] { grid-column: 2; grid-row: 1; justify-self: end; align-self: center; }
  .table td:first-child .q-num { font-size: var(--fs-xl); }
  .td-act { grid-column: 1 / -1; text-align: left; margin-top: var(--sp-1); }
  .td-act .btn { width: 100%; }
}
@media (min-width: 600px) and (max-width: 1199px) { .table tr { border-right: 1px solid var(--hair); } }

/* ================================================================ settings */
.counter-settings { display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .counter-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); } }
.cs-card { display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-5); border: 1px solid var(--line); border-radius: var(--r); }
.cs-card .btn, .form-grid .field > .btn { align-self: flex-start; }
.cs-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.cs-head h3 { font-size: var(--fs-md); }
.svc-toggle li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--hair); }
.svc-toggle li:first-child { border-top: 0; }
.st-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--tint); color: var(--blue); flex: none; }
.st-text { display: flex; flex-direction: column; flex: 1; min-width: 0; color: var(--ink); font-weight: 500; }
.panel-body > .muted.small:first-child { margin-bottom: var(--sp-3); }
.row-between { display: flex; flex-direction: column; gap: var(--sp-4); }
.row-between > div:first-child { display: flex; flex-direction: column; gap: var(--sp-1); }
@media (min-width: 768px) { .row-between { flex-direction: row; align-items: center; justify-content: space-between; gap: var(--sp-6); } }
.bullets { display: flex; flex-direction: column; gap: var(--sp-1); }
section[aria-labelledby="s5"] .panel-body > div { display: flex; flex-direction: column; gap: var(--sp-3); }
section[aria-labelledby="s5"] .btn-row { margin-top: var(--sp-2); }

/* ================================================================ dialogs + toasts */
.dialog { border: 0; padding: 0; border-radius: var(--r-lg); width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); box-shadow: var(--sh-pop); color: var(--body); overflow: hidden; }
.dialog[open] { display: flex; flex-direction: column; animation: dlgIn 0.16s ease-out; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(6px); } }
.dialog-sm { width: min(420px, calc(100vw - 24px)); }
.dialog-lg { width: min(880px, calc(100vw - 24px)); }
.dialog::backdrop { background: rgba(0, 16, 40, 0.5); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-6); border-bottom: 1px solid var(--hair); }
.dialog-head h2 { font-size: var(--fs-lg); }
.dialog-body { padding: var(--sp-6); overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-5); }
.dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-6) var(--sp-5); border-top: 1px solid var(--hair); }
@media (max-width: 479px) { .dialog-body { padding: var(--sp-5); } .dialog-head { padding-left: var(--sp-5); } .dialog-foot { padding: var(--sp-4) var(--sp-5); } .dialog-foot .btn { flex: 1 1 auto; } }
.detail-top { display: flex; gap: var(--sp-2); align-items: center; }
.detail-grid { display: grid; gap: var(--sp-6); grid-template-columns: minmax(0, 1fr); }
.detail-grid h3 { font-size: var(--fs-sm); margin: 0 0 var(--sp-3); color: var(--muted); font-family: var(--font); font-weight: 600; }
.detail-grid h3 + .dl, .detail-grid h3 + .timeline, .detail-grid h3 + p { margin-bottom: var(--sp-6); }
@media (min-width: 768px) { .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-8); } }
.dialog-body > .btn-row { padding-top: var(--sp-5); border-top: 1px solid var(--hair); }
.issued { text-align: center; display: flex; flex-direction: column; gap: var(--sp-2); align-items: center; padding: var(--sp-2) 0; }
.toasts { position: fixed; z-index: 200; left: var(--sp-3); right: var(--sp-3); bottom: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); align-items: center; pointer-events: none; }
@media (min-width: 600px) { .toasts { left: auto; right: var(--sp-6); bottom: var(--sp-6); align-items: flex-end; } }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: var(--sp-3); width: 100%; max-width: 420px; padding: var(--sp-3) var(--sp-2) var(--sp-3) var(--sp-4); border-radius: var(--r); background: var(--navy); color: #fff; box-shadow: var(--sh-pop); font-size: 14px; animation: toastIn 0.2s ease-out; }
.toast > .ic { width: 20px; height: 20px; margin-top: 1px; color: var(--blue-soft); }
.toast p { flex: 1; padding-top: 1px; }
.toast.tone-success > .ic { color: #8fe0b4; }
.toast.tone-error { background: #5c1418; }
.toast.tone-error > .ic { color: #ffb4b9; }
.toast-close { border: 0; background: transparent; color: #fff; width: 32px; height: 32px; margin: -4px 0; border-radius: var(--r-sm); cursor: pointer; display: grid; place-items: center; flex: none; }
.toast-close:hover { background: rgba(255, 255, 255, 0.12); }
.toast.out { opacity: 0; transform: translateY(6px); transition: 0.2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ================================================================ display board (TV screen) */
body.is-board .main { padding: 0; }
body.is-board .page { max-width: none; }
.board { min-height: calc(100vh - 60px); background: var(--navy); color: #fff; display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--sp-5) var(--gutter); }
.board:fullscreen { min-height: 100vh; padding: var(--sp-10); }
.board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.board-bank { font-family: var(--font-h); font-weight: 700; font-size: var(--fs-lg); }
.board-branch { color: var(--blue-soft); }
.board-tools { display: flex; gap: var(--sp-2); order: 3; width: 100%; }
.board-btn { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 0 var(--sp-4); border-radius: 10px; border: 1px solid #2b5592; background: var(--navy-2); color: #fff; font-weight: 600; font-size: var(--fs-sm); cursor: pointer; }
.board-btn:hover { background: var(--navy-3); }
.board-btn[aria-pressed="true"] { border-color: var(--blue-soft); }
.board-btn:focus-visible, .board :focus-visible { outline-color: #fff; }
.board-clock { font-family: var(--font-h); font-weight: 700; font-size: 28px; font-variant-numeric: tabular-nums; }
.board-main { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); }
.board-now { container-type: inline-size; background: #fff; color: var(--navy); border-radius: var(--r-xl); padding: var(--sp-6); display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: var(--sp-1); min-height: 240px; }
.bn-label { font-weight: 600; color: var(--muted); }
.bn-num { font-family: var(--font-h); font-weight: 700; font-size: 64px; font-size: clamp(56px, 27cqw, 200px); line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bn-num.is-calling { animation: blink 1.2s ease-in-out 4; }
@keyframes blink { 50% { color: var(--blue); } }
.bn-counter { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-h); font-weight: 700; font-size: clamp(22px, 4vw, 40px); color: var(--blue); }
.bn-svc { color: var(--body); }
.bn-empty { font-size: 22px; color: var(--muted); }
.board-counters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.bd { background: var(--navy-2); border: 1px solid #234a82; border-radius: var(--r-lg); padding: var(--sp-4); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bd.is-calling { background: var(--blue); border-color: var(--blue-soft); }
.bd.is-closed { opacity: 0.6; }
.bd-name { color: var(--blue-soft); font-weight: 600; font-size: 14px; }
.bd.is-calling .bd-name { color: #fff; }
.bd-num { font-family: var(--font-h); font-weight: 700; font-size: clamp(28px, 4vw, 48px); line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-st { font-size: 13px; color: #c9d8f2; min-height: 1.2em; }
.board-next { background: var(--navy-2); border-radius: var(--r-lg); padding: var(--sp-5); }
.bx-title { font-family: var(--font-h); font-weight: 700; font-size: var(--fs-md); margin-bottom: var(--sp-4); }
.bx-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.bx { border-top: 2px solid #2b5592; padding-top: 10px; min-width: 0; }
.bx-cat { display: flex; justify-content: space-between; gap: 6px; color: var(--blue-soft); font-size: 13px; font-weight: 600; }
.bx-cat span { color: #fff; }
.bx-nums { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); font-family: var(--font-h); font-weight: 700; font-size: var(--fs-xl); margin-top: var(--sp-1); font-variant-numeric: tabular-nums; }
.bx-none { font-family: var(--font); font-weight: 400; font-size: var(--fs-sm); color: #8ea3c2; }
.board-foot { margin-top: auto; text-align: center; font-size: 13px; color: #a9badb; }
@media (min-width: 768px) {
  .board { padding: var(--sp-6) var(--gutter); }
  .board-tools { order: 0; width: auto; }
  .board-clock { font-size: 36px; }
  .board-counters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .board-main { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .board-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: stretch; }
  .board-now { min-height: 360px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media print { .sidebar, .topbar, .toasts, .ticket-side, .page-actions { display: none !important; } .shell { margin: 0 !important; } body { background: #fff; } }
