/* base.css — Fonts, reset/root vars (incl. colour palette), typography, header/main layout, login banner, panels, forms, buttons.
   Split from style.css (load order matters: see the stylesheet <link> order in index.html). */
/* ============================
Orderroom Modern Skin (CSS-only)
Version 3.8 — Paul and Jim
============================ */

/* ============================
STYLESHEET MAP   (one file per area; load order in index.html = cascade order — do not reorder)
----------------------------
  base.css ............. Fonts · CSS Reset / Root Vars (colour palette) · Base / Typography ·
                         Layout: Header / Main · Login Banner (also holds receipt / print styles) ·
                         Panels · Forms / Inputs · Buttons / Badges / Status
  components.css ....... Move inline JS styles into classes · Menu Items / Orders (incl.
                         Orders-by-table rows, part-pay items) · Filters / Navigation (Pills) ·
                         Cart / Cart Rows · Cart Containers · Utilities / Helpers ·
                         Product Thumbs · Price + Favourite (row)
  screens.css .......... Screens (Tabs/Sections) · Screen: Login · Responsive: Screen grid (≥900px)
  admin.css ............ Admin Lists / Controls
  bookings.css ......... Bookings widget + availability grid
  till-layout.css ...... Product Lists (one per row on small) · Till Compact View/Mode ·
                         Desktop Layout (≥600px): Two Columns + Sticky Carts · Admin Grid (≥900px) ·
                         Home screen business card
  sheets.css ........... User Edit Sheet (slide-up) · variation / options picker
  modals.css ........... modals / sheets system ("modal-overlay {", ".sheet {") · Shared modal
                         panel · Stripe Embedded Checkout overlay · Books tab · Reassign table
                         modal · admin/user edit-sheet fixes · order tracker (step node /
                         connector / labels) · Pickup + Table themes · Deliveries tracker
  dark-mode.css ........ Dark Mode — follows device preference
  payment-modals.css ... Toast · cash/card payment modals (banknote grid, write-off) ·
                         Split bill sheet · Service-charge edit modal · Books export picker
  features.css ......... Occupancy tab · charts · allergen / preference filter sheets ·
                         Menu Overview tree · home-screen hints
============================ */

/* ============================
Fonts
============================ */

/* Unified family — browser picks the right file via font-weight */
@font-face {
    font-family: 'Gabarito';
    src: url('fonts/Gabarito-Regular.ttf');
    font-weight: 400;
}
@font-face {
    font-family: 'Gabarito';
    src: url('fonts/Gabarito-Medium.ttf');
    font-weight: 500;
}
@font-face {
    font-family: 'Gabarito';
    src: url('fonts/Gabarito-SemiBold.ttf');
    font-weight: 600;
}
@font-face {
    font-family: 'Gabarito';
    src: url('fonts/Gabarito-Bold.ttf');
    font-weight: 700;
}
@font-face {
    font-family: 'Gabarito';
    src: url('fonts/Gabarito-ExtraBold.ttf');
    font-weight: 800;
}
@font-face {
    font-family: 'Gabarito';
    src: url('fonts/Gabarito-Black.ttf');
    font-weight: 900;
}

/* Legacy aliases so existing var(--font-bold) / GabaritoBlack refs still resolve */
@font-face {
    font-family: 'GabaritoRegular';
    src: url('fonts/Gabarito-Regular.ttf');
}
@font-face {
    font-family: 'GabaritoBold';
    src: url('fonts/Gabarito-Bold.ttf');
}
@font-face {
    font-family: 'GabaritoBlack';
    src: url('fonts/Gabarito-Black.ttf');
}

/* ============================
CSS Reset / Root Vars
============================ */

* {
    box-sizing: border-box;
}

:root {
    --textColour: #2F2F2F;
    --bg: #eef3f4;
    --surface: #ffffff;
    --panel: #ffffff;
    --ink: #2F2F2F;
    --muted: #9fb3c8;
    --line: #3D3D3D;
    --accent: #6ea8ff;
    --accent-strong: #4c6fff;
    --ok-bg: #0a3d2a;
    --ok-fg: #aef5cd;
    --bad-bg: #FFEEEE;
    --bad-fg: #C42727;
    --chip: #162033;
    --chip-line: #23324a;
    --button-primary-admin: #790e6e;
    --button-primary-customer: #02B1C4;
    --header-action-fill: #3b3b3b;

    /* Border radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    /* Spacing / gaps */
    --gap-sm: 8px;
    --gap-md: 16px;
    --space-sm: 12px;

    /* Typography */
    --font-body: 'Gabarito', 'Helvetica Neue', Arial;
    --font-bold: 'Gabarito', 'Helvetica Neue', Arial;
    --font-size-base: 1rem;
    --font-size-sm: 13px;
    --font-size-xs: 12px;
    --font-size-caption: 0.85rem;
    --font-size-body: 0.95rem;

    /* Padding presets */
    --pad-card: 12px 16px;
    --pad-btn: 8px 12px;
    --pad-item: 10px 12px;
    --pad-chip: 6px 10px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    /* Palette (literal colour tokens). Pass-1 tokenisation: each value is exactly
       the hex it replaced throughout the file, so rendering is unchanged. Colours
       used fewer than 4 times remain literal for now. Consolidating near-duplicates
       (e.g. the grey ramp) is a later, visual design decision. */
    --white: #fff;
    --black: #000;
    --brand-purple: #6b1f66;
    --brand-purple-bright: #7b2d8e;
    --brand-purple-deep: #6a1b5a;
    --brand-lilac: #c870be;
    --brand-lavender: #b892ff;
    --brand-navy: #1f3b6d;
    --red-200: #f5a0a0;
    --grey-100: #f0f0f0;
    --grey-200: #ddd;
    --grey-300: #ccc;
    --grey-400: #bbb;
    --grey-450: #aaa;
    --grey-500: #888;
    --slate-400: #9aa1ab;
    --slate-500: #6b7280;
    --grey-600: #666;
    --grey-700: #555;
    --grey-750: #3b3b3b;
    --grey-800: #333;
    --grey-850: #2a2d33;
    --grey-900: #222;

}

