/* PARK CENTER — touch-first POS.
   Identity: the PARK CENTER logo palette — deep navy structure, bright cyan
   actions, one playful brand color per station, and a cart styled as the
   thermal receipt it will become. Baloo Bhaijaan 2 (bundled) is the rounded
   bubble face of the logo and covers Latin + Arabic in one voice, with
   Tajawal kept as fallback; CSS logical properties make [dir="rtl"] work
   without a second stylesheet. */

@font-face {
    font-family: 'Baloo Bhaijaan 2';
    src: url('../fonts/BalooBhaijaan2-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Baloo Bhaijaan 2';
    src: url('../fonts/BalooBhaijaan2-Medium.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Baloo Bhaijaan 2';
    src: url('../fonts/BalooBhaijaan2-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Baloo Bhaijaan 2';
    src: url('../fonts/BalooBhaijaan2-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-display: swap;
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Medium.ttf') format('truetype');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-Bold.ttf') format('truetype');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Tajawal';
    src: url('../fonts/Tajawal-ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-display: swap;
}

:root {
    /* PARK CENTER brand palette */
    --canvas: #F2F3F7;
    --card: #FFFFFF;
    --ink: #1A2859;         /* primary dark blue: text, borders, dark bg */
    --muted: #5C688C;
    --line: #DFE2EC;
    --night: #1A2859;
    --night-soft: #2B3A73;
    --night-ink: #F4F6FD;
    --marquee: #00C2D1;     /* bright cyan: buttons & accents */
    --marquee-press: #00A4B1;
    --ok: #8DC63F;          /* lime green: success states */
    --ok-ink: #5F8F1F;      /* darker lime for text on light backgrounds */
    --danger: #F9398C;      /* playful pink: alerts & highlights */
    --warn: #FFC107;        /* sunny yellow: warnings & accents */
    --purple: #8A339B;      /* vibrant purple: secondary elements */
    --paper: #FFFDF6;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(26, 40, 89, 0.08), 0 5px 16px rgba(26, 40, 89, 0.07);
    --tap-target: 56px;
    --accent: var(--night);
    --accent-ink: #FFFFFF;  /* readable text color on top of --accent */
}

/* One brand color per register: the cashier always knows which drawer they
   hold. Light accents (yellow, cyan, lime) carry navy ink instead of white. */
.station--playground { --accent: #FFC107; --accent-ink: #1A2859; }
.station--toys       { --accent: #F9398C; }
.station--vr         { --accent: #8A339B; }
.station--snacking   { --accent: #00C2D1; --accent-ink: #1A2859; }
.station--buvette    { --accent: #8DC63F; --accent-ink: #1A2859; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* The hidden attribute must always win, even over display:flex/grid rules
   (author styles beat the UA's [hidden] default, so without this the paid
   overlay would cover the POS forever). */
[hidden] {
    display: none !important;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Baloo Bhaijaan 2', 'Tajawal', 'Segoe UI', Tahoma, system-ui, sans-serif;
    background: var(--canvas);
    color: var(--ink);
    min-height: 100vh;
}

:focus-visible {
    outline: 3px solid var(--marquee);
    outline-offset: 2px;
}

/* Cross-fade between pages on browsers that support it (no JS involved). */
@view-transition {
    navigation: auto;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }

    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }

    /* Never leave scroll-reveal content stuck hidden without its animation. */
    .reveal-ready .reveal {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ---------- Top bar: the marquee ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 1.5rem;
    background: var(--night);
    color: var(--night-ink);
    border-block-end: 3px solid var(--marquee);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: inherit;
    text-decoration: none;
}

.topbar-logo {
    height: 42px;
    width: 42px;
    object-fit: contain;
    /* the logo's white outline melts into the navy bar without a plate */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-admin {
    background: var(--purple);
    color: #fff;
}

.badge-cashier {
    background: var(--night-soft);
    color: var(--night-ink);
}

.badge-waiter {
    background: var(--marquee);
    color: var(--night);
}

.lang-switch {
    display: inline-flex;
    border: 1px solid var(--night-soft);
    border-radius: 10px;
    overflow: hidden;
}

.lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 44px;
    text-decoration: none;
    color: var(--night-ink);
    font-weight: 700;
    background: transparent;
}

.lang-btn.active {
    background: var(--marquee);
    color: var(--night);
}

.topbar .btn-ghost {
    color: var(--night-ink);
    border-color: var(--night-soft);
}

/* ---------- Layout ---------- */

.container {
    max-width: 1280px;
    margin-inline: auto;
    padding: 1.5rem;
}

.section-title {
    margin-block: 1.5rem 0.75rem;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

/* ---------- Cards ---------- */

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-block-end: 1.25rem;
}

.card-title {
    font-size: 1.3rem;
    font-weight: 800;
    margin-block-end: 1.25rem;
}

.card-head-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Smooth motion for the admin dashboard: cards lift on hover and glide up
   into view as you scroll. .reveal-ready is set by JS, so no-JS visitors and
   prefers-reduced-motion users always see everything (see the reduce block). */
.card,
.stat-tile {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

#admin-root .card:hover,
#admin-root .stat-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(26, 40, 89, 0.10), 0 14px 30px rgba(26, 40, 89, 0.12);
}

.reveal-ready .reveal {
    opacity: 0;
}

.reveal-ready .reveal.is-visible {
    animation: card-rise 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes card-rise {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.center-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* ---------- Forms ---------- */

.field {
    display: block;
    margin-block-end: 1.25rem;
}

.field-label {
    display: block;
    font-weight: 700;
    margin-block-end: 0.5rem;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.07em;
}

.field input,
.scan-input {
    width: 100%;
    min-height: var(--tap-target);
    padding: 0.75rem 1rem;
    font-size: 1.15rem;
    font-family: inherit;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--ink);
}

.field input:focus,
.scan-input:focus {
    outline: none;
    border-color: var(--accent);
}

.field-amount input {
    font-size: 1.7rem;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.hint {
    color: var(--muted);
    margin-block-end: 1rem;
}

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap-target);
    padding: 0.75rem 1.75rem;
    font-size: 1.05rem;
    font-weight: 800;
    font-family: inherit;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s ease, transform 0.06s ease;
    touch-action: manipulation;
}

.btn:not(:disabled):active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--marquee);
    color: var(--night);
}

.btn-primary:not(:disabled):active {
    background: var(--marquee-press);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 2px solid var(--line);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-tall {
    min-height: 76px;
    font-size: 1.25rem;
}

.btn-sm {
    min-height: 44px;
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
}

/* ---------- Auth ---------- */

.auth-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding-block-start: 5vh;
}

.auth-logo {
    width: min(210px, 55vw);
    height: auto;
}

.auth-card {
    width: min(420px, 100%);
}

/* Space the stacked buttons on the open-caisse form (count float / open). */
#shift-open-form .btn-block {
    margin-block-start: 1rem;
}

/* ---------- Alerts ---------- */

.alert {
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    margin-block-end: 1.25rem;
    font-weight: 700;
}

.alert-error {
    background: #FEE9F3;
    color: #D81B70;
    border: 1px solid #FBC4DD;
}

.alert-ok {
    background: #F1F8E4;
    color: var(--ok-ink);
    border: 1px solid #D8ECB4;
}

/* Cash counter helper: count the drawer by denomination, live total. */
.cash-counter {
    max-width: 560px;
    margin-inline: auto;
}

.cash-rows {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-block: 1.25rem;
}

.cash-row {
    display: grid;
    grid-template-columns: 92px auto minmax(0, 1fr) 92px;
    align-items: center;
    gap: 0.6rem;
}

.cash-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 0.4rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
    white-space: nowrap;
}

/* Roughly the colours of the Moroccan notes and coins. */
.cash-note--200 { background: #2E9BD6; }
.cash-note--100 { background: #B65C4B; }
.cash-note--50  { background: #3FA95B; }
.cash-note--20  { background: #8A5CB0; }
.cash-note--10  { background: #C9A227; color: #3a2f00; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.12); }
.cash-note--5   { background: #B9A46A; color: #2f2700; }
.cash-note--2   { background: #C9A227; color: #3a2f00; }
.cash-note--1   { background: #A9AEB5; color: #23272c; }
.cash-note--0_5 { background: #C6CBD2; color: #23272c; }

.cash-x {
    color: var(--muted);
    font-weight: 800;
}

.cash-count {
    width: 100%;
    min-height: 48px;
    padding: 0.4rem 0.7rem;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: end;
    font-variant-numeric: tabular-nums;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--ink);
}

.cash-line {
    text-align: end;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.cash-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-block-start: 2px dashed var(--line);
    padding-block-start: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 1.15rem;
}

.cash-total-row strong {
    font-size: 1.6rem;
}

/* Menu QR page: a big centered code the customer scans. */
.menu-qr {
    max-width: 460px;
    margin-inline: auto;
    text-align: center;
}

.menu-qr-code {
    max-width: 340px;
    margin: 1.5rem auto 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.qr-svg {
    display: block;
    width: 100%;
    height: auto;
}

.menu-qr-url {
    font-weight: 700;
    color: var(--muted);
    word-break: break-all;
}

.menu-qr-edit {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--line);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: start;
}
.menu-qr-edit label { font-size: 0.85rem; font-weight: 700; }
.menu-qr-edit input { width: 100%; }
.menu-qr-status, .menu-qr-error { text-align: start; }

/* Live running-charge cell on "Sessions actives": plain colored text that keeps
   ticking up for standard play; prepaid loyalty/pack sessions read "Free". */
.est-price {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.est-price--free {
    color: #4E8F1B;
}

.est-price--charge {
    color: #F9398C;
}

/* "Sessions actives", paused row: the kid stepped out, their clock is frozen
   and the running charge stops with it, so both read faded and a ⏸ flag sits
   under the timer. Same state the wall board shows — it lives on the session. */
.session-paused-flag {
    display: block;
    margin-block-start: 0.15rem;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #9A6B00;
    white-space: nowrap;
}

.session-row-paused .session-elapsed > span:first-child,
.session-row-paused .est-price {
    opacity: 0.45;
}

/* Prepaid time ran out (loyalty balance at 0, or a pack's hour over). Nothing
   is owed — neither ever falls back to the standard tariff — so this is a red
   staff alert, not a price: the loyalty clock stops on the balance, the pack's
   keeps running, and the child stays in the park free. */
.session-over-flag {
    display: block;
    margin-block-start: 0.15rem;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--danger);
    white-space: nowrap;
}

.session-row-over .session-elapsed > span:first-child {
    color: var(--danger);
    animation: board-pulse 1.4s ease-in-out infinite;
}

.session-row-over > td:first-child {
    box-shadow: inset 3px 0 0 var(--danger);
}

.session-pause.is-paused {
    background: var(--marquee);
    border-color: var(--marquee);
    color: var(--night);
}

/* Three actions per row (pause / reprint / exit): let them wrap rather than
   push the table into a horizontal scroll on a narrow register. */
#sessions-table .table-actions {
    flex-wrap: wrap;
}

/* Orange heads-up (not a hard error): e.g. things to check before clôture. */
.alert-warn {
    background: #FFF6E0;
    color: #9A6B00;
    border: 1px solid #FBE3A6;
}

/* Green confirmation: e.g. the menu link was saved. */
.alert-success {
    background: #F0F7E4;
    color: #4C7A10;
    border: 1px solid #CBE6A0;
}

/* "Sessions actives" on the Park de Jeu desk: room around the card + rows. */
.pos-park .park-columns + .card {
    margin-block-start: 1.25rem;
}

.pos-park #sessions-table td {
    padding-block: 0.75rem;
}

/* Dépenses card (cashier dashboard): outgoing cash during the shift. */
.expense-form {
    display: flex;
    gap: 0.6rem;
    margin-block-start: 1rem;
    flex-wrap: wrap;
}

.expense-form input {
    flex: 1 1 140px;
    min-height: var(--tap-target);
    padding: 0.5rem 0.9rem;
    font-family: inherit;
    font-size: 1rem;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--ink);
}

.expense-form input:focus {
    border-color: var(--marquee);
    outline: none;
}

.expense-delete {
    margin-inline-start: 0.5rem;
    min-width: 36px;
    min-height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--danger);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    touch-action: manipulation;
}

.expense-total-row {
    border-block-start: 2px dashed var(--line);
    margin-block-start: 0.5rem;
    padding-block-start: 0.5rem;
    font-weight: 800;
}

/* Clôture blockers: what must be emptied before the drawer can close. */
.close-blockers ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-block-start: 0.6rem;
}

.close-blockers a {
    color: inherit;
    font-weight: 800;
    white-space: nowrap;
}

/* ---------- Tiles (stations / modules / products) ---------- */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-block-end: 1.5rem;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 130px;
    padding: 1rem;
    background: var(--card);
    border: 2px solid var(--line);
    border-block-end: 5px solid var(--accent);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    touch-action: manipulation;
}

.tile-icon {
    font-size: 2.2rem;
}

.tile-name {
    font-weight: 800;
    text-align: center;
}

.tile-tag {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--muted);
    background: var(--canvas);
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.station-tile:disabled,
.module-tile.locked {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.7);
}

.station-tile.selected {
    border-color: var(--marquee);
    background: #E0F8FA;
}

/* ---------- Summary rows ---------- */

.summary-rows {
    display: flex;
    flex-direction: column;
    margin-block-end: 1.25rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-block: 0.7rem;
    border-block-end: 1px dashed var(--line);
    font-size: 1.05rem;
}

.summary-row:last-child {
    border-block-end: none;
}

.summary-row span:first-child {
    color: var(--muted);
}

.summary-row strong {
    font-variant-numeric: tabular-nums;
}

.summary-row-diff strong {
    font-size: 1.25rem;
}

.summary-row-diff.diff-ok strong {
    color: var(--ok-ink);
}

.summary-row-diff.diff-bad strong {
    color: var(--danger);
}

/* ---------- Dashboard ---------- */

.shift-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.shift-banner-info {
    flex: 1 1 320px;
}

.shift-banner .summary-rows {
    margin-block-end: 0;
}

/* ---------- POS layout ---------- */

.pos {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 1.5rem;
    align-items: start;
}

/* The main column holds nowrap scrollers (category slider, orders strip):
   without min-width:0 their intrinsic width blows the page open sideways. */
.pos-main {
    min-width: 0;
}

/* Desktop split scrolling (retail registers): the catalog column gets its
   own scroller capped at the viewport, so browsing products never moves
   the ticket — and the page scrollbar belongs to the ticket alone, so a
   long cart is reached without dragging the catalog along. */
@media (min-width: 1025px) {
    .pos--split > .pos-main {
        position: sticky;
        top: 84px;
        max-height: calc(100vh - 84px - 1.25rem);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        padding-inline-end: 0.4rem;
    }

    /* The category slider stays pinned inside the catalog's scroller. */
    .pos--split .category-tabs {
        position: sticky;
        inset-block-start: 0;
        z-index: 30;
        background: var(--canvas);
        padding-block: 0.4rem;
    }
}

.pos-single,
.pos-park {
    grid-template-columns: minmax(0, 1fr);
}

.station-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-block-end: 1.25rem;
    box-shadow: var(--shadow);
}

.station-back {
    color: var(--accent-ink);
    opacity: 0.85;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-block;
    padding-block: 0.25rem;
}

/* Ghost buttons sitting on the coloured station bar read in the bar's ink,
   not the default navy (which would vanish on a navy bar). */
.station-bar .btn-ghost {
    color: var(--accent-ink);
    border-color: currentColor;
    background: transparent;
}

.station-name {
    font-size: 1.5rem;
    font-weight: 800;
}

.station-eyebrow {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    background: rgba(255, 255, 255, 0.22);
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
}

/* Quick-switch strip: hop between registers without the dashboard. */
.station-switch {
    display: flex;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.18);
    padding: 0.3rem;
    border-radius: 999px;
}

.station-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: 999px;
    font-size: 1.3rem;
    text-decoration: none;
    transition: background 0.12s ease, transform 0.06s ease;
}

.station-switch-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.station-switch-btn:active {
    transform: scale(0.94);
}

.station-switch-btn.active {
    background: var(--card);
    box-shadow: 0 1px 4px rgba(26, 40, 89, 0.2);
}

/* ---------- Product grid ---------- */

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.9rem;
}

/* Floating scroll jumpers: two small round buttons, start-side edge so
   they cover neither the ticket column nor the mobile cart bar. */
.scroll-nav {
    position: fixed;
    inset-inline-start: 0.75rem;
    inset-block-end: calc(6rem + env(safe-area-inset-bottom, 0px));
    z-index: 35;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.scroll-nav-btn {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 999px;
    background: rgba(26, 40, 89, 0.75);
    color: var(--night-ink);
    font-size: 1.15rem;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 3px 10px rgba(26, 40, 89, 0.3);
}

.scroll-nav-btn:active {
    transform: scale(0.92);
}

/* Pager under the big catalogs (toys, snacking): 24 tiles per page. */
.grid-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-block-start: 1rem;
}

.grid-pager .btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.pager-info {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

/* Barcode scan field + category tabs above the grid. */
.pos-scan {
    margin-block-end: 0.9rem;
}

.pos-scan .scan-input:focus {
    border-color: var(--marquee);
}

/* One scrolling row: long menus keep every category a swipe away
   instead of stacking rows of buttons above the grid. */
.category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-block-end: 0.9rem;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tabs .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 1.05rem;
}

@keyframes scan-pop {
    0% { box-shadow: 0 0 0 4px var(--marquee); transform: scale(1.04); }
    100% { box-shadow: none; transform: scale(1); }
}

.product-tile.scan-hit {
    animation: scan-pop 0.45s ease-out;
}

/* Image-led tile: photo (or station-icon fallback) on top, name + price
   plate below, stock state overlaid on the photo, and a live corner badge
   mirroring the cart quantity. */
.product-tile {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
    background: var(--card);
    border: 2px solid var(--line);
    border-block-end: 5px solid var(--accent);
    border-radius: 12px;
    font-family: inherit;
    color: var(--ink);
    cursor: pointer;
    text-align: start;
    touch-action: manipulation;
    transition: transform 0.06s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.product-tile:not(:disabled):hover {
    box-shadow: var(--shadow);
}

.product-tile:not(:disabled):active {
    transform: scale(0.97);
}

.product-tile:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.product-tile.in-cart {
    border-color: var(--accent);
}

.product-photo {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    background: color-mix(in srgb, var(--accent) 12%, #FFFFFF);
}

.product-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-photo-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 2.8rem;
}

.product-tile:disabled .product-photo {
    filter: grayscale(0.8);
}

.product-flag {
    position: absolute;
    inset-block-start: 0.5rem;
    inset-inline-start: 0.5rem;
}

.product-qty {
    position: absolute;
    inset-block-start: 0.45rem;
    inset-inline-end: 0.45rem;
    min-width: 32px;
    height: 32px;
    padding-inline: 0.4rem;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 800;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(26, 40, 89, 0.3);
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.55rem 0.8rem 0.65rem;
}

.product-name {
    font-weight: 700;
    line-height: 1.25;
}

.product-price {
    font-weight: 800;
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.chip {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: var(--canvas);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.chip-warn {
    background: #FFF3CD;
    color: #8A6100;
}

.chip-danger {
    background: #FEE9F3;
    color: #D81B70;
}

/* Ticket-history kind chips: sale (neutral), park entry (in), park exit (out). */
.ticket-kind {
    display: inline-block;
    margin-top: 0.25rem;
}
.ticket-kind-entry {
    background: #E3F6EC;
    color: #12794A;
}
.ticket-kind-exit {
    background: #E7EEFF;
    color: #2B4FA0;
}

/* ---------- The receipt cart (signature) ---------- */

.ticket {
    position: sticky;
    top: 84px;
    filter: drop-shadow(0 4px 12px rgba(26, 40, 89, 0.14));
}

.ticket-inner {
    background: var(--paper);
    padding: 1.5rem 1.25rem;
    /* perforated tear edges, top and bottom */
    --notch: 10px;
    clip-path: polygon(
        0 var(--notch),
        4% 0, 8% var(--notch), 12% 0, 16% var(--notch), 20% 0, 24% var(--notch),
        28% 0, 32% var(--notch), 36% 0, 40% var(--notch), 44% 0, 48% var(--notch),
        52% 0, 56% var(--notch), 60% 0, 64% var(--notch), 68% 0, 72% var(--notch),
        76% 0, 80% var(--notch), 84% 0, 88% var(--notch), 92% 0, 96% var(--notch), 100% 0,
        100% calc(100% - var(--notch)),
        96% 100%, 92% calc(100% - var(--notch)), 88% 100%, 84% calc(100% - var(--notch)),
        80% 100%, 76% calc(100% - var(--notch)), 72% 100%, 68% calc(100% - var(--notch)),
        64% 100%, 60% calc(100% - var(--notch)), 56% 100%, 52% calc(100% - var(--notch)),
        48% 100%, 44% calc(100% - var(--notch)), 40% 100%, 36% calc(100% - var(--notch)),
        32% 100%, 28% calc(100% - var(--notch)), 24% 100%, 20% calc(100% - var(--notch)),
        16% 100%, 12% calc(100% - var(--notch)), 8% 100%, 4% calc(100% - var(--notch)), 0 100%
    );
    padding-block: calc(1.5rem + var(--notch));
}

.ticket-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    border-block-end: 2px dashed var(--line);
    padding-block-end: 0.9rem;
    margin-block-end: 0.9rem;
}

.ticket-title {
    font-weight: 800;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
}

.ticket-sub {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.ticket-lines {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 40vh;
    overflow-y: auto;
}

.ticket-line {
    border-block-end: 1px dashed var(--line);
    padding-block-end: 0.6rem;
}

.ticket-line-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-block-end: 0.4rem;
}

.ticket-line-name {
    font-weight: 700;
}

.ticket-line-subtotal {
    font-variant-numeric: tabular-nums;
}

/* A loaded table's lines are already priced and prepared — shown read-only,
   no steppers, the quantity tucked to the side. */
.ticket-line--fixed {
    padding-block-end: 0.5rem;
}

.ticket-line--fixed .ticket-line-top {
    margin-block-end: 0;
}

.ticket-line-qty {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Which table the caisse ticket is settling. */
.ticket-settle-banner {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-block-end: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 10px;
    background: color-mix(in srgb, var(--accent) 15%, transparent);
    color: var(--ink);
    font-weight: 800;
}

.ticket-line-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ticket-line-remove {
    margin-inline-start: auto;
    min-width: 44px;
    min-height: 44px;
    border: none;
    background: transparent;
    color: var(--danger);
    font-size: 1.4rem;
    font-weight: 800;
    cursor: pointer;
    border-radius: 8px;
}

/* Settle-mode lines: each can be voided (annulation) or partly ticked to
   pay separately (séparation de l'addition). */
.ticket-line--settle .ticket-line-top {
    align-items: center;
}

.ticket-line--settle.is-splitting {
    background: color-mix(in srgb, #FFC107 18%, transparent);
    border-radius: 10px;
    padding-inline: 0.4rem;
}

.ticket-line-void {
    min-width: 40px;
    min-height: 40px;
    border: none;
    background: transparent;
    color: var(--danger);
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    border-radius: 8px;
}

.ticket-line-split {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-block-start: 0.15rem;
}

.ticket-line-split .split-tag {
    font-size: 0.95rem;
    opacity: 0.7;
}

.split-stepper .stepper-value {
    min-width: 2ch;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* A cancelled line stays on the ticket, struck and muted, for transparency. */
.ticket-line--void {
    opacity: 0.65;
}

.ticket-line--void .ticket-line-name {
    text-decoration: line-through;
    font-weight: 600;
}

.ticket-line--void .ticket-line-subtotal {
    color: var(--danger);
    text-decoration: line-through;
}

.ticket-line-voidtag {
    display: inline-block;
    margin-block-start: 0.15rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--danger);
    font-weight: 800;
}

/* A voided line in the "tables to settle" strip card. */
.order-item-void {
    text-decoration: line-through;
    opacity: 0.55;
}

/* Emoji icons (Twemoji SVG, native emoji as fallback). Category tabs carry a
   small one; a product with no photo shows its category's icon big. */
.cat-icon {
    display: inline-flex;
    align-items: center;
}

.cat-icon img.emoji,
.category-tabs img.emoji {
    height: 1.2em;
    width: 1.2em;
    vertical-align: -0.2em;
    margin: 0;
}

.product-photo-fallback img.emoji {
    width: 2.8rem;
    height: 2.8rem;
}

/* Packs tab (formules): meal + park-time deal cards on the Buvette caisse. */
.packs-panel {
    padding-block: 0.5rem;
}

.pack-form {
    display: grid;
    gap: 0.6rem;
    margin-block-end: 1rem;
}

.pack-form .scan-input {
    width: 100%;
}

.pack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.pack-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.9rem;
    text-align: start;
    border: 2px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    min-height: 104px;
    touch-action: manipulation;
}

.pack-card:hover {
    border-color: var(--accent);
}

.pack-card.is-selling {
    opacity: 0.6;
}

.pack-name {
    font-weight: 800;
}

.pack-meta {
    flex: 1;
    font-size: 0.8rem;
    color: var(--muted);
}

.pack-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--accent);
}

/* "Pay selected" (split) — yellow, distinct from the lime Charge button. */
.btn-split {
    background: #FFC107;
    color: #1A2859;
    border: 2px solid #FFC107;
    font-weight: 800;
}

/* The Split toggle: a clear, labelled way into séparation mode. Sits under
   the table banner, outlined until active, then filled yellow. */
.btn-split-toggle {
    display: block;
    width: 100%;
    margin-block-end: 0.6rem;
    background: transparent;
    color: var(--ink);
    border: 2px dashed #FFC107;
    font-weight: 800;
}

.btn-split-toggle.is-active {
    background: #FFC107;
    color: #1A2859;
    border-style: solid;
}

.split-hint {
    margin-block-end: 0.6rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
}

.ticket-empty {
    color: var(--muted);
    text-align: center;
    padding-block: 1.25rem;
}

/* Admin-only discount field inside the receipt cart. */
.ticket-discount {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-block-start: 0.9rem;
}

.ticket-discount label {
    font-weight: 700;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ticket-discount input {
    width: 110px;
    min-height: 44px;
    padding: 0.4rem 0.7rem;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    text-align: end;
    font-variant-numeric: tabular-nums;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--ink);
}

/* Gestion des crédits: the "put it on a tab" picker + the revealed Dette
   button, shared by every register (retail, VR, park exit). A dashed purple
   card that fills solid once a customer is chosen, so the cashier sees at a
   glance the sale is going on credit. */
.credit-option {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-block-start: 0.9rem;
    padding: 0.7rem 0.8rem;
    border: 2px dashed color-mix(in srgb, var(--purple) 45%, var(--line));
    border-radius: 12px;
    background: color-mix(in srgb, var(--purple) 6%, var(--card));
    transition: border-color 0.15s ease, background 0.15s ease;
}

.credit-option label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--purple);
}

