/* Dorek — kiosk, wall display, desk console, citizen pages and admin.
   Builds on /shared/tokens.css and /shared/base.css. */

.letter {
  --size: 44px;
  display: grid; place-items: center; flex-shrink: 0;
  width: var(--size); height: var(--size); border-radius: calc(var(--size) * .28);
  background: var(--c, var(--door)); color: #fff; font-weight: 700; font-size: calc(var(--size) * .45);
}
.net { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.net::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--nabeul); }
.net.off::before { background: var(--brand); }
.net.local::before { background: var(--kairouan); }
.center-msg { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); }

/* =========================================================
   KIOSK — tablet by the door, portrait
   ========================================================= */
.kiosk { min-height: 100vh; display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; }
.k-head { display: flex; align-items: center; gap: 14px; padding: 18px 28px; border-bottom: 1px solid var(--line); }
.k-brand { display: flex; align-items: center; gap: 12px; border: 0; background: none; padding: 0; text-align: start; }
.k-brand svg { width: 34px; height: 34px; }
.k-brand b { display: block; font-size: var(--fs-lg); font-weight: 600; line-height: 1.2; }
.k-brand span span { display: block; font-size: var(--fs-xs); color: var(--muted); }
.k-head .lang { margin-inline-start: auto; }
.k-head .lang button { padding: 10px 16px; font-size: var(--fs-sm); }
.k-main { flex: 1; display: flex; flex-direction: column; padding: 32px 28px 28px; max-width: 720px; width: 100%; margin-inline: auto; }
.k-foot { padding: 12px 28px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--muted); font-size: var(--fs-xs); border-top: 1px solid var(--line); }

.kiosk .btn { min-height: 72px; font-size: var(--fs-lg); border-radius: var(--r-md); }
.k-big { font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem); font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
:root[lang="ar"] .k-big { letter-spacing: 0; line-height: 1.4; }
.k-q { font-size: var(--fs-2xl); font-weight: 600; line-height: 1.25; margin: 10px 0 24px; }

.k-hero { display: grid; justify-items: center; text-align: center; gap: 10px; margin: 8px 0 28px; }
.k-hero .arch { width: min(300px, 60%); aspect-ratio: 4 / 3.4; display: grid; place-items: center; padding: 40px 24px 20px; }
.k-hero .arch b { font-size: clamp(1.8rem, 1rem + 3vw, 2.6rem); font-weight: 700; line-height: 1.1; }
.k-hero .arch small { display: block; margin-top: 6px; font-size: var(--fs-md); opacity: .85; }
.k-hero p { color: var(--muted); font-size: var(--fs-lg); margin-top: 18px; }
.k-status { display: grid; gap: 10px; margin-bottom: 28px; }
.k-svc { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md); }
.k-svc .name { flex: 1; font-weight: 500; text-align: start; }
.k-svc .meta { text-align: end; font-size: var(--fs-sm); color: var(--muted); line-height: 1.35; }
.k-svc .meta b { display: block; color: var(--text); font-weight: 600; }
.k-svc.off { opacity: .5; }
.k-actions { display: grid; gap: 12px; margin-top: auto; }

.k-steps { display: flex; gap: 6px; margin-bottom: 6px; }
.k-steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-2); }
.k-steps span.on { background: var(--door); }
.k-step-label { font-size: var(--fs-sm); color: var(--muted); }
.k-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.k-choice {
  display: grid; justify-items: start; gap: 18px; padding: 22px; min-height: 150px;
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--bg);
  text-align: start; font-size: var(--fs-lg); font-weight: 500;
}
.k-choice .ico { width: 40px; height: 40px; color: var(--door); stroke-width: 1.5; }
.k-choice:hover { border-color: var(--text); }
.k-choice[aria-pressed="true"] { border-color: var(--door); box-shadow: inset 0 0 0 1.5px var(--door); background: var(--sidi-wash); }
.k-svc-btn { width: 100%; background: var(--bg); font-size: var(--fs-lg); padding: 16px 18px; border-width: 1.5px; justify-content: flex-start; }
.k-svc-btn .letter { --size: 56px; }
.k-svc-btn[aria-pressed="true"] { border-color: var(--door); box-shadow: inset 0 0 0 1.5px var(--door); background: var(--sidi-wash); }
.k-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-top: auto; padding-top: 28px; }
.k-nav.one { grid-template-columns: 1fr; }