/* ============================
Base / Typography
============================ */

/* Reusable layout utilities — apply to elements that just need to centre
   their children with a flexbox row/column. Keeps repeated
   `display:flex; align-items:center; justify-content:center` blocks DRY. */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.flex-center-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

html,
body {
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

h1,
h2,
h3,
h4,
ul,
p,
.item,
.order {
    margin: 0 0 16px 0;
}

p.errormessage:empty {
    margin: 0;
    padding: 0;
    height: 0;
}

p.errormessage {
    padding: var(--gap-md);
    background: var(--bg);
    border-radius: var(--radius-lg);
}

h1 {
    margin: 0;
    font-size: 2.25rem;
    font-family: 'Gabarito', 'Helvetica Neue', Arial;
    font-weight: 900;
}

h2 {
    font-size: 1.75rem;
}

p,
input, select {
    font-size: var(--font-size-base);
}

ul {
    margin: 0;
    padding:0;
    list-style:none;
}

ul:not(:has(li)) {
    margin: 0!important;
}

li {
    margin:0;
}

/* ============================
Layout: Header / Main
============================ */

header {
    top: 0;
    margin: 0 auto;
    padding: 16px 20px 10px;
}

header .header {
    display: flex;
    align-items: center;
    /* vertical centering */
    justify-content: space-between;
    /* left/right alignment */
    margin-bottom: 20px;
}

main {
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width:900px) {
    main {
        grid-template-columns: 1fr 1fr 1fr;
    }

}

table {
    min-width: 900px;
}

/* ============================
Login Banner
============================ */

.cfg {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg);
    position: relative;
    flex-wrap: wrap;
}

.biz-heading {
    display: inline-flex;
    align-items: center;
    gap: 0;
    min-width: 0;
}

.biz-heading .biz {
    display: inline-flex;
    align-items: baseline;
}

.nav-context {
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-size: 2.25rem;
    font-weight: 700;
    white-space: nowrap;
}

.nav-context[hidden] {
    display: none !important;
}

.back-btn {
    color: var(--button-primary-admin);
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    padding: 0;
    margin-right: 6px;
    flex-shrink: 0;
}

.back-btn[hidden] {
    display: none !important;
}

/* Override: wins by source order when both are !important at 0-2-0 specificity */
.back-btn.back-btn--force-show {
    display: inline-flex !important;
}

.back-btn .back-arrow {
    font-size: 1.25em;
    font-weight: 900;
    line-height: 1;
}

.back-btn:hover {
    opacity: 0.75;
}

.nav-context-segment {
    font-weight: 600;
    white-space: nowrap;
    margin-left: 16px;
}

.nav-context-segment--active {
    color: var(--button-primary-admin);
    cursor: pointer;
    text-decoration: none;
    font-size: inherit;
    font-family: 'Gabarito', 'Helvetica Neue', Arial;
    font-weight: 900;
}
.nav-context-segment--current {

    font-size: inherit;
    font-family: 'Gabarito', 'Helvetica Neue', Arial;
    font-weight: 900;
}

.nav-context-sep {
    margin: 0 6px;
    color: #999;
    font-weight: 400;
}

/* Hide in-screen Return buttons (Back button delegates to them programmatically) */
a[data-admin="return"],
a[data-action="return"],
#header-return-pill {
    display: none !important;
}

/* Business heading as a button back to Directory */
h1.biz.biz-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    transition: color 140ms ease, text-shadow 140ms ease;
}

h1.biz.biz-btn:hover {
    color: var(--button-primary-admin);
}

/* Business name as breadcrumb link (admin colour, clickable) */
h1.biz.biz-breadcrumb-link {
    color: var(--button-primary-admin);
    cursor: pointer;
}