.credit-option .select {
    width: 100%;
    min-height: var(--tap-target);
    font-weight: 700;
}

.credit-option.is-active {
    border-style: solid;
    border-color: var(--purple);
    background: color-mix(in srgb, var(--purple) 12%, var(--card));
}

#payment-seg [data-method="credit"] {
    grid-column: 1 / -1;
}

#payment-seg [data-method="credit"].selected {
    border-color: var(--purple);
    background: var(--purple);
    color: #fff;
}

.ticket-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-block-start: 2px dashed var(--line);
    margin-block-start: 0.9rem;
    padding-block: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ticket-total-row strong {
    font-size: 1.65rem;
    font-variant-numeric: tabular-nums;
}

.ticket-actions {
    display: flex;
    gap: 0.75rem;
}

.ticket-actions .btn-primary {
    flex: 1;
}

/* POS ticket buttons (Vider · Payer la sélection · Encaisser): whether two or
   three are showing, they share the row evenly and shrink to fit — the split
   button no longer pushes the row past the panel width. */
.ticket .ticket-actions {
    gap: 0.5rem;
}

.ticket .ticket-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 0.55rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Steppers ---------- */

.stepper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.stepper-btn {
    min-width: 44px;
    min-height: 44px;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    font-size: 1.3rem;
    font-weight: 800;
    font-family: inherit;
    color: var(--ink);
    cursor: pointer;
    touch-action: manipulation;
}