.digits { display: flex; gap: 14px; justify-content: center; margin: 8px 0 10px; direction: ltr; }
.digits span {
  width: 88px; height: 104px; display: grid; place-items: center; border-radius: var(--r-md);
  border: 2px solid var(--line); font-size: 3.2rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.digits span.filled { border-color: var(--door); }
.digits span.cursor { border-color: var(--text); }
.digits.four span { width: 74px; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.k-help { text-align: center; color: var(--muted); margin-bottom: 22px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; direction: ltr; max-width: 460px; width: 100%; margin-inline: auto; }
.keypad button { min-height: 78px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); font-size: 2rem; font-weight: 500; }
.keypad button:active { background: var(--surface-2); }
.keypad .ico { width: 30px; height: 30px; margin: auto; }

.k-toggle { display: flex; align-items: center; gap: 16px; padding: 16px 18px; margin-top: 14px; border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.k-toggle b { display: block; font-weight: 600; }
.k-toggle small { display: block; color: var(--muted); font-size: var(--fs-sm); }
.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: 15px; background: var(--surface-2); position: relative; margin: 0; cursor: pointer; transition: background-color .2s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: inset-inline-start .2s; }
.switch:checked { background: var(--nabeul); }
.switch:checked::after { inset-inline-start: 25px; }

.ticket { --notch: 16px; position: relative; margin: 8px auto 0; width: min(440px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); text-align: center; overflow: hidden; }
.ticket-top { background: var(--c); color: #fff; padding: 26px 24px 30px; }
.ticket-top p { opacity: .9; }
.ticket-code { font-size: clamp(4rem, 3rem + 5vw, 6rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.05; direction: ltr; font-variant-numeric: tabular-nums; }
.ticket-svc { font-weight: 500; }
.ticket-appt { display: inline-block; margin-top: 6px; padding: 4px 12px; border-radius: var(--r-pill); background: rgba(255,255,255,.18); font-weight: 600; }
.ticket-perf { position: relative; height: 0; border-top: 2px dashed var(--line); margin: 0 var(--notch); }
.ticket-perf::before, .ticket-perf::after { content: ""; position: absolute; top: calc(var(--notch) * -1); width: calc(var(--notch) * 2); height: calc(var(--notch) * 2); border-radius: 50%; background: var(--surface); border: 1px solid var(--line); }
.ticket-perf::before { left: calc(var(--notch) * -2); }
.ticket-perf::after { right: calc(var(--notch) * -2); }
.ticket-body { padding: 22px 24px 26px; display: grid; gap: 6px; justify-items: center; }
.ticket-body .ahead { font-size: var(--fs-xl); font-weight: 600; }
.ticket-qr { display: flex; align-items: center; gap: 14px; margin-top: 14px; text-align: start; }
.ticket-qr img { width: 104px; height: 104px; flex-shrink: 0; background: #fff; border-radius: 6px; }
.k-ticket-screen { background: var(--surface); }
.k-countdown { text-align: center; color: var(--muted); font-size: var(--fs-sm); margin-top: 14px; }

.k-message { display: grid; justify-items: center; text-align: center; gap: 14px; margin: auto 0; }
.k-message .badge-ico { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; background: var(--sidi-wash); color: var(--door); }
.k-message .badge-ico .ico { width: 44px; height: 44px; }
.k-message p { color: var(--muted); font-size: var(--fs-lg); max-width: 32ch; }

.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(13, 22, 38, .55); display: grid; place-items: center; padding: 20px; backdrop-filter: blur(4px); }
.pin-card { background: var(--bg); border-radius: var(--r-lg); padding: 28px; width: min(420px, 100%); display: grid; gap: 16px; text-align: center; box-shadow: var(--shadow-lg); }
.pin-dots { display: flex; justify-content: center; gap: 14px; direction: ltr; }
.pin-dots span { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); }
.pin-dots span.on { background: var(--text); border-color: var(--text); }
.pin-card .keypad button { min-height: 64px; font-size: 1.6rem; }
.pin-err { color: var(--brand); font-size: var(--fs-sm); min-height: 1.4em; }

.admin-sheet { position: fixed; inset: 0; z-index: 45; background: var(--surface); overflow-y: auto; }
.admin-head { position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 18px 28px; display: flex; align-items: center; gap: 12px; }
.admin-head h2 { font-size: var(--fs-xl); font-weight: 600; flex: 1; }
.admin-body { max-width: 720px; margin-inline: auto; padding: 24px 28px 48px; display: grid; gap: 18px; }
.a-card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 20px; display: grid; gap: 14px; }
.a-card h3 { font-size: var(--fs-md); font-weight: 600; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; background: var(--surface); border-radius: var(--r-sm); gap: 4px; }
.seg button { min-height: 52px; border: 0; border-radius: 9px; background: none; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--bg); box-shadow: var(--shadow-sm); }
.seg button[data-status="open"][aria-pressed="true"] { color: var(--nabeul); }
.seg button[data-status="paused"][aria-pressed="true"] { color: var(--kairouan); }
.seg button[data-status="closed"][aria-pressed="true"] { color: var(--brand); }
.a-row { display: flex; align-items: center; gap: 14px; min-height: 52px; }
.a-row .grow { flex: 1; }
.a-row + .a-row { border-top: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stats div { background: var(--surface); border-radius: var(--r-sm); padding: 12px; }
.stats b { display: block; font-size: var(--fs-xl); font-weight: 600; font-variant-numeric: tabular-nums; }
.stats span { font-size: var(--fs-xs); color: var(--muted); }
.a-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Device setup (kiosk and display) */
.setup { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--surface); }
.setup { grid-template-columns: minmax(0, 1fr); }
.setup .card { min-width: 0; justify-self: center; }
.setup .card { width: min(480px, 100%); display: grid; gap: 16px; }
.setup .arch { width: 64px; height: 78px; margin: 0 auto; box-shadow: 0 0 0 5px var(--door-frame), 0 0 0 6px var(--line); }
.setup .arch::before { inset: 8px; }
.setup h1 { font-size: var(--fs-xl); text-align: center; font-weight: 600; }
.setup p { text-align: center; color: var(--muted); }

