/* Section styles (one block per feature area). Design tokens and shared
   components are in app.css; use its variables here. */

/* == platform == */
/* Super Admin console (platform/layout.html uses the workspace shell).
   Everything reads theme variables: store cards follow light/dark mode. */
.platform-filter { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.platform-filter label { flex: 1 1 220px; max-width: 360px; }
.platform-list { display: grid; gap: 14px; margin-top: 14px; }
.platform-store { background: var(--card); color: var(--ink); border: 1px solid var(--panel-border); border-left: 4px solid var(--c-teal); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); animation: rise .25s ease-out; }
.platform-store.pending { border-left-color: var(--c-amber); }
.platform-store.archived { border-left-color: var(--muted); border-style: dashed; border-left-style: solid; opacity: .85; }
.platform-store-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.platform-store-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: rgb(64 81 137 / 12%); color: var(--c-primary); flex: none; }
:root[data-theme="dark"] .platform-store-icon { color: var(--link); }
.platform-store-title { flex: 1 1 240px; min-width: 0; }
.platform-store-title h3 { margin: 0; font-size: 16px; color: var(--ink-strong); }
.platform-store-title p { margin: 2px 0 0; }
.badge-full { background: rgb(64 81 137 / 12%); color: var(--c-primary); }
.badge-basic { background: rgb(247 184 75 / 18%); color: #b7791f; }
:root[data-theme="dark"] .badge-full { color: var(--link); }
.platform-stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; margin: 14px 0 10px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; }
.platform-stats-row > div { display: grid; gap: 2px; padding: 8px 12px; background: var(--card); }
.platform-stats-row span { font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600; }
.platform-stats-row b { font-size: 18px; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.platform-stats-row b.hot { color: var(--c-red); }
.platform-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.platform-chips b { color: inherit; }
.platform-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.platform-more { margin-top: 8px; }
.platform-more > summary { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-s); background: var(--alt); color: var(--alt-ink); border: 1px solid var(--panel-border); font-size: 13px; }
.platform-more[open] > summary { margin-bottom: 4px; }
.platform-rename { align-items: end; justify-content: flex-start; margin-top: 10px; }
.platform-rename label { flex: 1; min-width: 220px; max-width: 420px; }
.platform-config:empty { display: none; }
.platform-panel { background: var(--card); color: var(--ink); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 16px 18px; margin-top: 12px; box-shadow: var(--shadow); }
.platform-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -16px -18px 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.platform-panel-head h3 { margin: 0; }
.platform-panel h3, .platform-panel h4 { display: flex; align-items: center; gap: 6px; }
.platform-panel hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.platform-panel fieldset { border: 1px solid var(--panel-border); border-radius: var(--radius-s); padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.platform-panel fieldset legend { font-weight: 600; font-size: 13px; padding: 0 4px; }
.platform-panel fieldset .small { flex-basis: 100%; }
.platform-preset { justify-content: flex-start; align-items: end; margin-bottom: 12px; }
.platform-preset label { min-width: 220px; }
.platform-button-row { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; }
.platform-history { padding-left: 18px; color: var(--ink); }
.platform-warn { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-s); background: rgb(247 184 75 / 16%); color: #b7791f; font-weight: 600; }
.platform-danger { border-color: var(--c-red); border-left: 4px solid var(--c-red); }
.platform-danger .platform-panel-head h3 { color: var(--c-red); }
.platform-transfer { border-top: 0; }
.platform-result { background: rgb(10 179 156 / 10%); border: 1px solid rgb(10 179 156 / 40%); color: var(--ink); border-radius: var(--radius-s); padding: 12px 14px; margin: 12px 0; }
.platform-result b { color: var(--ink-strong); }
.platform-temp { font-size: 18px; font-weight: 800; background: var(--input); color: var(--ink-strong); border: 1px solid var(--input-border); padding: 2px 8px; border-radius: 6px; user-select: all; }

/* == store sections == */
/* Shared helpers for the store workspace pages (tokens only: light + dark). */
.inline-flash { position: static; animation: none; box-shadow: none; margin: 0 0 14px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; align-items: end; }
.form-grid, .menu-form .grid3, .printers .grid3 { align-items: end; gap: 14px; }
.span-all { grid-column: 1 / -1; }
.grow { flex: 1 1 200px; width: auto; }
.row.wrap { flex-wrap: wrap; }
input.num { width: 6.5em; }
.break { word-break: break-all; }
.note.warn { color: var(--c-red); }
.card-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-head h2 .i { color: var(--c-primary); }
:root[data-theme="dark"] .card-head h2 .i { color: var(--link); }
.chip .i, .badge .i { width: 1em; height: 1em; }
.btn.flip .i, .i.flip { transform: rotate(180deg); }
.i.flip-x { transform: scaleX(-1); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.form-foot { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.add-form { align-items: flex-end; justify-content: flex-start; }
.add-form > label { flex: 0 1 auto; }
.add-form > label.grow { flex: 1 1 200px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-bar label { flex: 1 1 160px; }
.filter-actions { margin-left: auto; }
.icon-sq { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 10px; background: rgb(64 81 137 / 12%); color: var(--c-primary); }
.icon-sq.tone-teal { background: rgb(10 179 156 / 12%); color: var(--c-teal); }
.icon-sq.tone-amber { background: rgb(247 184 75 / 16%); color: #d99a2b; }
.icon-sq.tone-red { background: rgb(240 101 72 / 12%); color: var(--c-red); }
:root[data-theme="dark"] .icon-sq { color: var(--link); }
:root[data-theme="dark"] .icon-sq.tone-teal { color: var(--c-teal); }
:root[data-theme="dark"] .icon-sq.tone-amber { color: var(--c-amber); }
:root[data-theme="dark"] .icon-sq.tone-red { color: var(--c-red); }
/* Collapsible sections inside a card, and whole cards that fold. */
.sub-details { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.sub-details > summary, details.fold > summary, .sub-card > summary, .done-list > summary { display: flex; align-items: center; gap: 8px; color: var(--ink-strong); font-weight: 600; }
.sub-details[open] > summary { margin-bottom: 12px; }
details.fold[open] > summary { margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sub-card { border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 14px 16px; background: var(--card); }
.sub-card[open] > summary { margin-bottom: 12px; }
.sub-card > p { margin-top: 0; }
/* Segmented period switch (analytics). */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 10px; background: var(--card); border: 1px solid var(--panel-border); box-shadow: var(--shadow); }
.seg a { padding: 8px 14px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.seg a:hover { text-decoration: none; color: var(--ink-strong); }
.seg a.active { background: var(--c-primary); color: #fff; }
.tabs-line { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--panel-border); margin: 0 0 20px; }
.tabs-line a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-line a:hover { text-decoration: none; color: var(--ink-strong); }
.tabs-line a.active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
:root[data-theme="dark"] .tabs-line a.active { color: var(--link); border-bottom-color: var(--link); }
.an-chart .hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-chart .hbar-val { text-align: right; min-width: 3ch; }
/* Pills: category pickers (waiter, menu; the guest order page uses them too). */
.pills, .menu-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pill { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 16px; border-radius: 20px; background: var(--alt); color: var(--alt-ink); border: 1px solid var(--panel-border); font-weight: 600; font-size: 14px; }
.pill:hover { text-decoration: none; }
.pill.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.pill-n { opacity: .7; font-weight: 500; margin-left: 6px; }
/* Lists that become stacked cards on phones (key column first). */
.history .table-cards td:first-child, .table-cards td:first-child { font-weight: 600; }

/* == requests & history == */
.done-list { margin-top: 20px; }
.done-list[open] > summary { margin-bottom: 14px; }
.hist-item { border-bottom: 1px solid var(--line); }
.hist-item:last-child { border-bottom: 0; }
.hist-item > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; }
.hist-sum { flex: 1; min-width: 0; }
.hist-body { display: grid; gap: 6px; padding: 0 0 14px; }
.hist-order { margin-top: 8px; }
.push-actions { justify-content: flex-start; }

/* == printers == */
.printers-static { position: static; animation: none; box-shadow: none; margin: 0 0 12px; }
.pr-actions { justify-content: flex-start; }
.pr-dl-title { display: flex; align-items: center; gap: 8px; margin: 20px 0 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.pr-devices { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.pr-device { display: grid; gap: 12px; padding: 14px 16px; border: 1px solid var(--panel-border); border-radius: var(--radius); background: var(--card); }
.pr-device-head { display: flex; gap: 14px; align-items: flex-start; }
.pr-device-head .team-main { flex: 1; }
.pr-device-head .row { justify-content: flex-start; }
.pr-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; padding-top: 12px; border-top: 1px solid var(--line); }
.pr-inline { display: flex; gap: 8px; align-items: flex-end; }
.pr-inline label { flex: 1; }
.pr-code { max-width: 12em; font-size: 20px; letter-spacing: .2em; text-align: center; font-variant-numeric: tabular-nums; }
.pr-pin { margin-top: 16px; padding: 18px; text-align: center; border: 2px dashed var(--c-primary); border-radius: var(--radius); background: var(--alt); }
.pr-pin-code { font-size: 46px; font-weight: 800; letter-spacing: 12px; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.pr-pin-ok { border-color: var(--c-teal); background: rgb(10 179 156 / 8%); }
.pr-pin-icon { margin: 0; color: var(--c-teal); }
.pr-pin-expired { border-color: var(--panel-border); color: var(--muted); }
.pr-wait { justify-content: center; }
.pr-list-title { margin: 18px 0 10px; }

/* == team & screens == */
.team-create { display: grid; gap: 12px; }
.team-result:empty, #screen-result:empty { display: none; }
#screen-result:not(:empty) { margin-top: 16px; }
.team-card { margin-bottom: 20px; }
.team-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.team-row { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--panel-border); border-radius: var(--radius); background: var(--card); }
.team-row > .avatar, .team-row > .icon-sq { flex: none; }
.team-row.is-disabled { opacity: .6; }
.team-main { display: grid; gap: 4px; min-width: 0; flex: 1 1 220px; }
.team-main strong { color: var(--ink-strong); }
.team-chips { justify-content: flex-start; }
.team-actions { flex: 1 1 100%; }
.team-actions > summary { list-style: none; display: inline-flex; cursor: pointer; }
.team-actions > summary::-webkit-details-marker { display: none; }
.team-actions[open] > .stack { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--panel-border); }
.team-actions .row { justify-content: flex-start; }
.perm-grid { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 14px; margin: 0; }
.perm-grid legend { font-weight: 600; font-size: 13px; padding: 0 4px; color: var(--ink-strong); }
.table-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.online-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.online-list li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--alt); color: var(--alt-ink); }
.dot-online { width: 9px; height: 9px; border-radius: 50%; background: var(--c-teal); box-shadow: 0 0 0 3px rgb(10 179 156 / 20%); }
.invite-qr-panel { display: grid; justify-items: start; gap: 6px; margin: 10px 0; }
.invite-qr-panel svg.qr { width: 216px; height: auto; max-width: 100%; background: #fff; padding: 6px; border-radius: 8px; }
.kopa-pin { display: inline-block; font-size: clamp(35px, 9vw, 51px); font-weight: 800; letter-spacing: .18em; color: var(--c-primary); background: rgb(64 81 137 / 8%); border: 2px dashed var(--c-primary); border-radius: 14px; padding: 6px 18px; margin: 6px 0; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .theme-light .kopa-pin { color: var(--link); border-color: var(--link); }
.theme-dark .kopa-pin { color: #4de1b2; background: #10263b; border-color: #2abf92; }
.kopa-code { font-size: 1.3em; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.result-head { display: flex; align-items: center; gap: 10px; }
.result-head .icon-sq { width: 38px; height: 38px; }

/* == menu & tables == */
.menu-editor:empty { display: none; }
.menu-editor { margin-bottom: 20px; }
.menu-form fieldset.form-section, .import-row { border: 1px solid var(--panel-border); border-radius: var(--radius-s); padding: 14px; display: grid; gap: 10px; margin: 0; min-width: 0; }
.menu-form legend { display: flex; align-items: center; gap: 6px; padding: 0 4px; font-weight: 600; color: var(--ink-strong); }
.menu-bulk { justify-content: flex-start; margin-bottom: 4px; }
.menu-cat { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.menu-cat-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.menu-rows { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.menu-row { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: space-between; align-items: center; background: var(--card); border: 1px solid var(--panel-border); border-radius: var(--radius-s); padding: 12px 14px; }
.menu-row.off { opacity: .65; }
.menu-row-main { display: grid; gap: 6px; min-width: 0; flex: 1 1 260px; }
.menu-row-main strong { color: var(--ink-strong); }
.menu-row-main .price { margin-left: 6px; color: var(--c-primary); }
:root[data-theme="dark"] .menu-row-main .price { color: var(--link); }
.menu-row-tags { justify-content: flex-start; gap: 6px; }
.menu-row-actions { justify-content: flex-end; }
.menu-pages { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.menu-pages li { display: grid; gap: 8px; justify-items: start; padding: 10px; border: 1px solid var(--panel-border); border-radius: var(--radius-s); }
.menu-pages img { border-radius: 6px; border: 1px solid var(--line); }
.import-row { margin: 0 0 10px; }
.import-row.dup { border-color: var(--c-amber); }
.import-row.invalid { border-color: var(--c-red); }
.import-actions { justify-content: flex-end; }
.import-wait { margin-top: 8px; }
.ingr-row { display: grid; grid-template-columns: 90px 2fr 1fr 1fr 110px auto; gap: 10px; align-items: end; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.ingr-del { color: var(--c-red); }
.nfc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 20px; }
.nfc-grid > .card { margin: 0; display: grid; gap: 10px; align-content: start; }
.nfc-grid > .card > .card-head { margin-bottom: 6px; }
.nfc-table.off { opacity: .7; }
.nfc-label { margin: 4px 0 0; }
.nfc-url { font-family: ui-monospace, monospace; font-size: 13px; background: var(--alt); }
.qr-slot { padding: 8px 0; }
svg.qr { width: 210px; height: 210px; background: #fff; padding: 6px; border-radius: 8px; }
.danger-zone { border-color: rgb(240 101 72 / 45%); }
.danger-zone .card-head h2, .danger-zone .card-head h2 .i, .danger-details > summary { color: var(--c-red); }
.danger-form { align-items: flex-end; }
/* QR sheet: printed, so black on white in every theme. */
.qr-print-head { margin-top: 16px; }
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.qr-card { margin: 0; border: 1px dashed #999; border-radius: 12px; padding: 14px; text-align: center; break-inside: avoid; background: #fff; color: #000; }
.qr-card figcaption { display: grid; gap: 2px; margin-bottom: 8px; }
.qr-card figcaption span { font-size: 22px; font-weight: 800; }
.qr-card svg.qr { width: 200px; height: 200px; padding: 0; }
.qr-card p { font-size: 12px; margin: 6px 0 0; }
@media print { .qr-sheet { grid-template-columns: repeat(3, 1fr); } .qr-card { border-color: #bbb; } }

/* == orders == */
/* Table tiles (orders, bills, tables board, waiter): a card with a status bar on top. */
.ttiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.ttile { position: relative; display: grid; gap: 6px; align-content: start; min-height: 104px; padding: 14px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--panel-border); border-top: 4px solid var(--c-teal); color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.ttile:hover { text-decoration: none; box-shadow: var(--shadow-lg); }
.ttile:active { transform: scale(.98); }
.ttile-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ttile-head strong { font-size: 16px; color: var(--ink-strong); }
.ttile-icon { color: var(--muted); }
.ttile .row { justify-content: flex-start; }
.ttile-owes { border-top-color: var(--c-amber); }
.ttile-needs-help { border-top-color: var(--c-red); background-image: linear-gradient(rgb(240 101 72 / 7%), rgb(240 101 72 / 7%)); }
.ttile-clear { border-top-color: var(--c-teal); }
.ttile-inactive { opacity: .6; border-top-color: var(--panel-border); }
.ttile-selected { outline: 2px solid var(--c-primary); outline-offset: 2px; }
.ttile-amount { font-size: 20px; font-weight: 700; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.board-legend { margin-bottom: 12px; }
.board-legend p { margin: 0; }
.table-detail h3 { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; }
.detail-sub { margin-top: 20px !important; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-actions { justify-content: flex-start; margin-top: 16px; }
.order-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.order-card { display: grid; gap: 10px; align-content: start; background: var(--card); border: 1px solid var(--panel-border); border-top: 4px solid var(--c-red); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); animation: rise .25s ease-out; }
.order-preparing { border-top-color: var(--c-amber); }
.order-done { border-top-color: var(--c-teal); }
.order-table { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; color: var(--ink-strong); }
.order-number { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.order-chips { justify-content: flex-start; }
.order-meta { padding-top: 8px; border-top: 1px solid var(--line); }
.order-total { font-size: 18px; color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.oline { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.oline-main { display: grid; gap: 2px; min-width: 0; }
.oline-marks { justify-content: flex-start; margin-top: 2px; }
.oline .price { color: var(--ink-strong); font-variant-numeric: tabular-nums; }
.paid-mark { color: var(--c-teal); font-weight: 700; }
.unpaid-mark { color: var(--c-red); font-weight: 700; }
.bill-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bill-line { display: grid; gap: 6px; padding-bottom: 8px; justify-items: start; }
.bill-line .oline { width: 100%; }
.bill-totals { margin: 14px 0 6px; padding: 2px 14px; background: var(--alt); border-radius: var(--radius-s); }
.bill-rest strong { font-size: 20px; color: var(--ink-strong); }
.bill-clear { display: flex; align-items: center; gap: 6px; color: var(--c-teal); font-weight: 700; }
.bill-actions { justify-content: flex-start; }
.lookup-form { justify-content: flex-start; }
.lookup-form input { max-width: 220px; }
#lookup-result:not(:empty) { display: grid; gap: 10px; margin-top: 14px; }
.lookup-card { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--panel-border); border-radius: var(--radius-s); }
.lookup-none { margin: 0; }
/* Waiter ordering. */
.waiter-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); align-items: start; }
.waiter-grid:not(:has(.cart)) { grid-template-columns: minmax(0, 1fr); }
.waiter-grid .cart { position: sticky; top: calc(var(--topbar-h) + 16px); }
.waiter-table { display: flex; align-items: center; gap: 12px; }
.waiter-table .order-table { font-size: 18px; }
.products-title { margin: 18px 0 10px; }
.products { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.product { display: grid; gap: 4px; align-content: start; min-height: 112px; padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--panel-border); color: var(--ink); box-shadow: var(--shadow); }
.product:hover { text-decoration: none; border-color: var(--c-primary); }
.product:active { transform: scale(.97); }
.product strong { color: var(--ink-strong); }
.product .price { color: var(--c-primary); }
:root[data-theme="dark"] .product .price { color: var(--link); }
.product-icon { font-size: 26px; }
.cart-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-total { font-size: 20px; color: var(--ink-strong); }
.cart-send { margin: 12px 0 8px; }
.cart-bar { position: sticky; bottom: 12px; display: flex; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--primary); color: var(--primary-ink); font-weight: 700; margin-top: 16px; box-shadow: var(--shadow-lg); }
.cart-bar:hover { text-decoration: none; }
/* Product editor (waiter + guest): options, ingredients with a CSS-only stepper. */
.item-editor { display: grid; gap: 14px; max-width: 620px; }
.item-editor .card-head .price { font-size: 18px; color: var(--ink-strong); }
.item-ings-title { margin: 6px 0 0; }
.item-ings { display: grid; }
.opt-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.stepper { display: inline-flex; flex: none; }
.step-radio { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.step-view { display: none; align-items: center; gap: 10px; border-radius: 12px; }
.step-radio:checked + .step-view { display: inline-flex; }
.step-radio:focus-visible + .step-view { outline: 3px solid var(--focus); outline-offset: 2px; }
.stepper .step-btn { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--panel-border); background: var(--alt); color: var(--ink-strong); font-size: 24px; font-weight: 700; line-height: 1; cursor: pointer; user-select: none; touch-action: manipulation; }
.stepper .step-btn:active { transform: scale(.94); background: var(--primary); color: var(--primary-ink); }
.stepper .step-btn.off { opacity: .35; cursor: default; }
.step-val { min-width: 2ch; text-align: center; font-size: 20px; font-weight: 700; color: var(--ink-strong); font-variant-numeric: tabular-nums; }

/* == store sections: phones == */
@media (max-width: 1000px) {
  .waiter-grid { grid-template-columns: minmax(0, 1fr); }
  .waiter-grid .cart { position: static; }
}
@media (max-width: 860px) {
  /* Primary actions at the bottom, full width. */
  .form-foot > .btn, .form-foot > form, .form-foot > a { flex: 1 1 100%; }
  .form-foot .btn, .cart-send .btn, .detail-actions .btn, .bill-actions .btn, .bill-actions form, .import-actions .btn { width: 100%; }
  .add-form > label, .add-form > label.grow, .add-form > .btn { flex: 1 1 100%; }
  .add-form > .btn { width: 100%; }
  .filter-bar label { flex: 1 1 100%; }
  .filter-actions { margin-left: 0; width: 100%; }
  .filter-actions .btn { flex: 1 1 auto; }
  .lookup-form input { max-width: none; flex: 1 1 140px; }
  .order-card .request-actions .btn, .order-card .request-actions form { flex: 1 1 auto; }
  .menu-row-actions, .import-actions { justify-content: flex-start; }
  .ttiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ttile { padding: 12px; }
  .ingr-row { grid-template-columns: 1fr 1fr; }
  .pr-device-head { flex-wrap: wrap; }
  .pr-inline { flex-wrap: wrap; }
  .seg { display: flex; width: 100%; }
  .seg a { flex: 1 1 auto; text-align: center; }
  .tabs-line { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs-line a { white-space: nowrap; min-height: 44px; }
  /* Tables that turn into stacked cards: key column first, action last. */
  table.table-cards thead { display: none; }
  table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td { display: block; width: 100%; }
  table.table-cards tr { padding: 10px 4px; border-bottom: 1px solid var(--line); }
  table.table-cards td { border: 0; padding: 3px 10px; text-align: left; }
  table.table-cards td.num { text-align: left; }
  table.table-cards td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); font-weight: 600; }
  table.table-cards td.td-action .btn, table.table-cards td.td-action form { width: 100%; margin-top: 6px; }
  table.table-cards tr:hover td { background: transparent; }
}

/* == receipt == */
/* Browser copy of a ticket: the paper stays black on white in every theme. */
.receipt-mode { background: var(--bg); }
.receipt-wrap { max-width: 440px; margin: 0 auto; padding: 20px 16px; }
.receipt-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; color: var(--ink-strong); }
.receipt-bar strong { display: inline-flex; align-items: center; gap: 6px; }
.receipt-paper { width: 76mm; max-width: 100%; margin: 0 auto; background: #fff; color: #000; padding: 4mm; font: 13px/1.35 "DejaVu Sans", Arial, sans-serif; box-shadow: var(--shadow-lg); border-radius: 2px; }
.receipt-paper h1, .receipt-paper b { color: #000; }
.receipt-store { font-size: 17px; text-align: center; margin: 0 0 6px; }
.receipt-line { display: flex; justify-content: space-between; gap: 8px; }
.receipt-item { margin: 6px 0; }
.receipt-label { font-size: 11px; font-weight: 800; margin-top: 3px; }
.receipt-sub { padding-left: 10px; }
.receipt-total { font-size: 15px; }
.receipt-end { text-align: center; font-weight: 800; }
.receipt-paper hr { border: 0; border-top: 1px dashed #000; margin: 6px 0; }
.receipt-actions { margin-top: 20px; }
.receipt-status { font-weight: 700; }
#receipt-status .htmx-indicator { display: none; }
#receipt-status .htmx-request .htmx-indicator, #receipt-status .htmx-request.htmx-indicator { display: block; }
@media print {
  @page { size: 80mm auto; margin: 2mm; }
  .no-print, #flash { display: none !important; }
  .receipt-mode, .receipt-wrap { background: #fff; padding: 0; margin: 0; max-width: none; }
  .receipt-paper { width: 76mm; box-shadow: none; padding: 0; }
}

/* == screen == */
/* Display screens (/screen): brand dark, large type, readable from a distance. */
.screen-mode { --bg: #070c17; --bg-grad: #070c17; font-size: 20px; }
.screen-mode .spinner { width: 28px; height: 28px; border-width: 4px; border-color: rgb(255 255 255 / 20%); border-top-color: var(--primary); }
.screen-setup { max-width: 520px; margin: 8vh auto; padding: 0 16px; text-align: center; }
.screen-setup h1 { font-size: 32px; }
.screen-setup .auth-card { text-align: left; margin-top: 18px; }
.screen-logo { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 16px; margin-bottom: 14px; background: linear-gradient(135deg, var(--c-teal), var(--c-primary)); color: #fff; }
.screen-logo .i { width: 32px; height: 32px; }
.screen-pin-input, .pin-input { font-size: 32px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; min-height: 60px; }
.screen-wait { font-size: 24px; display: flex; gap: 14px; align-items: center; justify-content: center; margin: 8px 0; }
.screen-error { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--new); font-size: 22px; }
.screen-wait-error { text-align: center; }
.screen-board { padding: 20px clamp(12px, 2vw, 32px) 40px; }
.sb-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sb-head h1 { display: flex; align-items: center; gap: 14px; margin: 0; font-size: clamp(28px, 3.2vw, 46px); }
.sb-mark { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; border-radius: 14px; background: linear-gradient(135deg, var(--c-teal), var(--c-primary)); color: #fff; }
.sb-mark .i { width: .7em; height: .7em; }
.sb-sub { margin: 4px 0 0; color: var(--muted); font-size: 20px; }
.sb-clock { font-size: clamp(34px, 4vw, 60px); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink-strong); padding: 4px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-border); }
.sb-note, .sb-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: 15px; margin: 10px 0 12px; }
.sb-live { width: 10px; height: 10px; border-radius: 50%; background: var(--done); box-shadow: 0 0 0 4px rgb(55 193 141 / 25%); animation: sb-pulse 2s ease-in-out infinite; }
@keyframes sb-pulse { 50% { box-shadow: 0 0 0 8px rgb(55 193 141 / 0%); } }
.sb-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.sb-dot.red { background: var(--new); } .sb-dot.green { background: var(--done); } .sb-dot.grey { background: var(--muted); }
.sb-section { margin-top: 26px; }
.sb-section h2 { display: flex; align-items: center; gap: 10px; font-size: clamp(24px, 2.4vw, 34px); margin: 0 0 12px; }
.sb-section h2 .i { color: var(--primary); }
.sb-count { display: inline-grid; place-items: center; min-width: 1.5em; padding: 0 .35em; border-radius: 999px; background: var(--alt); color: var(--ink-strong); font-size: .7em; }
.sb-empty { color: var(--muted); font-size: 22px; padding: 18px; border: 1px dashed var(--panel-border); border-radius: var(--radius); }
.sb-requests { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.sb-request { display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--radius); background: rgb(251 106 119 / 16%); border: 1px solid rgb(251 106 119 / 45%); border-left: 6px solid var(--new); animation: rise .25s ease-out; }
.sb-request strong { font-size: 30px; color: var(--ink-strong); }
.sb-request span { font-size: 24px; font-weight: 700; }
.sb-request small { color: var(--muted); font-size: 16px; }
.sb-request.sb-accepted { background: rgb(246 199 92 / 14%); border-color: rgb(246 199 92 / 45%); border-left-color: var(--accepted); }
.sb-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.sb-order { padding: 16px 18px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-border); border-left: 6px solid var(--c-blue); }
.sb-order.sb-o-preparing { border-left-color: var(--accepted); }
.sb-order header { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sb-order header strong { font-size: 30px; color: var(--ink-strong); }
.sb-order header span { color: var(--muted); font-size: 18px; }
.sb-order ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.sb-order li { font-size: 24px; font-weight: 700; }
.sb-qty { color: var(--primary); }
.sb-opt { font-size: 18px; font-weight: 500; color: var(--muted); padding-left: 1.6em; }
.sb-note-line { display: flex; gap: 6px; align-items: center; font-size: 18px; color: var(--accepted); padding-left: 1.6em; margin: 4px 0 0; }
.sb-tag { display: flex; gap: 6px; align-items: center; margin: 8px 0 0; color: var(--accepted); font-size: 18px; }
.sb-tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.sb-table { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--panel-border); border-top: 5px solid var(--done); font-size: 17px; }
.sb-table strong { font-size: 24px; color: var(--ink-strong); }
.sb-table.sb-bill { border-top-color: var(--c-blue); }
.sb-table.has-request { background: rgb(251 106 119 / 14%); border-top-color: var(--new); }
.sb-table.inactive { border-top-color: var(--muted); color: var(--muted); opacity: .7; }
.sb-total { font-weight: 800; font-size: 20px; color: var(--ink-strong); }
.sb-paid { display: flex; gap: 6px; align-items: center; font-weight: 800; color: var(--done); }
.sb-logout { margin-top: 40px; text-align: center; }
@media (max-width: 600px) { .screen-mode { font-size: 17px; } .sb-orders { grid-template-columns: 1fr; } .sb-head { flex-wrap: wrap; } }

/* == public pages == */
/* Login / join */
.login-brand strong { color: var(--ink-strong); }
.tabs a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.login-note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-s); background: var(--alt); color: var(--alt-ink); }
.login-note .i { margin-top: 2px; color: var(--primary); }
.login-back { margin: 16px 0 0; }
.login-back .i { transform: rotate(180deg); }
.auth-card h1 { font-size: 24px; }
/* Store chooser (/home): light workspace look, follows dark mode */
.home-mode .topbar { background: var(--topbar-bg); box-shadow: var(--shadow); }
.home-mode .topbar .appbar-btn { color: var(--alt-ink); }
.logo-inline { display: inline-flex; gap: 10px; align-items: center; color: var(--ink-strong); }
.logo-inline:hover { text-decoration: none; }
.logo-inline small { display: block; font-size: 9.5px; letter-spacing: 2px; color: var(--muted); font-weight: 600; }
.home-head { margin-top: 12px; }
.home-head p { margin: 4px 0 0; }
.home-admin { display: flex; align-items: center; gap: 14px; }
.home-admin > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.home-admin strong { color: var(--ink-strong); }
.home-admin .kpi-icon { width: 44px; height: 44px; background: rgb(64 81 137 / 12%); color: var(--c-primary); }
.store-card { grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.store-card-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: rgb(10 179 156 / 12%); color: var(--c-teal); }
.store-card.off .store-card-icon { background: var(--alt); color: var(--muted); }
.store-card-body { display: grid; gap: 2px; min-width: 0; }
.store-card-body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-id { margin-top: 14px; }
.home-id code { display: inline-block; margin-top: 6px; }
/* Customer pages (brand dark, big emoji buttons) */
.guest main.container { max-width: 640px; padding-top: 8px; }
.guest-bar .container { max-width: 640px; }
.guest-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; color: var(--ink-strong); min-width: 0; }
.guest-brand .mark { width: 32px; height: 32px; font-size: 15px; }
.lang { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--input); border: 1px solid var(--panel-border); }
.lang a { margin: 0; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; }
.lang a:hover { text-decoration: none; color: var(--ink); }
.lang a[aria-current] { background: var(--primary); color: var(--primary-ink); }
.guest-hero { padding: 26px 18px 22px; margin: 18px 0 20px; border-radius: 20px; background: linear-gradient(160deg, rgb(52 195 160 / 16%), rgb(79 123 217 / 10%)); border: 1px solid var(--panel-border); }
.guest-hero h1 { font-size: clamp(30px, 8vw, 42px); margin: 4px 0 6px; }
.guest-hero p { margin: 0; }
.guest-buttons .actionbtn { border-radius: 18px; min-height: 136px; }
.guest-top { display: flex; align-items: center; gap: 12px; margin: 14px 0 16px; }
.guest-top h1 { margin: 0; }
.guest-top p { margin: 2px 0 0; }
.guest-card { border-radius: 18px; padding: 24px 20px; }
.guest .card { box-shadow: 0 6px 18px rgb(0 0 0 / 22%); }
.guest .menu-group { margin: 0 0 16px; padding: 6px 18px; }
.guest .menu-group h2 { margin: 14px 0 4px; font-size: 18px; }
.guest .menu-item:last-child { border-bottom: 0; }
.guest-emoji { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.guest-done h1 { margin: 6px 0; }
.guest-check { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--done); color: var(--primary-ink); font-size: 38px; font-weight: 800; margin-bottom: 8px; animation: rise .3s ease-out; }
.guest-cart .cart-line { padding: 14px 16px; margin: 0; }
.guest-total { margin: 16px 0; font-size: 18px; }
.guest .pills { margin: 0 0 14px; }

/* == store sections: fixes == */
.row.start { justify-content: flex-start; }
.chip .dot, .badge .dot { background: currentColor; box-shadow: none; width: 7px; height: 7px; }
.ttile > .chip, .ttile > .badge { justify-self: start; }
@media (max-width: 860px) {
  .form-grid > div > .btn[type=submit] { width: 100%; }
  .row.start > .btn, .row.start > a.btn { flex: 1 1 auto; }
}

/* == screen actions (ready / served) == */
.sb-actions { display: flex; gap: 10px; margin-top: 12px; }
.sb-actions form { flex: 1; }
.sb-btn { width: 100%; min-height: 56px; font-size: 18px; border-radius: 14px; }
.sb-btn-served { background: var(--c-blue) !important; }
.sb-tag-ready { color: #fff; background: linear-gradient(90deg, var(--c-teal), var(--c-primary)); padding: 6px 10px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; }
.sb-o-ready { border-color: var(--c-teal) !important; box-shadow: 0 0 0 2px rgb(10 179 156 / 35%); }