.stepper-btn:active {
    background: var(--canvas);
}

.stepper-value {
    min-width: 2.2ch;
    text-align: center;
    font-weight: 800;
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

.stepper-lg .stepper-btn {
    min-width: 76px;
    min-height: 76px;
    font-size: 2rem;
}

.stepper-lg .stepper-value {
    font-size: 3rem;
    min-width: 3ch;
}

.stepper-lg {
    justify-content: center;
    width: 100%;
    gap: 1.5rem;
    margin-block: 1rem;
}

/* ---------- Segmented payment control ---------- */

.segmented {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-block: 1rem;
}

.segmented button {
    min-height: var(--tap-target);
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    color: var(--muted);
    cursor: pointer;
    touch-action: manipulation;
}

.segmented button.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

/* Waiter cart: dine-in / take-away switch + table number stepper. */
.order-mode-seg {
    margin-block: 0.9rem 0;
}

/* Table number: a directly-typed field (replaces the +/- stepper). */
.table-input {
    inline-size: 4.5rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    padding: 0.3rem 0.5rem;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: #FFFFFF;
    color: var(--ink);
}

.table-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Waiter order cart: give the table + extra-note fields room to breathe and
   full-width inputs, instead of the cramped right-aligned discount box. */
.pos--order .order-mode-seg {
    margin-block-start: 1.1rem;
}

.pos--order .order-table-row {
    margin-block-start: 0.9rem;
    padding: 0.55rem 0.4rem 0.55rem 0.85rem;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: var(--card);
}

/* The extra note stacks: label above a full-width, left-aligned input. */
.pos--order .ticket-discount:not(.order-table-row) {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    margin-block-start: 1.1rem;
}

.pos--order .ticket-discount:not(.order-table-row) input {
    width: 100%;
    min-height: 48px;
    text-align: start;
    font-size: 1rem;
    font-weight: 600;
}

.pos--order .ticket-actions {
    margin-block-start: 1.4rem;
}

/* Named % reduction buttons (Personnel, Amis, Remise…) on the caisse. */
.staff-toggle {
    margin-block-start: 0.9rem;
}

/* Stacked full-width: the ticket is narrow — two buttons side by side
   ("👥 Personnel (−30%)" + "🤝 Amis (−15%)") end up unreadably small. */
.rate-toggles {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    margin-block-start: 0.9rem;
}

.rate-toggles .staff-toggle {
    margin-block-start: 0;
    width: 100%;
    white-space: nowrap;
}

.staff-toggle.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

/* ---------- VR ---------- */

.vr-card {
    max-width: 520px;
    margin-inline: auto;
    text-align: center;
}

.vr-rates {
    font-variant-numeric: tabular-nums;
}

.vr-total {
    text-align: start;
}

/* ---------- Park de Jeu ---------- */

.park-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

.park-card {
    margin-block-end: 0;
}

.park-divider {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-block: 1.25rem;
}

.park-divider::before,
.park-divider::after {
    content: '';
    flex: 1;
    border-block-start: 2px dashed var(--line);
}

/* Loyalty desk: its own screen for card sales, balances and the register. */
.loyalty-desk {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
    margin-block-end: 1.25rem;
}

.loyalty-head {
    margin-block-end: 0.5rem;
}

.head-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.loyalty-head .section-title {
    margin-block: 0;
}

@media (max-width: 640px) {
    .loyalty-desk {
        grid-template-columns: 1fr;
    }
}

/* Recharge desk: hours and price side by side. */
.recharge-time {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin-block: 0.5rem 0.9rem;
}

.recharge-time .field {
    margin-block-end: 0;
}

.recharge-result {
    margin-block-start: 0.9rem;
    font-weight: 700;
    color: var(--ink);
}

.scan-row {
    display: flex;
    gap: 0.6rem;
    margin-block-end: 0.9rem;
}

.scan-row .scan-input {
    flex: 1;
}

/* Entry autocomplete: a dropdown of returning kids under the name field. */
.autocomplete {
    position: relative;
    flex: 1;
}

.autocomplete .scan-input {
    width: 100%;
}

.autocomplete-menu {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 4px);
    z-index: 30;
    margin: 0;
    padding: 0.3rem;
    list-style: none;
    background: var(--card);
    border: 2px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-height: 280px;
    overflow-y: auto;
}