h1.biz.biz-breadcrumb-link:hover {
    opacity: 0.75;
}

@media (max-width: 640px) {
    .biz-heading {
        gap: 0;
        flex-wrap: nowrap;
    }

    .nav-context {
        font-size: 1.05rem;
    }
}

/* Centered header action pills (Print / Email / Return) */
.header-action-pills {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding: 0;
    margin: 0;
}

.header-action-pills ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.header-action-pills li {
    display: inline-flex;
}

/* Specificity bumped via combined classes / id selectors so we don't need !important
   to override .screen-pills .pill-btn { background: none } below. */
.header-action-pills.screen-pills .pill-btn,
#receipt-actions.receipt-screen-actions .pill-btn {
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    background: var(--header-action-fill);
    color: var(--white);
}

.header-action-pills .pill-btn:hover,
.header-action-pills .pill-btn:focus {
    filter: brightness(1.05);
}

.login-banner.logged-in {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 40px 6px 14px;
    background: url(images/icons/user.svg) no-repeat calc(100% - 10px) 50%;
    color: var(--ink);
    font-weight: 400;
    cursor: pointer;
    border: 2px solid var(--ink);
    border-radius: var(--radius-pill);
    transition: opacity 140ms ease;
}

.login-banner.logged-in strong {
    font-family: var(--font-bold);
    font-weight: 700;
}

.login-banner.logged-in:hover {
    opacity: 0.7;
}

/* Login banner dropdown wrapper */
.login-banner-wrap {
    position: relative;
}

.login-banner-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    background: var(--surface, var(--white));
    border: 2px solid var(--ink);
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.25);
    padding: 6px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-banner-menu[hidden] {
    display: none;
}

.login-banner-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--ink, var(--grey-900));
    font-family: var(--font-body);
    font-size: var(--font-size-body);
    cursor: pointer;
    text-align: left;
    white-space: nowrap;
}

.login-banner-menu-item[hidden] {
    display: none !important;
}

.login-banner-menu-item:hover,
.login-banner-menu-item:focus-visible {
    background: var(--line, var(--grey-100));
}

.login-banner-menu-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

header #logo {
    margin: 0;
}

/* Invisible iframe used to trigger browser print without affecting layout */
.print-frame {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
    border: 0;
}

body.receipt-print-page {
    font-family: Arial, Helvetica, sans-serif;
    padding: 20px;
    color: var(--grey-900);
    background: var(--white);
}

body.receipt-print-page .receipt-shell {
    justify-content: flex-start;
}

body.receipt-print-page .panel.receipt-panel {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0;
    box-shadow: none;
    background: var(--white);
}

body.receipt-print-page.receipt-print-page--thermal {
    width: var(--receipt-paper-width, 80mm);
    max-width: var(--receipt-paper-width, 80mm);
    padding: var(--receipt-pad-top, 2.5mm) var(--receipt-pad-right, 1.5mm) var(--receipt-pad-bottom, 3.5mm) var(--receipt-pad-left, 2.5mm);
    margin: 0 auto;
    box-sizing: border-box;
}

