/* =====================================================================
   Snacks Ordering — Farbstoffe International
   Design "B · Farbstoffe Clean" — colours taken from the company logo.
   ===================================================================== */

@font-face { font-family: "Plex Sans"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/plex-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/plex-mono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
    --navy: #0A2463;  --navy-deep: #071A48;  --navy-2: #12337F;  --navy-line: #1B3470;
    --royal: #0B5CAB; --royal-dark: #094A8B; --royal-tint: #E7F0FA; --royal-line: #B9CDE6;
    --cyan: #1CB5EF;  --cyan-soft: #8FDDF8;  --cyan-tint: #E3F6FD;
    --ground: #F2F5F9; --surface: #FFFFFF; --surface-2: #F6F8FB;
    --line: #DCE3EC;  --line-soft: #EDF1F6;
    --ink: #0F1B33;   --ink-2: #33415A;  --muted: #55627A;  --on-navy-muted: #B9C6DE;
    --ok: #146C43;    --ok-bg: #DDF3E7;
    --warn: #7A4A00;  --warn-bg: #FBEFD5;
    --info: #0B4F94;  --info-bg: #E1ECF8;
    --err: #A3261B;   --err-bg: #FBE4E1;  --err-line: #F0C9C4;
    --r-sm: 8px; --r: 12px; --r-lg: 14px;
    --sans: "Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bot: env(safe-area-inset-bottom, 0px);
    --side-w: 236px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--royal); }
