/*
 * Design foundation for the pizzeria management application.
 * Token system + reset + shared chrome (header/nav/footer) + base component
 * library (buttons, forms, tables, cards) consumed by professional.css and
 * polish.css. Dual register: manager surfaces read as clean SaaS software,
 * customer surfaces keep a warmer editorial touch — both share the same
 * spacing/radius/shadow mechanics so the product feels like one system.
 *
 * IMPORTANT contract: `.manager-body`/`.auth-body-manager` and
 * `.customer-body`/`.auth-body-customer`/`.theme-option-customer` receive
 * live brand variables from the server-generated `/theme.css`, loaded AFTER
 * this file and professional.css. The variable names below on those
 * selectors are fallbacks only (shown before theme.css parses, or if it
 * fails) — keep the names exact, values are free to change.
 */

:root {
    /* Spacing (4px base) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-14: 56px;
    --space-16: 64px;
    --space-20: 80px;

    /* Radius */
    --radius-xs: 8px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-2xl: 30px;
    --radius-full: 999px;

    /* Motion */
    --ease-standard: cubic-bezier(.4, 0, .2, 1);
    --duration-fast: 130ms;
    --duration-base: 200ms;
    --duration-slow: 360ms;

    /* Typography */
    --serif: Georgia, "Times New Roman", ui-serif, serif;
    --sans: "Segoe UI", system-ui, -apple-system, "Inter", "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", ui-monospace, Consolas, monospace;

    /* Neutral scale (manager-first cool gray) */
    --gray-0: #ffffff;
    --gray-50: #f7f8f7;
    --gray-100: #eef1ee;
    --gray-150: #e6e9e5;
    --gray-200: #dde1dc;
    --gray-300: #c4cac3;
    --gray-400: #9aa39c;
    --gray-500: #707b73;
    --gray-600: #545f56;
    --gray-700: #3c463f;
    --gray-800: #262f28;
    --gray-900: #161d18;

    /* Fixed near-black ink for "always dark" fills paired with white text
       (dark buttons, footer, badges) — deliberately does NOT flip in dark
       mode like --gray-800/900 do (those invert to near-white so surfaces
       stay legible, which would turn a white-text button invisible). */
    --charcoal-light: #262f28;
    --charcoal: #161d18;
    --charcoal-deep: #0d100e;

    /* Warm neutral scale (customer surfaces) */
    --cream: #f7f3ea;
    --cream-deep: #ede4d2;
    --paper: #ffffff;

    --ink: #1a2119;
    --muted: #68736c;
    --line: rgba(23, 33, 26, .11);
    --line-strong: rgba(23, 33, 26, .19);

    /* Semantic defaults (not overridden by theme.css) */
    --red: #c44726;
    --red-dark: #a53a20;
    --red-soft: #fdece5;
    /* Text/icon variants of --red/--red-dark for use on a card/page surface
       (fills that pair them with white text — buttons, dots — keep using
       --red/--red-dark directly, unaffected). Relit for dark mode below. */
    --red-ink: var(--red);
    --red-dark-ink: var(--red-dark);
    --amber: #966111;
    --amber-soft: #fbf0dc;
    --amber-ink: var(--amber);
    --blue: #2f6f90;
    --blue-soft: #e6f1f6;
    --blue-ink: var(--blue);
    --violet: #6a5296;
    --violet-soft: #eee9f7;
    --violet-ink: var(--violet);
    --yellow: #e2ab48;

    /* Green is part of the dynamic contract: theme.css repoints it inside
       .manager-body/.customer-body to match the tenant accent. */
    --green: #2f7652;
    --green-soft: #e5f2eb;

    --shadow-xs: 0 1px 2px rgba(20, 30, 22, .05);
    --shadow-sm: 0 4px 14px rgba(20, 30, 22, .055);
    --shadow-soft: 0 10px 26px rgba(20, 30, 22, .065);
    --shadow: 0 18px 44px rgba(20, 30, 22, .09);
    --shadow-lift: 0 24px 60px rgba(20, 30, 22, .14);
    --surface-tint: #f8faf7;
    --forest-2: #23573d;
    --forest-3: #102a1c;

    /* Generic theme aliases: theme.css repoints these per scope too */
    --theme-primary: var(--green);
    --theme-rgb: 47, 118, 82;

    color-scheme: light;
}

/* ---------------------------------------------------------------------- */
/* Fallback brand tokens (mirror PizzeriaSettings defaults: manager        */
/* #2F7652, customer #123B29). Overridden live by /theme.css.              */
/* ---------------------------------------------------------------------- */