body.receipt-print-page.receipt-print-page--thermal .receipt-shell {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

body.receipt-print-page.receipt-print-page--thermal .panel.receipt-panel {
    width: var(--receipt-content-width, 72mm) !important;
    max-width: var(--receipt-content-width, 72mm) !important;
    padding: 0 !important;
    margin: 0 auto !important;
}

/* Force the full itemised table (Description / Unit / Qty / Amount) to show on
   the narrow thermal receipt, overriding the responsive mobile rules that hide
   the qty and amount columns at small viewports. */
body.receipt-print-page.receipt-print-page--thermal .receipt-table,
body.receipt-print-page.receipt-print-page--thermal .receipt-table thead,
body.receipt-print-page.receipt-print-page--thermal .receipt-table tbody,
body.receipt-print-page.receipt-print-page--thermal .receipt-table tr {
    display: table;
    width: 100% !important;
    table-layout: fixed;
}
body.receipt-print-page.receipt-print-page--thermal .receipt-table thead {
    display: table-header-group;
}
body.receipt-print-page.receipt-print-page--thermal .receipt-table tbody {
    display: table-row-group;
}
body.receipt-print-page.receipt-print-page--thermal .receipt-table tr {
    display: table-row;
}
body.receipt-print-page.receipt-print-page--thermal .receipt-table th,
body.receipt-print-page.receipt-print-page--thermal .receipt-table td {
    display: table-cell !important;
    padding: 2px 2px !important;
    font-size: 11px !important;
    line-height: 1.25 !important;
    vertical-align: top;
    word-break: break-word;
}
body.receipt-print-page.receipt-print-page--thermal .receipt-table th.receipt-col-unit,
body.receipt-print-page.receipt-print-page--thermal .receipt-table th.receipt-col-qty,
body.receipt-print-page.receipt-print-page--thermal .receipt-table th.receipt-col-amount,
body.receipt-print-page.receipt-print-page--thermal .receipt-table tbody td.receipt-cell-right {
    text-align: right !important;
    white-space: nowrap;
    width: auto !important;
}
body.receipt-print-page.receipt-print-page--thermal .receipt-table th.receipt-col-qty,
body.receipt-print-page.receipt-print-page--thermal .receipt-table tbody td:nth-child(3) {
    width: 22px !important;
}
body.receipt-print-page.receipt-print-page--thermal .receipt-table th.receipt-col-unit,
body.receipt-print-page.receipt-print-page--thermal .receipt-table th.receipt-col-amount,
body.receipt-print-page.receipt-print-page--thermal .receipt-table tbody td:nth-child(2),
body.receipt-print-page.receipt-print-page--thermal .receipt-table tbody td:nth-child(4) {
    width: 38px !important;
}
body.receipt-print-page.receipt-print-page--thermal .receipt-desc-row {
    display: block !important;
}

@media print {
    body.receipt-print-page {
        padding: 0;
    }

    body.receipt-print-page.receipt-print-page--thermal {
        width: var(--receipt-paper-width, 80mm);
        max-width: var(--receipt-paper-width, 80mm);
        margin: 0 auto;
    }

    body.receipt-print-page.receipt-print-page--thermal .panel.receipt-panel {
        margin: 0 auto !important;
    }
}

/* ============================
Panels
============================ */

.panel {
    background: var(--panel);
    border-radius: var(--radius-lg);
    padding: var(--gap-md);
    margin-bottom: 16px;
    width: 100%;
    overflow-x: auto;
}

/* Receipt panel: size to content, reduce padding, avoid horizontal scrolling */
.receipt-panel {
    padding-left: 8px;
    padding-right: 8px;
    display: inline-block;
    overflow: hidden;
    vertical-align: top;
}

.panel.receipt-panel {
    width: min(95vw, 980px) !important;
    display: inline-block !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    box-sizing: border-box;
    padding: var(--space-sm);
}

.receipt-shell {
    display: flex;
    justify-content: center;
}

/* Reset panel wrapper when showing a receipt */
.receipt-panel-reset {
    background: transparent;
    padding: 0;
    overflow: visible;
}

.receipt-empty-box {
    display: inline-block;
    padding: 16px 20px;
}

.receipt-screen-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin: 8px 0 16px;
}

.receipt-screen-actions:empty {
    display: none;
}

.receipt-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    transition: opacity 140ms ease;
}

.receipt-icon-btn:hover,
.receipt-icon-btn:focus-visible {
    opacity: 0.72;
}

.receipt-icon-btn img {
    display: block;
    width: 32px;
    height: 32px;
}

.receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 16px;
}

.receipt-business {
    flex: 1 1 50%;
    max-width: 48%;
}

.receipt-business-name {
    margin-bottom: 6px;
    font-size: 22px;
    font-weight: 700;
}

.receipt-business-phone {
    margin-top: 6px;
}

.receipt-meta {
    flex: 1 1 40%;
    max-width: 48%;
    text-align: right;
}

.receipt-meta-row {
    margin-top: 6px;
}

.receipt-meta-row--spaced {
    margin-top: 8px;
}

.receipt-items {
    margin-bottom: 10px;
    padding: 8px 0;
    border-top: 1px solid #e9e9e9;
    border-bottom: 1px solid #e9e9e9;
}

.receipt-items--compact {
    padding-top: 6px;
}

.receipt-items-head--compact,
.receipt-item-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: baseline;
    gap: 0 10px;
    width: 100%;
}

.receipt-items-head--compact {
    padding: 0 6px 6px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    border-bottom: 1px solid #e0e0e0;
}

.receipt-items-head-unit,
.receipt-item-unit {
    text-align: right;
    white-space: nowrap;
}

.receipt-items-head-qty,
.receipt-item-qty {
    text-align: right;
    white-space: nowrap;
}

.receipt-item-row {
    padding: 5px 6px;
    border-bottom: 1px solid #f4f4f4;
}

.receipt-item-row:last-child {
    border-bottom: 0;
}

.receipt-item-name {
    min-width: 0;
    overflow-wrap: break-word;
}

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

.receipt-table th,
.receipt-table td {
    padding: 6px;
    text-align: left;
}

.receipt-table thead th {
    font-size: var(--font-size-sm);
}

.receipt-table tbody td {
    border-bottom: 1px solid #f4f4f4;
}

.receipt-desc-cell {
    width: 100%;
}

.receipt-desc-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.receipt-desc-text {
    min-width: 0;
}

@media (max-width: 900px) {
    .receipt-col-qty,
    .receipt-col-amount,
    .receipt-table tbody td:nth-child(3),
    .receipt-table tbody td:nth-child(4) {
        display: none;
    }

    .receipt-table tbody td:first-child {
        display: table-cell;
        width: auto;
    }

    .receipt-table tbody tr {
        display: table-row;
    }

    .receipt-desc-cell {
        display: table-cell;
        width: auto;
    }

    .receipt-desc-row {
        display: block;
        width: 100%;
    }

    .receipt-desc-text {
        min-width: 0;
    }

    .receipt-table .receipt-col-unit,
    .receipt-table thead th:nth-child(2),
    .receipt-table tbody td:nth-child(2) {
        display: table-cell;
        width: 86px;
        text-align: right !important;
        white-space: nowrap;
    }
}

