/* ---------------------------------------------------------------
   Design tokens. Everything visual resolves through these, so a
   rebrand in Claude Design is a change to this block, not a rewrite.
   Light by default: the printed menu is a core deliverable, and
   staff use tablets in bright classrooms.
   --------------------------------------------------------------- */
:root {
  --bg:            #fbfaf7;
  --surface:       #ffffff;
  --surface-sunk:  #f2f1ec;
  --line:          #e0ded6;
  --line-strong:   #c8c5b9;

  --ink:           #23261f;
  --ink-soft:      #5c6154;
  --ink-faint:     #8b9082;

  --accent:        #4a6b4d;
  --accent-soft:   #e6ede6;
  --accent-ink:    #ffffff;

  --ok:            #3f7d52;
  --warn:          #a8730f;
  --warn-soft:     #fbf1dc;
  --stop:          #a33a2c;
  --stop-soft:     #f9e7e4;

  --grain:         #c08a2e;
  --mma:           #3f7391;
  --fruit:         #a8474f;
  --vegetable:     #5c7d3a;
  --milk:          #6b5f9c;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px;
  --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;

  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --tap: 44px; /* tablet touch target floor */
  --shadow: 0 1px 2px rgba(35,38,31,.06), 0 4px 12px rgba(35,38,31,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
.muted { color: var(--ink-faint); font-size: 13px; }
.h2 { font-size: 17px; margin: 0; }
.h2--spaced { margin: var(--s-6) 0 var(--s-3); }
.error { color: var(--stop); font-size: 13px; margin: 0; }

/* ---- gate ---- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: var(--s-4); }
.gate__card { width: min(360px, 100%); display: grid; gap: var(--s-3); }
.gate__title { margin: 0; font-size: 22px; letter-spacing: -0.01em; }
.gate__sub { margin: 0 0 var(--s-2); color: var(--ink-soft); font-size: 14px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow);
}

/* ---- controls ---- */
.field { display: grid; gap: var(--s-1); font-size: 13px; color: var(--ink-soft); }
.field--inline { grid-auto-flow: column; align-items: center; gap: var(--s-2); }
.field input, .input {
  font: inherit; color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 0 var(--s-3);
  min-height: var(--tap);
}
.input { min-width: 220px; }
:where(input, button, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  font: inherit; font-weight: 500;
  min-height: var(--tap); padding: 0 var(--s-4);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  cursor: pointer;
}
.btn:hover { background: var(--surface-sunk); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.btn--ghost:hover { background: var(--surface-sunk); }

.segmented { display: flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.seg {
  font: inherit; min-height: var(--tap); padding: 0 var(--s-4);
  background: var(--surface); color: var(--ink-soft);
  border: 0; border-right: 1px solid var(--line); cursor: pointer;
}
.seg:last-child { border-right: 0; }
.seg.is-on { background: var(--accent-soft); color: var(--ink); font-weight: 600; }

/* ---- chrome ---- */
.topbar {
  display: flex; align-items: center; gap: var(--s-5);
  padding: var(--s-3) var(--s-5);
  background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar__brand { font-weight: 650; letter-spacing: -0.01em; }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: var(--s-3); }
.tabs { display: flex; gap: var(--s-1); }
.tab {
  font: inherit; min-height: 36px; padding: 0 var(--s-3);
  background: none; border: 0; border-radius: var(--r-sm);
  color: var(--ink-soft); cursor: pointer;
}
.tab[aria-current="page"] { background: var(--surface-sunk); color: var(--ink); font-weight: 600; }

.view { padding: var(--s-5); max-width: 1200px; margin: 0 auto; }
.controls { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-4); }
.controls__spacer { flex: 1; }

.banner {
  margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md); font-size: 14px;
  background: var(--warn-soft); border: 1px solid #e8d8a8; color: #6b4a05;
}
.banner[data-tone="stop"] { background: var(--stop-soft); border-color: #eec4bd; color: #7d2b20; }
.banner[data-tone="ok"]   { background: var(--accent-soft); border-color: #c9dbc9; color: #2f4a32; }

.legend { display: flex; gap: var(--s-2); margin-bottom: var(--s-3); flex-wrap: wrap; }
.chip {
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 2px var(--s-2); border-radius: 999px;
  background: var(--surface-sunk); color: var(--ink-soft);
}
.chip--grain      { background: #f7eeda; color: #7a5510; }
.chip--mma        { background: #e2edf3; color: #26505f; }
.chip--fruit      { background: #f7e4e5; color: #7c2f36; }
.chip--vegetable  { background: #e8f0dd; color: #3d5626; }
.chip--milk       { background: #eae7f5; color: #453a70; }

/* ---- calendar ---- */
.calendar { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-2); }
.cal__head {
  font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); padding: var(--s-2); text-align: center;
}
.day {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); overflow: hidden; display: flex; flex-direction: column;
}
.day--closed { background: var(--surface-sunk); opacity: .6; }
.day__date {
  display: flex; align-items: baseline; gap: var(--s-2);
  padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line);
}
.day__num { font: 600 15px/1 var(--font-num); }
.day__dow { font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }

/* The signature element: a compliance strip per day. This tool exists to answer
   one question at a glance — is this day defensible? */
.day__strip { height: 3px; background: var(--line); }
.day__strip[data-state="ok"]         { background: var(--ok); }
.day__strip[data-state="unverified"] { background: var(--warn); }
.day__strip[data-state="blocking"]   { background: var(--stop); }
.day__strip[data-state="empty"]      { background: var(--line); }

.slot { padding: var(--s-3); border-bottom: 1px solid var(--line); flex: 1; }
.slot:last-child { border-bottom: 0; }
.slot__label { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--ink-faint); text-transform: uppercase; }
.slot__btn {
  width: 100%; min-height: var(--tap); margin-top: var(--s-1);
  font: inherit; text-align: left; cursor: pointer;
  background: none; border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
  color: var(--ink-faint); padding: var(--s-2);
}
.slot__btn:hover { border-color: var(--accent); color: var(--accent); }
.slot__btn.is-filled { border-style: solid; border-color: var(--line); color: var(--ink); background: var(--surface); }
.slot__name { font-size: 13px; font-weight: 550; line-height: 1.3; }
.slot__serve { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }
.slot__chips { display: flex; gap: 3px; margin-top: var(--s-1); flex-wrap: wrap; }

.day__issues { padding: var(--s-2) var(--s-3); background: var(--warn-soft); font-size: 11px; color: #6b4a05; }
.day__issues[data-tone="stop"] { background: var(--stop-soft); color: #7d2b20; }

/* ---- combos + guide ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s-3); }
.stack { display: grid; gap: var(--s-2); }
.combo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3); }
.combo__name { font-size: 14px; font-weight: 600; margin: var(--s-1) 0; }
.combo__meta { font-size: 12px; color: var(--ink-soft); }

.guide {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s-4);
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3);
}
.guide__name { font-weight: 600; grid-column: 1 / -1; }
.guide__k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.guide__v { font-size: 13px; color: var(--ink-soft); }
.guide--blocked { border-left: 3px solid var(--stop); }

/* ---- picker ---- */
.modal {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s-4); width: min(460px, 92vw); max-height: 80dvh;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.modal::backdrop { background: rgba(35,38,31,.4); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.modal__title { margin: 0; font-size: 16px; }
.picker { list-style: none; margin: var(--s-3) 0 0; padding: 0; overflow-y: auto; max-height: 52dvh; display: grid; gap: var(--s-1); }
.picker button {
  width: 100%; text-align: left; font: inherit; cursor: pointer;
  min-height: var(--tap); padding: var(--s-2) var(--s-3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.picker button:hover { border-color: var(--accent); background: var(--accent-soft); }

@media (max-width: 900px) {
  .calendar { grid-template-columns: 1fr; }
  .cal__head { display: none; }
  .guide { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- print: the menu is the deliverable ---- */
@media print {
  .topbar, .controls, .legend, .banner, .modal { display: none !important; }
  body { background: #fff; }
  .view { padding: 0; max-width: none; }
  .calendar { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .day { break-inside: avoid; box-shadow: none; }
  .slot__btn { border: 0; padding: 0; }
  .day__strip { display: none; }
}


/* ---- product intake ---- */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.prod {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-2); padding: var(--s-1) 0; font-size: 13px;
}
.prod__x { min-height: 28px; padding: 0 var(--s-2); font-size: 16px; line-height: 1; }
.prod__add { min-height: 32px; padding: 0 var(--s-3); font-size: 12px; margin-top: var(--s-2); }
.segmented .seg:has(input:checked) { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.segmented .seg { display: inline-flex; align-items: center; }
#prod-form select.input { min-width: 0; width: 100%; }