.manager-body, .auth-body-manager {
    --manager-theme-selected: #2f7652;
    --manager-accent: #2f7652;
    --manager-accent-light: #4c9370;
    --manager-accent-dark: #235a3f;
    --manager-accent-deep: #163a29;
    --manager-accent-soft: #e5f2eb;
    --manager-mint: #bfe3d0;
    --manager-accent-rgb: 47, 118, 82;
    --manager-deep-rgb: 22, 58, 41;
    --green: var(--manager-accent);
    --green-soft: var(--manager-accent-soft);
    --theme-selected: var(--manager-theme-selected);
    --theme-primary: var(--manager-accent);
    --theme-light: var(--manager-accent-light);
    --theme-dark: var(--manager-accent-dark);
    --theme-deep: var(--manager-accent-deep);
    --theme-soft: var(--manager-accent-soft);
    --theme-muted: var(--manager-mint);
    --theme-rgb: var(--manager-accent-rgb);
    --theme-deep-rgb: var(--manager-deep-rgb);
    --forest-2: var(--manager-accent-dark);
    --forest-3: var(--manager-accent-deep);
    /* Text/icon color for the accent sitting directly on a card or page
       background (as opposed to white text on an accent-filled button).
       Equals --theme-primary in light mode; relit for dark mode below so it
       never goes dark-on-dark regardless of which brand color is picked. */
    --theme-ink: var(--theme-primary);
    --surface-tint: #f7f9f7;
    --line: rgba(23, 33, 26, .1);
    --line-strong: rgba(23, 33, 26, .17);
    --shadow: 0 18px 44px rgba(20, 30, 22, .08);
    --shadow-soft: 0 10px 26px rgba(20, 30, 22, .06);
    --shadow-lift: 0 24px 55px rgba(20, 30, 22, .13);
}

.customer-body, .auth-body-customer, .theme-option-customer {
    --customer-theme-selected: #123b29;
    --customer-forest: #123b29;
    --customer-forest-light: #235a41;
    --customer-forest-dark: #0e2e20;
    --customer-forest-deep: #081b13;
    --customer-sage: #bfd8c9;
    --customer-theme-muted: #b9cfc1;
    --customer-theme-rgb: 18, 59, 41;
    --customer-deep-rgb: 8, 27, 19;
    --green: var(--customer-forest);
    --green-soft: #e5efe9;
    --theme-selected: var(--customer-theme-selected);
    --theme-primary: var(--customer-forest);
    --theme-light: var(--customer-forest-light);
    --theme-dark: var(--customer-forest-dark);
    --theme-deep: var(--customer-forest-deep);
    --theme-soft: var(--green-soft);
    --theme-muted: var(--customer-sage);
    --theme-rgb: var(--customer-theme-rgb);
    --theme-deep-rgb: var(--customer-deep-rgb);
    --forest-2: var(--customer-forest-light);
    --forest-3: var(--customer-forest-deep);
    --theme-ink: var(--theme-primary);
    --surface-tint: #f8f9f6;
}

/* ---------------------------------------------------------------------- */
/* Reset & base elements                                                   */
/* ---------------------------------------------------------------------- */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; }
[hidden] { display: none !important; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--cream);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.manager-body { background: var(--gray-50); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { line-height: 1.6; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
form { margin: 0; }
img { max-width: 100%; }
svg { display: block; }

button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
input, textarea, select { color: var(--ink); min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--gray-400); }

* { scrollbar-width: thin; scrollbar-color: rgba(var(--theme-rgb), .3) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(var(--theme-rgb), .38); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--theme-rgb), .6); }
::selection { color: white; background: rgba(var(--theme-rgb), .82); }