.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    min-height: 44px;
}

.autocomplete-item:hover {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.autocomplete-item .ac-name {
    font-weight: 700;
}

.autocomplete-item .ac-phone {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.qr-code {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-align: center;
    background: var(--canvas);
    border: 2px dashed var(--line);
    border-radius: 10px;
    padding: 1rem;
    margin-block: 1rem;
    font-variant-numeric: tabular-nums;
}

.park-dialog {
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(26, 40, 89, 0.3);
    padding: 1.75rem;
    width: min(440px, 92vw);
}

.park-dialog::backdrop {
    background: rgba(26, 40, 89, 0.55);
}

/* ---------- Data table ---------- */

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: start;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    padding: 0.6rem 0.75rem;
    border-block-end: 2px solid var(--line);
}

.data-table td {
    padding: 0.75rem;
    border-block-end: 1px solid var(--line);
    font-size: 1.02rem;
}

.mono {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    font-weight: 700;
}

/* Admin tariff page: the standard-block price schedule under the inputs. */
.tariff-grid {
    margin-block-start: 0.85rem;
    max-width: 22rem;
}

.tariff-grid td {
    padding-block: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.tariff-grid td:last-child {
    text-align: end;
    font-weight: 700;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Products screen: the Modèle/Import/Export/Nouveau row wraps on small
   screens — smaller buttons, air below before the station filter. */
#products-root .card-head-row {
    flex-wrap: wrap;
    margin-block-end: 1rem;
}

#products-root .card-head-row .card-title {
    margin-block-end: 0;
}

#products-root .table-actions {
    flex-wrap: wrap;
    margin-block-end: 0.25rem;
}