a:hover { color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.mono { font-family: var(--sans); font-variant-numeric: tabular-nums; font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.spacer { margin-left: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline { display: inline; margin: 0; }
.pre { white-space: pre-wrap; margin: 0; }

/* ---------------------------------------------------------------------
   Shell A — employee app (phone-first)
   --------------------------------------------------------------------- */
.app { min-height: 100dvh; max-width: 640px; margin: 0 auto; background: var(--ground); display: flex; flex-direction: column; padding-bottom: calc(66px + var(--safe-bot)); }
.appbar { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); padding: calc(10px + var(--safe-top)) 18px 10px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand img { height: 36px; width: auto; display: block; }
.brand__name { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name strong { font-size: 17px; }
.brand__name span { font-size: 12px; color: var(--muted); }
.avatar { width: 44px; height: 44px; border-radius: 22px; background: var(--navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; text-decoration: none; flex-shrink: 0; }
.avatar:hover { color: #fff; background: var(--navy-2); }
.appbar__cart { position: relative; width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--navy); }
.appbar__cart .count { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--royal); color: #fff; font-size: 11.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.app-main { flex: 1 1 auto; padding: 16px 18px 24px; }
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 640px; z-index: 40; height: calc(62px + var(--safe-bot)); padding-bottom: var(--safe-bot); background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 11.5px; font-weight: 500; }
.tabbar a.is-active { color: var(--royal); font-weight: 700; }
.tabbar svg { width: 21px; height: 21px; }

/* ---------------------------------------------------------------------
   Shell B — staff (canteen / HR / admin): navy sidebar
   --------------------------------------------------------------------- */
.staff { min-height: 100dvh; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.side { background: var(--navy); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.side__brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; text-decoration: none; color: #fff; }
.side__logo { width: 42px; height: 48px; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.side__logo img { height: 36px; width: auto; }
.side__brand strong { display: block; font-size: 16px; }
.side__brand span { font-size: 12px; color: var(--on-navy-muted); }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side__group { font-size: 12px; color: var(--on-navy-muted); padding: 12px 12px 4px; }
.side__link { height: 44px; padding: 0 12px; border-radius: 9px; color: #D5DEEE; text-decoration: none; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.side__link svg { width: 18px; height: 18px; flex-shrink: 0; }
.side__link:hover { background: var(--navy-2); color: #fff; }
.side__link.is-active { background: var(--navy-2); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--cyan); }
.side__badge { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--cyan); color: var(--navy-deep); padding: 1px 8px; border-radius: 10px; }
.side__foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.side__status { background: var(--navy-deep); border-radius: 12px; padding: 12px 14px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.side__status .dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; margin-right: 8px; background: #4ADE9B; }
.side__status .dot.off { background: #F59E8B; }
.side__meter { height: 6px; border-radius: 3px; background: var(--navy-line); overflow: hidden; }
.side__meter span { display: block; height: 6px; background: var(--cyan); }
.side__user { display: flex; align-items: center; gap: 10px; padding: 6px; }
.side__user .avatar { width: 38px; height: 38px; background: var(--navy-2); }
.side__user a { color: var(--on-navy-muted); font-size: 12.5px; }
.side__user a:hover { color: #fff; }
.side__user strong { display: block; font-size: 14px; color: #fff; font-weight: 600; }
.side__logout { background: none; border: 0; padding: 0; color: var(--on-navy-muted); font: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; }
.side__logout:hover { color: #fff; }
.staff-main { padding: 24px 30px 40px; min-width: 0; }

@media (max-width: 959px) {
    .staff { grid-template-columns: 1fr; }
    .side { position: sticky; height: auto; padding: calc(10px + var(--safe-top)) 12px 0; gap: 8px; z-index: 30; }
    .side__brand { padding: 0 4px; }
    .side__logo { width: 36px; height: 40px; } .side__logo img { height: 30px; }
    .side nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 8px; scrollbar-width: none; }
    .side__group { display: none; }
    .side__link { height: 40px; white-space: nowrap; flex-shrink: 0; }
    .side__link.is-active { box-shadow: inset 0 -3px 0 var(--cyan); }
    .side__foot { display: none; }
    .side__mobile-user { display: flex !important; }
    .staff-main { padding: 18px 16px 32px; }
}
.side__mobile-user { display: none; margin-left: auto; align-items: center; gap: 8px; }
.side__top { display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------------
   Page furniture
   --------------------------------------------------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.section-title { margin: 26px 0 10px; font-size: 16px; font-weight: 700; color: var(--navy); }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 8px; }
.back:hover { color: var(--royal); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.panel + .panel { margin-top: 12px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; }
.panel--flush { padding: 0; overflow: hidden; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.narrow { max-width: 640px; }

.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 16px; text-decoration: none; color: inherit; display: block; }
a.kpi:hover { border-color: var(--royal); }
.kpi__label { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi__value { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: 27px; font-weight: 600; color: var(--navy); line-height: 1.3; }
.kpi--navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.kpi--navy .kpi__label { color: var(--cyan-soft); }
.kpi--navy .kpi__value { color: #fff; }

/* ---------------------------------------------------------------------
   Controls
   --------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent; font: 600 14.5px var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--royal); color: #fff; }
.btn-primary:hover { background: var(--royal-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--royal); border-color: var(--royal-line); }
.btn-secondary:hover { background: var(--royal-tint); color: var(--royal); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--err); border-color: var(--err-line); }
.btn-danger:hover { background: var(--err-bg); color: var(--err); }
.btn-danger-solid { background: var(--err); color: #fff; }
.btn-danger-solid:hover { filter: brightness(1.08); color: #fff; }
.btn-cyan { background: var(--cyan); color: var(--navy-deep); }
.btn-cyan:hover { filter: brightness(1.06); color: var(--navy-deep); }
.btn-sm { min-height: 36px; padding: 0 11px; font-size: 13.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; min-height: 36px; padding: 0; border-radius: 8px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field__hint { font-size: 12.5px; color: var(--muted); }
.input { width: 100%; min-height: 46px; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 400 15px var(--sans); }
.input:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 3px var(--royal-tint); }
.input--mono { font-variant-numeric: tabular-nums; font-weight: 500; }
textarea.input { min-height: 96px; resize: vertical; }
select.input { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2355627A' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 180px; }
.check { display: flex; align-items: center; gap: 9px; font-size: 14.5px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--royal); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters .input { width: auto; flex: 1 1 160px; min-height: 42px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.tab { flex-shrink: 0; height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; border-bottom: 3px solid transparent; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.tab:hover { color: var(--navy); }
.tab.is-active { color: var(--navy); border-bottom-color: var(--royal); font-weight: 700; }
.tab .count { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Feedback
   --------------------------------------------------------------------- */
.alert { border-radius: 10px; padding: 11px 14px; margin: 0 0 14px; font-size: 14.5px; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--err-bg); color: var(--err); }
.alert-warning { background: var(--warn-bg); color: var(--warn); }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert a { color: inherit; font-weight: 700; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.pill-pending, .pill-open { color: var(--warn); background: var(--warn-bg); }
.pill-out, .pill-review { color: var(--info); background: var(--info-bg); }
.pill-done, .pill-resolved, .pill-active { color: var(--ok); background: var(--ok-bg); }
.pill-cancel, .pill-inactive, .pill-failed { color: var(--err); background: var(--err-bg); }
.pill-muted { color: var(--muted); background: var(--line-soft); }
.pill-navy { color: var(--royal); background: var(--royal-tint); }

.empty { text-align: center; padding: 36px 18px; color: var(--muted); }
.empty strong { display: block; color: var(--navy); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tfoot td { border-top: 1px solid var(--line); font-weight: 700; }
.table .sub { display: block; font-size: 12.5px; color: var(--muted); }
.table a { font-weight: 600; text-decoration: none; }
.table tr.is-dim td { color: var(--muted); }
.table tr.is-late .age { color: var(--err); font-weight: 700; }
.table--compact td, .table--compact th { padding: 9px 12px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: nowrap; }

/* popover (details/summary) — used for cancel reason, edit forms */
.pop { position: relative; display: inline-block; }
.pop > summary { list-style: none; }
.pop > summary::-webkit-details-marker { display: none; }
.pop__panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(10, 36, 99, .16); padding: 14px; text-align: left; }
.pop__panel--left { right: auto; left: 0; }
.pop__panel h3 { margin: 0 0 8px; font-size: 14.5px; }

/* ---------------------------------------------------------------------
   Employee app components
   --------------------------------------------------------------------- */
.slot { background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 14px 16px; display: flex; align-items: center; gap: 14px; }
.slot__state { font-size: 12.5px; font-weight: 600; color: var(--cyan-soft); display: flex; align-items: center; gap: 7px; }
.slot__state::before { content: ""; width: 7px; height: 7px; border-radius: 4px; background: var(--cyan); }
.slot--closed .slot__state { color: #F9C9BF; }
.slot--closed .slot__state::before { background: #F59E8B; }
.slot__title { font-size: 15.5px; font-weight: 600; }
.slot__timer { margin-left: auto; text-align: right; display: flex; flex-direction: column; }
.slot__timer strong { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: 21px; font-weight: 600; color: var(--cyan); line-height: 1.2; }
.slot__timer span { font-size: 11.5px; color: var(--on-navy-muted); }

.again { margin-top: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 10px 10px 14px; display: flex; align-items: center; gap: 12px; }
.again svg { width: 20px; height: 20px; color: var(--royal); flex-shrink: 0; }
.again__text { flex: 1 1 auto; min-width: 0; line-height: 1.3; }
.again__text span { display: block; font-size: 12.5px; color: var(--muted); }
.again__text strong { font-size: 14px; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu-tabs { position: sticky; top: calc(65px + var(--safe-top)); z-index: 20; background: var(--ground); margin: 14px -18px 0; padding: 0 18px; }
.menu-tabs .tabs { margin-bottom: 0; }
.menu-cat { scroll-margin-top: 130px; }
.menu-cat h2 { font-size: 15px; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }
.menu-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 140px; }
.item:last-child { border-bottom: 0; }
.item__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--royal-tint); color: var(--royal); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.item__icon svg { width: 21px; height: 21px; }
.item__body { flex: 1 1 auto; min-width: 0; }
.item__name { font-size: 15.5px; font-weight: 600; display: block; }
.item__meta { font-size: 12.5px; color: var(--muted); }
.item__meta .mono { color: var(--ink); }
.item.is-out .item__name, .item.is-out .item__icon { opacity: .55; }
.item form { margin: 0; }
.add-btn { width: 92px; }
.soldout { width: 92px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--err); background: var(--err-bg); padding: 9px 0; border-radius: 9px; }
.stepper { display: inline-flex; align-items: center; border-radius: 9px; background: var(--royal); color: #fff; }
.stepper form { display: contents; }
.stepper button { width: 36px; height: 38px; border: 0; background: transparent; color: #fff; font-size: 19px; cursor: pointer; border-radius: 9px; }
.stepper button:hover { background: var(--royal-dark); }
.stepper output { min-width: 22px; text-align: center; font-family: var(--sans); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14.5px; }

.cartbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(62px + var(--safe-bot)); width: 100%; max-width: 640px; z-index: 35; padding: 0 10px 10px; }
.cartbar__inner { background: var(--navy); color: #fff; border-radius: var(--r-lg); padding: 10px 10px 10px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 8px 24px rgba(10, 36, 99, .25); }
.cartbar__sum { flex: 1 1 auto; line-height: 1.25; }
.cartbar__sum span { display: block; font-size: 12.5px; color: var(--on-navy-muted); }
.cartbar__sum strong { font-family: var(--sans); font-variant-numeric: tabular-nums; font-size: 19px; font-weight: 600; }
.has-cartbar { padding-bottom: 90px; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.list__row { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: inherit; }
.list__row:last-child { border-bottom: 0; }
a.list__row:hover { background: var(--surface-2); color: inherit; }
.list__main { flex: 1 1 auto; min-width: 0; }
.list__title { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list__sub { font-size: 12.5px; color: var(--muted); }
.list__end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.steps { display: flex; gap: 6px; margin: 14px 0 16px; }
.steps li { flex: 1; list-style: none; font-size: 12.5px; color: var(--muted); }
.steps li::before { content: ""; display: block; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 6px; }
.steps li.is-done { color: var(--navy); font-weight: 600; }
.steps li.is-done::before { background: var(--royal); }
.steps li.is-now::before { background: var(--cyan); }
.steps { padding: 0; }

/* ---------------------------------------------------------------------
   Canteen
   --------------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.chip.is-muted { color: var(--muted); background: var(--surface-2); }
.chip button { border: 0; background: none; color: var(--royal); font: 600 12px var(--sans); cursor: pointer; padding: 0; }
.log { list-style: none; padding: 0; margin: 0; }
.log li { padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; word-break: break-all; }

/* ---------------------------------------------------------------------
   Reports
   --------------------------------------------------------------------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 170px; overflow-x: auto; }
.bar { flex: 1 0 16px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar__fill { width: 100%; background: var(--royal); border-radius: 4px 4px 0 0; }
.bar:hover .bar__fill { background: var(--cyan); }
.bar__lbl { font-size: 10.5px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 14px; }
.photo { display: block; margin-top: 12px; }
.photo img { max-height: 360px; border-radius: 10px; border: 1px solid var(--line); }
.reply { border-left: 3px solid var(--cyan); }
.cred { font-size: 14.5px; }
.cred code { font-size: 14px; }

/* ---------------------------------------------------------------------
   Auth (login / password) — navy screen with white sheet
   --------------------------------------------------------------------- */
.auth { min-height: 100dvh; background: var(--navy); display: flex; flex-direction: column; align-items: center; }
.auth__hero { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: calc(36px + var(--safe-top)) 24px 28px; color: #fff; text-align: center; }
.auth__logo { width: 104px; height: 124px; border-radius: 24px; background: #fff; display: flex; align-items: center; justify-content: center; }
.auth__logo img { height: 92px; width: auto; }
.auth__company { font-size: 13px; font-weight: 600; color: var(--cyan-soft); letter-spacing: .08em; }
.auth__title { margin: 0; font-size: 30px; font-weight: 700; color: #fff; }
.auth__tag { margin: 0; font-size: 14.5px; color: var(--on-navy-muted); }
.auth__sheet { width: 100%; max-width: 460px; background: var(--surface); border-radius: 24px 24px 0 0; padding: 26px 22px calc(28px + var(--safe-bot)); }
.auth__sheet h2 { margin: 0 0 14px; font-size: 20px; }
.auth__note { display: flex; align-items: center; gap: 10px; background: var(--cyan-tint); color: #0A4E70; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.auth__note svg { width: 18px; height: 18px; flex-shrink: 0; }
@media (min-width: 700px) {
    .auth { justify-content: center; }
    .auth__hero { flex: 0 0 auto; }
    .auth__sheet { border-radius: 24px; margin-bottom: 48px; }
}

.error-page { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 40px 18px; }
.error-page__code { font-family: var(--mono); font-size: 56px; font-weight: 600; color: var(--royal); }
.error-page h1 { margin: 0; font-size: 22px; }

/* ---- Category tree (canteen) ---- */
.cat-tree { display: flex; flex-direction: column; }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.cat-row__name { flex: 1 1 auto; font-weight: 700; color: var(--navy); }
.cat-row--sub { padding-left: 22px; position: relative; }
.cat-row--sub::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 50%; width: 9px; border-left: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); border-bottom-left-radius: 4px; }
.cat-row--sub .cat-row__name { font-weight: 500; color: var(--ink); }
.cat-row.is-hidden .cat-row__name { color: var(--muted); }
.group-row td { background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--navy); padding-top: 8px; padding-bottom: 8px; }

/* ---- Menu: product tabs, sub-category jump links, item price column ---- */
.product-tabs .tab { font-size: 15px; }
.subnav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 10px 0 2px; }
.subnav a { flex-shrink: 0; font-size: 13.5px; font-weight: 600; color: var(--royal); background: var(--royal-tint); border-radius: 999px; padding: 6px 12px; text-decoration: none; }
.subnav a:hover { background: var(--royal); color: #fff; }
.menu-cat { scroll-margin-top: 160px; }
.item__price { font-size: 14.5px; color: var(--ink); min-width: 62px; text-align: right; }
.item__action { flex-shrink: 0; }
.cart-side { display: none; }
.appnav { display: none; }

/* ---- Employee app on desktop ---------------------------------------------- */
@media (min-width: 960px) {
    .app { max-width: none; padding-bottom: 0; }
    .app.has-cartbar { padding-bottom: 0; }
    .tabbar, .cartbar { display: none; }
    .appbar { padding: 12px max(28px, calc((100vw - 1240px) / 2)); gap: 28px; }
    .appnav { display: flex; gap: 4px; }
    .appnav a { height: 44px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
    .appnav a:hover { background: var(--surface-2); color: var(--navy); }
    .appnav a.is-active { color: var(--navy); font-weight: 700; background: var(--royal-tint); }
    .app-main { width: 100%; max-width: 900px; margin: 0 auto; padding: 28px 28px 48px; }
    .app-main--wide { max-width: 1240px; }

    .menu-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
    .cart-side { display: block; position: sticky; top: 96px; }
    .cart-side h2 { display: flex; align-items: center; gap: 8px; }
    .cart-side h2 svg { width: 20px; height: 20px; color: var(--royal); }
    .menu-tabs { top: 69px; margin: 18px 0 0; padding: 0; }
    .menu-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; background: none; border: 0; border-radius: 0; overflow: visible; }
    .menu-list .item { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "icon body" "price action"; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
    .menu-list .item:hover { border-color: var(--royal-line); }
    .menu-list .item__icon { grid-area: icon; }
    .menu-list .item__body { grid-area: body; }
    .menu-list .item__price { grid-area: price; grid-column: 1 / 2; font-size: 16px; text-align: left; min-width: 0; white-space: nowrap; }
    .menu-list .item__action { grid-area: action; justify-self: end; }
    .menu-cat h2 { font-size: 16px; color: var(--navy); margin-top: 24px; }
    .slot, .again { max-width: none; }
}
.cart-side__list { list-style: none; margin: 0; padding: 0; }
.cart-side__list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.cart-side__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; font-weight: 700; color: var(--navy); }
.cart-side__total strong { font-size: 19px; }
.item__price { display: none; }
@media (min-width: 960px) {
    .item__price { display: block; }
    .price-inline { display: none; }
    .cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
    .cart-layout > form.panel { margin-top: 0 !important; position: sticky; top: 96px; }
}

/* ---- Icon sizing: a default for every inline icon, then per-place sizes ---- */
:where(svg.icon) { width: 20px; height: 20px; flex-shrink: 0; vertical-align: -4px; }
.appbar__cart svg.icon { width: 22px; height: 22px; }
.back svg.icon { width: 16px; height: 16px; }
.pill svg.icon { width: 13px; height: 13px; vertical-align: -2px; }
:where(a) > :where(svg.icon:first-child) { margin-right: 4px; }

/* ---- Tables: numeric columns align with their headings ---- */
.table th.right, .table td.right { text-align: right; }
.table th.center, .table td.center { text-align: center; }

/* ---- Staff sidebar runs the full page height on long pages ---- */
@media (min-width: 960px) {
    .staff { background: linear-gradient(to right, var(--navy) var(--side-w), var(--ground) var(--side-w)); }
}

/* ---- File inputs in the design ---- */
input[type="file"].input { padding: 7px; }
input[type="file"]::file-selector-button { font: 600 13.5px var(--sans); color: var(--royal); background: var(--royal-tint); border: 1px solid var(--royal-line); border-radius: 8px; padding: 8px 12px; margin-right: 12px; cursor: pointer; }
input[type="file"]::file-selector-button:hover { background: #fff; }

/* ---- Canteen board on a phone: each order becomes a card ---- */
@media (max-width: 760px) {
    .table--stack thead { display: none; }
    .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
    .table--stack tr { border-bottom: 8px solid var(--ground); padding: 8px 0; }
    .table--stack td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 14px; border: 0; text-align: right; min-width: 0 !important; }
    .table--stack td::before { content: attr(data-label); font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: left; flex-shrink: 0; }
    .table--stack td:last-child { padding-top: 10px; }
    .table--stack td:last-child::before { content: none; }
    .table--stack .actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .table--stack .sub { display: inline; margin-left: 6px; }
    .table-wrap:has(.table--stack) { overflow: visible; }
}