:focus-visible {
    outline: 3px solid rgba(var(--theme-rgb), .35);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------------------------------------------------------------------- */
/* Header & primary navigation                                             */
/* ---------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1px 0 rgba(20, 30, 22, .04);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.nav-shell {
    width: min(1400px, calc(100% - 48px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    white-space: nowrap;
}

.brand-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: white;
    background: linear-gradient(150deg, var(--theme-light, #4c9370), var(--theme-primary, var(--green)));
    border-radius: var(--radius-md);
    box-shadow: 0 8px 18px rgba(var(--theme-rgb), .25);
    font-family: var(--sans);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .02em;
}
.brand-mark > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-mark > span { width: 100%; height: 100%; display: grid; place-items: center; }

.brand-copy { display: grid; gap: 0; }
.brand-copy strong { font-family: var(--sans); font-size: 1rem; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.customer-body .brand-copy strong, .auth-body-customer .brand-copy strong { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; }
.brand-copy small { display: block; color: var(--muted); font-size: .58rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--gray-50);
}
.customer-body .main-nav, .auth-body-customer .main-nav { background: rgba(23, 33, 26, .04); }

.nav-item {
    min-height: 38px;
    padding: 0 13px;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: calc(var(--radius-md) - 4px);
    color: var(--gray-600);
    font-size: .78rem;
    font-weight: 700;
    white-space: nowrap;
    transition: color var(--duration-base) var(--ease-standard), background var(--duration-base) var(--ease-standard);
}
.nav-item:hover { color: var(--ink); background: rgba(255, 255, 255, .85); }
.nav-item-active { color: white; background: var(--theme-primary, var(--green)); box-shadow: 0 6px 16px rgba(var(--theme-rgb), .22); }
.nav-item-active:hover { color: white; background: var(--theme-dark, var(--forest-2)); }
.nav-icon { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.nav-actions { display: flex; align-items: center; gap: 6px; padding-left: 4px; }

.manager-session-identity {
    padding: 0 12px 0 4px;
    display: grid;
    gap: 0;
    text-align: right;
    line-height: 1.25;
}
.manager-session-identity span { display: block; font-size: .78rem; font-weight: 700; }
.manager-session-identity small { display: block; color: var(--muted); font-size: .66rem; }

.nav-icon-button {
    width: 38px;
    height: 38px;
    padding: 0;
    position: relative;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    background: var(--gray-0);
    cursor: pointer;
    transition: color var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard), background var(--duration-base) var(--ease-standard);
}
.nav-icon-button:hover, .nav-icon-button-active {
    color: var(--theme-ink, var(--green));
    border-color: rgba(var(--theme-rgb), .3);
    background: var(--theme-soft, var(--green-soft));
}
.nav-icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.nav-action-label { display: none; }

.cart-count, .notification-count {
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    display: inline-grid;
    place-items: center;
    color: white;
    background: var(--red);
    border-radius: var(--radius-full);
    font-size: .62rem;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(209, 80, 46, .3);
}
.notification-link { position: relative; }
.notification-count { position: absolute; top: -6px; right: -6px; border: 2px solid var(--paper); }

.logout-form { display: flex; }
.button-link { padding: 0; border: 0; background: transparent; cursor: pointer; font-weight: 700; }
.text-link { font-size: .88rem; font-weight: 700; transition: color var(--duration-base) ease; }
.text-link:hover, .button-link:hover { color: var(--theme-ink, var(--red)); }
.text-link-large { text-decoration: underline; text-underline-offset: 5px; }

.ordering-global-banner {
    padding: 9px 24px;
    display: flex;
    justify-content: center;
    gap: 8px;
    color: white;
    background: linear-gradient(90deg, var(--red-dark), var(--red));
    font-size: .78rem;
    font-weight: 600;
}

/* Auth headers (customer/manager login shells) */

.auth-header {
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(16px);
}
.auth-header-manager { background: rgba(255, 255, 255, .96); }
.auth-header-shell {
    width: min(1320px, calc(100% - 48px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
}
.auth-header-context {
    margin-left: auto;
    padding-right: 8px;
    display: grid;
    gap: 0;
    text-align: right;
}
.auth-header-context span { font-size: .76rem; font-weight: 700; }
.auth-header-context small { color: var(--muted); font-size: .66rem; }
.auth-header-actions { display: flex; align-items: center; gap: 8px; }
.auth-home-link {
    min-height: 38px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--gray-700);
    background: var(--gray-0);
    font-size: .76rem;
    font-weight: 700;
    transition: color var(--duration-base) ease, border-color var(--duration-base) ease;
}
.auth-home-link:hover { color: var(--theme-ink, var(--green)); border-color: rgba(var(--theme-rgb), .3); }
.auth-home-link svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */

.button {
    min-height: 44px;
    padding: 0 19px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    cursor: pointer;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: -.005em;
    transition: transform var(--duration-fast) var(--ease-standard), background var(--duration-base) var(--ease-standard), border-color var(--duration-base) var(--ease-standard), box-shadow var(--duration-base) var(--ease-standard);
}
.button:active { transform: scale(.97); }
.button-small { min-height: 38px; padding: 0 15px; gap: 8px; font-size: .75rem; }
.button-primary { color: white; background: var(--theme-primary, var(--red)); box-shadow: 0 8px 18px rgba(var(--theme-rgb), .22); }
.button-primary:hover { background: var(--theme-dark, var(--red-dark)); box-shadow: 0 10px 22px rgba(var(--theme-rgb), .28); }
.button-danger { color: white; background: var(--red-dark); }
.button-danger:hover { background: #832c17; }
/* Strong secondary CTA (manager login, "applica logo", header "Accedi"…).
   Uses the darkest brand shade so it follows the tenant color while staying
   safely above 4.6:1 with white text — --theme-deep is darker than
   --theme-primary, which ThemePalette already guarantees against white. */
.button-dark { color: white; background: var(--theme-deep, var(--charcoal)); }
.button-dark:hover { background: var(--theme-dark, var(--charcoal-light)); }
.button-light { color: var(--ink); background: var(--gray-0); box-shadow: var(--shadow-xs); }
.button-outline { color: var(--ink); border-color: var(--line-strong); background: var(--gray-0); }
.button-outline:hover { border-color: rgba(var(--theme-rgb), .35); color: var(--theme-ink, var(--green)); }
.button-ghost { border-color: var(--line-strong); background: transparent; }
.button-ghost:hover { background: var(--gray-50); }
.button-outline-light { color: white; border-color: rgba(255, 255, 255, .5); background: transparent; }
.button-outline-light:hover { background: rgba(255, 255, 255, .1); }
.button-full { width: 100%; justify-content: space-between; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.button-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.button-plus {
    width: 21px; height: 21px;
    display: inline-grid; place-items: center;
    border-radius: 7px;
    color: var(--theme-ink, var(--red));
    background: white;
    font-size: 1rem; line-height: 1;
}

.text-button {
    border: 0;
    padding: 4px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.eyebrow {
    display: block;
    margin-bottom: 12px;
    color: var(--theme-ink, var(--red));
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
}
.eyebrow-light { color: rgba(255, 255, 255, .78); }

/* ---------------------------------------------------------------------- */
/* Flash messages                                                          */
/* ---------------------------------------------------------------------- */

.flash-stack { margin: 20px 0; display: grid; gap: 8px; }
.flash {
    padding: 13px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid;
    border-radius: var(--radius-sm);
    font-size: .82rem;
    font-weight: 600;
}
.flash > span:first-child {
    width: 20px; height: 20px; flex: 0 0 20px;
    display: grid; place-items: center;
    border-radius: 50%;
    font-weight: 800; font-size: .68rem;
}
.flash-success { color: var(--theme-ink); border-color: rgba(var(--theme-rgb), .32); background: var(--theme-soft, var(--green-soft)); }
.flash-success > span:first-child { background: rgba(var(--theme-rgb), .22); }
.flash-error { color: #9a351f; border-color: #efc1b5; background: #fff0eb; }
.flash-error > span:first-child { background: #f6d3c8; }
.flash-info { color: #285a76; border-color: #bdd5e1; background: #eef7fb; }
.flash-info > span:first-child { background: #d1e6ef; }

/* ---------------------------------------------------------------------- */
/* Footer                                                                   */
/* ---------------------------------------------------------------------- */

.site-footer { padding: 44px 0; color: rgba(255, 255, 255, .68); background: var(--charcoal); }
.footer-shell {
    width: min(1320px, calc(100% - 48px));
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
}
.brand-footer { color: white; }
.brand-footer .brand-mark { background: linear-gradient(150deg, var(--theme-light, #4c9370), var(--theme-primary, var(--green))); }
.footer-shell p { margin: 12px 0 0; font-size: .84rem; }
.footer-meta { display: flex; gap: 26px; font-size: .78rem; text-align: right; }

/* ---------------------------------------------------------------------- */
/* Page shells                                                             */
/* ---------------------------------------------------------------------- */

.section-shell { width: min(1320px, calc(100% - 48px)); margin: 0 auto; }
.dashboard-page { min-height: calc(100vh - 72px); padding: 40px 0 100px; }
.dashboard-shell { width: min(1280px, calc(100% - 48px)); margin: 0 auto; }
.narrow-shell { width: min(1000px, calc(100% - 48px)); }

.dashboard-heading {
    margin-bottom: 26px;
    padding: 26px 28px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--gray-0);
    box-shadow: var(--shadow-soft);
}
.dashboard-heading h1 { font-family: var(--sans); font-weight: 800; font-size: clamp(1.6rem, 2.6vw, 2.3rem); letter-spacing: -.02em; }
.customer-body .dashboard-heading h1 { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; }
.dashboard-heading p { margin: 8px 0 0; max-width: 600px; color: var(--muted); font-size: .88rem; line-height: 1.6; }
.dashboard-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.heading-actions { display: flex; align-items: center; gap: 10px; }

.section-title-row {
    padding-bottom: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--line);
}
.section-title-row h2 { font-family: var(--sans); font-weight: 800; font-size: 1.25rem; letter-spacing: -.01em; }
.customer-body .section-title-row h2 { font-family: var(--serif); font-weight: 600; }
.section-title-row > div > p { margin: 4px 0 0; color: var(--muted); font-size: .74rem; }
.section-title-row > span { color: var(--muted); font-size: .78rem; }
.orders-section, .management-table-wrap { margin-top: 32px; }

.empty-state {
    padding: 70px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-xl);
    background: var(--gray-0);
}
.compact-empty { margin-top: 16px; padding: 46px 30px; }
.empty-mark {
    width: 52px; height: 52px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: var(--theme-ink, var(--red));
    background: var(--theme-soft, var(--red-soft));
    font-family: var(--sans);
    font-size: 1.3rem;
    font-weight: 800;
}
.empty-state h1, .empty-state h2, .empty-state h3 { margin: 18px 0 6px; font-family: var(--sans); font-weight: 800; }
.customer-body .empty-state h1, .customer-body .empty-state h2, .customer-body .empty-state h3 { font-family: var(--serif); font-weight: 600; }
.empty-state h2 { font-size: 1.7rem; }
.empty-state p { max-width: 480px; margin: 0 0 22px; color: var(--muted); line-height: 1.6; }
.error-state { width: min(760px, calc(100% - 48px)); margin: 30px auto; }

/* ---------------------------------------------------------------------- */
/* Manager order workflow                                                  */
/* ---------------------------------------------------------------------- */

.manager-order-list { display: grid; gap: 10px; padding-top: 16px; }
.manager-order {
    min-height: 100px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: 70px 1.05fr 1.7fr 90px minmax(230px, .9fr);
    gap: 18px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--gray-0);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--duration-base) ease, box-shadow var(--duration-base) ease, transform var(--duration-base) ease;
}
.manager-order:hover { border-color: rgba(var(--theme-rgb), .2); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.manager-order.order-queued { border-left: 3px solid var(--yellow); }
.manager-order.order-history { opacity: .8; }
.manager-order-id, .manager-order-customer { display: grid; gap: 4px; }
.manager-order-id span { font-family: var(--sans); font-size: 1.05rem; font-weight: 800; }
.manager-order-id time, .manager-order-customer span { color: var(--muted); font-size: .7rem; }
.manager-order-id .queue-position {
    width: fit-content;
    padding: 3px 7px;
    border-radius: var(--radius-full);
    color: var(--theme-ink);
    background: var(--theme-soft, var(--green-soft));
    font-size: .58rem;
    font-weight: 800;
    text-transform: uppercase;
}
.manager-order-items { margin: 0; padding: 0; display: grid; gap: 6px; list-style: none; font-size: .8rem; line-height: 1.5; }
.manager-order-items li { display: grid; gap: 6px; }
.manager-order-items small { color: var(--muted); font-size: .68rem; }
.manager-order-item-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.manager-order-item-name { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.custom-pizza-badge {
    padding: 2px 7px;
    border-radius: var(--radius-full);
    color: var(--red-dark-ink);
    border: 1px solid rgba(209, 80, 46, .22);
    background: var(--red-soft);
    font-size: .55rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.pizza-info-button {
    min-height: 27px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: .62rem;
    font-weight: 700;
}
.pizza-info-button > span {
    width: 14px; height: 14px;
    display: grid; place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: .58rem;
}
.pizza-info-button:hover, .pizza-info-button.is-open { color: var(--theme-ink, var(--green)); border-color: rgba(var(--theme-rgb), .35); background: var(--theme-soft, var(--green-soft)); }
.pizza-info-button-custom { color: var(--red-ink); border-color: rgba(209, 80, 46, .25); }
.manager-item-info {
    padding: 10px 11px;
    display: grid;
    gap: 7px;
    border-left: 2px solid var(--theme-primary, var(--green));
    border-radius: var(--radius-xs);
    background: var(--theme-soft, var(--green-soft));
}
.manager-item-info > div { display: grid; gap: 1px; }
.manager-item-info strong { color: var(--theme-ink, var(--green)); font-size: .58rem; letter-spacing: .04em; text-transform: uppercase; }
.manager-item-info span { color: var(--ink); font-size: .7rem; }
.fulfillment-label { color: var(--red-ink) !important; font-weight: 700; }
/* Come incassa il portapizze: va letto a colpo d'occhio nella coda ordini. */
.payment-label { color: var(--muted); font-weight: 700; }
.payment-label-pos { color: var(--theme-ink, var(--green)) !important; }
.manager-order-note { color: var(--muted); font-style: italic; }
.manager-rejection-reason {
    padding: 8px 10px;
    border-radius: var(--radius-xs);
    color: var(--red-dark-ink);
    border-left: 2px solid var(--red);
    background: var(--red-soft);
    font-style: normal;
}
.manager-order-total { text-align: right; }
.manager-order-actions { width: 100%; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.decision-row { display: flex; justify-content: flex-end; gap: 7px; }
.accept-order-form { display: flex; align-items: flex-end; justify-content: flex-end; gap: 7px; }
.accept-order-form label { display: grid; gap: 3px; color: var(--muted); font-size: .6rem; font-weight: 700; }
.accept-order-form select { height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: white; font-size: .7rem; }
.manager-ready-estimate { color: var(--theme-ink, var(--green)); font-size: .68rem; font-weight: 700; }
.decision-button { height: 36px; padding: 0 13px; border: 1px solid; border-radius: var(--radius-xs); cursor: pointer; font-size: .72rem; font-weight: 700; }
.accept-button, .pickup-button { color: white; border-color: var(--theme-primary, var(--green)); background: var(--theme-primary, var(--green)); }
.reject-button { color: var(--red-ink); border-color: rgba(209, 80, 46, .25); background: transparent; }
.working-button { color: white; border-color: var(--theme-primary, var(--green)); background: var(--theme-primary, var(--green)); }
.delivery-button { color: white; border-color: var(--theme-primary, var(--green)); background: var(--theme-primary, var(--green)); }
.reject-reason-form { width: 100%; padding-top: 10px; display: grid; gap: 7px; border-top: 1px solid rgba(209, 80, 46, .22); }
.reject-reason-form label { color: var(--red-dark-ink); font-size: .67rem; font-weight: 700; }
.reject-reason-form textarea {
    width: 100%; min-height: 70px; padding: 9px;
    border: 1px solid rgba(209, 80, 46, .25); border-radius: var(--radius-xs);
    background: white; outline: 0; resize: vertical; font-size: .7rem;
}
.reject-reason-form textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(209, 80, 46, .1); }
.reject-reason-form > div { display: flex; flex-wrap: wrap; gap: 6px; }
.reject-confirm-button { color: white; border-color: var(--red); background: var(--red); }
.reject-cancel-button { color: var(--muted); border-color: var(--line); background: transparent; }

/* ---------------------------------------------------------------------- */
/* Generic management table (pizzas / ingredients / riders / accounts)     */
/* ---------------------------------------------------------------------- */

.management-table { display: grid; gap: 8px; }
.management-row {
    min-height: 92px;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: minmax(260px, 2fr) .55fr .75fr minmax(300px, 1.35fr);
    gap: 18px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--gray-0);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--duration-base) ease, box-shadow var(--duration-base) ease, transform var(--duration-base) ease;
}
.management-row:not(.management-head):hover { border-color: rgba(var(--theme-rgb), .22); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.management-row > div:first-child { display: grid; gap: 4px; }
.management-row small { max-width: 500px; color: var(--muted); font-size: .74rem; }
.management-head {
    min-height: 32px;
    padding-top: 0; padding-bottom: 0;
    color: var(--muted);
    border: 0; background: transparent; box-shadow: none;
    font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
}
.management-item { display: flex !important; align-items: center; gap: 13px !important; }
.management-item-mark {
    width: 44px; height: 44px; flex: 0 0 44px;
    display: grid; place-items: center;
    border-radius: var(--radius-sm);
    color: var(--theme-ink, var(--red));
    background: var(--theme-soft, var(--red-soft));
}
.management-item-mark svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.5; }
.management-item-photo { overflow: hidden; border: 1px solid var(--line); background: var(--gray-100); }
.management-item-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.management-item-copy { display: grid; gap: 3px; min-width: 0; }
.management-item-copy > strong { font-size: .92rem; }
.management-price { font-size: .88rem; font-weight: 700; white-space: nowrap; }
.management-row > .availability { width: fit-content; padding: 6px 10px; border-radius: var(--radius-full); background: var(--green-soft); }
.management-row > .availability.unavailable { background: var(--gray-100); }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.table-link {
    min-height: 33px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xs);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-600);
    background: var(--gray-50);
    cursor: pointer;
    font-size: .68rem;
    font-weight: 700;
    transition: color var(--duration-base) ease, border-color var(--duration-base) ease, background var(--duration-base) ease;
}
.table-link:hover { color: var(--theme-ink, var(--red)); border-color: rgba(var(--theme-rgb), .3); background: white; }
.table-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.danger-link { color: var(--red-ink); }
.history-lock {
    padding: 6px 9px;
    border-radius: var(--radius-xs);
    color: var(--muted);
    background: var(--gray-100);
    font-size: .64rem !important;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------- */
/* Forms & editors                                                         */
/* ---------------------------------------------------------------------- */

.stack-form { display: grid; gap: 16px; }
.stack-form label > span, .quantity-form label, .rider-create-card label {
    display: block;
    margin-bottom: 6px;
    color: var(--gray-700);
    font-size: .72rem;
    font-weight: 700;
}
.stack-form label small { color: var(--muted); font-weight: 400; }
/* Text-like fields only: checkboxes and radios must keep their intrinsic box,
   otherwise the full-width/46px-tall sizing meant for text inputs blows them
   up into huge rectangles (e.g. the "amministratore" flag). */
.stack-form input:not([type="checkbox"]):not([type="radio"]),
.stack-form textarea,
.price-input,
.rider-create-card input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--gray-0);
    outline: 0;
    transition: border-color var(--duration-base) ease, box-shadow var(--duration-base) ease;
}
.stack-form input:not([type="checkbox"]):not([type="radio"]),
.rider-create-card input:not([type="checkbox"]):not([type="radio"]) { min-height: 46px; padding: 0 13px; }
.stack-form input[type="checkbox"], .stack-form input[type="radio"] {
    width: auto;
    min-height: 0;
    margin: 0;
    accent-color: var(--theme-primary, var(--green));
}
.stack-form textarea { padding: 13px; resize: vertical; }
.stack-form input:not([type="checkbox"]):not([type="radio"]):focus,
.stack-form textarea:focus, .price-input:focus-within,
.rider-create-card input:not([type="checkbox"]):not([type="radio"]):focus {
    border-color: rgba(var(--theme-rgb), .55);
    box-shadow: 0 0 0 4px rgba(var(--theme-rgb), .1);
}
.field-error { display: block; margin-top: 6px; color: var(--red-ink) !important; font-size: .74rem; }
.form-switch { margin: 22px 0; color: var(--muted); font-size: .85rem; text-align: center; }
.form-switch a { color: var(--theme-ink, var(--red)); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.form-intro { margin: 10px 0 26px; color: var(--muted); line-height: 1.6; }
.demo-box { padding: 13px; display: grid; gap: 4px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); font-size: .72rem; }
.demo-box strong { color: var(--ink); }

/* Custom select (progressive enhancement over a real <select data-pretty-select>,
   kept in the DOM — visually hidden but still focusable/submittable — so the
   form works identically with JS disabled). */
.pretty-select { position: relative; }
.pretty-select-native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}
.pretty-select-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 0 40px 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--gray-0);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: border-color var(--duration-base) var(--ease-standard),
        box-shadow var(--duration-base) var(--ease-standard);
}
.pretty-select-trigger:hover { border-color: rgba(var(--theme-rgb), .4); }
.pretty-select-trigger:focus-visible,
.pretty-select.is-open .pretty-select-trigger {
    outline: 0;
    border-color: rgba(var(--theme-rgb), .55);
    box-shadow: 0 0 0 4px rgba(var(--theme-rgb), .1);
}
.pretty-select.is-disabled .pretty-select-trigger { cursor: not-allowed; opacity: .6; }
.pretty-select-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
}
.pretty-select.has-value .pretty-select-value { color: var(--ink); font-weight: 600; }
.pretty-select-chevron {
    position: absolute;
    right: 13px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    color: var(--muted);
    pointer-events: none;
    transition: transform var(--duration-base) var(--ease-standard), color var(--duration-base);
}
.pretty-select.is-open .pretty-select-chevron {
    transform: rotate(180deg);
    color: var(--theme-ink, var(--theme-primary));
}
.pretty-select-panel {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--gray-0);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lift);
    animation: pretty-select-in .15s var(--ease-standard);
}
@keyframes pretty-select-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}
.pretty-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    font-size: .86rem;
    color: var(--ink);
    cursor: pointer;
}
.pretty-select-option:hover,
.pretty-select-option:focus {
    outline: 0;
    background: rgba(var(--theme-rgb), .08);
}
.pretty-select-option[aria-selected="true"] {
    background: rgba(var(--theme-rgb), .12);
    color: var(--theme-ink, var(--ink));
    font-weight: 700;
}
.pretty-select-option[aria-selected="true"]::after {
    content: "✓";
    color: var(--theme-ink, var(--theme-primary));
}

