/*
  One palette, one set of components, for the back office.

  It was written three times — front desk, stores, finance — which is three
  places to change a colour and three chances to change two of them. The
  waiter terminal and the kitchen display keep their own: they are devices with
  one job, not screens somebody browses.
*/
/* Two palettes and one set of names. Dark is the default because the desk
   runs all night and a lit screen at three in the morning is the thing
   somebody turns the brightness down on; light is the owner's ask
   (September 2026) and is what a laptop by a window needs.

   Every colour in the back office comes through one of these names — a rule
   with a literal in it stays dark whichever theme is on, and a dark field on
   a light page is the one thing that reads as broken rather than as a theme.
   `--field` exists for that reason: it was `#0e131b` written out fourteen
   times, six in this file and eight inside template strings in `area-desk.js`.

   The theme is stamped on <html> by `app.html` before the first paint, so
   nobody sees a dark page flash white. */
:root{
  --ink:#0F1319; --panel:#171D27; --panel2:#1E2531; --line:#293243;
  --field:#0e131b;
  /* Surfaces the chart needs and the palette did not name: a weekend column,
     a cell under the cursor, a column that is today, the hatching on a room
     off sale, a button being pressed. Each was a literal in area-desk.css,
     which means each stayed dark whichever theme was on. */
  --weekend:#12171F; --weekend-head:#141A24; --today-head:#1D2230;
  --hover:#1A212C; --hatch-a:#161A21; --hatch-b:#1D222B;
  --btn-hover:#242C3A; --btn-hover-line:#3A465A;
  --on-amber:var(--on-amber); --amber-hi:#E0AC45;
  --paid:#2D6B4C; --owed:#9A3B26; --cool-text:#93B4EE;
  --soon:#7A6A3C; --soon-dim:#8A7A4C; --amber-dim:#9A7A2E;
  --text:#D8DEE9; --muted:#78849A; --paper:#EDEAE1; --paper-ink:#22262E;
  --vc:#3FA87A; --vi:#2E8F9E; --vd:#D4A03C; --oc:#4A7BD4; --od:#2C4E96; --ooo:#5A6474;
  --ok:#3FA87A; --amber:#D4A03C; --danger:#C4553F; --cool:#4A7BD4;
  --prep:#D4A03C;
  --mono:'IBM Plex Mono',ui-monospace,monospace;
  --cond:'IBM Plex Sans Condensed',system-ui,sans-serif;
  --sans:'IBM Plex Sans',system-ui,sans-serif;
}
/* The same names, daylight values. The room-state colours are darkened
   rather than swapped: a green that reads as "vacant clean" on near-black
   is nearly invisible on white, and the chart is read at a glance from two
   feet away. Amber stays the accent, because it is what "this one" has
   meant on every screen in the building for a year. */
:root[data-theme="light"]{
  --ink:#F4F2ED; --panel:#FFFFFF; --panel2:#FAF8F3; --line:#DAD5CA;
  --field:#FFFFFF;
  --text:#22262E; --muted:#6B7280; --paper:#EDEAE1; --paper-ink:#22262E;
  --vc:#2D7A57; --vi:#216A76; --vd:#9A6F1B; --oc:#2F5BA8; --od:#1F3A70; --ooo:#8A909C;
  --ok:#2D7A57; --amber:#9A6F1B; --danger:#A3402C; --cool:#2F5BA8;
  --prep:#9A6F1B;
  --weekend:#EFEBE2; --weekend-head:#EFEBE2; --today-head:#FBF3E0;
  --hover:#F0EDE6; --hatch-a:#EAE6DC; --hatch-b:#F4F2ED;
  --btn-hover:#F0EDE6; --btn-hover-line:#B9B2A4;
  --on-amber:#FFF8E8; --amber-hi:#7E5A12;
  --paid:#2D7A57; --owed:#A3402C; --cool-text:#2F5BA8;
  --soon:#8A6B22; --soon-dim:#9A8043; --amber-dim:#9A6F1B;
}
*{box-sizing:border-box}
body{margin:0;background:var(--ink);color:var(--text);font-family:var(--sans);
     font-size:15px;-webkit-font-smoothing:antialiased}

#view{padding:20px}
#view.narrow{max-width:1080px}
#view.wide{max-width:none;padding:0}

/* ── the shell ─────────────────────────────────────────────────────── */
.top{display:flex;align-items:center;gap:18px;padding:12px 20px;
     background:var(--panel);border-bottom:1px solid var(--line);flex-wrap:wrap}
.brand b{font-family:var(--cond);letter-spacing:.02em;font-size:16px}
.brand span{display:block;font-family:var(--cond);font-size:11px;
            letter-spacing:.14em;color:var(--muted);text-transform:uppercase}