/* =========================================================
   WALL DISPLAY — landscape, always the night palette
   ========================================================= */
.display { height: 100vh; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto; font-size: 1.6vw; }
.d-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2vw; padding: 1.6vw 3vw; border-bottom: 1px solid var(--line); }
.d-head .office { font-weight: 600; font-size: 1.5vw; line-height: 1.3; }
.d-head .office span { display: block; font-weight: 400; color: var(--muted); font-size: 1.1vw; }
.d-head .office.end { text-align: end; }
.d-clock { text-align: center; }
.d-clock b { display: block; font-size: 3vw; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.d-clock span { color: var(--muted); font-size: 1vw; }
.d-main { display: grid; grid-template-columns: 1.55fr 1fr; gap: 3vw; padding: 2.4vw 3vw; min-height: 0; }
.d-call { display: grid; place-items: center; min-height: 0; }
.d-call .arch { width: 100%; height: 100%; max-height: 70vh; display: grid; align-content: center; justify-items: center; gap: .6vw; padding: 7vw 3vw 3vw; text-align: center; }
.d-label { font-size: 1.5vw; opacity: .85; }
.d-label span + span::before { content: "  ·  "; white-space: pre; }
.d-code { font-size: 11vw; font-weight: 700; line-height: 1; letter-spacing: -.02em; direction: ltr; font-variant-numeric: tabular-nums; }
.d-to { display: flex; align-items: center; gap: 1.6vw; margin-top: 1vw; direction: ltr; }
.d-to svg { width: 4vw; height: 4vw; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.d-desk { display: flex; align-items: center; gap: 1vw; background: rgba(255,255,255,.14); border-radius: 1.2vw; padding: .6vw 1.8vw; }
.d-desk .lbl { font-size: 1.3vw; text-align: start; line-height: 1.25; }
.d-desk b { font-size: 6vw; line-height: 1.05; color: #F6D78B; font-variant-numeric: tabular-nums; }
.d-call.flash .arch { animation: flash 1s 3; }
@keyframes flash { 50% { background: color-mix(in srgb, var(--door) 70%, #fff); } }
.d-side { display: grid; grid-template-rows: auto 1fr auto auto; gap: 1.2vw; min-height: 0; }
.d-side h2 { font-size: 1.3vw; font-weight: 500; color: var(--muted); }
.d-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: .7vw; align-content: start; }
.d-recent li { display: flex; align-items: center; gap: 1.4vw; background: var(--surface); border-radius: 1vw; padding: .5vw 1.4vw; direction: ltr; }
.d-recent .code { font-size: 2.4vw; font-weight: 600; flex: 1; font-variant-numeric: tabular-nums; }
.d-recent .arrow { width: 2vw; height: 2vw; fill: none; stroke: var(--muted); stroke-width: 2; }
.d-recent .dk { font-size: 2.4vw; font-weight: 600; color: #F6D78B; min-width: 3vw; text-align: end; }
.d-wait { display: grid; grid-template-columns: repeat(auto-fit, minmax(5vw, 1fr)); gap: .8vw; }
.d-wait div { background: var(--surface); border-radius: 1vw; padding: .9vw; display: grid; justify-items: center; gap: .3vw; }
.d-wait .letter { --size: 2.8vw; }
.d-wait b { font-size: 2vw; font-variant-numeric: tabular-nums; }
.d-foot { display: flex; align-items: center; gap: 2vw; padding: 1.1vw 3vw; border-top: 1px solid var(--line); color: var(--muted); font-size: 1.15vw; }
.d-foot .prov { margin-inline-start: auto; color: var(--kairouan); }
.d-banner { position: fixed; top: 0; left: 0; right: 0; background: var(--kairouan); color: var(--medina); text-align: center; font-weight: 600; padding: .5vw; font-size: 1.2vw; z-index: 5; }
.d-sound { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(13, 22, 38, .82); border: 0; color: #fff; font-size: 2vw; }
.d-sound svg { width: 6vw; height: 6vw; fill: none; stroke: currentColor; stroke-width: 1.6; margin: 0 auto 1vw; }

/* =========================================================
   DESK CONSOLE
   ========================================================= */
.desk { min-height: 100vh; background: var(--surface); }
.s-head { background: var(--bg); border-bottom: 1px solid var(--line); padding: 14px 18px; display: grid; gap: 12px; position: sticky; top: 0; z-index: 5; }
.s-head-row { display: flex; align-items: center; gap: 10px; }
.s-head h1 { font-size: var(--fs-lg); font-weight: 600; flex: 1; }
.s-svcs { display: flex; gap: 6px; align-items: center; }
.s-svcs .letter { --size: 26px; }
.s-agent { display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); line-height: 1.3; }
.s-agent small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.s-agent .grow { flex: 1; }
.s-body { padding: 18px; display: grid; gap: 16px; max-width: 560px; margin-inline: auto; }
.s-current { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 14px; }
.s-current .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.s-code { font-size: 3.6rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--c, var(--text)); direction: ltr; text-align: start; font-variant-numeric: tabular-nums; }
:root[dir="rtl"] .s-code { text-align: end; }
.s-verify { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--sidi-wash); font-weight: 500; }
.s-verify .ico { color: var(--door); }
.digits-hint { font-variant-numeric: tabular-nums; letter-spacing: .08em; direction: ltr; unicode-bidi: isolate; font-weight: 700; }
.s-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 520px) { .s-btns { grid-template-columns: repeat(4, 1fr); } }
.s-btns .btn { padding: 0 8px; font-size: var(--fs-sm); }
.s-idle { text-align: center; padding: 18px 0 6px; display: grid; gap: 6px; }
.s-idle b { font-size: var(--fs-lg); }
.s-call { min-height: 64px; font-size: var(--fs-lg); }
.s-queue { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 0; }
.s-queue h2 { font-size: var(--fs-sm); font-weight: 500; color: var(--muted); padding: 10px 18px; }
.s-queue ol { list-style: none; margin: 0; padding: 0; }
.s-queue li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); }
.s-queue li .letter { --size: 32px; }
.s-queue li .code { font-weight: 600; font-variant-numeric: tabular-nums; direction: ltr; }
.s-queue li .tags { margin-inline-start: auto; display: flex; gap: 6px; }
.s-queue li.away { opacity: .55; }
.s-empty { padding: 18px; color: var(--muted); text-align: center; }
.s-pick { display: grid; gap: 14px; }
.s-desk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; }
.s-desk-grid button { min-height: 88px; border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--bg); display: grid; place-items: center; gap: 4px; padding: 8px; }
.s-desk-grid button b { font-size: var(--fs-2xl); line-height: 1; }
.s-desk-grid button span { display: flex; gap: 4px; }
.s-desk-grid button .letter { --size: 20px; }
.s-desk-grid button[aria-pressed="true"] { border-color: var(--door); background: var(--sidi-wash); }

