/* Back office. Calm and powerful: a night sidebar, clear surfaces, dense but readable, no scroll theatre.
   Layout: 248px sidebar + main on desktop; a bottom tab bar on phones. */
.staff { background: #F6F1E2; }
.staff .site-head, .staff body::before { display: none; }
.boot { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-weight: 600; }

/* ---------- sign in */
.login { min-height: 100svh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { position: relative; background: var(--night); color: var(--cream); display: flex; flex-direction: column; justify-content: space-between; padding: 40px; overflow: hidden; isolation: isolate; }
.login-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 50% at 70% 55%, rgba(255, 196, 92, .28), transparent 70%); }
.login-art h1 { font: 400 clamp(2.4rem, 5vw, 4.4rem)/.92 var(--display); text-transform: uppercase; }
.login-art h1 span { color: var(--yellow); }
.login-art img.logo { width: 220px; height: auto; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); }
.login-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 16px; }
.demo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 820px) { .login { grid-template-columns: 1fr; } .login-art { padding: 28px 20px; min-height: 240px; gap: 24px; } }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100svh; }
.side { position: sticky; top: 0; height: 100svh; background: var(--night); color: var(--cream); display: flex; flex-direction: column; padding: 20px 14px calc(16px + env(safe-area-inset-bottom, 0px)); gap: 18px; overflow-y: auto; }
.side .logo { width: 170px; height: auto; margin: 4px 8px 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: rgba(255, 246, 220, .78); font-weight: 600; font-size: .95rem; text-align: left; transition: background-color var(--t-hover), color var(--t-hover); }
.nav button:hover { background: rgba(255, 246, 220, .07); color: var(--cream); }
.nav button[aria-current="page"] { background: rgba(247, 195, 49, .14); color: var(--yellow); }
.nav button svg { width: 18px; height: 18px; flex: none; }
.nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--red); color: var(--on-red); font-size: .74rem; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.nav-h { font: 700 .66rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: rgba(255, 246, 220, .45); padding: 14px 12px 6px; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid rgba(255, 246, 220, .12); padding-top: 14px; }
.me { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.me .av { width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); color: var(--ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.me small { display: block; color: rgba(255, 246, 220, .55); }
.side .btn.ghost { color: var(--cream); border-color: rgba(255, 246, 220, .35); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; background: rgba(246, 241, 226, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid #E2D8BC; flex-wrap: wrap; }
.topbar h1 { font: 400 1.6rem/1 var(--display); text-transform: uppercase; }
.topbar .row { gap: 10px; }
.content { padding: 24px 28px 64px; display: flex; flex-direction: column; gap: 20px; }
.demo-note { background: var(--yellow-soft); border: 1.5px solid var(--ink); padding: 10px 14px; font-size: .88rem; }

/* toggle switch */
.switch { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: .9rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 46px; height: 26px; border-radius: 999px; background: #C9C1A6; position: relative; transition: background-color var(--t-hover); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--white); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--t-hover) var(--ease); }
.switch input:checked + .track { background: var(--leaf); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--ink); outline-offset: 2px; }

/* ---------- surfaces */
.panel { background: var(--white); border: 1px solid #E2D8BC; border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel h2 { font: 700 1.05rem/1.3 var(--sans); margin: 0; }
.panel .spread h2 { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { background: var(--white); border: 1px solid #E2D8BC; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi .label { color: var(--muted); }
.kpi b { font: 700 1.8rem/1.1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kpi small { color: var(--muted); font-size: .82rem; }
.kpi.alert { border-color: var(--red); background: #FFF4F1; }
.kpi.alert b { color: var(--red-text); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid2 { grid-template-columns: 1fr; } }

/* bar chart */
.chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 6px; height: 160px; padding-top: 10px; border-bottom: 1.5px solid var(--ink); }
.chart .b { position: relative; background: var(--yellow); border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 6px 6px 0 0; min-height: 2px; }
.chart .b:hover { background: var(--red); }
.chart .b span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: .68rem; font-weight: 700; font-variant-numeric: tabular-nums; padding-bottom: 2px; white-space: nowrap; }
.chart-x { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; font-size: .68rem; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }

/* tables */
.tbl-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.tbl th { text-align: left; font: 700 .7rem/1.2 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 10px 10px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.tbl td { padding: 12px 10px; border-bottom: 1px solid #EDE5CC; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #FFFBEF; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 700 .74rem/1.4 var(--sans); border: 1.5px solid var(--ink); white-space: nowrap; background: var(--white); }
.pill.y { background: var(--yellow); } .pill.g { background: var(--leaf); color: var(--on-leaf); border-color: var(--leaf); } .pill.r { background: var(--red); color: var(--on-red); border-color: var(--red); }
.pill.soft { background: #F1EBD8; border-color: #D6CBAA; }
.meter { height: 8px; border-radius: 4px; background: #EFE7CF; overflow: hidden; min-width: 80px; }
.meter i { display: block; height: 100%; background: var(--leaf); }
.meter.low i { background: var(--yellow); } .meter.out i { background: var(--red); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input { min-height: 42px; width: auto; flex: 1 1 220px; }
.seg.small button { min-height: 36px; font-size: .86rem; padding: 6px 12px; }

/* ---------- order board */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: #EEE6CE; border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
.col-h { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; font: 700 .76rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.col-h b { min-width: 24px; height: 24px; border-radius: 999px; background: var(--ink); color: var(--cream); display: inline-grid; place-items: center; font-size: .78rem; letter-spacing: 0; }
.col[data-s="new"] .col-h b { background: var(--red); }
.ocard { background: var(--white); border: 1.5px solid var(--ink); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; text-align: left; color: var(--ink); width: 100%; transition: transform var(--t-hover) var(--ease); }
.ocard.fresh { animation: fresh 1.4s var(--ease) 3; }
@keyframes fresh { 50% { box-shadow: 0 0 0 5px rgba(201, 40, 26, .3); } }
.ocard .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ocard .code { font: 400 1.15rem/1 var(--display); letter-spacing: .04em; }
.ocard .age { font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.ocard .age.late { color: var(--red-text); }
.ocard .who { font-size: .86rem; color: var(--muted); }
.ocard ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: .9rem; }
.ocard li b { font-variant-numeric: tabular-nums; margin-right: 4px; }
.ocard li small { display: block; color: var(--muted); font-size: .78rem; margin-left: 22px; }
.ocard .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ocard .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.ocard .acts .btn { flex: 1 1 auto; }
@media (max-width: 1200px) { .board { grid-template-columns: repeat(4, minmax(230px, 82vw)); scroll-snap-type: x mandatory; } .col { scroll-snap-align: start; } }

/* ---------- counter till */
.till { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.till-menu { display: flex; flex-direction: column; gap: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { min-height: 92px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 12px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--white); text-align: left; font-weight: 700; color: var(--ink); }
.tile small { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; }
.tile.lean { border-color: var(--leaf); }
.tile.off { opacity: .4; }
.tile:active { transform: scale(.98); }
.ticket { position: sticky; top: 84px; }
.tline { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #EDE5CC; align-items: center; }
.tline small { display: block; color: var(--muted); font-size: .8rem; }
.tline .qty { grid-template-columns: 30px 32px 30px; }
.tline .qty button { min-height: 32px; font-size: 1rem; }
.sum { display: flex; flex-direction: column; gap: 4px; font-variant-numeric: tabular-nums; }
.sum .ln { display: flex; justify-content: space-between; }
.sum .tot { font-weight: 800; font-size: 1.25rem; }
@media (max-width: 1000px) { .till { grid-template-columns: 1fr; } .ticket { position: static; } }

/* ---------- Lean Heat prep + labels */
.prep-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.prep-grid .panel b.big { font: 400 2.4rem/1 var(--display); font-variant-numeric: tabular-nums; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lbl { border: 2px solid var(--ink); border-radius: 14px; background: var(--white); padding: 12px; display: flex; flex-direction: column; gap: 8px; break-inside: avoid; }
.lbl .top { display: flex; justify-content: space-between; align-items: center; }
.lbl .dish { font-size: 1.05rem; }
.lbl .macros b { font-size: 1rem; }
.lbl .foot { font-size: .72rem; color: var(--muted); }
@media (max-width: 900px) { .prep-grid { grid-template-columns: 1fr; } }

/* ---------- phones: bottom tab bar */
.tabbar { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); top: env(safe-area-inset-top, 0px); }
  .topbar h1 { font-size: 1.3rem; }
  .content { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 110px max(16px, env(safe-area-inset-left, 0px)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--night); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid rgba(255,246,220,.1); }
  .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; border: 0; background: none; color: rgba(255, 246, 220, .7); font-size: .68rem; font-weight: 700; border-radius: 10px; }
  .tabbar button[aria-current="page"] { color: var(--yellow); background: rgba(247, 195, 49, .1); }
  .tabbar svg { width: 20px; height: 20px; }
  .tabbar .count { position: absolute; top: 2px; right: 18%; min-width: 18px; height: 18px; border-radius: 999px; background: var(--red); color: var(--on-red); font-size: .66rem; display: grid; place-items: center; }
  .kpi b { font-size: 1.45rem; }
}

/* printing macro labels: only the label sheet prints */
@media print {
  body.staff > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
  #print-area .labels { grid-template-columns: repeat(2, 1fr); gap: 6mm; }
  #print-area .lbl { border-radius: 4mm; }
}
#print-area { display: none; }
.more-nav button { color: var(--ink); min-height: 50px; border: 1px solid #E2D8BC; background: var(--white); margin-bottom: 6px; }
.more-nav button:hover { background: #FFFBEF; color: var(--ink); }

/* ---------- the back office in the same world: lamp light in the sidebar, a night brief on Today */
.side { background: radial-gradient(120% 50% at 0% 0%, rgba(255, 196, 92, .16), transparent 60%), var(--night); box-shadow: inset -1px 0 0 rgba(255, 236, 190, .08); }
.nav button[aria-current="page"] { background: linear-gradient(90deg, rgba(247, 195, 49, .2), rgba(247, 195, 49, .06)); box-shadow: inset 2px 0 0 var(--yellow); }
.topbar { background: var(--lid-body-strong); box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .5), 0 1px 0 #E2D8BC; }
.brief { position: relative; overflow: hidden; isolation: isolate; border-radius: 18px; padding: 26px 28px; color: var(--cream); background: var(--night); display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.brief::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(50% 120% at 85% 0%, rgba(255, 196, 92, .3), transparent 70%); }
.brief::after { content: ""; position: absolute; right: -40px; bottom: -70px; width: 260px; height: 260px; z-index: -1; opacity: .16;
  background: url("/img/gpk-mark-cream.svg") center / contain no-repeat; transform: rotate(-14deg); }
.brief .label { color: var(--yellow); }
.brief-h { font: 400 clamp(1.8rem, 3.4vw, 2.8rem)/.98 var(--display); text-transform: uppercase; margin: 8px 0 10px; }
.brief-h .mask { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .05em; }
.brief-h .mask > span { display: inline-block; animation: brief-in 700ms var(--ease) both; }
.brief-h .mask:nth-child(2) > span { animation-delay: 90ms; }
.brief-h .y { color: var(--yellow); }
@keyframes brief-in { from { transform: translateY(105%); } }
.brief p { color: rgba(255, 246, 220, .85); }
.brief-acts { display: flex; gap: 10px; flex-wrap: wrap; }
.brief .btn.ghost { color: var(--cream); border-color: rgba(255, 246, 220, .5); }
@media (prefers-reduced-motion: reduce) { .brief-h .mask > span { animation: none; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
.filters .field { gap: 4px; }
.filters .field .input { min-height: 42px; }
.filters .field .input { flex: none; width: 100%; }
.filters > .field { flex: 1 1 160px; }