.areas{display:flex;gap:8px;flex-wrap:wrap}
.areas button{padding:8px 14px;border-radius:8px;background:var(--field);
  color:var(--text);border:1px solid var(--line);font:inherit;cursor:pointer;
  font-family:var(--cond);letter-spacing:.06em;text-transform:uppercase;
  font-size:12px}
.areas button.on{border-color:var(--amber);color:var(--amber)}
.areas button .dot{display:inline-block;width:6px;height:6px;border-radius:50%;
  background:var(--danger);margin-left:6px;vertical-align:middle}
.who{margin-left:auto;text-align:right;font-size:13px;line-height:1.35}
.who small{display:block;font-family:var(--cond);font-size:10.5px;
  letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}

/* ── common furniture ──────────────────────────────────────────────── */
.btn{padding:9px 14px;border-radius:8px;background:var(--field);color:var(--text);
     border:1px solid var(--line);font:inherit;cursor:pointer}
.btn:hover{border-color:var(--muted)}
.btn.on{border-color:var(--amber);color:var(--amber)}
.btn.pri{background:var(--amber);border-color:var(--amber);color:var(--on-amber);
         font-weight:600}
.btn.sm{padding:5px 10px;font-size:12.5px}
.btn.wide{width:100%}
h2{font-family:var(--cond);font-size:20px;margin:0 0 4px}
h3{font-family:var(--cond);font-size:12px;letter-spacing:.14em;
   text-transform:uppercase;color:var(--muted);margin:0 0 12px}
.lede{color:var(--muted);font-size:13.5px;margin:0 0 18px;max-width:64ch}
.card{background:var(--panel);border:1px solid var(--line);border-radius:10px;
      padding:16px 18px;margin-bottom:14px}
.card.red{border-color:var(--danger)} .card.amb{border-color:var(--amber)}
/* Something that has already been dealt with and is kept because
   nothing is deleted — a retracted posting, say. Still readable, and
   plainly not the row to act on. */
.card.muted{opacity:.62}
.row{display:grid;grid-template-columns:1fr auto;gap:6px 16px;padding:10px 0;
     border-bottom:1px solid rgba(41,50,67,.6);align-items:baseline}
.row:last-child{border-bottom:none}
.row small{display:block;color:var(--muted);font-size:12.5px;line-height:1.5}
.num{font-family:var(--mono);font-variant-numeric:tabular-nums;text-align:right;
     white-space:nowrap}
.pill{font-family:var(--cond);font-size:10.5px;letter-spacing:.1em;
      text-transform:uppercase;padding:2px 7px;border-radius:3px;
      border:1px solid currentColor;white-space:nowrap}
.red{color:var(--danger)} .amb{color:var(--amber)} .grn{color:var(--ok)}
.blu{color:var(--cool)} .mut{color:var(--muted)}
.empty{color:var(--muted);font-size:13.5px;padding:8px 0}
/* Columns of money have to line up, and tabular figures are the whole reason:
   proportional digits make a payroll column look ragged and make two different
   amounts look like the same one. */
/* A row of small inputs that ends in a button — a movement being recorded,
   not a form being filled in. Wraps rather than squeezing, because the last
   field squeezed to nothing is the one somebody leaves blank. */
.lrow{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
.lrow>div{flex:1;min-width:120px}
.lrow input,.lrow select{width:100%}
/* A button is as wide as its own label. As a flex item it shrinks by default,
   so in a row that already wraps "Explained" was being cut to "Explain" — a
   control that lies about what it does, and the kind of thing only a browser
   shows you. */
.lrow>.btn{flex:0 0 auto}
.tbl{width:100%;border-collapse:collapse;font-size:13.5px}
.tbl th{text-align:left;font-family:var(--cond);font-size:10.5px;
  letter-spacing:.12em;text-transform:uppercase;color:var(--muted);
  padding:0 10px 7px 0;border-bottom:1px solid var(--line);font-weight:400}
.tbl td{padding:8px 10px 8px 0;border-bottom:1px solid var(--line)}
.tbl tr:last-child td{border-bottom:0}
.tbl .r,.tbl th.r{text-align:right;font-variant-numeric:tabular-nums;
  padding-right:0}
.tbl .mono{font-family:var(--mono);font-size:12.5px}
/* The hotel's laundry list, as the form on the counter is laid out: the
   article down the page and the three services across it. The number boxes
   are small because a quantity is one or two digits, and the table is allowed
   to scroll sideways inside its own wrapper rather than widening the panel —
   three money columns on a 390px phone do not fit and must not drag the page
   with them. A service the laundry does not do says so in words: an empty
   cell reads as a box somebody failed to draw, and "—" reads as nil. */
.lwrap{overflow-x:auto;margin:0 0 14px}
.llist input{width:76px;padding:5px 7px;margin:0;text-align:right}
.llist td,.llist th{padding:5px 10px 5px 0;white-space:nowrap}
.llist .none{font-family:var(--cond);font-size:10.5px;letter-spacing:.06em;
  text-transform:uppercase;color:var(--muted)}
/* A name on a shift. Small and removable — a roster is edited far more often
   than it is written, and a name you cannot take off is one somebody works
   around by writing the real roster on paper. */
.chip{display:inline-block;padding:3px 9px;border-radius:999px;font-size:12.5px;
  background:var(--field);border:1px solid var(--line);cursor:pointer;
  margin:2px 1px}
.chip:hover{border-color:var(--danger);color:var(--danger)}
input,select,textarea{padding:10px;border-radius:8px;background:var(--field);
  color:var(--text);border:1px solid var(--line);font:inherit;width:100%}
input.mono,textarea.mono{font-family:var(--mono)}
label{display:block;font-family:var(--cond);font-size:11px;letter-spacing:.12em;
      text-transform:uppercase;color:var(--muted);margin:10px 0 4px}
.grid{display:grid;gap:12px}
@media(min-width:640px){.grid.two{grid-template-columns:1fr 1fr}}

/* ── overlays ──────────────────────────────────────────────────────── */
#mask{position:fixed;inset:0;background:rgba(4,7,12,.72);z-index:50;
      display:none;align-items:center;justify-content:center;padding:22px}