.receipt-col-unit,
.receipt-col-qty,
.receipt-col-amount,
.receipt-cell-right {
    text-align: right !important;
}

.receipt-col-unit,
.receipt-col-amount {
    width: 120px;
}

.receipt-col-qty {
    width: 64px;
}

.receipt-empty {
    padding: 12px !important;
}

.receipt-totals {
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    gap: 24px;
    margin-top: 12px;
}

.receipt-totals-card {
    width: 260px;
    font-size: var(--font-size-sm);
    text-align: right;
}

.receipt-total-block {
    margin-top: 8px;
}

.receipt-total-block:first-child {
    margin-top: 0;
}

.receipt-total-value {
    display: block;
    margin-top: 6px;
    font-weight: 700;
}

.receipt-total-block--grand .receipt-total-value {
    font-size: 16px;
    font-weight: 800;
}

.receipt-footer {
    margin-top: 18px;
    font-size: var(--font-size-sm);
    color: var(--grey-600);
}

.receipt-company {
    margin-top: 18px;
    font-size: var(--font-size-sm);
    color: var(--grey-900);
    text-align: center;
}

@media (max-width: 640px) {
    .receipt-header {
        flex-direction: column;
        gap: 12px;
    }

    .receipt-business-name {
        font-size: 1.85rem;
        font-weight: 700;
    }

    .receipt-business,
    .receipt-meta {
        max-width: 100%;
    }

    .receipt-meta {
        text-align: left;
    }

    .receipt-meta-row {
        font-size: 1.02rem;
    }

    .receipt-meta-row strong {
        font-weight: 700;
    }

    .receipt-table thead th:first-child {
        font-size: 1.05rem;
        font-weight: 700;
    }

    .receipt-table thead th {
        font-size: 0.88rem;
    }

    .receipt-col-qty,
    .receipt-col-amount,
    .receipt-table tbody td:nth-child(3),
    .receipt-table tbody td:nth-child(4) {
        display: none;
    }

    .receipt-table tbody tr {
        display: table-row;
    }

    .receipt-table tbody td:first-child {
        font-size: 0.9rem;
        line-height: 1.2;
        display: table-cell;
        width: auto;
    }

    .receipt-desc-cell {
        display: table-cell;
        width: auto;
    }

    .receipt-desc-row {
        display: block;
    }

    .receipt-table tbody td {
        font-size: 0.78rem;
        padding: 5px 4px;
        vertical-align: top;
    }

    .receipt-table .receipt-col-unit,
    .receipt-table thead th:nth-child(2),
    .receipt-table tbody td:nth-child(2) {
        display: table-cell;
        width: 86px;
        text-align: right !important;
        white-space: nowrap;
    }

    .receipt-table tbody td:last-child,
    .receipt-table thead th:last-child {
        text-align: right;
    }

    .receipt-totals {
        justify-content: stretch;
    }

    .receipt-totals-card {
        width: 100%;
        font-size: 1.08rem;
    }

    .receipt-total-block {
        font-size: 1.08rem;
    }

    .receipt-total-value {
        font-size: 1.26rem;
    }

    .receipt-total-block--grand .receipt-total-value {
        font-size: 1.42rem;
    }

    .receipt-meta-row:last-child,
    .receipt-meta-row:nth-child(1),
    .receipt-meta-row:nth-child(2),
    .receipt-meta-row:nth-child(3) {
        font-family: inherit;
    }

    .global-working-banner {
        width: calc(100% - 20px);
        justify-content: center;
        padding: var(--pad-item);
    }
}

/* first child spacing tidy in panels */
.panel>*:first-child {
    margin-top: 0;
}

/* Network indicator (small persistent banner) */
#network-indicator {
    position: fixed;
    right: 12px;
    top: 12px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: var(--pad-chip);
    border-radius: 14px;
    font-size: var(--font-size-sm);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    background: rgba(0,0,0,0.06);
    color: var(--ink);
}

#network-indicator.network-online {
    background: rgba(46, 204, 113, 0.12);
    color: #0b8a39;
}

#network-indicator.network-offline {
    background: rgba(231, 76, 60, 0.08);
    color: #c1271b;
}

#network-indicator .ni-dot {
    font-weight: 700;
    margin-right: 4px;
}

#network-indicator .ni-text {
    font-size: var(--font-size-xs);
    opacity: 0.95;
}

.network-offline-banner {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    padding: var(--pad-item);
    background: #fff4f4;
    color: #8b0000;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.global-working-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: var(--pad-btn);
    border-radius: var(--radius-pill);
    background: rgba(23, 27, 38, 0.94);
    color: var(--white);
    font-size: var(--font-size-sm);
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
}