/* =========================================================
   CITIZEN PAGES — inside e-Tunisia, phone first
   ========================================================= */
.page { max-width: 760px; margin: 0 auto; padding: 0 0 120px; }
.hero-mini { padding: 28px 16px 8px; display: grid; gap: 6px; }
.hero-mini h1 { font-size: var(--fs-2xl); font-weight: 600; line-height: 1.2; }
.office-list { display: grid; gap: 14px; padding: 16px; }
.office-card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); color: inherit; text-decoration: none; background: var(--bg); }
.office-card:hover { border-color: var(--text); }
.office-card .thumb { border-radius: var(--r-sm); background-color: var(--sidi-bou-said); background-image: var(--arches); background-size: 24px 32px; position: relative; }
.office-card h2 { font-size: var(--fs-md); font-weight: 600; }
.office-card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
:root { --arches: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='48'%3E%3Cpath d='M4 48V22c0-9 6-16 14-16s14 7 14 16v26' fill='none' stroke='white' stroke-opacity='.3' stroke-width='1.6'/%3E%3Cpath d='M8 48V23c0-6 4-11 10-11s10 5 10 11v25' fill='none' stroke='white' stroke-opacity='.18' stroke-width='1.2'/%3E%3C/svg%3E"); }

.c-cover { margin: 16px; height: 150px; border-radius: var(--r-md); background-color: var(--sidi-bou-said); position: relative; overflow: hidden; background-image: var(--arches); background-size: 36px 48px; }
.c-cover .chip { position: absolute; top: 12px; inset-inline-start: 12px; background: rgba(255,255,255,.95); color: var(--medina); }
.c-cover .glyph { position: absolute; inset-inline-end: 18px; bottom: -18px; width: 86px; height: 112px; }
.c-office { padding: 0 16px; display: grid; gap: 2px; }
.c-office h1 { font-size: var(--fs-xl); font-weight: 600; line-height: 1.3; }
.c-book { justify-self: start; margin-top: 8px; }
.c-section { padding: 22px 16px 0; display: grid; gap: 10px; }
.c-section h2 { font-size: var(--fs-md); font-weight: 600; }
.c-svc { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.c-svc.off { opacity: .55; }
.c-svc .name { flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: 500; line-height: 1.35; }
.c-svc .name small { display: block; color: var(--muted); font-weight: 400; }
.c-svc .now { text-align: end; font-size: var(--fs-xs); color: var(--muted); line-height: 1.3; }
.c-svc .now b { display: block; font-size: var(--fs-md); color: var(--text); font-variant-numeric: tabular-nums; direction: ltr; }
.c-rules { background: var(--surface); border-radius: var(--r-md); padding: 16px; display: grid; gap: 12px; font-size: var(--fs-sm); }
.c-rule-row { display: flex; align-items: center; gap: 10px; }
.c-rule-row .grow { flex: 1; }
.meter { display: flex; gap: 4px; direction: ltr; }
.meter i { width: 22px; height: 8px; border-radius: 4px; background: var(--surface-2); }
.meter i.on { background: var(--door); }
.meter.strikes i.on { background: var(--kairouan); }
.c-rules p { color: var(--muted); }
.c-cta { position: fixed; bottom: 0; left: 0; right: 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); z-index: 6; }
.c-cta .btn { min-height: 54px; max-width: 728px; margin-inline: auto; display: flex; }
.c-banner { margin: 12px 16px 0; padding: 12px 14px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--kairouan) 18%, var(--bg)); font-size: var(--fs-sm); display: flex; gap: 10px; }
.c-banner .ico { color: var(--kairouan); }