#products-root .table-actions .btn {
    min-height: 42px;
    padding: 0.3rem 0.85rem;
    font-size: 0.88rem;
}

/* ---------- Paid overlay ---------- */

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 40, 89, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    /* above the mobile cart sheet (z 50) */
    z-index: 60;
    padding: 1.5rem;
}

.overlay-card {
    background: var(--paper);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: min(420px, 100%);
    text-align: center;
}

.overlay-check {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--ok);
    color: #fff;
    font-size: 2.4rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-block-end: 1rem;
}

.overlay-card h2 {
    font-size: 1.4rem;
    font-weight: 800;
}

.overlay-total {
    font-size: 2.6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    margin-block: 0.75rem 1.5rem;
}

/* ---------- Admin dashboard ---------- */

.filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.5rem;
}

.filter-presets {
    display: flex;
    gap: 0.5rem;
}

.filter-presets .btn.selected {
    border-color: var(--marquee);
    background: #E0F8FA;
}

.filter-dates {
    display: flex;
    gap: 1rem;
}

.filter-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--muted);
    font-size: 0.9rem;
}

.filter-date input {
    min-height: 44px;
    padding: 0.4rem 0.7rem;
    border: 2px solid var(--line);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--card);
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-block-end: 1.25rem;
}

.stat-tile {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.4rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-size: 2.1rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.stat-unit {
    font-size: 1.1rem;
    color: var(--muted);
    font-weight: 700;
}

.stat-label {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Horizontal bar chart: thin marks, rounded data-end, recessive track. */

.barchart {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.bar-row {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) 110px;
    align-items: center;
    gap: 0.9rem;
}

.bar-label {
    font-weight: 700;
    text-align: end;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    background: var(--canvas);
    border-radius: 4px;
    block-size: 26px;
}

.bar-fill {
    block-size: 100%;
    border-start-end-radius: 4px;
    border-end-end-radius: 4px;
    min-inline-size: 0;
    transition: inline-size 0.3s ease;
}

.bar-value {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}

.chart-tooltip {
    position: fixed;
    z-index: 60;
    background: var(--night);
    color: var(--night-ink);
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow);
}

.admin-columns {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.25rem;
    align-items: start;
}

.data-table th.num,
.data-table td.num {
    text-align: end;
    font-variant-numeric: tabular-nums;
}

.mono-strong {
    font-weight: 800;
}

.chip-ok {
    background: #EEF7DF;
    color: var(--ok-ink);
}

@media (max-width: 1024px) {
    .admin-columns {
        grid-template-columns: 1fr;
    }

    .bar-row {
        grid-template-columns: 110px minmax(0, 1fr) 100px;
    }
}

/* ---------- Admin transactions ---------- */

.tx-row {
    cursor: pointer;
}

.tx-cancelled td {
    color: var(--muted);
    text-decoration: line-through;
}

.tx-cancelled td:last-child,
.tx-cancelled td.tx-status-cell,
.tx-cancelled td .chip {
    text-decoration: none;
}

/* "Annulé par <cashier> · <time>" on its own line under the status chip. Its
   cell is exempt from the row's line-through, so a plain block reads clean. */
.tx-canceller {
    display: block;
    margin-block-start: 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--danger);
    white-space: nowrap;
}