#mask.on{display:flex}
/* Not ".sheet": the front desk has had a .sheet since long before this — the
   paper folio, dark ink on cream — and the modal inherited its colours,
   rendering its own text invisible. Two stylesheets in one page share one
   namespace, and the older meaning wins. */
#mask .modalbox{background:var(--panel);border:1px solid var(--line);
  border-radius:10px;max-width:480px;width:100%;padding:22px;
  max-height:88vh;overflow:auto}
#mask .modalbox.wide{max-width:920px}
/* A document the domain rendered, shown exactly as it will print. Monospaced
   because it is laid out in columns of characters, and left alone otherwise —
   a screen that reflows a payslip is a screen disagreeing with the paper. */
.doc{font-family:var(--mono);font-size:12.5px;line-height:1.55;white-space:pre;
  overflow-x:auto;background:var(--field);border:1px solid var(--line);
  border-radius:8px;padding:18px;margin:0 0 16px}
@media print{
  body>*{display:none!important}
  #mask,#mask *{display:revert!important}
  #mask{position:static!important;background:0!important}
  #mask .modalbox{border:0!important;max-width:none!important}
  #mask h2,#mask .acts{display:none!important}
  .doc{background:#fff!important;color:#000!important;border:0!important;
    padding:0!important;font-size:11pt}
}
#toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%) translateY(20px);
  background:var(--panel2);border:1px solid var(--line);border-radius:9px;
  padding:11px 16px;font-size:13.5px;opacity:0;transition:.18s;z-index:80;
  pointer-events:none;max-width:80vw}
#toast.show{opacity:1;transform:translateX(-50%)}

/* ── one sign-in for the whole back office ─────────────────────────── */
#signin{position:fixed;inset:0;z-index:60;background:var(--ink);display:none;
        align-items:center;justify-content:center;padding:24px}
#signin.on{display:flex}
#signin .box{max-width:470px;width:100%}
#signin .idf{display:block;margin:16px 0 6px;color:var(--muted);
  font-family:var(--cond);font-size:11px;letter-spacing:.1em;
  text-transform:uppercase}
#signin .idin{width:100%;padding:14px;border-radius:8px;background:var(--field);
  color:var(--text);border:1px solid var(--line);font:inherit;font-size:20px;
  font-family:var(--mono);letter-spacing:.16em;text-transform:uppercase;
  margin-bottom:12px}
#signin .idin::placeholder{text-transform:none;letter-spacing:.04em;opacity:.55}
input::placeholder{text-transform:none;letter-spacing:.04em;opacity:.55}
#signin .idin:focus{outline:0;border-color:var(--amber)}
#signin .go{width:100%;padding:15px;border-radius:8px;background:var(--amber);
  color:var(--on-amber);border:0;font:inherit;font-size:15px;font-family:var(--cond);
  letter-spacing:.08em;text-transform:uppercase;cursor:pointer;margin-top:4px}

/* ── the menu, as the kitchen keeps it ─────────────────────────────────── */
/* Its own block rather than reusing the desk's: those classes belong to a
   tape chart, and a bare class name is global across every area sheet the
   browser loads at once. Every colour here is a token this file already
   defines, so both themes answer for it. */