.sheet-wrap { position: fixed; inset: 0; z-index: 20; background: rgba(13, 22, 38, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 760px; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 12px; max-height: 90vh; overflow-y: auto; animation: up .25s cubic-bezier(.25,.8,.25,1); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 6px; }
.sheet h2 { font-size: var(--fs-lg); font-weight: 600; }
.c-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--bg); text-align: start; width: 100%; }
.c-opt[aria-pressed="true"] { border-color: var(--door); background: var(--sidi-wash); }
.c-opt:disabled { opacity: .5; }
.c-opt .name { flex: 1; font-weight: 500; font-size: var(--fs-sm); }
.c-opt .meta { font-size: var(--fs-xs); color: var(--muted); text-align: end; }

.c-ticket { margin: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--bg); }
.c-ticket .head { background: var(--c, var(--door)); color: #fff; padding: 20px; display: grid; gap: 4px; text-align: center; }
.c-ticket .head .code { font-size: 4rem; font-weight: 700; line-height: 1; direction: ltr; font-variant-numeric: tabular-nums; }
.c-ticket .body { padding: 18px 20px; display: grid; gap: 14px; }
.c-progress { display: grid; gap: 8px; }
.c-progress .bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.c-progress .bar span { display: block; height: 100%; background: var(--door); border-radius: 4px; transition: width .4s; }
.c-progress .row { display: flex; justify-content: space-between; font-size: var(--fs-sm); }
.c-progress .row b { font-size: var(--fs-lg); }
.c-check { display: flex; align-items: center; gap: 14px; padding: 14px; background: var(--surface); border-radius: var(--r-sm); }
.c-check .pin { font-size: 1.6rem; font-weight: 700; letter-spacing: .2em; direction: ltr; font-variant-numeric: tabular-nums; }
.c-check small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.c-ticket.turn .head { background: var(--nabeul); }
.c-ticket.turn .head .turn { font-size: var(--fs-2xl); font-weight: 700; }
.c-ticket.turn { animation: ring .6s 3; }
@keyframes ring { 30% { transform: rotate(-1.2deg); } 60% { transform: rotate(1.2deg); } }
.c-final { text-align: center; padding: 20px; display: grid; gap: 10px; justify-items: center; }
.c-final .letter { --size: 64px; }

/* =========================================================
   ADMIN WEB PAGE
   ========================================================= */
.adm { max-width: 980px; margin: 0 auto; padding: 24px 16px 80px; display: grid; gap: 20px; }
.adm h1 { font-size: var(--fs-2xl); font-weight: 600; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.adm-office { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: inherit; background: var(--bg); }
.adm-office:hover { border-color: var(--text); }
.adm section.card { display: grid; gap: 14px; }
.adm h2 { font-size: var(--fs-lg); font-weight: 600; }
.adm .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.adm table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.adm th { text-align: start; font-weight: 500; color: var(--muted); padding: 8px 6px; border-bottom: 1px solid var(--line); }
.adm td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.adm td .input { min-height: 40px; padding: 6px 10px; }
.adm td.n { width: 76px; }
.adm .letters { display: flex; gap: 6px; flex-wrap: wrap; }
.adm .letters label { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--r-pill); cursor: pointer; }
.adm .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.adm .list > div { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.adm .list > div:first-child { border-top: 0; }
.adm .list .grow { flex: 1; min-width: 0; }
.adm .list small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.adm .link-box { display: flex; gap: 8px; align-items: center; padding: 10px; background: var(--surface); border-radius: var(--r-sm); word-break: break-all; font-size: var(--fs-sm); direction: ltr; }
.adm .tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.adm .stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.adm .stat-row div { background: var(--surface); border-radius: var(--r-sm); padding: 12px; }
.adm .stat-row b { display: block; font-size: var(--fs-xl); }
.adm .stat-row span { color: var(--muted); font-size: var(--fs-xs); }
