/* ==========================================================================
   YesChef desk client — desk.css

   One brand, two jobs. The palette, the type and the radii are lifted from
   `yeschef-website/css/site.css` unchanged, because a chef who has just come
   off the tablet must not feel they have arrived at a different company (that
   complaint is TR-479 inside the app and TR-480 on the website; this is the
   third surface and it starts in the right place rather than being corrected
   later).

   What is NOT lifted is the density. The marketing site is a brochure — big
   type, generous air, one column, read once. This is a tool somebody sits in
   front of for an hour with a stack of invoices: tighter leading, real tables,
   tabular figures, and a column of numbers that lines up. Same brand, different
   job.
   ========================================================================== */

:root {
  /* The app's palette, byte for byte from site.css. */
  --plum: #4A1942;
  --plum-dark: #2D0F28;
  --plum-soft: #6B3162;
  --cream: #F5F0E8;
  --cream-deep: #EBE3D6;
  --charcoal: #2C2C2C;
  --charcoal-soft: #5A5350;
  --gold: #C9A84C;
  --gold-bright: #E0C071;
  --white: #FFFFFF;
  --line: rgba(74, 25, 66, 0.12);
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 6px 24px rgba(45, 15, 40, 0.10);

  /* Desk-only. A wider page than the brochure's 1140: an invoice has fourteen
     columns and wrapping them costs more than the white space is worth. */
  --desk-width: 1360px;

  /* Status colours. Red is NOT used for "this needs attention" — it is reserved
     for a refusal and for a compliance failure, so that a chef scanning a list
     can trust it. Amber carries "look at this". */
  --warn: #8A6A1F;
  --warn-bg: #FBF3DE;
  --bad: #993838;
  --bad-bg: #FBEDED;
  --good: #2F6B4F;
  --good-bg: #E9F3ED;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* A modal <dialog> is centred by the browser's own `margin: auto`, which the
   reset above takes away - so the allergen confirm opened in the top-left
   corner, half off a narrow screen (office walk, 9 Oct 2026). Given back here,
   with a size that always fits the window, 375px wide included. */
dialog {
  margin: auto;
  padding: 20px;
  width: auto;
  max-width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--charcoal);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.35); }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--plum);
  line-height: 1.2;
  font-weight: 700;
}

h1 { font-size: 28px; margin-bottom: 4px; }
h2 { font-size: 21px; margin-bottom: 10px; }
h3 { font-size: 17px; margin-bottom: 6px; }

a { color: var(--plum); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: underline; }

/* ── chrome ───────────────────────────────────────────────────────────────── */

.desk-head {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--plum);
  color: var(--cream);
  padding: 0 28px;
  height: 58px;
}

.desk-head .brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}
.desk-head .brand span { color: var(--gold-bright); font-style: italic; }

.desk-head nav { display: flex; gap: 4px; margin-right: auto; }

.desk-head nav a {
  color: rgba(245, 240, 232, 0.78);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.desk-head nav a:hover { background: rgba(255, 255, 255, 0.10); color: var(--white); }
.desk-head nav a.active { background: var(--plum-dark); color: var(--white); }

.desk-head .who { display: flex; align-items: center; gap: 14px; }

.badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 700;
  color: var(--plum-dark);
  background: var(--gold-bright);
  border-radius: 999px;
  padding: 3px 10px;
}
.badge:empty { display: none; }

button.link {
  background: none;
  border: 0;
  color: rgba(245, 240, 232, 0.78);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}
button.link:hover { color: var(--white); text-decoration: underline; }

/* ── layout ───────────────────────────────────────────────────────────────── */

main { width: 100%; max-width: var(--desk-width); margin: 0 auto; padding: 26px 28px 70px; }

.page-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 18px; }
.page-head .grow { margin-right: auto; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 18px;
}

.muted { color: var(--charcoal-soft); font-size: 14px; }
.tiny { font-size: 12.5px; color: var(--charcoal-soft); }

.row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; gap: 18px; align-items: baseline; justify-content: space-between; }

/* ── tables ───────────────────────────────────────────────────────────────── */

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--charcoal-soft);
  font-weight: 700;
  padding: 0 12px 8px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}

td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }

tbody tr:hover { background: var(--cream); }
tbody tr:last-child td { border-bottom: 0; }

/* Figures line up or they cannot be scanned down a column, and a money column
   that jitters is one a chef adds up by hand to be sure. */
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
th.num { text-align: right; }