.tx-detail td {
    background: var(--canvas);
    padding-block: 0.5rem;
}

.tx-item-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.35rem 0.5rem;
}

.tx-item-line span {
    flex: 1;
}

/* A voided line kept for the audit trail: struck through, its price negative. */
.tx-item-void span {
    text-decoration: line-through;
    color: var(--muted);
}

.tx-item-void strong {
    color: var(--danger);
    text-decoration: line-through;
}

.select-inline {
    width: auto;
    min-height: 44px;
    padding: 0.4rem 0.7rem;
    font-size: 1rem;
}

/* ---------- Admin management ---------- */

.admin-nav {
    display: flex;
    gap: 0.5rem;
    margin-block-end: 1.25rem;
    flex-wrap: wrap;
}

.admin-nav a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 48px;
    padding: 0.5rem 1.2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 800;
    color: var(--muted);
    background: var(--card);
    border: 2px solid var(--line);
}

.admin-nav a.active {
    background: var(--night);
    border-color: var(--night);
    color: var(--night-ink);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1.25rem;
}

.dialog-wide {
    width: min(640px, 94vw);
}

.select {
    width: 100%;
    min-height: var(--tap-target);
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
    font-family: inherit;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--ink);
}

.btn-sm-danger {
    color: #D81B70;
    border-color: #FBC4DD;
}

/* Product photo thumbnails (admin table + edit dialog). */
.photo-thumb {
    display: inline-block;
    width: 52px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    vertical-align: middle;
}

.category-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-row .select {
    flex: 1;
}

.barcode-sub {
    font-size: 0.78rem;
    color: var(--muted);
}

.photo-thumb-empty {
    background: var(--canvas);
    border: 2px dashed var(--line);
}

.photo-field {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.photo-field input[type="file"] {
    flex: 1;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--muted);
}

.photo-field .photo-thumb {
    width: 72px;
    height: 54px;
}

.station-config {
    border-inline-start: 6px solid var(--accent);
}

.station-config-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.station-config .ticket-actions {
    justify-content: flex-end;
}

.station-config .ticket-actions .btn-primary {
    flex: 0 0 auto;
}