.global-working-banner.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition: opacity 180ms ease, transform 180ms ease;
}

.global-working-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: global-working-spin 0.9s linear infinite;
}

@keyframes global-working-spin {
    to { transform: rotate(360deg); }
}

body.has-network-offline-banner {
    padding-top: calc(var(--network-banner-base-padding-top, 0px) + var(--network-offline-banner-offset, 48px));
}

/* Opening screen full-viewport hero */
.opening-screen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: var(--opening-display, flex);
    align-items: center;
    justify-content: center;
    z-index: 99990;
    background-color: #eceff0;
    background-image: url('images/cafeimage.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* opening background image element: show entire photo without stretching */
.opening-bg {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    height: 100%;
    max-width: none;
    object-fit: contain;
    /* ensures image is not stretched and full image visible */
    pointer-events: none;
    user-select: none;
    z-index: 1;
}

.opening-screen .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.02), rgba(0,0,0,0.22));
    z-index: 2;
}

.opening-screen .center-column {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 300px;
    padding: var(--gap-md);
    transform: translateY(-36px);
}

.opening-logo {
    max-width: 320px;
    height: auto;
    margin-bottom: 8px;
    filter: drop-shadow(0 6px 18px rgba(0,0,0,0.12));
}

.opening-btn {
    width: 280px;
    height: 56px;
    border-radius: var(--radius-md);
    border: none;
    font-family: 'Gabarito', Arial, sans-serif;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    cursor: pointer;
}

.opening-btn.primary {
    background: #0b5962;
    color: var(--white);
}

.opening-btn.secondary {
    background: rgba(255,255,255,0.92);
    color: var(--button-primary-admin);
    box-shadow: 0 6px 18px rgba(11,89,98,0.08);
}

.opening-screen .hint {
    margin-top: 8px;
    font-size: var(--font-size-sm);
    color: rgba(0,0,0,0.6);
}

.policy-link-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: rgba(255,255,255,0.85);
    text-decoration: underline;
    font-family: inherit;
}

.policy-link-btn:hover {
    color: var(--white);
}

.screen-policy-links {
    position: fixed;
    bottom: 16px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 100;
    white-space: nowrap;
}

.screen-policy-links span {
    color: var(--grey-400);
    font-size: 11px;
}

.policy-link-btn-dark {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 11px;
    color: var(--grey-400);
    text-decoration: none;
    font-family: inherit;
    letter-spacing: 0.01em;
}

.policy-link-btn-dark:hover {
    color: var(--grey-600);
    text-decoration: underline;
}

.policy-modal-inner {
    background: var(--white);
    padding: 24px;
    border-radius: 18px;
    width: min(560px, calc(100% - 32px));
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    box-shadow: 0 18px 40px rgba(0,0,0,0.2);
}

.policy-modal-inner .ues-header {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.policy-modal-inner .ues-header h3 {
    margin: 0;
    line-height: 1.25;
}

.policy-modal-body {
    overflow-y: auto;
    flex: 1 1 auto;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--grey-800);
}

.policy-modal-body h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    color: #111;
}

.policy-modal-body h4:not(:first-child) {
    margin-top: 20px;
}

.policy-modal-body p, .policy-modal-body ul {
    margin: 0 0 10px;
}

.policy-modal-body ul {
    padding-left: 20px;
}

.policy-modal-body hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.stripe-policy-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--grey-600);
    text-align: center;
    line-height: 1.5;
}

.stripe-policy-note .policy-link-btn-dark {
    font-size: 12px;
    color: #635bff;
}

.stripe-policy-note .policy-link-btn-dark:hover {
    color: #4b45c6;
}

.panel>*:last-child {
    margin-bottom: 0;
}

#subscriptions-tiers-panel {
    background: transparent;
    padding: 0;
}

/* ============================
Forms / Inputs
============================ */

label {
    font-size: var(--font-size-base);
    margin: 0 0 16px 0;
    display: block;
}

label.checkbox {
    display: block;
}

label.checkbox.deliveries-include-delivered {
    display: inline-block;
    margin-left: 12px;
}

.businesses-include-all-toggle {
    display: inline-block;
    margin-left: 8px;
    align-self: flex-end;
}

label.checkbox,
label.checkbox span {
    width: auto;
}

label span {
    display: block;
    margin: 0 0 8px 0;
}

input,
select,
textarea,input[type="time"], input[type="date"] {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: var(--pad-card);
    min-width: 200px;
    display: inline-block;
    font-size: var(--font-size-base);
    width: 100%;
    font-family: var(--font-body);
    line-height: normal;
    height:3em;
    text-align:left
}

input[type="date"]{
    background: url(images/icons/calendar.svg) no-repeat right 16px center var(--surface);
        line-height: normal;
        appearance: none;
        -webkit-appearance: none;
        display: block;
        max-width: 100%;
        min-width: 0;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
}

