/* XLAPPY Smart Queue v1.1 — design system (approved 2026-11-24). No external fonts or CDNs (works offline).
   Colour pairs are WCAG 2.2 AA; customer brand colours are contrast-guarded by /brand.css. */

/* IBM Plex Sans Arabic (SIL OFL 1.1, see /fonts/ibm-plex-sans-arabic/OFL.txt), bundled locally. */
@font-face { font-family: "XQ Plex"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "XQ Plex"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "XQ Plex"; font-style: normal; font-weight: 700 900; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "XQ Plex"; font-style: normal; font-weight: 400 500; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "XQ Plex"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "XQ Plex"; font-style: normal; font-weight: 700 900; font-display: swap; src: url("../fonts/ibm-plex-sans-arabic/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* Overridden by /brand.css (customer colours, contrast-guarded) */
  --brand-primary: #0B2545;
  --brand-accent: #08756D;        /* text/button-safe accent (≥4.5:1 with white) */
  --brand-accent-bright: #13A89E; /* decorative only */
  --brand-accent-dark: #5FD3C6;   /* accent for dark surfaces */

  --navy-950: #06142A; --navy-900: #071A33; --navy-800: #0B2545; --navy-700: #13315C;
  --teal-300: #5FD3C6;

  --bg: #F5F7FB; --surface: #FFFFFF; --surface-2: #EEF2F8; --border: #DFE5EE; --border-strong: #C9D3E1;
  --text: #0C1B30; --text-2: #33445C; --text-muted: #56657A;
  --primary: var(--brand-primary); --on-primary: #FFFFFF;
  --accent: var(--brand-accent); --on-accent: #FFFFFF; --accent-soft: color-mix(in srgb, var(--brand-accent) 13%, #FFFFFF);
  --accent-bright: var(--brand-accent-bright);

  --waiting: #3B5BDB; --waiting-soft: #E6ECFF;
  --called: var(--accent); --called-soft: var(--accent-soft);
  --serving: #8A5A00; --serving-soft: #FFF4D6;
  --done: #13784A; --done-soft: #E2F4EA;
  --danger: #B4232C; --danger-soft: #FCE8E9;
  --amber-500: #E0A100; --red-500: var(--danger); --green-500: var(--done);

  --focus: #2F6FED;
  --shadow: 0 1px 2px rgba(12,27,48,.06), 0 1px 1px rgba(12,27,48,.04);
  --shadow-2: 0 2px 4px rgba(12,27,48,.05), 0 8px 24px rgba(12,27,48,.08);
  --shadow-3: 0 12px 40px rgba(12,27,48,.18);
  --radius: 14px; --radius-sm: 10px; --radius-lg: 20px; --radius-xl: 28px;
  --font: "XQ Plex", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Noto Sans", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --font-display: "XQ Plex", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Noto Sans", "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  --mono: var(--font-display);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #06142A; --surface: #0E1E36; --surface-2: #142844; --border: #1F3556; --border-strong: #2A4670;
    --text: #EAF1FA; --text-2: #C5D2E3; --text-muted: #A3B3C8; --primary: #23406B;
    --accent: var(--brand-accent-dark); --on-accent: #06142A; --accent-soft: color-mix(in srgb, var(--brand-accent-dark) 16%, #0E1E36);
    --waiting: #8FA8FF; --waiting-soft: #1A2A55; --serving: #F2C14E; --serving-soft: #3A2E10;
    --done: #6FD39B; --done-soft: #12341F; --danger: #FF8A8F; --danger-soft: #3D1418;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 24px rgba(0,0,0,.35); --shadow-3: 0 12px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #06142A; --surface: #0E1E36; --surface-2: #142844; --border: #1F3556; --border-strong: #2A4670;
  --text: #EAF1FA; --text-2: #C5D2E3; --text-muted: #A3B3C8; --primary: #23406B;
  --accent: var(--brand-accent-dark); --on-accent: #06142A; --accent-soft: color-mix(in srgb, var(--brand-accent-dark) 16%, #0E1E36);
  --waiting: #8FA8FF; --waiting-soft: #1A2A55; --serving: #F2C14E; --serving-soft: #3A2E10;
  --done: #6FD39B; --done-soft: #12341F; --danger: #FF8A8F; --danger-soft: #3D1418;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-2: 0 8px 24px rgba(0,0,0,.35); --shadow-3: 0 12px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
html[lang="ar"] body { font-size: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.icon { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.hidden { display: none !important; }
.mt { margin-block-start: 1rem; } .mb { margin-block-end: 1rem; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row > select.grow { width: auto; }

/* Ticket codes: the signature element. Always LTR, tabular, service letter in the accent colour. */
.code, .mono, .ticket-code { font-family: var(--font-display); font-weight: 800; letter-spacing: .02em; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.code, .ticket-code { display: inline-block; }
.code::first-letter, .ticket-code::first-letter { color: var(--accent); }
.code.plain::first-letter, td.mono::first-letter { color: inherit; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 44px; padding: .5em 1em; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, border-color .15s, filter .15s; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.15); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-accent:hover { background: var(--accent); filter: brightness(1.08); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-lg { min-height: 56px; font-size: 1.05rem; padding: .7em 1.3em; border-radius: var(--radius); }
.btn-xl { min-height: 76px; font-size: 1.3rem; border-radius: var(--radius); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: .25em .75em; font-size: .85rem; }
.btn-tile { flex-direction: column; gap: .35rem; min-height: 76px; font-size: .9rem; border-radius: 16px; text-align: center; white-space: normal; }

label { display: block; font-weight: 650; margin-block-end: .35em; font-size: .9rem; }
.field { margin-block-end: 1rem; }
.hint { font-size: .8rem; color: var(--text-muted); margin-block-start: .25em; }
input[type=text], input[type=password], input[type=number], input[type=url], input[type=date], input[type=time], input[type=file], select, textarea {
  width: 100%; min-height: 46px; padding: .55em .8em; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 12px;
}
input[type=color] { width: 56px; height: 46px; padding: 3px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.check { display: flex; gap: .55em; align-items: center; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.error { color: var(--danger); font-size: .85rem; margin-block-start: .25em; }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: .75rem 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.stack > * + * { margin-block-start: 1.25rem; }

/* ---------- Cards, alerts, chips, tables ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.4rem; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-block-end: 1rem; }
.card-title h2 { margin: 0; }
.alert { padding: .8rem 1rem; border-radius: 12px; border: 1px solid; margin-block-end: 1rem; }
.alert-ok { background: var(--done-soft); border-color: color-mix(in srgb, var(--done) 35%, transparent); }
.alert-err { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.alert-warn { background: var(--serving-soft); border-color: color-mix(in srgb, var(--serving) 35%, transparent); }
.badge, .chip { display: inline-flex; align-items: center; gap: .35em; padding: .12em .6em; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--surface-2); color: var(--text-muted); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-accent, .st-called { background: var(--accent-soft); color: var(--accent); }
.badge-warn, .st-serving { background: var(--serving-soft); color: var(--serving); }
.badge-red, .st-skipped, .st-cancelled { background: var(--danger-soft); color: var(--danger); }
.badge-green, .st-completed { background: var(--done-soft); color: var(--done); }
.st-waiting { background: var(--waiting-soft); color: var(--waiting); }
.st-expired { background: var(--surface-2); color: var(--text-muted); }
.prefix-badge { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; background: var(--primary); color: #fff; font-weight: 800; font-size: .9rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: .7rem .7rem; border-block-end: 1px solid var(--border); vertical-align: middle; }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 700; }
html[lang="ar"] th { text-transform: none; letter-spacing: 0; font-size: .85rem; }
tbody tr:hover { background: var(--surface-2); }
.num { text-align: end; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

/* ---------- KPI tiles ---------- */
.kpi { display: flex; flex-direction: column; gap: .15rem; }
.kpi .label { font-size: .82rem; color: var(--text-muted); font-weight: 600; }
.kpi .value { font: 800 2rem/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .8rem; color: var(--text-muted); }

/* ---------- Staff shell ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy-800); color: #C9D8EC; padding: 1rem .75rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sidebar .brand { display: flex; align-items: center; gap: .65rem; padding: .3rem .6rem 1.1rem; color: #fff; font-weight: 800; line-height: 1.25; }
.sidebar .brand img { width: 38px; height: 38px; border-radius: 10px; object-fit: contain; background: #fff; padding: 3px; }
.sidebar .brand small { display: block; font-weight: 500; color: #93AACB; font-size: .72rem; }
.nav-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .8rem; border-radius: 10px; color: #C9D8EC; font-weight: 600; font-size: .93rem; }
.nav-link:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav-link.active { background: rgba(95,211,198,.16); color: #fff; box-shadow: inset 3px 0 0 var(--teal-300); }
[dir="rtl"] .nav-link.active { box-shadow: inset -3px 0 0 var(--teal-300); }
.nav-sep { margin: .9rem .8rem .3rem; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #8EA6C7; }
html[lang="ar"] .nav-sep { letter-spacing: 0; font-size: .78rem; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; padding: .6rem 1.5rem; background: var(--surface); border-block-end: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 1.15rem; margin: 0; }
.topbar .row { flex-wrap: nowrap; }
.content { padding: 1.5rem; max-width: 1440px; width: 100%; }
.menu-btn { display: none; }
.user-chip { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; font-size: .85rem; }
.inline-form { display: inline; margin: 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.seg a { padding: .35rem .8rem; border-radius: 8px; font-weight: 600; font-size: .85rem; color: var(--text-muted); }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); text-decoration: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 272px; z-index: 30; transform: translateX(-105%); transition: transform .2s; }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  .sidebar.open { transform: none !important; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .menu-btn { display: inline-flex; }
  .content { padding: 1rem; }
  .topbar { padding: .5rem .75rem; gap: .5rem; min-height: 56px; }
  .topbar h1 { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .locale-btn .label, .user-chip .name { display: none; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 1.6rem; }
}

/* ---------- Public pages ---------- */
.public { min-height: 100vh; display: flex; flex-direction: column; }
.public-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.5rem; background: var(--navy-800); color: #fff; }
.public-header .brand { display: flex; align-items: center; gap: .75rem; font-weight: 800; font-size: 1.1rem; color: #fff; min-width: 0; }
.public-header .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.public-header .brand img { width: 42px; height: 42px; border-radius: 11px; background: #fff; object-fit: contain; padding: 3px; flex: none; }
.public-header .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.public-main { flex: 1; padding: 1.5rem; width: 100%; max-width: 1100px; margin-inline: auto; }
@media (max-width: 600px) {
  .public-header { padding: .6rem 1rem; }
  .public-header .brand { font-size: 1rem; gap: .5rem; }
  .public-header .brand img { width: 34px; height: 34px; }
  .public-header .row { flex-wrap: nowrap; gap: .35rem; }
  .public-header .locale-btn .label { display: none; }
  .public-main { padding: 1rem; }
}
.public-footer { text-align: center; padding: 1rem; font-size: .8rem; color: var(--text-muted); }
.privacy-note { text-align: center; font-size: .85rem; color: var(--text-muted); margin-block-start: 1rem; }

.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); }
.auth-art { background: var(--navy-800); color: #fff; padding: 3rem; display: flex; flex-direction: column; overflow: hidden; }
.auth-art .big { font: 800 clamp(5rem, 11vw, 9rem)/1 var(--font-display); color: rgba(95,211,198,.18); margin-top: auto; direction: ltr; text-align: start; }
.auth-art p { color: #C9D8EC; font-size: 1.05rem; max-width: 34ch; }
.auth-pane { display: grid; place-items: center; padding: 2rem 1.5rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card.card { box-shadow: none; border: 0; background: transparent; padding: 0; }
.auth-brand { display: flex; align-items: center; gap: .75rem; margin-block-end: 1.5rem; }
.auth-brand img { width: 48px; height: 48px; border-radius: 12px; background: #fff; object-fit: contain; border: 1px solid var(--border); padding: 3px; }
.auth-art .auth-brand { color: #fff; } .auth-art .auth-brand .small { color: #93AACB; }
.auth-brand-mobile { visibility: hidden; margin: 0; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } .auth-brand-mobile { visibility: visible; } }

.service-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.service-btn { display: flex; align-items: center; gap: 1rem; text-align: start; padding: 1rem 1.15rem; min-height: 84px; width: 100%; border-radius: 18px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow); transition: border-color .15s, transform .1s; }
.service-btn:hover, .service-btn:focus-visible { border-color: var(--accent); transform: translateY(-1px); }
.service-btn .prefix { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--primary); color: #fff; font-weight: 800; font-size: 1.35rem; }
.service-btn .txt { display: flex; flex-direction: column; min-width: 0; }
.service-btn .name { font-size: 1.2rem; font-weight: 800; }
.service-btn .meta { color: var(--text-muted); font-size: .9rem; }
.service-btn .wait { margin-inline-start: auto; text-align: end; line-height: 1.15; }
.service-btn .wait b { font-size: 1.35rem; font-variant-numeric: tabular-nums; display: block; }
.service-btn .wait small { color: var(--text-muted); font-size: .78rem; }

/* Mobile ticket */
.ticket-wrap { max-width: 440px; margin: 0 auto; }
.ticket-card { background: var(--surface); border-radius: var(--radius-xl); box-shadow: var(--shadow-2); overflow: hidden; text-align: start; }
.ticket-band { background: var(--navy-800); color: #fff; padding: 1.1rem 1.4rem 1.4rem; }
.ticket-band .lbl { color: #C9D8EC; }
.ticket-band .ticket-code { color: #fff; }
.ticket-band .ticket-code::first-letter { color: var(--teal-300); }
.ticket-card.is-called { outline: 3px solid var(--accent-bright); }
.ticket-card.is-called .ticket-band { background: linear-gradient(160deg, #0F3A3B, var(--navy-800)); }
.ticket-code { font-size: clamp(3.6rem, 19vw, 5rem); line-height: 1; margin: .35rem 0; color: var(--primary); }
.notch { position: relative; height: 0; border-top: 2px dashed var(--border-strong); margin: 0 1.4rem; }
.notch::before, .notch::after { content: ""; position: absolute; top: -14px; width: 28px; height: 28px; border-radius: 50%; background: var(--bg); }
.notch::before { inset-inline-start: -2.3rem; } .notch::after { inset-inline-end: -2.3rem; }
.ticket-body { padding: 1.25rem 1.4rem 1.4rem; }
.stat-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.stat-pair > div { background: var(--surface-2); border-radius: 14px; padding: .75rem .9rem; }
.stat-pair .v { font: 800 1.7rem/1.15 var(--font-display); font-variant-numeric: tabular-nums; }
.go-to { text-align: center; font: 800 2.2rem/1.2 var(--font-display); }
.ticket-status { font-weight: 700; }
.share-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: 1rem; }
.share-row .btn { flex-direction: column; min-height: 72px; gap: .35rem; font-size: .82rem; border-radius: 16px; }
.share-row .icon { width: 26px; height: 26px; }
.share-row .wa { color: #0F7A3E; }
:root[data-theme="dark"] .share-row .wa { color: #6FD39B; }
.qr-box { display: inline-block; padding: .75rem; background: #fff; border-radius: 16px; border: 1px solid var(--border); }
.qr-box svg, .qr-box img { width: 180px; height: 180px; display: block; }
@keyframes pulse { 50% { opacity: .55; } }

/* Kiosk */
.kiosk-page .public-main { max-width: none; padding: 0; display: flex; }
.kiosk { flex: 1; display: grid; grid-template-columns: 1.05fr 1fr; min-height: calc(100vh - 66px); }
.k-hero { background: radial-gradient(900px 520px at 15% 0%, var(--navy-700), var(--navy-800)); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: flex-end; gap: .5rem; }
.k-hero h1 { font-size: clamp(2rem, 3.6vw, 3rem); color: #fff; }
.k-hero p { color: #C9D8EC; font-size: 1.15rem; max-width: 32ch; }
.k-hero .ticket-code { color: #fff; font-size: clamp(5rem, 13vw, 10rem); }
.k-hero .ticket-code::first-letter { color: var(--teal-300); }
.k-lang { display: flex; gap: .75rem; margin-top: 1.25rem; }
.k-lang .btn { min-height: 60px; font-size: 1.1rem; border-radius: 16px; padding: 0 1.6rem; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.3); color: #fff; }
.k-lang .btn.on { background: #fff; color: var(--navy-800); }
.k-pick { padding: 2.5rem; display: flex; flex-direction: column; justify-content: center; gap: .9rem; }
.k-pick .service-grid { grid-template-columns: 1fr; }
.k-center { justify-content: center; }
.k-label { color: var(--teal-300); font-weight: 700; font-size: 1.3rem; }
.k-done { align-items: center; text-align: center; }
.k-done h2 { margin-top: .5rem; }
.k-actions { width: min(440px, 100%); flex-wrap: nowrap; }
.btn-ghost.btn-danger { border-color: transparent; }
@media (max-width: 900px) { .kiosk { grid-template-columns: 1fr; min-height: 0; } .k-hero { padding: 1.5rem; } .k-pick { padding: 1.25rem; } }

/* ---------- Waiting room display (TV) ---------- */
.display { min-height: 100vh; height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: var(--navy-950); color: #EAF1FA; overflow: hidden; }
.display-head { display: flex; align-items: center; justify-content: space-between; padding: 1.3vh 2.5vw; background: var(--navy-800); }
.display-head .brand { display: flex; align-items: center; gap: 1vw; font-size: clamp(1.1rem, 2vw, 2.2rem); font-weight: 800; }
.display-head .brand img { height: clamp(40px, 6vh, 72px); width: auto; border-radius: 14px; background: #fff; padding: 5px; }
.display-clock { font: 700 clamp(1.5rem, 2.6vw, 3rem) var(--font-display); font-variant-numeric: tabular-nums; }
.display-body { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.8vw; padding: 2.2vh 2.5vw; min-height: 0; }
.hero-call { border-radius: 2vw; background: linear-gradient(160deg, #0F3A3B, var(--navy-800) 70%); border: 3px solid var(--teal-300); padding: 3vh 3vw; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; min-height: 0; }
.hero-call .lbl { font-size: clamp(1rem, 1.7vw, 2rem); color: var(--teal-300); font-weight: 700; }
.hero-call .code { font-size: clamp(4rem, 11vw, 14rem); line-height: .95; color: #fff; }
.hero-call .code::first-letter { color: var(--teal-300); }
.hero-call .to { font-size: clamp(1.4rem, 2.6vw, 3.2rem); font-weight: 700; }
.hero-call.empty .code { color: #46628A; }
.hero-call.flash { animation: hero 1s ease-in-out 3; }
@keyframes hero { 50% { box-shadow: 0 0 0 1.2vw rgba(95,211,198,.35); } }
.side-panel { display: flex; flex-direction: column; gap: 1.4vh; min-height: 0; }
.now-serving { display: grid; gap: 1vw; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.serve-tile { background: #0E1E36; border-radius: 1.2vw; padding: 1.2vh 1.2vw; display: flex; flex-direction: column; gap: .2vh; border: 2px solid transparent; }
.serve-tile .counter { font-size: clamp(.9rem, 1.25vw, 1.6rem); color: #A3B3C8; font-weight: 600; }
.serve-tile .code { font-size: clamp(1.8rem, 3.2vw, 4rem); line-height: 1.05; }
.serve-tile .code::first-letter { color: var(--teal-300); }
.serve-tile.empty .code { color: #46628A; }
.serve-tile.empty .code::first-letter { color: inherit; }
.serve-tile.flash { border-color: var(--teal-300); animation: flash 1s ease-in-out 4; }
@keyframes flash { 50% { background: #0F3A3B; } }
.panel { background: #0E1E36; border-radius: 1.2vw; padding: 1.2vh 1.3vw; min-height: 0; overflow: hidden; }
.panel h2 { font-size: clamp(.95rem, 1.3vw, 1.6rem); color: #A3B3C8; margin-block-end: .8vh; }
.recent-list, .wait-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4vh; }
.recent-list li, .wait-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: clamp(1rem, 1.7vw, 2.1rem); padding: .5vh 0; border-block-start: 1px solid #1F3556; }
.recent-list li:first-child { border-block-start: 0; }
.join-panel { display: flex; gap: 1.2vw; align-items: center; background: #fff; color: var(--navy-800); border-radius: 1.2vw; padding: 1.2vh 1.2vw; }
.join-panel img { width: clamp(90px, 9vw, 170px); height: auto; aspect-ratio: 1; }
.join-panel b { font-size: clamp(1.1rem, 1.7vw, 2rem); display: block; }
.join-panel span { font-size: clamp(.9rem, 1.2vw, 1.4rem); }
.display-foot { display: flex; align-items: center; gap: 1.2vw; background: var(--navy-800); color: #C9D8EC; font-size: clamp(.95rem, 1.5vw, 1.8rem); padding: 1vh 2.5vw; white-space: nowrap; overflow: hidden; }
.display-foot .wait-chips { display: flex; gap: .8vw; flex: none; }
.display-foot .wait-chips span { background: #1A2A55; color: #8FA8FF; border-radius: 99px; padding: .15em .8em; font-weight: 700; }
.display-foot .ticker { flex: 1; overflow: hidden; }
.display-foot .ticker span { display: inline-block; padding-inline-start: 100%; animation: marquee 30s linear infinite; }
[dir="rtl"] .display-foot .ticker span { animation-name: marquee-rtl; }
@keyframes marquee { to { transform: translateX(-100%); } }
@keyframes marquee-rtl { to { transform: translateX(100%); } }
.overlay { position: fixed; inset: 0; background: rgba(6,20,42,.94); display: grid; place-items: center; z-index: 50; text-align: center; padding: 2rem; }
.overlay .btn { font-size: 1.4rem; }
.overlay .btn-ghost { color: #C9D8EC; font-size: 1rem; text-decoration: underline; }
.overlay h1, .overlay p { color: #fff; }
.btn-accent .kbd, .btn-primary .kbd { color: inherit; border-color: currentColor; }
.display-tools { position: fixed; inset-block-end: 1rem; inset-inline-end: 1rem; display: flex; gap: .5rem; opacity: 0; transition: opacity .3s; }
.display:hover .display-tools, .display-tools:focus-within { opacity: 1; }
.conn-dot { width: 12px; height: 12px; border-radius: 50%; background: #6FD39B; display: inline-block; }
.conn-dot.off { background: #FF8A8F; }
@media (max-width: 900px) { .display { height: auto; } .display-body { grid-template-columns: 1fr; } }

/* ---------- Desk ---------- */
.desk { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.current { text-align: center; padding: 1.75rem 1.5rem; position: relative; overflow: hidden; }
.current::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); }
.current .code { font-size: clamp(3.2rem, 7vw, 5.8rem); line-height: 1; margin: .4rem 0; color: var(--text); }
.current .service { color: var(--text-muted); font-weight: 600; margin-block: .4rem 1.1rem; }
.desk-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-block-start: .8rem; }
.desk-actions .btn { flex-direction: column; gap: .3rem; min-height: 76px; white-space: normal; text-align: center; line-height: 1.2; }
.queue-list { list-style: none; margin: 0; padding: 0; display: grid; max-height: 460px; overflow-y: auto; }
.queue-list li { display: flex; align-items: center; gap: .6rem; padding: .6rem .2rem; border-block-start: 1px solid var(--border); }
.queue-list li:first-child { border-block-start: 0; }
.queue-list .code { font-size: 1.15rem; min-width: 3.6em; }
.queue-list li > span:first-child { display: flex; align-items: center; gap: .55rem; flex: 1; min-width: 0; flex-wrap: wrap; }
.kbd { font: 600 .7rem/1 var(--font); padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 5px; color: var(--text-muted); }
@media (max-width: 1000px) { .desk { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .desk-actions { grid-template-columns: 1fr 1fr; } .current .code { font-size: 3.4rem; } }

/* ---------- Provider workspace (v1.1) ---------- */
.provider { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 1.25rem; align-items: start; }
.provider-current { padding: 2.5rem 2rem; }
.provider-current .code { font-size: clamp(4rem, 9vw, 7.5rem); }
.provider-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1.5rem 0 .75rem; }
.provider-actions .btn { flex-direction: column; gap: .3rem; font-size: 1.05rem; }
.provider-next { min-height: 88px; font-size: 1.4rem; }
@media (max-width: 1000px) { .provider { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .provider-actions { grid-template-columns: 1fr; } }

/* ---------- Queue board (v1.1) ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 1rem; align-items: start; overflow-x: auto; padding-bottom: .5rem; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; min-height: 420px; transition: background .15s, outline-color .15s; }
.board-col h2 { display: flex; align-items: center; gap: .5rem; font-size: .95rem; margin: .2rem .2rem .8rem; }
.board-col h2 .n { margin-inline-start: auto; font-size: .78rem; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 99px; padding: 0 .55rem; }
.board-col.drop-ok { outline: 2px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }
.board-col.drop-no { outline: 2px dashed var(--danger); outline-offset: -6px; }
.board-zone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: .7rem; margin-bottom: .6rem; text-align: center; font-size: .85rem; color: var(--text-muted); }
.tk { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .7rem .8rem; margin-bottom: .6rem; box-shadow: var(--shadow); cursor: grab; }
.tk[aria-grabbed="true"] { opacity: .5; }
.tk.prio { border-inline-start: 4px solid var(--danger); }
.tk.serving { border-color: var(--serving); }
.tk .code { font-size: 1.3rem; }
.tk .meta { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.tk .tk-move { display: flex; gap: .35rem; margin-top: .5rem; }
.tk .tk-move select { min-height: 34px; padding: .2rem .5rem; font-size: .82rem; }
.tk .tk-move .btn { min-height: 34px; }

/* ---------- Charts (SVG) ---------- */
.bar-chart { width: 100%; height: auto; max-height: 260px; display: block; }
.bar-chart .bar { fill: var(--accent); }
.bar-chart .bar-alt { fill: var(--primary); }
.bar-chart text { fill: var(--text-muted); font-size: 10px; font-family: var(--font); }
.bar-chart line { stroke: var(--border); }

dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 2rem)); box-shadow: var(--shadow-3); }
dialog::backdrop { background: rgba(6,20,42,.55); }
.pagination { display: flex; gap: .35rem; flex-wrap: wrap; margin-block-start: 1rem; }
.kv { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .82rem; }
.kv span { white-space: nowrap; } .kv b { font-weight: 650; }

/* ---------- Print (thermal ticket 58–80 mm) ---------- */
@media print {
  @page { margin: 4mm; size: 80mm auto; }
  body { background: #fff; color: #000; }
  .no-print, .public-header, .public-footer, .k-pick .btn { display: none !important; }
  .kiosk { display: block; min-height: 0; } .k-hero { background: none; color: #000; padding: 0; text-align: center; }
  .k-hero .ticket-code, .k-hero .ticket-code::first-letter { color: #000; }
  .public-main { padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