.station-feedback {
    text-align: end;
    font-weight: 700;
    margin-block-start: 0.5rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Printable report ---------- */

.report {
    max-width: 900px;
    margin-inline: auto;
    padding: 1.5rem;
}

.report-head {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-block-end: 1.5rem;
}

.report-head h1 {
    font-size: 1.5rem;
    font-weight: 800;
}

.report-head > div {
    flex: 1;
}

.report-logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.report-foot {
    text-align: center;
    margin-block-start: 1.5rem;
}

@media print {
    .no-print {
        display: none !important;
    }

    body.report-page {
        background: #fff;
    }

    .report .card,
    .report .stat-tile {
        box-shadow: none;
        border: 1px solid var(--line);
        break-inside: avoid;
    }
}

/* ---------- Mobile cart sheet (waiters order from their phones) ---------- */

html {
    scroll-behavior: smooth;
}

/* The floating bar and the sheet chrome only exist on small screens. */
.cart-jump,
.cart-backdrop,
.ticket-close {
    display: none;
}

@media (max-width: 1024px) {
    .cart-jump {
        position: fixed;
        inset-block-end: calc(1rem + env(safe-area-inset-bottom, 0px));
        inset-inline: 1rem;
        z-index: 40;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        min-height: 56px;
        padding: 0.6rem 1.25rem;
        border: none;
        border-radius: 999px;
        background: var(--night);
        color: var(--night-ink);
        font-family: inherit;
        font-weight: 800;
        font-size: 1.05rem;
        cursor: pointer;
        touch-action: manipulation;
        box-shadow: 0 6px 24px rgba(26, 40, 89, 0.35);
    }

    .cart-jump strong {
        font-variant-numeric: tabular-nums;
    }

    .cart-jump-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 30px;
        height: 30px;
        padding-inline: 0.4rem;
        border-radius: 999px;
        background: var(--marquee);
        color: var(--night);
        font-variant-numeric: tabular-nums;
    }

    .cart-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 45;
        background: rgba(26, 40, 89, 0.45);
    }

    .cart-backdrop[hidden] {
        display: none;
    }

    body.cart-open {
        overflow: hidden;
    }
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
    .pos {
        grid-template-columns: 1fr;
        /* keep the last product row clear of the floating bar */
        padding-block-end: 5rem;
    }

    /* The receipt cart becomes a slide-up bottom sheet. */
    .ticket {
        position: fixed;
        inset-inline: 0;
        inset-block-end: 0;
        z-index: 50;
        transform: translateY(calc(100% + 24px));
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0.22, 1);
    }

    .ticket.open {
        transform: none;
    }

    .ticket-inner {
        position: relative;
        max-height: min(84dvh, 84vh);
        overflow-y: auto;
        overscroll-behavior: contain;
        /* the sheet sits flush with the screen bottom: no tear edge there */
        clip-path: polygon(
            0 var(--notch),
            4% 0, 8% var(--notch), 12% 0, 16% var(--notch), 20% 0, 24% var(--notch),
            28% 0, 32% var(--notch), 36% 0, 40% var(--notch), 44% 0, 48% var(--notch),
            52% 0, 56% var(--notch), 60% 0, 64% var(--notch), 68% 0, 72% var(--notch),
            76% 0, 80% var(--notch), 84% 0, 88% var(--notch), 92% 0, 96% var(--notch), 100% 0,
            100% 100%, 0 100%
        );
        padding-block-end: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    }

    .ticket-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        inset-block-start: calc(0.5rem + var(--notch, 10px));
        inset-inline-end: 0.75rem;
        min-width: 44px;
        min-height: 44px;
        border: none;
        border-radius: 999px;
        background: var(--canvas);
        color: var(--muted);
        font-size: 1.1rem;
        font-weight: 800;
        font-family: inherit;
        cursor: pointer;
        touch-action: manipulation;
    }

    .park-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 1rem;
    }

    /* Keep the category filter reachable while scrolling a long menu. */
    .category-tabs {
        position: sticky;
        inset-block-start: 0;
        z-index: 30;
        background: var(--canvas);
        padding-block: 0.5rem;
        margin-block-end: 0.5rem;
    }

    /* One slim row on phones: logo, language, badge, exit — the screen
       belongs to the register, not the chrome. */
    .topbar {
        flex-wrap: nowrap;
        gap: 0.5rem;
        padding: 0.4rem 0.75rem;
    }

    .topbar-brand-text,
    .user-chip-name {
        display: none;
    }

    .topbar-logo {
        height: 34px;
        width: 34px;
    }

    .topbar-nav {
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    .lang-btn {
        min-width: 40px;
        min-height: 38px;
    }

    .topbar .btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.85rem;
        min-height: 38px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.7rem;
    }

    .station-bar {
        padding: 0.8rem 1rem;
        flex-wrap: wrap;
    }

    .station-name {
        font-size: 1.2rem;
    }

    .tile-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .card {
        padding: 1.25rem;
    }

    /* Table by table on a phone: near-full-width cards, hard snap. */
    .orders-strip {
        scroll-snap-type: x mandatory;
    }

    .table-card {
        flex: 0 0 min(85vw, 340px);
    }

    .pos-tab {
        font-size: 0.92rem;
        padding-inline: 0.9rem;
    }
}

/* Small phones (walk-up registers): tighter tiles so the menu shows 3-up. */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
        gap: 0.5rem;
    }

    .product-info {
        padding: 0.45rem 0.55rem 0.55rem;
    }

    .product-name {
        font-size: 0.98rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .product-photo-fallback {
        font-size: 2.1rem;
    }
}

/* ---------- Waiter screen (pos--order), mobile-first ----------
   Order-taking is a list job, not a gallery: dense rows (small photo,
   name, price, inline − once in the cart), slim chrome above. */

.tile-minus {
    display: none;
}

@media (max-width: 1024px) {
    .pos--order .station-bar {
        padding: 0.55rem 0.9rem;
        margin-block-end: 0.6rem;
    }

    .pos--order .station-back {
        font-size: 0.72rem;
    }

    .pos--order .station-name {
        font-size: 1.05rem;
    }

    .pos--order .orders-board-row {
        margin-block-end: 0.5rem;
    }

    /* Keep the category slider reachable on tablets too, not just ≤640. */
    .pos--order .category-tabs {
        position: sticky;
        inset-block-start: 0;
        z-index: 30;
        background: var(--canvas);
        padding-block: 0.5rem;
        margin-block-end: 0.5rem;
    }

    .pos--order .product-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .pos--order .product-tile {
        flex-direction: row;
        align-items: center;
        gap: 0.65rem;
        min-height: 62px;
        padding-inline-end: 0.5rem;
        border-block-end-width: 2px;
        border-inline-start: 5px solid var(--accent);
        border-radius: 12px;
    }

    .pos--order .product-photo {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
        aspect-ratio: 1 / 1;
        border-radius: 9px;
        overflow: hidden;
        margin: 7px 0 7px 7px;
        align-self: center;
    }

    .pos--order .product-photo-fallback {
        font-size: 1.5rem;
    }

    /* Row layout: stock chips would cover the tiny photo. */
    .pos--order .product-flag {
        display: none;
    }

    .pos--order .product-qty {
        inset-block-start: 50%;
        transform: translateY(-50%);
        inset-inline: 0;
        margin-inline: auto;
        min-width: 26px;
        height: 26px;
        font-size: 0.9rem;
    }

    .pos--order .product-info {
        flex: 1;
        min-width: 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.6rem;
        padding: 0;
    }

    .pos--order .product-name {
        font-size: 0.95rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .pos--order .product-price {
        font-size: 0.95rem;
        white-space: nowrap;
    }

    /* The inline − appears once the row is in the cart. */
    .pos--order .product-tile.in-cart .tile-minus {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 44px;
        min-height: 44px;
        border-radius: 10px;
        border: 2px solid var(--line);
        background: var(--canvas);
        color: var(--danger);
        font-size: 1.35rem;
        font-weight: 800;
        line-height: 1;
    }
}

/* ---------- Park wall board (dedicated display screen) ---------- */

.board-page {
    min-height: 100vh;
    background: var(--night);
    color: var(--night-ink);
    padding: 1.5rem clamp(1rem, 3vw, 3rem) 3rem;
}

.board-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-block-end: 1.5rem;
}

.board-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.board-title {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 800;
    flex: 1;
}

.board-count {
    background: var(--marquee);
    color: var(--night);
    font-size: 1.1rem;
    min-width: 2.4rem;
    text-align: center;
}

.board-clock {
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    opacity: 0.85;
}

.board-notice {
    margin-block-end: 1.25rem;
}

/* Three colour-coded type columns: Standard · Loyalty · Pack. */
.board-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    align-items: start;
}

@media (max-width: 900px) {
    .board-columns { grid-template-columns: 1fr; }
}

.board-col {
    --col: var(--marquee);
    background: var(--night-soft);
    border-radius: var(--radius);
    padding: 1rem;
    border-top: 4px solid var(--col);
}