.editor-card { padding: 30px; background: var(--gray-0); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-soft); }
.form-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 20px; }
.field-wide { grid-column: 1 / -1; }
.price-input { height: 46px; display: flex; align-items: center; }
.price-input span { padding-left: 13px; color: var(--muted); font-weight: 700; }
.price-input input { border: 0 !important; box-shadow: none !important; }
.toggle-field { display: flex !important; align-items: center; }
.toggle-field > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-field > label { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle-control { width: 42px !important; height: 24px; margin: 0 !important; position: relative; flex: 0 0 42px; border-radius: var(--radius-full); background: var(--gray-300); transition: background var(--duration-base) ease; }
.toggle-control::after { content: ""; width: 18px; height: 18px; position: absolute; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--duration-base) ease; }
.toggle-field input:checked ~ label .toggle-control { background: var(--theme-primary, var(--green)); }
.toggle-field input:checked ~ label .toggle-control::after { transform: translateX(18px); }
.toggle-field input:focus-visible ~ label .toggle-control { outline: 2px solid var(--red); outline-offset: 3px; }
.toggle-field > label > span:last-child { display: grid; gap: 2px; margin: 0; }
.toggle-field small { font-weight: 400; }
.editor-actions { padding-top: 24px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }

.pizza-image-field > label > span { display: block; margin-bottom: 7px; font-size: .78rem; font-weight: 700; }
.pizza-image-field > label small { color: var(--muted); font-weight: 400; }
.pizza-image-upload {
    padding: 15px;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--gray-50);
}
.pizza-image-preview { aspect-ratio: 4 / 3; overflow: hidden; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: var(--gray-100); }
.pizza-image-preview > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.pizza-image-placeholder { width: 100%; height: 100%; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); text-align: center; font-size: .7rem; }
.pizza-image-placeholder svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.35; }
.pizza-image-controls { min-width: 0; display: grid; gap: 8px; }
.pizza-image-controls > input[type="file"] { width: 100%; min-height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; }
.pizza-image-controls > small { color: var(--muted); font-size: .7rem; line-height: 1.45; }
.pizza-image-remove { margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.pizza-image-remove input { width: auto; height: auto; accent-color: var(--red); }
.pizza-image-remove label { color: var(--red-ink); font-size: .72rem; font-weight: 700; cursor: pointer; }

.allergen-field { margin: 0; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.allergen-field legend { padding: 0 8px; font-weight: 700; }
.allergen-field > p { margin: 0 0 14px; color: var(--muted); font-size: .75rem; }
.allergen-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.allergen-options > div { display: flex; align-items: center; gap: 8px; }
.allergen-options input { width: auto; height: auto; accent-color: var(--red); }
.allergen-options label { font-size: .78rem; cursor: pointer; }

/* ---------------------------------------------------------------------- */
/* Custom pizza builder (structural skeleton — themed in professional.css) */
/* ---------------------------------------------------------------------- */

.custom-pizza-builder { padding: 28px; background: var(--gray-0); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow-soft); }
.builder-heading { padding-bottom: 22px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }
.builder-heading > div { display: grid; gap: 4px; }
.builder-heading .eyebrow { margin: 0; }
.builder-heading strong { font-size: 1.3rem; }
.builder-total { text-align: right; }
.builder-total span { color: var(--muted); font-size: .72rem; }
.builder-section { padding-top: 22px; }
.builder-section .section-title-row { margin-bottom: 0; }
.builder-section .section-title-row h2 { font-size: 1rem; }
.ingredient-picker { padding: 22px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.base-picker { grid-template-columns: repeat(3, 1fr); }
.ingredient-option {
    padding: 14px;
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color var(--duration-base) ease, background var(--duration-base) ease;
}
.ingredient-option > input { position: absolute; opacity: 0; pointer-events: none; }
.ingredient-check { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-xs); color: var(--red-ink); }
.ingredient-option:has(input:checked) { border-color: rgba(var(--theme-rgb), .4); background: var(--theme-soft, var(--green-soft)); }
.ingredient-option input:checked + .ingredient-check { color: white; background: var(--theme-primary, var(--green)); border-color: transparent; }
.ingredient-disabled { opacity: .5; cursor: not-allowed; background: var(--gray-50); }
.ingredient-copy { display: grid; gap: 3px; }
.ingredient-copy small { color: var(--muted); font-size: .68rem; }
.ingredient-option > strong:last-child { font-size: .74rem; }
.builder-empty { grid-column: 1 / -1; margin: 0; color: var(--muted); }

/* ---------------------------------------------------------------------- */
/* Notifications (base list — page-specific variant in professional.css)   */
/* ---------------------------------------------------------------------- */

.notification-list { display: grid; gap: 8px; }
.notification-card { padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--gray-0); }
.notification-card > div { position: relative; display: grid; gap: 5px; }
.notification-card p { margin: 0; }
.notification-card time { color: var(--muted); font-size: .7rem; }
.notification-unread { border-color: rgba(var(--theme-rgb), .25); background: var(--theme-soft, var(--green-soft)); }
.notification-unread .notification-dot { width: 8px; height: 8px; position: absolute; left: -13px; top: 7px; border-radius: 50%; background: var(--red); }