/* A dash is an ABSENCE, not a small number — it is greyed so a column of real
   figures reads as a column of real figures. */
.none { color: var(--charcoal-soft); }

/* ── controls ─────────────────────────────────────────────────────────────── */

label { display: block; font-size: 12.5px; font-weight: 600; color: var(--plum); margin-bottom: 5px; }

input[type=text], input[type=password], input[type=number], input[type=search], select {
  font: inherit;
  font-size: 14px;
  color: var(--charcoal);
  background: var(--white);
  border: 1px solid rgba(74, 25, 66, 0.28);
  border-radius: var(--radius);
  padding: 9px 11px;
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--plum); }

input[type=number] { font-variant-numeric: tabular-nums; }

.field { max-width: 260px; }
.field.wide { max-width: 420px; }

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 18px;
  cursor: pointer;
}
.btn:disabled { opacity: .55; cursor: default; }

.btn-primary { background: var(--plum); color: var(--white); }
.btn-primary:hover:not(:disabled) { background: var(--plum-dark); }

.btn-quiet { background: var(--white); color: var(--plum); border-color: rgba(74, 25, 66, 0.28); }
.btn-quiet:hover:not(:disabled) { background: var(--cream); }

/* ── notices ──────────────────────────────────────────────────────────────── */

.notice { border-radius: var(--radius); padding: 16px 18px; margin: 10px 0; }
.notice p + p { margin-top: 6px; }

.notice-refused { background: var(--bad-bg); color: var(--bad); border: 1px solid rgba(153, 56, 56, 0.25); }
.notice-upgrade { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(201, 168, 76, 0.45); }
.notice-empty { background: var(--white); border: 1px dashed var(--line); color: var(--charcoal-soft); }
.notice-ok { background: var(--good-bg); color: var(--good); border: 1px solid rgba(47, 107, 79, 0.25); }

.notice-upgrade a, .notice-refused a { color: inherit; text-decoration: underline; }

/* ── flags ────────────────────────────────────────────────────────────────── */

/* A flag says what is true of a row and never why it is red, because the words
   are the server's. `estimated` and `zero_priced` are H20 and H18: the figure is
   kept and the doubt is shown beside it, never instead of it. */
.flag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-radius: 999px;
  padding: 2px 9px;
  margin-left: 6px;
  white-space: nowrap;
}
.flag-warn { background: var(--warn-bg); color: var(--warn); }
.flag-bad { background: var(--bad-bg); color: var(--bad); }
.flag-ok { background: var(--good-bg); color: var(--good); }
.flag-quiet { background: var(--cream-deep); color: var(--charcoal-soft); }

/* ── sign in ──────────────────────────────────────────────────────────────── */

.signin-wrap { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.signin { width: 100%; max-width: 400px; }
.signin h1 { text-align: center; }
.signin .lead { text-align: center; margin-bottom: 22px; }
.signin .field { max-width: none; margin-bottom: 14px; }
.signin .btn { width: 100%; }

@media (max-width: 760px) {
  .desk-head { gap: 14px; padding: 0 14px; }
  .desk-head nav { overflow-x: auto; }
  main { padding: 18px 14px 50px; }
  td, th { padding-left: 8px; padding-right: 8px; }
}

/* The stock suggestion dropdown on a recipe's ingredient name.
   Floated on the body rather than inside the table cell: a table cell clips,
   and a dropdown that is cut off by the row below it is worse than none. */
.suggest {
  position: absolute;
  z-index: 60;
  display: none;
  max-height: 268px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.suggest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 15px;
}
.suggest-row + .suggest-row { border-top: 1px solid var(--line); }
.suggest-row:hover,
.suggest-row.is-on { background: var(--cream); }

/* ── the kitchen choice at sign-in ────────────────────────────────────────── */

.kitchen-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.kitchen-row:first-of-type { border-top: 0; }
.kitchen-info { min-width: 0; }
.kitchen-name { font-weight: 600; color: var(--charcoal); overflow-wrap: anywhere; }
.signin .kitchen-row .btn { width: auto; flex: none; }
.kitchen-tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; vertical-align: 1px;
}
.kitchen-tag-invite { background: var(--warn-bg); color: var(--warn); }
.kitchen-tag-records { background: var(--cream-deep); color: var(--charcoal-soft); }
