/* A shared header control size fixes anchor/button baseline and height differences. */
:root{--control-bg:#fff;--control-text:#244b40;--control-border:#d5dedb;--control-hover:#eef5f1}
.topbar .topbar-actions,.topbar>.form-actions{display:flex;align-items:center;gap:8px;min-width:0;flex-wrap:wrap}
.topbar .topbar-actions>.secondary-button,.topbar .topbar-actions>.display-fullscreen,.topbar>.form-actions>.secondary-button,.topbar #layout-toggle,.topbar #theme-toggle{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;box-sizing:border-box;flex-shrink:0;height:40px;min-height:40px;margin:0;padding:0 13px;line-height:1;font-family:inherit;font-size:13px;font-weight:500;white-space:nowrap;border:1px solid var(--control-border);border-radius:10px;background:var(--control-bg);color:var(--control-text);text-decoration:none}
.topbar .topbar-actions>.secondary-button:hover,.topbar .display-fullscreen:hover,.topbar>.form-actions>.secondary-button:hover{background:var(--control-hover)}
.topbar .topbar-actions>.kitchen-entry{display:inline-flex}
.topbar #theme-toggle:focus-visible,.topbar .kitchen-entry:focus-visible{outline:3px solid #65a98c;outline-offset:2px}
@media(max-width:900px){.topbar,.simple-layout .topbar,.kitchen-page .topbar{height:auto;min-height:60px;padding-top:10px;padding-bottom:10px;gap:10px;flex-wrap:wrap}.topbar .topbar-actions{margin-left:auto;justify-content:flex-end}.topbar #clock,.topbar #kitchen-clock{display:none}}
@media(max-width:600px){.topbar .topbar-actions{flex-basis:100%;margin-left:0;justify-content:flex-start;gap:7px}.topbar .topbar-actions>.secondary-button,.topbar .topbar-actions>.display-fullscreen,.topbar #layout-toggle,.topbar #theme-toggle,.topbar>.form-actions>.secondary-button{padding:0 10px;font-size:12px}.topbar .connection{font-size:11px}.topbar>.form-actions{gap:7px;flex-wrap:wrap}.topbar>.form-actions .text-button{padding:8px 3px}}
/* Colors remain semantic: blue scheduled, green cooking, amber ready, gray done, rose cancelled. */
:root[data-theme="dark"]{color-scheme:dark;--ink:#e7edf6;--muted:#a7b4c7;--green:#76d8b4;--green-dark:#1e7157;--mint:#203b33;--line:#344155;--bg:#10151e;--orange:#f2ba7d;--red:#ff9a9a;--panel:#181f2b;--surface:#202938;--raised:#263244;--control-bg:#202b3b;--control-text:#dce5ef;--control-border:#40516a;--control-hover:#2b3b4e}
[data-theme="dark"] body,[data-theme="dark"] body.inventory-page,[data-theme="dark"] body.kitchen-page{background:var(--bg);color:var(--ink)}
[data-theme="dark"] .topbar,[data-theme="dark"] .rail,[data-theme="dark"] .cart,[data-theme="dark"] .cart-bottom,[data-theme="dark"] .modal,[data-theme="dark"] .modal-footer,[data-theme="dark"] .frontdesk-toolbar,[data-theme="dark"] .frontdesk-dialog,[data-theme="dark"] .mobile-order-bar,[data-theme="dark"] .inventory-panel,[data-theme="dark"] .customer-panel,[data-theme="dark"] .customer-confirm{background:var(--panel);color:var(--ink);border-color:var(--line);box-shadow:none}
[data-theme="dark"] .brand-seal{background:#23795f;color:#fff;box-shadow:none}
[data-theme="dark"] .connection{color:#8dd5b6}[data-theme="dark"] .connection.offline{color:#ff9a9a}[data-theme="dark"] #clock,[data-theme="dark"] #kitchen-clock{color:var(--muted)}
[data-theme="dark"] .primary-button,[data-theme="dark"] .submit-order,[data-theme="dark"] .category.selected,[data-theme="dark"] .order-tabs button.selected,[data-theme="dark"] .kitchen-filters button.selected{background:#23795f;color:#fff;border-color:#3b9a7b}
[data-theme="dark"] .primary-button:hover:not(:disabled),[data-theme="dark"] .submit-order:hover:not(:disabled){background:#2b8c6e}
[data-theme="dark"] .secondary-button,[data-theme="dark"] .option-button,[data-theme="dark"] .stepper button,[data-theme="dark"] .entry-segment button,[data-theme="dark"] .order-tabs button,[data-theme="dark"] .kitchen-filters button{background:var(--surface);border-color:var(--line);color:#d0dfd7}
[data-theme="dark"] .option-button.selected,[data-theme="dark"] .entry-segment button[aria-pressed=true]{background:#203b33;border-color:#76d8b4;color:#a3ebca}
[data-theme="dark"] .option-button.selected strong{color:#a3ebca}
[data-theme="dark"] .modal-input,[data-theme="dark"] .cart-bottom textarea,[data-theme="dark"] .quantity-row input,[data-theme="dark"] .order-date input,[data-theme="dark"] .kitchen-search input,[data-theme="dark"] .search{background:var(--surface);border-color:var(--line);color:var(--ink)}
[data-theme="dark"] .search input{color:var(--ink)}[data-theme="dark"] textarea::placeholder,[data-theme="dark"] input::placeholder{color:#94a4b8;opacity:1}
[data-theme="dark"] input[type=checkbox],[data-theme="dark"] input[type=radio]{accent-color:#76d8b4}
[data-theme="dark"] .product-card,[data-theme="dark"] .multi-order-product{background:var(--panel);border-color:var(--line);color:var(--ink);box-shadow:none}
[data-theme="dark"] .product-card:hover,[data-theme="dark"] .multi-order-product:hover{background:var(--surface);border-color:#76d8b4}
[data-theme="dark"] .product-card.combo{background:#1d2c29;border-color:#3b5a4d}
[data-theme="dark"] .product-mark{background:#293b54;color:#b7d4fb}[data-theme="dark"] .female .product-mark{background:#49312c;color:#f2bba4}[data-theme="dark"] .shrimp .product-mark{background:#473a22;color:#f4ce8b}[data-theme="dark"] .combo .product-mark{background:#2e4430;color:#c5e0ad}
[data-theme="dark"] .card-price,[data-theme="dark"] .multi-order-total>strong,[data-theme="dark"] .multi-order-line,[data-theme="dark"] #oa-total-note,[data-theme="dark"] .order-timer,[data-theme="dark"] .combo-availability>strong{color:#a3ebca}
[data-theme="dark"] .card-badge,[data-theme="dark"] .rule-note,[data-theme="dark"] .cart-warning,[data-theme="dark"] .kitchen-item small,[data-theme="dark"] .kitchen-note{background:#3c321e;color:#efd49b;border-color:#75633b}
[data-theme="dark"] .card-selected{background:#23795f;color:#fff}
[data-theme="dark"] .product-description,[data-theme="dark"] .stock-label,[data-theme="dark"] .card-price em,[data-theme="dark"] .cart-item-sub,[data-theme="dark"] .cart-note-label,[data-theme="dark"] .cart-tip,[data-theme="dark"] .fee-line,[data-theme="dark"] .helper,[data-theme="dark"] .form-field>span,[data-theme="dark"] .entry-heading>span,[data-theme="dark"] .entry-choice legend,[data-theme="dark"] .entry-tip,[data-theme="dark"] .modal-total small,[data-theme="dark"] .detail-lines,[data-theme="dark"] .detail-item small,[data-theme="dark"] .order-date,[data-theme="dark"] .active-orders-toggle,[data-theme="dark"] .order-legend,[data-theme="dark"] .menu-footer,[data-theme="dark"] .category,[data-theme="dark"] .empty-cart strong,[data-theme="dark"] .empty-cart,[data-theme="dark"] .loading-state,[data-theme="dark"] .list-empty{color:var(--muted)}
[data-theme="dark"] .text-button,[data-theme="dark"] .edit-item,[data-theme="dark"] .customer-edit-link,[data-theme="dark"] .customer-tools summary,[data-theme="dark"] .extension-presets button,[data-theme="dark"] .frontdesk-toolbar .secondary-button,[data-theme="dark"] .close-cart{color:#9ddbbd}
[data-theme="dark"] .cart-item-note{color:#e5be8e}
[data-theme="dark"] .order-entry,[data-theme="dark"] .product-order-modal .order-entry,[data-theme="dark"] .simple-layout .product-order-modal .order-entry,[data-theme="dark"] .flavor-section,[data-theme="dark"] .customer-import,[data-theme="dark"] .fulfillment-summary,[data-theme="dark"] .checkout-items,[data-theme="dark"] .customer-tools,[data-theme="dark"] .order-extension,[data-theme="dark"] .oa-item,[data-theme="dark"] .stock-edit,[data-theme="dark"] .inventory-history tr,[data-theme="dark"] .customer-record,[data-theme="dark"] .customer-matches{background:var(--surface);border-color:var(--line);color:var(--ink)}
[data-theme="dark"] .fee-summary,[data-theme="dark"] .multi-order-summary,[data-theme="dark"] .combo-availability,[data-theme="dark"] .customer-record.selected{background:#1d332c;border-color:#3d6554;color:var(--ink)}
[data-theme="dark"] .service-note span,[data-theme="dark"] .rail-count,[data-theme="dark"] .cart-heading h2 span,[data-theme="dark"] .customer-record .customer-group-badge{background:var(--raised);border-color:var(--line);color:#bbd7c9}
[data-theme="dark"] .customer-matches button,[data-theme="dark"] .order-legend summary,[data-theme="dark"] .order-legend>div,[data-theme="dark"] .kitchen-empty{background:var(--panel);border-color:var(--line);color:var(--ink)}
[data-theme="dark"] .close-button{background:var(--raised);color:#c5d1e0}
[data-theme="dark"] .cart-item,[data-theme="dark"] .detail-item,[data-theme="dark"] .modal-footer,[data-theme="dark"] .multi-order-line,[data-theme="dark"] .multi-order-picker-footer,[data-theme="dark"] .inventory-history td,[data-theme="dark"] .inventory-history th,[data-theme="dark"] .kitchen-item{border-color:var(--line)}
[data-theme="dark"] .multi-order-entry>span,[data-theme="dark"] .multi-order-heading>span,[data-theme="dark"] .multi-order-line small,[data-theme="dark"] .multi-order-total>span,[data-theme="dark"] .multi-order-product span,[data-theme="dark"] .multi-order-product small,[data-theme="dark"] .order-extension>p,[data-theme="dark"] .oa-flavors>small,[data-theme="dark"] .stock-shared-note,[data-theme="dark"] .stock-input-row>span,[data-theme="dark"] .stock-edit>[data-stock-hint],[data-theme="dark"] .combo-availability p,[data-theme="dark"] .inventory-history td:before,[data-theme="dark"] .customer-matches>small,[data-theme="dark"] .customer-matches button small,[data-theme="dark"] .kitchen-info p,[data-theme="dark"] .kitchen-info>span,[data-theme="dark"] .kitchen-number small,[data-theme="dark"] .kitchen-times,[data-theme="dark"] .kitchen-print,[data-theme="dark"] .kitchen-item>span,[data-theme="dark"] .frontdesk-dialog>p,[data-theme="dark"] .alert-time{color:var(--muted)}
[data-theme="dark"] .mobile-order-bar>button:first-child{color:var(--ink)}[data-theme="dark"] .mobile-order-bar span{color:var(--muted)}
[data-theme="dark"] .error-box,[data-theme="dark"] .oa-cancel-warning,[data-theme="dark"] .inventory-message.error,[data-theme="dark"] #customer-message.error{background:#42232a;border-color:#97515d;color:#ffb7b7}
[data-theme="dark"] .danger-button,[data-theme="dark"] .customer-danger{background:#3b252a;border-color:#9b535d;color:#ffbbbd}
[data-theme="dark"] .danger-button:hover,[data-theme="dark"] .customer-danger:hover{background:#503039}
[data-theme="dark"] .inventory-message,[data-theme="dark"] #customer-message{background:#203b2e;border-color:#426950;color:#b6e7c6}
[data-theme="dark"] .stock-edit>[data-stock-hint].stock-error,[data-theme="dark"] .stock-edit>[data-reload-stock],[data-theme="dark"] .order-extension .extension-error,[data-theme="dark"] .product-card:disabled .stock-label{color:#ffb7b7}
[data-theme="dark"] .sound-error{color:#ffb7b7!important}
[data-theme="dark"] .modal-backdrop,[data-theme="dark"] .customer-confirm-backdrop{background:#05080dcc}[data-theme="dark"] .frontdesk-dialog::backdrop{background:#05080ddd}
[data-theme="dark"] .toast{background:#d6ede2;color:#152b21}[data-theme="dark"] .display-fullscreen-hint:not(:empty){background:#d6ede2;color:#152b21}
/* Work states override neutral surfaces, including their badges and secondary text. */
[data-theme="dark"] .order-row.pending,[data-theme="dark"] .kitchen-card.pending{background:#1b2431;border-color:#455467;border-left-color:#708095;color:var(--ink)}
[data-theme="dark"] .order-row.pending.scheduled,[data-theme="dark"] .kitchen-card.pending.scheduled,[data-theme="dark"] .frontdesk-alert-card.scheduled{background:#172b43;border-color:#41658d;border-left-color:#65aafa}
[data-theme="dark"] .order-row.cooking,[data-theme="dark"] .kitchen-card.cooking{background:#15382d;border-color:#2d6a4f;border-left-color:#53c87f;color:var(--ink)}
[data-theme="dark"] .order-row.ready.delivery,[data-theme="dark"] .order-row.ready.pickup,[data-theme="dark"] .kitchen-card.ready,[data-theme="dark"] .frontdesk-alert-card{background:#3b321c;border-color:#88712b;border-left-color:#e8b938;color:var(--ink)}
[data-theme="dark"] .order-row.completed{background:#353d49;border-color:#55606e;border-left-color:#242b33;color:#e5e9ee}
[data-theme="dark"] .order-row.cancelled{background:#3b282d;border-color:#80515b;border-left-color:#ba7885;color:#f4c6cf}
[data-theme="dark"] .order-row.overdue,[data-theme="dark"] .order-row.ready.overdue,[data-theme="dark"] .kitchen-card.overdue,[data-theme="dark"] .frontdesk-alert-card.overdue{background:#491b27;border-color:#ff4960;border-left-color:#ff1733;color:#fff0f2}
[data-theme="dark"] .order-row .order-card-item>span,[data-theme="dark"] .order-row .order-card-time,[data-theme="dark"] .order-row .order-card-footer>span,[data-theme="dark"] .order-row .order-no small,[data-theme="dark"] .order-row .order-card-more{color:#becbd8}
[data-theme="dark"] .order-row .order-card-footer{border-top-color:#ffffff24}[data-theme="dark"] .order-row .order-card-customer,[data-theme="dark"] .order-row .order-card-item strong,[data-theme="dark"] .order-row .order-card-footer>strong{color:inherit}
[data-theme="dark"] .order-row.cancelled .order-card-item>span,[data-theme="dark"] .order-row.cancelled .order-card-time,[data-theme="dark"] .order-row.cancelled .order-no small,[data-theme="dark"] .order-row.cancelled .order-card-footer>span,[data-theme="dark"] .order-row.cancelled .order-card-more{color:#e6b4bf}
[data-theme="dark"] .order-row .status-pill,[data-theme="dark"] .kitchen-card .status-pill{background:#2a3544;color:#d8e2ef}
[data-theme="dark"] .order-row.pending.scheduled .status-pill,[data-theme="dark"] .kitchen-card.pending.scheduled .status-pill{background:#254366;color:#b3d5ff}
[data-theme="dark"] .order-row.cooking .status-pill,[data-theme="dark"] .kitchen-card.cooking .status-pill{background:#265541;color:#abedc5}
[data-theme="dark"] .order-row.ready .status-pill,[data-theme="dark"] .kitchen-card.ready .status-pill{background:#5d4b1c;color:#ffe29a}
[data-theme="dark"] .order-row.completed .status-pill{background:#252d38;color:#e5e9ee}[data-theme="dark"] .order-row.cancelled .status-pill{background:#54313b;color:#ffd1da}
[data-theme="dark"] .order-row.overdue .status-pill,[data-theme="dark"] .kitchen-card.overdue .status-pill{background:#7a2336;color:#ffdce2}
[data-theme="dark"] .priority-badge{background:#61372c;color:#ffd2b6}[data-theme="dark"] .frontdesk-toolbar strong{color:#f1d184}[data-theme="dark"] .overdue .frontdesk-alert-title{color:#ffb7c2}
[data-theme="dark"] .overdue-label,[data-theme="dark"] .kitchen-warning{background:#c9263b;color:#fff}
@media print{.theme-toggle{display:none}}