/* ---------------------------------------------------------------------- */
/* Status pills                                                            */
/* ---------------------------------------------------------------------- */

.status-pill {
    padding: 6px 10px 6px 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    border-radius: var(--radius-full);
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.status-pill::before { content: ""; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.status-received, .status-ready_for_delivery { color: var(--amber); background: var(--amber-soft); }
.status-accepted, .status-ready_for_pickup, .status-delivered { color: var(--theme-ink); background: var(--theme-soft, var(--green-soft)); }
.status-in_preparation { color: #245f7b; background: var(--blue-soft); }
.status-out_for_delivery { color: #5c468d; background: var(--violet-soft); }
.status-delivery_failed, .status-rejected { color: var(--red-dark-ink); background: var(--red-soft); }
.status-customer_cancelled { color: var(--gray-600); background: var(--gray-100); }
.availability { display: inline-flex; align-items: center; gap: 7px; color: var(--theme-ink, var(--green)); font-size: .68rem; font-weight: 700; }
.availability i { width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.availability.unavailable { color: var(--muted); }

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */

@media (max-width: 1050px) {
    .nav-shell { gap: 14px; }
    .main-nav { gap: 2px; }
    .nav-item { padding: 0 10px; }
    .brand-copy small { display: none; }
    .manager-order { grid-template-columns: 56px 1fr 1.5fr 80px; }
    .manager-order-actions, .manager-order > .status-pill { grid-column: 2 / -1; justify-self: end; }
}

@media (max-width: 800px) {
    .nav-shell { width: min(100% - 28px, 1400px); min-height: 64px; flex-wrap: wrap; padding: 10px 0; }
    .brand { margin-right: auto; }
    .main-nav {
        order: 3;
        width: 100%;
        margin-left: 0;
        padding: 4px;
        overflow-x: auto;
        border: 1px solid var(--line);
        scrollbar-width: none;
    }
    .main-nav::-webkit-scrollbar { display: none; }
    .nav-item { flex: 0 0 auto; }
    .nav-actions { padding-left: 0; }
    .section-shell, .footer-shell, .dashboard-shell, .narrow-shell { width: calc(100% - 32px); }
    .auth-header-shell { flex-wrap: wrap; row-gap: 10px; }
    .checkout-grid { grid-template-columns: 1fr; }
    .ingredient-picker, .base-picker { grid-template-columns: 1fr; }
    .allergen-options { grid-template-columns: 1fr 1fr; }
    .order-summary { position: static; }
    .management-row { grid-template-columns: minmax(0, 1.5fr) .5fr .7fr; }
    .management-row > :last-child { grid-column: 1 / -1; justify-self: stretch; justify-content: flex-start; }
    .management-head { display: none; }
    .rider-management-grid { grid-template-columns: 1fr; }
    .delivery-queue-card { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .nav-actions .text-link { display: none; }
    .dashboard-heading, .footer-shell, .heading-actions { align-items: flex-start; flex-direction: column; }
    .dashboard-heading-actions { width: 100%; justify-content: flex-start; }
    .footer-meta { flex-direction: column; gap: 6px; text-align: left; }
    .dashboard-page { padding-top: 30px; }
    .order-card-body { grid-template-columns: 1fr; }
    .order-card-actions { align-items: flex-start; flex-direction: column; }
    .order-total { padding: 14px 0 0; align-items: flex-start; border-left: 0; border-top: 1px solid var(--line); }
    .order-fulfillment { padding: 14px 0; border-left: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
    .allergen-options { grid-template-columns: 1fr; }
    .cart-line { flex-direction: column; }
    .cart-line-actions { justify-content: space-between; flex-wrap: wrap; }
    .rider-create-card { grid-template-columns: 1fr; }
    .rider-create-card > div, .rider-create-card > button { grid-column: auto; }
    /* On one column a right-aligned natural-width button reads as stranded:
       let the submit span the field width like the inputs above it. */
    .rider-create-submit { justify-self: stretch; }
    .delivery-queue-list li { grid-template-columns: auto 1fr auto; }
    .delivery-queue-next { grid-column: 2 / -1; width: fit-content; }
    .ordering-control-form { grid-template-columns: 1fr; }
    .manager-order { grid-template-columns: 50px 1fr; gap: 13px; }
    .manager-order-items, .manager-order-total { grid-column: 2; text-align: left; }
    .manager-order-actions, .manager-order > .status-pill { grid-column: 2; justify-self: start; }
    .management-row { grid-template-columns: 1fr auto; gap: 12px; padding: 15px; }
    .management-row > :first-child { grid-column: 1 / -1; }
    .management-row > :nth-child(2) { grid-column: 1; }
    .management-row > :nth-child(3) { grid-column: 2; }
    .management-row > :last-child { grid-column: 1 / -1; grid-row: auto; }
    .management-item-mark { width: 40px; height: 40px; flex-basis: 40px; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .editor-card { padding: 20px; }
    .pizza-image-upload { grid-template-columns: 1fr; }
    .pizza-image-preview { max-width: 260px; width: 100%; }
    .editor-actions { flex-direction: column-reverse; }
    .editor-actions .button { width: 100%; }
}
.category-groups-heading {
    margin-top: 24px;
}