select {
    line-height: normal;
}

input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    line-height: normal;
    height:3em;
    display: block;
    max-width: 100%;
    min-width: 0;
}

input[type="checkbox"] {
    visibility: hidden;
    height: 0;
    padding: 0;
    display: none;
}
input[readonly] { opacity: 0.6; }

/* Feature toggle visuals used on the Subscriptions screen */
.feature-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--pad-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    gap: var(--gap-sm);
    flex-shrink: 0;
}

.feature-toggle.enabled {
    background: color-mix(in srgb, var(--button-primary-admin) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--button-primary-admin) 20%, transparent);
}

.feature-toggle-label {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    cursor: pointer;
    flex: 1;
    opacity: 1;
    margin: 0;
    line-height: 1;
}

.feature-toggle-label.is-disabled {
    cursor: default;
    opacity: 0.6;
}

.feature-toggle-checkbox {
    cursor: pointer;
}

.feature-toggle-checkbox:disabled {
    cursor: not-allowed;
}

.feature-toggle .dummycheckbox {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    margin: 0;
    flex-shrink: 0;
}

.feature-toggle.enabled .dummycheckbox {
    background: var(--button-primary-admin);
    color: var(--white);
    border-color: var(--button-primary-admin);
}

.feature-toggle .state-badge {
    font-size: var(--font-size-sm);
    padding: var(--pad-chip);
    border-radius: var(--radius-md);
    background: var(--bg);
    color: var(--ink);
    white-space: nowrap;
    align-self: center;
}

.feature-toggle.enabled .state-badge {
    background: var(--button-primary-admin);
    color: var(--white);
}

.feature-toggle .hint {
    color: var(--muted);
    margin-left: 8px;
    font-size: var(--font-size-sm);
}

.feature-toggle .state-badge.is-requires-subscription {
    opacity: 0.9;
}

tr.inactive {
    background: var(--bg);
}

/* focus noop holders */
input:focus,
select:focus,
textarea:focus {
    --_focus_noop: 0;
}

/* custom select arrow */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color: var(--grey-800);
    background: url(images/icons/chevrondown.svg) no-repeat right 16px center;
}

/* ============================
Buttons / Badges / Status
============================ */

button {
    background: var(--button-primary-admin);
    color: var(--white);
    border: 0;
    border-radius: var(--radius-lg);
    padding: var(--pad-card);
    font-size: var(--font-size-base);
    width:100%;
}


button.secondary {
    background:none;
    color: var(--button-primary-admin);
    border: 2px solid var(--button-primary-admin);
}

button.link-button {
    background: none;
    border: 0;
    padding: 0;
    color: var(--button-primary-admin);
    text-decoration: underline;
    width: auto;
    min-width: 0;
}

button:hover {
    cursor: pointer;
    filter: brightness(1.06);
}

button:active {
    transform: translateY(1px);
}

button:disabled {
    opacity: 1;
    cursor: not-allowed;
}

button.button-inline, #businesses-search-btn {
    width: auto
}

/* Subscription tiers card layout: ensure action buttons align horizontally
by making cards equal-height columns and pushing the action row to the bottom. */
#subscriptions-loading {
    text-align: center;
    padding: 40px;
}

#subscriptions-content {
    display: none;
}

#subscriptions-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--gap-md);
    align-items: start;
}

#subscriptions-tiers > div {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    border-radius: var(--radius-lg);
    padding: var(--gap-md);
    height:100%;
}

.subscription-tier-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--bg);
}

.subscription-tier-card.is-included {
    background: var(--surface);
}

.subscription-tier-title {
    margin: 0 0 4px 0;
}

.subscription-tier-description {
    margin: 0 0 16px 0;
}

.subscription-tier-features {
    margin: 0 0 16px 0;
    padding-left: 0;
    list-style: none;
}

.subscription-tier-features li {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    margin-bottom: 6px;
}

/* Inline toggle switch inside tier cards */
.tier-switch {
    margin: 0 0 0 auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}

.tier-switch.is-disabled {
    cursor: default;
    opacity: 0.35;
}

.tier-switch-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    display: none;
}

.tier-switch-track {
    display: block;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: var(--grey-300);
    position: relative;
    transition: background 150ms ease;
    margin: 0;
}

.tier-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--white);
    transition: transform 150ms ease;
}

.tier-switch-input:checked + .tier-switch-track {
    background: var(--button-primary-admin);
}

.tier-switch-input:checked + .tier-switch-track::after {
    transform: translateX(16px);
}

.subscription-tier-actions {
    display: flex;
    gap: var(--gap-sm);
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
}

.subscription-tier-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    color: var(--white);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.subscription-tier-badge.is-active,
.subscription-tier-badge.is-included {
    background: var(--button-primary-customer);
}

.subscription-tier-badge.is-requires-tier {
    background: var(--bg);
    color: var(--muted);
}

.subscription-tier-card .button-inline[disabled].is-current-plan {
    opacity: 0.5;
}

