/* =========================================================================
   FOOD4LIFE — PROPOSED "DATA REGISTER"
   An additive layer on top of the locked Food4Life design system, for the
   operational surfaces (menu week, compliance, count sheets, catalogue).
   Nothing here overrides a shipped token; it only adds a second register
   for dense, numeric, regulated content.
   ========================================================================= */

:root {
  /* ---- Data type scale (Hanken, tabular) ------------------------------ */
  --fs-data-lg:  20px;   /* headline figure in a meter row      */
  --fs-data:     15px;   /* default numeric cell                */
  --fs-data-sm:  13px;   /* secondary / unit / delta            */

  /* ---- Dense row register (cf. --space-6 / --r-lg marketing card) ------ */
  --row-h:        32px;
  --row-pad-x:    14px;
  --dense-radius: var(--r-md);
  --dense-card-pad: 18px;

  /* ---- Compliance status ramp -----------------------------------------
     Status is NEVER carried by hue alone: every value pairs a glyph and a
     text label with its color, and color appears only as a meter fill or
     small text — never a large surface. This satisfies the brand's
     "amber is rare, never a large fill" rule and color-blind access with
     a single decision.                                                     */
  --status-pass-fg:   var(--garden-600);
  --status-pass-bg:   var(--garden-50);
  --status-near-fg:   var(--harvest-600);
  --status-near-bg:   var(--harvest-200);
  --status-short-fg:  var(--tomato-600);
  --status-short-bg:  #FBE9E5;
  --status-over-fg:   var(--tomato-600);
  --status-over-bg:   #FBE9E5;
  --status-none-fg:   var(--ink-3);
  --status-none-bg:   var(--sand);

  /* ---- Meter track ----------------------------------------------------- */
  --meter-track: #E9E4D7;
  --meter-h:     6px;
}

/* All figures are tabular so columns align. The shipped system does not
   specify this and the product is columns of oz-eq and cup values. */
.num, .meter-value, .cell-num, td.num, .count-figure {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ---- StatusPip --------------------------------------------------------- */
.pip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-body); font-weight: 700;
  font-size: var(--fs-data-sm); line-height: 1;
  padding: 4px 9px; border-radius: var(--r-pill); white-space: nowrap;
}
.pip--pass  { color: var(--status-pass-fg);  background: var(--status-pass-bg); }
.pip--near  { color: var(--status-near-fg);  background: var(--status-near-bg); }
.pip--short { color: var(--status-short-fg); background: var(--status-short-bg); }
.pip--over  { color: var(--status-over-fg);  background: var(--status-over-bg); }
.pip--none  { color: var(--status-none-fg);  background: var(--status-none-bg); }
.pip__glyph { font-size: 11px; }

/* ---- Meter / RangeBar -------------------------------------------------- */
.meter { display: block; }
.meter__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 6px;
}
.meter__label {
  font-family: var(--font-body); font-weight: 600;
  font-size: var(--fs-data); color: var(--ink-2);
}
.meter__value {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--fs-data-lg); color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.meter__target {
  font-family: var(--font-body); font-weight: 600;
  font-size: var(--fs-data-sm); color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.meter__track {
  position: relative; height: var(--meter-h);
  background: var(--meter-track); border-radius: var(--r-pill); overflow: hidden;
}
.meter__fill {
  position: absolute; inset: 0 auto 0 0; border-radius: var(--r-pill);
}
.meter__fill--pass  { background: var(--garden-500); }
.meter__fill--near  { background: var(--harvest-500); }
.meter__fill--short { background: var(--tomato-500); }
.meter__fill--over  { background: var(--tomato-500); }
/* the acceptable band on a min–max metric (e.g. grains 5.0–5.5 oz eq) */
.meter__band {
  position: absolute; top: -2px; bottom: -2px;
  border-left: 2px solid var(--garden-300);
  border-right: 2px solid var(--garden-300);
  background: rgba(46,158,91,.10);
}
.meter__foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 7px;
}
.meter__fixlink {
  font-family: var(--font-body); font-weight: 700; font-size: var(--fs-data-sm);
  color: var(--garden-600); background: none; border: none; padding: 0;
  cursor: pointer; text-decoration: none;
}