.board-col--standard { --col: #00C2D1; } /* cyan */
.board-col--loyalty  { --col: #B267C6; } /* purple */
.board-col--pack     { --col: #FFC107; } /* gold */

.board-col-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-block-end: 0.9rem;
}

.board-col-dot {
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 999px;
    background: var(--col);
    flex: none;
}

.board-col-title {
    flex: 1;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-weight: 800;
}

.board-col-count {
    min-width: 2rem;
    text-align: center;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background: var(--col);
    color: var(--night);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.board-col-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.board-card {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    border-inline-start: 5px solid var(--col);
}

.board-card-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.board-card-name {
    flex: 1;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    font-weight: 800;
    overflow-wrap: anywhere;
}

/* Health/safety flag: a red dot only — the note text never shows on the wall. */
.board-note-dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 999px;
    background: var(--danger);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 30%, transparent);
    flex: none;
}

.board-card.has-note {
    background: color-mix(in srgb, var(--danger) 14%, rgba(255, 255, 255, 0.05));
}

.board-card-meta {
    opacity: 0.6;
    font-size: 0.82rem;
    font-weight: 700;
    margin-block: 0.1rem 0.5rem;
}

.board-card-timer {
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    color: var(--col);
}

.board-card-sub {
    margin-block-start: 0.2rem;
    font-weight: 700;
    font-size: 0.8rem;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Pack countdown urgency: last 10 min amber, over → pulsing red. */
.board-card.is-warn { border-inline-start-color: var(--warn); }
.board-card.is-warn .board-card-timer { color: var(--warn); }
.board-card.is-over { border-inline-start-color: var(--danger); }

@keyframes board-pulse {
    50% { opacity: 0.5; }
}

.board-card.is-over .board-card-timer {
    color: var(--danger);
    animation: board-pulse 1.4s ease-in-out infinite;
}

/* "Solde épuisé" / "Temps écoulé": the reason has to read as loudly as the
   clock, since neither one costs the family anything — it is a staff alert. */
.board-card.is-over .board-card-sub {
    color: var(--danger);
    font-weight: 800;
}

.board-col-empty {
    text-align: center;
    font-weight: 700;
    opacity: 0.4;
    padding-block: 1.5rem;
}

/* ---------- Buvette caisse: tabs (tables to settle / catalog) ---------- */

.pos-tabs {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-block-end: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.pos-tabs::-webkit-scrollbar {
    display: none;
}

.pos-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: var(--tap-target);
    padding: 0.5rem 1.15rem;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
}

.pos-tab.selected {
    border-color: var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
}

.pos-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding-inline: 0.35rem;
    border-radius: 999px;
    background: var(--card);
    color: var(--ink);
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--line);
}

.pos-tab.selected .pos-tab-count {
    border-color: transparent;
}

.pos-tabs-board {
    margin-inline-start: auto;
    white-space: nowrap;
}

/* ---------- Buvette caisse: orders-to-settle strip ---------- */

.orders-panel {
    background: color-mix(in srgb, var(--accent) 10%, #FFFFFF);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    margin-block-end: 1rem;
}

.orders-empty {
    color: var(--muted);
    font-weight: 700;
    text-align: center;
    padding-block: 1.5rem;
}

.orders-empty:not([hidden]) + .orders-strip {
    display: none;
}

/* Quick-jump chips: one per waiting table, glides the strip to its card. */
.table-jump {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    margin-block-end: 0.75rem;
    scrollbar-width: none;
}

.table-jump::-webkit-scrollbar {
    display: none;
}

.table-jump-chip {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0.3rem 0.95rem;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
}

.table-jump-chip:active {
    transform: scale(0.95);
}

/* Table-by-table: the strip snaps one card at a time. */
.orders-strip {
    display: flex;
    gap: 0.9rem;
    overflow-x: auto;
    padding-block-end: 0.25rem;
    scroll-snap-type: x proximity;
    scroll-behavior: smooth;
    scroll-padding-inline-start: 0.1rem;
}

.orders-strip .order-card {
    scroll-snap-align: start;
}

.order-card {
    flex: 0 0 240px;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.8rem 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-card.is-busy {
    opacity: 0.5;
    pointer-events: none;
}

.order-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--ink);
}

.order-card-age {
    color: var(--muted);
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.order-card-items {
    list-style: none;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.5;
    flex: 1;
}

.order-card-note {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.order-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    border-block-start: 1px dashed var(--line);
    padding-block-start: 0.5rem;
}

.order-card-total {
    color: var(--ink);
    font-size: 1.05rem;
    white-space: nowrap;
}

.order-card-add {
    white-space: nowrap;
}

/* ---------- Buvette: table grouping + open-orders board ---------- */

.orders-board-row {
    display: flex;
    justify-content: flex-end;
    margin-block-end: 0.75rem;
}

.required-star {
    color: var(--danger);
}

.table-card {
    flex-basis: 260px;
}

.table-card-order {
    position: relative;
    border-block-start: 1px dashed var(--line);
    padding-block-start: 0.4rem;
}

.table-card-order-meta {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    padding-inline-end: 2rem;
}

.table-card-order-cancel {
    position: absolute;
    inset-block-start: 0.25rem;
    inset-inline-end: 0;
    padding: 0.1rem 0.45rem;
    line-height: 1;
}

.board-back {
    white-space: nowrap;
}

.board-logout {
    display: inline-flex;
    margin: 0;
}

/* Board head buttons (back, log out) sit on the dark board — keep them light. */
.board-head .btn-ghost {
    color: var(--night-ink);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

/* Per-kid pause: a small control on each card. Paused → the button lights up
   and that one kid's frozen counter reads dimmed; other cards keep counting. */
.board-card-pause {
    flex: none;
    border: 1px solid color-mix(in srgb, var(--night-ink) 35%, transparent);
    background: transparent;
    color: var(--night-ink);
    border-radius: 8px;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
}

.board-card-pause.is-paused {
    background: var(--marquee);
    border-color: var(--marquee);
    color: var(--night);
}

.board-card-paused .board-card-timer {
    opacity: 0.5;
}

/* Open-orders board: a responsive card grid — several columns on a wall
   screen, auto-collapsing to a single column on a phone. */
.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
    align-items: start;
}

.board-empty {
    text-align: center;
    font-weight: 700;
    opacity: 0.6;
    padding-block: 2rem;
}

.orders-board-grid .order-card {
    flex: initial;
}

.orders-board-grid .order-card-items {
    font-size: 1.15rem;
}

/* Phones: tighten the board chrome so the head and cards fit a narrow screen. */
@media (max-width: 640px) {
    .board-page {
        padding: 1rem 0.9rem 2rem;
    }

    .board-logo {
        width: 40px;
        height: 40px;
    }

    /* Logo + title share the first line; count, clock and buttons wrap below. */
    .board-title {
        font-size: 1.3rem;
        min-width: 0;
    }

    .board-columns {
        gap: 0.9rem;
    }

    .board-col {
        padding: 0.85rem;
    }

    .board-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
}