.mn-pad{padding:16px}
.mn-row3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.mn-stat{background:var(--panel);border:1px solid var(--line);border-radius:10px;
  padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.mn-stat b{font-size:24px;font-variant-numeric:tabular-nums}
.mn-stat span{color:var(--muted);font-size:12px}
.mn-stat.warn{border-color:var(--amber);background:var(--amber-dim)}
.mn-note{margin:14px 0;padding:14px;border-radius:10px;background:var(--panel);
  border:1px solid var(--line)}
.mn-note p{margin:0 0 10px;color:var(--muted);line-height:1.5}
.mn-note.ok{color:var(--ok);border-color:var(--ok)}
.mn-cat{margin:22px 0 8px;font-family:var(--cond);font-size:19px;
  display:flex;align-items:baseline;gap:12px}
/* Timing a whole category, which is how a kitchen answers the question.
   Quiet, because it is the shortcut and not the thing: the per-dish boxes
   are where a cook disagrees with the category. */
.mn-cattime{background:0;border:0;padding:0;cursor:pointer;
  font-family:var(--cond);font-size:11px;letter-spacing:.08em;
  text-transform:uppercase;color:var(--muted);text-decoration:underline}
.mn-cattime:hover{color:var(--text)}
/* How long the kitchen takes. Blank is a real answer and means "we do not
   say for this one", so the boxes show an em dash rather than a nought —
   a nought would read as instant. */
.mn-time{display:flex;align-items:center;gap:7px;margin-top:9px;
  font-family:var(--cond);font-size:11px;letter-spacing:.08em;
  text-transform:uppercase;color:var(--muted)}
.mn-time input{width:46px;padding:4px 6px;margin:0;text-align:center}
.mn-dishes{display:grid;gap:10px}
.mn-dish{display:flex;gap:12px;align-items:flex-start;background:var(--panel);
  border:1px solid var(--line);border-radius:10px;padding:10px}
.mn-pic{width:92px;flex:0 0 92px;display:flex;flex-direction:column;gap:6px}
.mn-pic img{width:92px;height:70px;object-fit:cover;border-radius:7px;display:block}
.mn-pic .none{width:92px;height:70px;border-radius:7px;display:flex;
  align-items:center;justify-content:center;background:var(--field);
  color:var(--muted);font-size:11px}
.mn-shoot{font-size:12px;padding:5px 0;border-radius:6px;border:1px solid var(--line);
  background:var(--field);color:var(--text);cursor:pointer}
.mn-shoot:hover{background:var(--btn-hover);border-color:var(--btn-hover-line)}
.mn-what{flex:1;min-width:0}
.mn-what b{display:block;margin-bottom:8px}
.mn-marks{display:flex;gap:6px;flex-wrap:wrap}
.mn-mark{font-size:12px;padding:6px 11px;border-radius:7px;cursor:pointer;
  border:1px solid var(--line);background:var(--field);color:var(--muted)}
.mn-mark:hover{background:var(--btn-hover)}
.mn-mark.on.m1{background:var(--ok);border-color:var(--ok);color:var(--panel)}
.mn-mark.on.m0{background:var(--danger);border-color:var(--danger);color:var(--panel)}
.mn-mark.on.mx{background:var(--muted);border-color:var(--muted);color:var(--panel)}

/* ── the cash book's day strip ──────────────────────────────────────
   One bar a day, every day of the month. Drawn against the busiest day so
   the tallest fills the strip and the rest are read against it: against the
   median instead, one wage day makes every other bar a sliver. A day well
   over a usual one is amber, which is the same day the flag engine calls
   heavy — the chart and the register agreeing about what busy means. */
.kbars{display:flex;align-items:flex-end;gap:3px;height:150px;
  overflow-x:auto;padding-top:6px}
.kbar{flex:1 0 18px;min-width:18px;display:flex;flex-direction:column;
  justify-content:flex-end;height:100%;text-align:center}
.kbar small{font-size:9.5px;color:var(--muted);font-family:var(--cond);
  line-height:1.3;flex:0 0 auto}
.kfill{background:var(--cool);border-radius:2px 2px 0 0;min-height:1px;
  flex:0 0 auto}
.kfill.hot{background:var(--amber)}
/* The share each head took, so a column of rupees reads at a glance. */
.kmeter{background:var(--field);border-radius:2px;height:8px;overflow:hidden}
.kmeter>div{background:var(--cool);height:100%;border-radius:2px}

/* The digest as it will be read: the domain lays it out in text, like Form C
   and the payslip, so the copy on a screen and the copy in somebody's inbox
   cannot say different things. Pre-wrapped rather than pre, or a long line
   gives the whole page a sideways scroll on a phone. */
.digest{font-family:var(--mono);font-size:12.5px;line-height:1.65;
  white-space:pre-wrap;overflow-wrap:anywhere;margin:0;color:var(--text);
  background:var(--field);border:1px solid var(--line);border-radius:4px;
  padding:14px 16px;max-height:420px;overflow-y:auto}