.subscription-tier-card .button-inline.downgrade-btn {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--muted);
}

.subscription-tier-card .button-inline.downgrade-btn:hover {
    background: var(--bg);
}

#feature-toggles {
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
    margin-top: 16px;
}

#subscriptions-tiers > div .button-inline {
    width: auto;
    /* keep buttons natural width */
    align-self: flex-start;
    /* left-align buttons inside the card */
}

button.large {
    width: 100%;
}

.ordering button {
    background: var(--button-primary-customer);
}

.badge,
.pill,
.status {
    display: inline-flex;
    align-items: center;
    height: 20px;
    background: var(--chip);
    color: #cde2ff;
    border: 1px solid var(--chip-line);
    border-radius: var(--radius-pill);
    padding: 0 10px;
    font-size: .8rem;
}
/* State classes toggled by JS; !important so they beat later-file theme rules
   (dark-mode.css) regardless of load order. */
.status-error { color: #e55 !important; }
.status-ok    { color: #4c4 !important; }

/* Status badges (consolidated) */
.status-badge {
    display: inline-block;
    padding: var(--pad-chip);
    margin-left: 8px;
    margin-right: 8px;
    border-radius: 18px;
    font-size: 0.85em;
    color: white;
}

.status-badge.delivery,
.status-badge.pickup {
    border: 1px solid rgba(0,0,0,0.06);
}

.status-badge.delivery {
    background: #dbeeff;
    color: #063a6b;
}

.status-badge.pickup {
    background: #2DAF7F;
    color: var(--white);
}

.status-badge.table-order {
    background: color-mix(in srgb, var(--button-primary-admin) 12%, white);
    color: var(--button-primary-admin);
}

.status-badge.channel-badge {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-left: 0;
    margin-right: 6px;
    padding: 4px 10px;
    vertical-align: middle;
}

.pickup-status {
    margin: 8px 0 4px;
}

.status-badge.pickup-status-badge {
    font-size: 0.9rem;
    font-weight: 700;
    margin-left: 0;
}

.status-badge.pickup-status-badge.ready {
    background: #2DAF7F;
    color: var(--white);
}

.status-badge.pickup-status-badge.preparing {
    background: var(--grey-100);
    color: var(--grey-700);
}

.status-badge.refunded {
    background: #f8d7da;
    color: #842029;
}

.status-badge.sent {
    background: #e9ecef;
    color: #343a40;
}

.status-badge.delivered {
    background: #e6f9f0;
    color: #0b4f3a;
    font-weight: 700;
}

.status-badge.unpaid {
    background: #fff3cd;
    color: #664d03;
    font-weight: 700;
}

.status-badge.paid {
    background: #d1e7dd;
    color: #0a3622;
    font-weight: 700;
}

.status-badge.eta-range {
    background: #e6f7ff;
    color: #055;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    margin-left: 8px;
    display: inline-block;
    margin-bottom: 8px;
}

/* Highlight order rows for pickup/delivery in Stations view.
   State classes toggled by JS; !important so they beat later-file panel/theme
   rules (screens.css, dark-mode.css) regardless of load order. */

.ok {
    background: var(--ok-bg) !important;
    color: var(--ok-fg) !important;
    border-color: rgba(10, 61, 42, .6) !important;
}

.err {
    background: var(--bad-bg) !important;
    color: var(--bad-fg) !important;
    border-color: rgba(58, 21, 21, .6) !important;
    padding: var(--gap-md);
    border-radius: var(--radius-sm);
}

/* Hide empty error blocks so we don't display an empty red bar when
a status element has the .err class but no message text. */
.err:empty {
    display: none;
    padding: 0;
    height: 0;
    margin: 0;
}

/* visual "disabled" for primary buttons */
.button-primary.disabled,
.disabled.button-primary {
    opacity: .6;
    filter: grayscale(.25);
    cursor: default;
}

/* Till payment button spacing */
#till-cartcontainer .till-pay-buttons > p {
    margin: 0 0 0.75rem;
}

/* ============================
Move inline JS styles into classes
============================ */

/* small pill-style badge used for ETA/delivered markers */
.pill-badge {
    display: inline-block;
    white-space: nowrap;
    font-weight: 600;
    background: #e6f7ff;
    color: #055;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    margin-left: 8px;
    font-size: var(--font-size-xs);
    vertical-align: middle;
    z-index: 9999;
}

/* deliveries header layout */
.deliveries-header {
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.eta-inline {
    display:flex;
    align-items:center;
    gap: var(--gap-sm);
}

/* small display utilities used by JS to toggle element layout without inline styles */
.d-inline-flex {
    display: inline-flex !important;
}

.d-inline-block {
    display: inline-block !important;
}

.d-inline {
    display: inline-block !important;
}

.button-primary.disabled:focus,
.disabled.button-primary:focus {
    outline: 3px solid rgba(0, 0, 0, .06);
    outline-offset: 2px;
}