/* ---- Dense table ------------------------------------------------------- */
.dtable { width: 100%; border-collapse: collapse; }
.dtable th {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
  color: var(--ink-3); text-align: left; padding: 8px var(--row-pad-x);
  background: var(--sand); border-bottom: 1px solid var(--line);
}
.dtable th.r, .dtable td.r { text-align: right; }
.dtable td {
  font-family: var(--font-body); font-size: var(--fs-data); color: var(--ink-2);
  padding: 0 var(--row-pad-x); height: var(--row-h);
  border-bottom: 1px solid var(--line-soft);
}
.dtable tr:last-child td { border-bottom: none; }
.dtable td.strong { color: var(--ink); font-weight: 600; }

/* ---- Credit chip (per-item meal-pattern contribution) ------------------- */
.credit {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-body); font-weight: 600; font-size: 12px;
  color: var(--garden-700); background: var(--garden-50);
  border-radius: var(--r-pill); padding: 3px 8px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.credit--veg   { background: #EDF7E3; color: #3F6B1E; }
.credit--fruit { background: #FDF0E0; color: #8A5A10; }
.credit--milk  { background: #E8F4F7; color: #17606F; }
.credit--grain { background: #F3EFE2; color: #6B5A22; }

/* ---- Day card ---------------------------------------------------------- */
.daycard {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  overflow: hidden; margin-bottom: 14px;
}
.daycard__head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
}
.daycard__date {
  font-family: var(--font-display); font-weight: 700; font-size: 17px;
  color: var(--ink); letter-spacing: var(--ls-heading);
}
.daycard__foot {
  display: flex; align-items: center; gap: 18px;
  padding: 10px 18px; background: #FCFAF5; border-top: 1px solid var(--line-soft);
}
.statepip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-body); font-size: var(--fs-data-sm); color: var(--ink-3);
}
.statepip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.statepip--done   .statepip__dot { background: var(--garden-500); }
.statepip--done   { color: var(--garden-700); font-weight: 600; }
.statepip--due    .statepip__dot { background: var(--harvest-500); }
.statepip--due    { color: var(--harvest-600); font-weight: 600; }

/* ---- Shared shell (mirrors the shipped director-app kit) ---------------- */
body { margin: 0; background: var(--cream); font-family: var(--font-body); }
.shell { display: flex; height: 100vh; overflow: hidden; }
.side {
  width: 244px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--line); padding: 22px 16px;
  display: flex; flex-direction: column; box-sizing: border-box;
}
.side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.side__tile {
  width: 34px; height: 34px; border-radius: 10px; background: var(--garden-700);
  color: var(--sprout-400); font-family: var(--font-display); font-weight: 800;
  font-size: 19px; display: grid; place-items: center;
}
.wm2 { font-family: var(--font-display); font-weight: 800; font-size: 22px;
       letter-spacing: var(--ls-wordmark); color: var(--garden-700); }
.wm2 i { color: var(--harvest-500); font-style: normal; }
.side__nav { display: flex; flex-direction: column; gap: 4px; }
.navitem {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border-radius: var(--r-md); border: none; background: transparent; cursor: pointer;
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  color: var(--ink-2); text-align: left; text-decoration: none;
}
.navitem.on { background: var(--garden-50); color: var(--garden-700); font-weight: 700; }
.navitem__c { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--tomato-600); }
.main { flex: 1; overflow: auto; background: var(--cream); }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 30px; border-bottom: 1px solid var(--line); background: var(--cream);
}
.top h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 25px;
  color: var(--ink); letter-spacing: var(--ls-heading); margin: 0;
}
.eyebrow2 {
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--garden-600);
}
.btn {
  font-family: var(--font-body); font-weight: 700; font-size: 14px;
  border-radius: var(--r-pill); padding: 9px 18px; cursor: pointer; border: 1px solid transparent;
}
.btn--primary { background: var(--garden-600); color: #fff; }  /* garden-600, not -500: AA at body size */
.btn--ghost   { background: transparent; color: var(--garden-600); border-color: var(--garden-200); }
.btn--warm    { background: var(--harvest-500); color: var(--ink); }
.btn--sm      { padding: 7px 14px; font-size: 13px; }
.card2 {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: var(--space-6);
}
.tag2 {
  display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-pill);
  font-family: var(--font-body); font-weight: 600; font-size: 13px; padding: 5px 11px;
}
.tag2--green { background: var(--garden-50); color: var(--garden-700); }
.tag2--sand  { background: var(--sand); color: var(--ink-2); }
.tag2--amber { background: var(--harvest-200); color: var(--harvest-600); }
