/* 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;
    }
}

/* ---------- 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;
}

.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%);
}

/* ---------- 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;
}

/* 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;
}

.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;
}

.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;
}

/* 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;
}

@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;
}

/* ---------- 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;
}

.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);
}

.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;
}

/* ---------- 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-stepper .stepper-value {
    font-size: 1.5rem;
    min-width: 3ch;
}

/* 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;
}

.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;
}

.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 .chip {
    text-decoration: none;
}

.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;
}

.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.88rem;
    }

    .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;
    gap: 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;
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.board-tile {
    background: var(--night-soft);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    border-inline-start: 6px solid var(--marquee);
}

.board-name {
    font-size: clamp(1.3rem, 2.2vw, 1.7rem);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.board-meta {
    color: var(--night-ink);
    opacity: 0.65;
    font-size: 0.9rem;
    font-weight: 700;
    margin-block: 0.15rem 0.75rem;
}

.board-timer {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    margin-block-end: 0.6rem;
}

.board-slider {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
}

.board-slider-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--marquee);
    transition: width 1s linear;
}

.board-sub {
    margin-block-start: 0.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
}

.board-tile.is-warn {
    border-inline-start-color: var(--warn);
}

.board-tile.is-warn .board-slider-fill {
    background: var(--warn);
}

.board-tile.is-over {
    border-inline-start-color: var(--danger);
}

.board-tile.is-over .board-slider-fill {
    background: var(--danger);
}

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

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

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

/* ---------- 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;
}

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

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