:root {
  --bg: #0e0d0b;
  --bg-2: #15130f;
  --surface: #1c1a15;
  --surface-2: #23201a;
  --line: #2c2820;
  --line-2: #3a3528;
  --text: #f3ece0;
  --text-muted: #b5a992;
  --text-faint: #7a715f;
  --accent: #e8a33d;      /* warm pizza amber */
  --accent-2: #c9302c;    /* tomato red */
  --accent-3: #3b6e3b;    /* basil green */
  --accent-4: #d7b26a;
  --success: #6fbf73;
  --warn: #f0b429;
  --error: #e85a4f;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 10px 30px rgba(0,0,0,0.35);
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: radial-gradient(1200px 800px at 15% -10%, #1a1712 0%, var(--bg) 55%) fixed;
  color: var(--text);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 28px; }
h3 { font-size: 17px; letter-spacing: 0.01em; }
h4 { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; font-family: var(--font-body); font-weight: 600; }

/* SIDEBAR */
.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #141209 0%, #0e0d0b 100%);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 16px; border-bottom: 1px solid var(--line); }
.brand .logo { width: 40px; height: 40px; flex-shrink: 0; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-faint); letter-spacing: 0.1em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  appearance: none; background: transparent; border: 0; color: var(--text-muted);
  text-align: left; padding: 10px 12px; border-radius: var(--radius-sm);
  font: 500 14px var(--font-body); cursor: pointer; transition: background .15s, color .15s;
  display: flex; align-items: center; gap: 10px;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.nav-item.active .dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.side-footer { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.ghost-btn { appearance: none; background: transparent; border: 1px solid var(--line-2); color: var(--text-muted); padding: 8px 10px; font: 500 12px var(--font-body); border-radius: var(--radius-sm); cursor: pointer; }
.ghost-btn:hover { color: var(--text); border-color: var(--accent); }
.tz { font-size: 11px; color: var(--text-faint); text-align: center; letter-spacing: 0.06em; }

/* MAIN */
.main { padding: 28px 36px 60px; max-width: 1400px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; gap: 20px; }
.sub { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }
.topbar-actions { display: flex; gap: 14px; align-items: center; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; }
.seg-btn { appearance: none; background: transparent; border: 0; color: var(--text-muted); font: 500 12px var(--font-body); padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.seg-btn.active { background: var(--accent); color: #1a120a; }

.health-pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 12px; color: var(--text-muted); background: var(--surface); }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
.health-pill.warn .health-dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); }
.health-pill.err  .health-dot { background: var(--error); box-shadow: 0 0 8px var(--error); }

.platform-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid rgba(232,163,61,.4); border-radius: 999px; font-size: 12px; color: var(--accent); background: rgba(232,163,61,.08); text-decoration: none; font-weight: 600; letter-spacing: .03em; transition: background .15s, border-color .15s; }
.platform-pill[hidden] { display: none; }
.platform-pill:hover { background: rgba(232,163,61,.18); border-color: var(--accent); }
.platform-pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* VIEWS */
.view { display: none; flex-direction: column; gap: 20px; }
.view.active { display: flex; }

/* KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
  position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: 0.8; }
.kpi-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.kpi-value { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin-top: 6px; letter-spacing: -0.02em; }
.kpi-delta { font-size: 12px; margin-top: 4px; color: var(--success); }
.kpi-delta.down { color: var(--error); }
.kpi-foot { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

/* CARDS */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; gap: 12px; }
.chart-wrap { position: relative; height: 280px; width: 100%; }
.chart-wrap.tall { height: 420px; }
.chart-wrap canvas { max-height: 100%; }
.muted { font-size: 12px; color: var(--text-faint); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* P&L */
.pl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 18px; }
.pl-col label { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; color: var(--text-muted); border-bottom: 1px dashed var(--line); }
.pl-col label input { width: 90px; }
.pl-col .pl-total { display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 600; font-size: 15px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); color: var(--text); }
.pl-col .pl-total span { font-variant-numeric: tabular-nums; }

input[type="number"], input[type="text"], select {
  background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text);
  padding: 6px 8px; border-radius: 4px; font: 500 13px var(--font-mono);
  width: 100%;
}
input[type="number"]:focus, input[type="text"]:focus, select:focus { outline: none; border-color: var(--accent); }

.pl-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pl-summary > div { display: flex; justify-content: space-between; align-items: center; }
.pl-summary span { font-size: 12px; color: var(--text-muted); letter-spacing: 0.05em; text-transform: uppercase; }
.pl-summary strong { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.pl-summary .accent strong { color: var(--accent); }

/* BREAK EVEN */
.be-body { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.be-stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.be-stat.big { grid-column: span 3; background: linear-gradient(135deg, rgba(232,163,61,.08), transparent); border-color: rgba(232,163,61,.35); }
.be-label { font-size: 11px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.be-value { font-family: var(--font-display); font-size: 22px; margin-top: 6px; font-weight: 600; }
.be-stat.big .be-value { font-size: 30px; color: var(--accent); }

/* TABLES */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); }
.tbl tr:hover td { background: rgba(255,255,255,0.015); }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; }
.tbl input { width: 70px; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.pill.ok { background: rgba(111,191,115,0.12); color: var(--success); }
.pill.warn { background: rgba(240,180,41,0.12); color: var(--warn); }
.pill.err { background: rgba(232,90,79,0.15); color: var(--error); }
.pill.neutral { background: var(--bg-2); color: var(--text-muted); }

/* Menu classification colors */
.cls-star { color: var(--accent); font-weight: 600; }
.cls-plow { color: var(--success); }
.cls-puzl { color: var(--warn); }
.cls-dog  { color: var(--error); }

/* Alerts */
.alerts { list-style: none; padding: 0; margin: 0; max-height: 320px; overflow-y: auto; }
.alerts li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.alerts li:last-child { border-bottom: 0; }
.alert-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; font-size: 13px; font-weight: 700; }
.alert-icon.err { background: rgba(232,90,79,0.15); color: var(--error); }
.alert-icon.warn { background: rgba(240,180,41,0.15); color: var(--warn); }
.alert-icon.ok { background: rgba(111,191,115,0.15); color: var(--success); }
.alert-body { flex: 1; }
.alert-title { font-weight: 500; font-size: 13px; }
.alert-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* Temperature grid */
.temp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.temp-cell { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.temp-cell.ok { border-color: rgba(111,191,115,0.35); }
.temp-cell.err { border-color: rgba(232,90,79,0.45); background: rgba(232,90,79,0.05); }
.temp-label { font-size: 12px; color: var(--text-muted); }
.temp-range { font-size: 11px; color: var(--text-faint); }
.temp-input { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.temp-input input { width: 80px; font-family: var(--font-mono); font-size: 16px; }
.temp-input .unit { color: var(--text-muted); font-size: 13px; }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.checklist li:last-child { border-bottom: 0; }
.check-box { width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 4px; flex-shrink: 0; display: grid; place-items: center; transition: all .15s; }
.checklist li.done .check-box { background: var(--success); border-color: var(--success); }
.checklist li.done .check-box::after { content: "✓"; color: #0a1f0c; font-weight: 700; font-size: 12px; }
.checklist li.done .check-label { color: var(--text-faint); text-decoration: line-through; }
.check-label { font-size: 13px; flex: 1; }
.check-time { font-size: 11px; color: var(--text-faint); }

/* Buttons */
.btn { appearance: none; background: var(--accent); color: #1a120a; border: 0; padding: 9px 14px; border-radius: var(--radius-sm); font: 600 13px var(--font-body); cursor: pointer; transition: background .15s; margin-bottom: 12px; }
.btn:hover { background: #f0b457; }

/* Staff summary */
.staff-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.staff-sum > div { display: flex; flex-direction: column; }
.staff-sum span { font-size: 11px; color: var(--text-muted); letter-spacing: 0.08em; text-transform: uppercase; }
.staff-sum strong { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin-top: 4px; }

/* Compliance bars */
.comp-bars { display: flex; flex-direction: column; gap: 14px; }
.comp-row { display: grid; grid-template-columns: 180px 1fr 60px; gap: 14px; align-items: center; }
.comp-row .label { font-size: 13px; color: var(--text-muted); }
.comp-row .score { font-family: var(--font-display); font-weight: 600; text-align: right; font-size: 15px; }
.comp-bar { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.comp-bar .fill { height: 100%; background: var(--success); border-radius: 999px; transition: width .6s ease; }
.comp-bar .fill.warn { background: var(--warn); }
.comp-bar .fill.err { background: var(--error); }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: grid; place-items: center; z-index: 99; backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 24px; width: 420px; box-shadow: 0 30px 60px rgba(0,0,0,0.5); }
.modal-card h3 { margin-bottom: 14px; }
.modal-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* NAV sections & badges */
.nav-section { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); padding: 12px 12px 4px; margin-top: 4px; }
.nav-section:first-child { margin-top: 0; padding-top: 2px; }
.nav-badge { margin-left: auto; background: var(--accent); color: #1a120a; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 999px; letter-spacing: 0.04em; }
.nav-badge.hot { background: var(--error); color: #fff; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Role switch */
.role-switch { display: flex; flex-direction: column; gap: 4px; }
.role-switch label { font-size: 10px; color: var(--text-faint); letter-spacing: 0.1em; text-transform: uppercase; padding-left: 2px; }
.role-switch select { font: 500 12px var(--font-body); }

/* KPI 4-up */
.kpi-grid.kpi-4 { grid-template-columns: repeat(4, 1fr); }

/* Briefing */
.briefing-hero { background: linear-gradient(135deg, rgba(232,163,61,0.10), rgba(201,48,44,0.05)); border: 1px solid rgba(232,163,61,0.35); border-radius: var(--radius); padding: 28px; position: relative; overflow: hidden; }
.briefing-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(232,163,61,0.18), transparent 70%); }
.briefing-badge, .brief-badge { display: inline-block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); background: rgba(232,163,61,0.12); padding: 4px 10px; border-radius: 999px; font-weight: 600; margin-bottom: 10px; }
.briefing-hero h2 { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 6px; max-width: 80%; }
.brief-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 22px 0 18px; position: relative; z-index: 1; }
.brief-kpi { background: rgba(0,0,0,0.25); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.brief-kpi .lbl { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.brief-kpi .val { font-family: var(--font-display); font-size: 20px; font-weight: 600; margin-top: 4px; }
.brief-kpi .dlt { font-size: 11px; margin-top: 2px; color: var(--text-faint); }
.brief-kpi .dlt.up { color: var(--success); }
.brief-kpi .dlt.down { color: var(--error); }

.insights { list-style: none; padding: 0; margin: 0; }
.insights li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.insights li:last-child { border-bottom: 0; }
.insight-ico { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: var(--bg-2); font-size: 14px; }
.insight-body { flex: 1; }
.insight-title { font-weight: 500; font-size: 13px; }
.insight-sub { font-size: 12px; color: var(--text-faint); margin-top: 3px; line-height: 1.5; }
.insight-meta { font-size: 11px; color: var(--accent); margin-top: 4px; font-family: var(--font-mono); }
.focus-list { padding-left: 0; list-style: none; counter-reset: focus; margin: 0; }
.focus-list li { counter-increment: focus; padding: 14px 0 14px 42px; border-bottom: 1px solid var(--line); position: relative; }
.focus-list li:last-child { border-bottom: 0; }
.focus-list li::before { content: counter(focus); position: absolute; left: 0; top: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #1a120a; font-weight: 700; display: grid; place-items: center; font-size: 13px; }

/* Recipes */
.recipe-list { list-style: none; padding: 0; margin: 0; max-height: 500px; overflow-y: auto; }
.recipe-list li { padding: 12px 14px; border-radius: var(--radius-sm); cursor: pointer; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.recipe-list li:hover { background: var(--bg-2); }
.recipe-list li.selected { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.recipe-list .r-name { font-weight: 500; font-size: 13px; }
.recipe-list .r-cost { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.recipe-list .r-margin { font-size: 11px; color: var(--accent); margin-top: 2px; }
.recipe-ing { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13px; }
.recipe-ing th { text-align: left; font-size: 10px; text-transform: uppercase; color: var(--text-faint); padding: 6px 8px; border-bottom: 1px solid var(--line-2); letter-spacing: 0.08em; font-weight: 500; }
.recipe-ing td { padding: 8px; border-bottom: 1px solid var(--line); }
.recipe-ing input { width: 70px; }
.recipe-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.recipe-summary > div { background: var(--bg-2); padding: 10px 12px; border-radius: var(--radius-sm); }
.recipe-summary .lbl { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.recipe-summary .val { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-top: 3px; }

.variance-grid { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 14px; }
.var-stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; }
.var-stat.big { background: linear-gradient(135deg, rgba(232,163,61,0.08), transparent); border-color: rgba(232,163,61,0.35); }
.var-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.var-value { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin-top: 6px; }
.var-foot { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.var-stat.big .var-value { color: var(--accent); font-size: 30px; }

/* Campaigns */
.campaigns { list-style: none; padding: 0; margin: 0; }
.campaigns li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.campaigns li:last-child { border-bottom: 0; }
.campaigns .cname { font-weight: 500; font-size: 13px; }
.campaigns .cdesc { font-size: 12px; color: var(--text-faint); margin-top: 3px; max-width: 340px; }
.campaigns .csize { font-family: var(--font-display); font-size: 18px; font-weight: 600; color: var(--accent); }
.campaigns .ghost-btn { margin-left: 10px; }

/* Scheduler */
.sched-controls { display: flex; gap: 10px; align-items: center; }
.sched-pill { font-size: 12px; background: var(--bg-2); border: 1px solid var(--line-2); padding: 4px 10px; border-radius: 999px; font-family: var(--font-mono); font-weight: 500; }
.sched-pill.warn { border-color: var(--warn); color: var(--warn); }
.sched-pill.err { border-color: var(--error); color: var(--error); }
.sched-hint { font-size: 12px; color: var(--text-faint); margin-bottom: 12px; }
.sched-wrap { overflow-x: auto; }
.sched-grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px; }
.sched-grid th, .sched-grid td { border: 1px solid var(--line); padding: 0; }
.sched-grid th { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); padding: 8px 10px; background: var(--bg-2); font-weight: 500; }
.sched-grid th:first-child { text-align: left; min-width: 140px; }
.sched-grid .name-cell { padding: 10px 12px; background: var(--bg-2); font-size: 13px; font-weight: 500; }
.sched-grid .name-cell .role { display: block; font-size: 10px; color: var(--text-faint); letter-spacing: 0.05em; text-transform: uppercase; margin-top: 2px; font-weight: 400; }
.sched-grid tbody tr { height: 52px; }
.sched-cell { cursor: pointer; transition: background .12s; position: relative; text-align: center; vertical-align: middle; padding: 0 !important; }
.sched-cell:hover { background: rgba(232,163,61,0.08); }
.sched-cell.shift { background: linear-gradient(135deg, var(--accent), #d89338); color: #1a120a; font-weight: 600; font-size: 11px; font-family: var(--font-mono); }
.sched-cell.off .muted { color: var(--text-faint); font-size: 14px; }
.sched-cell.shift:hover { background: linear-gradient(135deg, #f2b14e, var(--accent)); }

/* DBPR Inspection */
.insp-hero { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; background: linear-gradient(135deg, rgba(232,90,79,0.08), rgba(232,163,61,0.04)); border: 1px solid rgba(232,163,61,0.35); border-radius: var(--radius); padding: 28px; }
.insp-hero h2 { font-family: var(--font-display); font-size: 28px; margin: 0 0 6px; letter-spacing: -0.01em; }
.insp-score { display: flex; align-items: center; gap: 24px; }
.insp-score-ring { position: relative; width: 120px; height: 120px; }
.insp-score-ring svg { width: 100%; height: 100%; }
.insp-score-value { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.insp-score-stats { display: flex; flex-direction: column; gap: 8px; font-size: 13px; min-width: 200px; }
.insp-score-stats > div { display: flex; justify-content: space-between; gap: 20px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.insp-score-stats > div:last-child { border-bottom: 0; }
.insp-score-stats span { color: var(--text-muted); }
.insp-score-stats strong { font-family: var(--font-mono); }

.insp-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text-muted); padding: 5px 12px; font: 500 12px var(--font-body); border-radius: 999px; cursor: pointer; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); color: #1a120a; border-color: var(--accent); }

.insp-group { margin-top: 18px; }
.insp-group h4 { font-family: var(--font-body); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; }
.insp-group .cat-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); letter-spacing: 0; text-transform: none; }
.insp-item { display: grid; grid-template-columns: auto 60px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 6px; cursor: pointer; transition: background .12s; }
.insp-item:hover { background: var(--bg-2); }
.insp-item.done { opacity: 0.55; background: rgba(111,191,115,0.04); border-color: rgba(111,191,115,0.3); }
.insp-item.done .insp-task { text-decoration: line-through; color: var(--text-faint); }
.insp-item .check-box { width: 20px; height: 20px; border: 1.5px solid var(--line-2); border-radius: 4px; display: grid; place-items: center; flex-shrink: 0; }
.insp-item.done .check-box { background: var(--success); border-color: var(--success); }
.insp-item.done .check-box::after { content: "✓"; color: #0a1f0c; font-weight: 700; font-size: 12px; }
.insp-code { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); background: var(--bg-2); padding: 2px 6px; border-radius: 4px; text-align: center; }
.insp-task { font-size: 13px; }
.insp-task small { display: block; color: var(--text-faint); font-size: 11px; margin-top: 3px; line-height: 1.45; }
.insp-sev { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; }
.insp-sev.high { background: rgba(232,90,79,0.15); color: var(--error); }
.insp-sev.intermediate { background: rgba(240,180,41,0.15); color: var(--warn); }
.insp-sev.basic { background: rgba(181,169,146,0.15); color: var(--text-muted); }

.top-viol { padding-left: 0; list-style: none; counter-reset: viol; margin: 0; }
.top-viol li { counter-increment: viol; padding: 10px 0 10px 38px; border-bottom: 1px solid var(--line); position: relative; font-size: 13px; }
.top-viol li:last-child { border-bottom: 0; }
.top-viol li::before { content: counter(viol); position: absolute; left: 0; top: 10px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.top-viol small { display: block; color: var(--text-faint); font-size: 11px; margin-top: 3px; }

#mock-results { margin-top: 16px; }
.mock-q { background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 10px; }
.mock-q .q-head { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 11px; color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }
.mock-q .q-text { font-size: 13px; margin-bottom: 10px; }
.mock-q .q-actions { display: flex; gap: 8px; }
.mock-q .q-btn { flex: 1; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: transparent; color: var(--text); cursor: pointer; font: 500 12px var(--font-body); }
.mock-q .q-btn:hover { border-color: var(--accent); }
.mock-q.passed .q-btn.pass, .mock-q.passed .q-btn.pass:hover { background: rgba(111,191,115,0.2); border-color: var(--success); color: var(--success); }
.mock-q.failed .q-btn.fail, .mock-q.failed .q-btn.fail:hover { background: rgba(232,90,79,0.2); border-color: var(--error); color: var(--error); }
.mock-summary { background: linear-gradient(135deg, rgba(232,163,61,0.08), transparent); border: 1px solid rgba(232,163,61,0.35); padding: 16px; border-radius: var(--radius-sm); margin-top: 14px; }
.mock-summary h4 { margin: 0 0 6px; color: var(--accent); font-family: var(--font-display); font-size: 18px; }

/* Role-based visibility */
body.role-manager [data-role="owner-only"] { display: none; }
body.role-staff [data-role="owner-only"], body.role-staff [data-role="manager-up"] { display: none; }
body.role-staff .nav-item[data-view="costs"], body.role-staff .nav-item[data-view="briefing"], body.role-staff .nav-item[data-view="recipes"], body.role-staff .nav-item[data-view="sales"], body.role-staff .nav-item[data-view="scheduler"], body.role-staff .nav-item[data-view="compliance"] { display: none; }
body.role-manager .nav-item[data-view="costs"], body.role-manager .nav-item[data-view="briefing"] { display: none; }

@media (max-width: 1100px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar .brand { border-bottom: 0; padding: 0 12px 0 0; border-right: 1px solid var(--line); }
  .nav { flex-direction: row; }
  .side-footer { flex-direction: row; margin-left: auto; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .row-2 { grid-template-columns: 1fr; }
  .pl-grid { grid-template-columns: 1fr 1fr; }
  .pl-summary { grid-template-columns: 1fr 1fr; }
  .main { padding: 20px; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .pl-grid { grid-template-columns: 1fr; }
  .be-body { grid-template-columns: 1fr; }
  .be-stat.big { grid-column: span 1; }
}

/* =============================================================
   PHASE 2 — Additional styles for recipe, CRM, scheduler, briefing
   ============================================================= */

/* Mono + small utility */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.small { font-size: 11px; }
.good { color: var(--success) !important; }
.bad  { color: var(--error) !important; }
.mid  { color: var(--warn) !important; }

/* Briefing — insights icon */
.ins-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 6px; font-size: 14px; flex-shrink: 0; }
.ins-icon.err { border-color: var(--error); background: rgba(232,90,79,0.12); }
.ins-icon.warn { border-color: var(--warn); background: rgba(240,180,41,0.12); }
.insights li > span:last-child { font-size: 13px; line-height: 1.5; }

/* Recipe — stats + ingredient table */
.rec-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.rec-stats > div { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.rec-stats .muted { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; display: block; margin-bottom: 4px; }
.rec-stats strong { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.rec-ing { margin: 10px 0; }
.rec-ing input[type="number"] { width: 72px; background: transparent; border: 1px solid var(--line-2); color: var(--text); padding: 4px 6px; border-radius: 4px; font: 500 12px var(--font-mono); }
.rec-ing input:focus { outline: none; border-color: var(--accent); }
.rec-price { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--text-muted); }
.rec-price input { width: 100px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text); padding: 6px 8px; border-radius: 4px; font: 500 13px var(--font-mono); }

/* CRM tags */
.tag { display: inline-block; font-size: 10px; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-2); color: var(--text-muted); margin-right: 4px; }
.tag-vip { background: rgba(232,163,61,0.15); border-color: var(--accent); color: var(--accent); }
.tag-winback, .tag-atrisk { background: rgba(232,90,79,0.12); border-color: var(--error); color: var(--error); }
.tag-delivery { background: rgba(59,110,59,0.15); border-color: var(--basil, #3B6E3B); color: #7fa67f; }
.tag-catering, .tag-loyalty { background: rgba(207,169,131,0.12); border-color: #c08d3f; color: #d7b26a; }
.tag-growth { background: rgba(107,142,174,0.12); border-color: #6B8EAE; color: #9ab4cd; }
.tag-retention { background: rgba(168,124,160,0.12); border-color: #A87CA0; color: #c09ebb; }
.tag-takeout, .tag-dinein { color: var(--text-faint); }

/* Scheduler sum column */
.sched-grid .sched-sum { padding: 8px 12px; text-align: right; font-family: var(--font-mono); font-size: 12px; background: var(--bg-2); }
.sched-grid .sched-totals td { background: rgba(232,163,61,0.08); font-weight: 600; }
.sched-grid .sched-totals .name-cell { color: var(--accent); }

/* Mock summary */
.mock-summary { }
.mock-summary h4 { font-size: 16px; }

/* Role-based nav visibility (enhance existing) — hide Briefing section title when empty */
body.role-staff .nav-section:nth-of-type(1) { /* keep People for staff */ }

/* =============================================================
   TASK ASSIGNMENTS
   ============================================================= */
.task-hero { margin-bottom: 20px; }
.task-hero-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.task-kpi { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.task-kpi .kpi-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); font-weight: 500; }
.task-kpi .kpi-num { font-family: var(--font-display); font-size: 28px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 2px; }
.task-kpi .kpi-num.warn { color: var(--error); }
.task-kpi .kpi-sub { font-size: 11px; color: var(--text-muted); }

.task-filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { background: transparent; border: 1px solid var(--line-2); color: var(--text-muted); padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all .15s; font-family: var(--font-body); }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #1a120a; }
.task-select { background: var(--bg); border: 1px solid var(--line-2); color: var(--text); padding: 6px 10px; border-radius: 6px; font: 500 12px var(--font-body); cursor: pointer; }

.task-group { margin-bottom: 28px; }
.task-group-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.task-group-head h3 { font-family: var(--font-display); font-size: 22px; font-weight: 600; margin: 0; }
.task-group-head .small { font-size: 12px; margin-top: 2px; }

.task-list { display: flex; flex-direction: column; gap: 8px; }
.task-row { display: flex; gap: 14px; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); transition: all .15s; }
.task-row:hover { border-color: var(--line-2); }
.task-row.overdue { border-left: 3px solid var(--error); background: rgba(232,90,79,0.04); }
.task-row.done { opacity: 0.55; }
.task-row.done .task-title { text-decoration: line-through; }

.task-check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-2); background: transparent; cursor: pointer; flex-shrink: 0; display: grid; place-items: center; color: #1a120a; font-weight: 700; font-size: 14px; margin-top: 2px; transition: all .15s; }
.task-check:hover { border-color: var(--accent); }
.task-check.checked { background: var(--accent-3); border-color: var(--accent-3); color: #fff; }

.task-body { flex: 1; min-width: 0; }
.task-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.task-title { font-weight: 600; font-size: 14px; color: var(--text); }
.task-detail { font-size: 12px; margin: 4px 0 8px; line-height: 1.4; }

.sev-pill { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; font-weight: 600; }
.sev-critical { background: rgba(232,90,79,0.15); color: var(--error); border: 1px solid rgba(232,90,79,0.35); }
.sev-important { background: rgba(240,180,41,0.12); color: var(--warn); border: 1px solid rgba(240,180,41,0.3); }
.sev-routine { background: var(--bg); color: var(--text-faint); border: 1px solid var(--line-2); }

.cat-pill { font-size: 10px; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--text-muted); border: 1px solid var(--line-2); }
.vendor-pill { font-size: 9px; letter-spacing: 0.08em; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: rgba(107,142,174,0.15); color: #9ab4cd; border: 1px solid rgba(107,142,174,0.35); }

.task-meta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; font-size: 11px; color: var(--text-muted); }
.task-assignee { cursor: pointer; transition: color .15s; padding: 2px 6px; border-radius: 4px; margin-left: -6px; }
.task-assignee:hover { color: var(--accent); background: rgba(232,163,61,0.08); }
.task-status { margin-left: auto; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.task-status.done { background: rgba(59,110,59,0.15); color: #7fa67f; border: 1px solid rgba(59,110,59,0.35); }
.task-status.overdue { background: rgba(232,90,79,0.15); color: var(--error); border: 1px solid rgba(232,90,79,0.35); }
.task-status.due { background: var(--bg); color: var(--text-muted); border: 1px solid var(--line-2); }

/* Role-based tasks visibility — staff only sees assigned daily tasks */
body.role-staff .task-filters .chip-row:nth-child(2) { display: none; }

/* Nav badge hot variant */
.nav-badge.hot { background: var(--error); color: #fff; }
.nav-badge:empty { display: none; }

/* ---------- Team & Invites view ---------- */
.team-shell { display: grid; gap: 16px; max-width: 920px; }
.team-body { padding: 4px 0 2px; }
.invite-form {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  gap: 12px;
  align-items: end;
}
.invite-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.85rem; color: var(--text-muted); }
.invite-field input, .invite-field select {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.invite-form button { height: 38px; }
.invite-msg {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-all;
}
.invite-msg.ok  { background: rgba(111,191,115,0.12); color: #a6e3aa; border: 1px solid rgba(111,191,115,0.35); }
.invite-msg.err { background: rgba(232,90,79,0.12); color: #f6a8a0; border: 1px solid rgba(232,90,79,0.4); }
.invite-msg code {
  display: inline-block;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.8rem;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 4px;
  word-break: break-all;
}
.team-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.team-table th, .team-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.team-table th { font-weight: 600; color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.team-table tbody tr:last-child td { border-bottom: 0; }
.invite-chip-inline {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 600;
  color: var(--text-muted);
}
.invite-link-code {
  display: inline-block;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.76rem;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  margin-right: 6px;
}
.team-table .warn { color: #a14e00; }

@media (max-width: 720px) {
  .invite-form { grid-template-columns: 1fr; }
}

/* ---------- Legal pages (shared with informational layout) ---------- */
.legal-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 80px;
  line-height: 1.7;
  color: var(--text);
}
.legal-shell h1 { font-size: 2rem; margin: 0 0 0.5rem; }
.legal-shell h2 { font-size: 1.15rem; margin: 2.4rem 0 0.6rem; }
.legal-shell p, .legal-shell li { font-size: 0.98rem; }
.legal-shell ul { padding-left: 1.3rem; }
.legal-shell .updated { color: var(--text-muted); font-size: 0.88rem; }
.legal-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; }
.legal-head .brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 600; }

/* Demo mode banner */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  margin: 0;
  background: linear-gradient(90deg, rgba(232, 163, 61, 0.12), rgba(232, 163, 61, 0.04));
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--text-muted);
}
.demo-banner[hidden] { display: none; }
.demo-banner-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.25);
  flex: 0 0 auto;
}
.demo-banner-text { flex: 1 1 auto; color: var(--text); opacity: 0.92; }
.demo-banner-text strong { color: var(--text); font-weight: 600; }
.demo-banner-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  padding: 4px 10px;
  border: 1px solid rgba(232, 163, 61, 0.35);
  border-radius: 6px;
}
.demo-banner-link:hover { background: rgba(232, 163, 61, 0.1); }

/* ========================================
   Food Safety — Tabs
   ======================================== */
.tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 18px;
}
.tab-btn {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font: 500 12px var(--font-body);
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: var(--accent);
  color: #1a120a;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: tabFade 200ms ease; }
@keyframes tabFade {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================
   Food Safety — Temperature cells
   ======================================== */
.temp-cell.warn {
  border-color: rgba(240, 180, 41, 0.45);
  background: rgba(240, 180, 41, 0.05);
}

/* ========================================
   Food Safety — Prep Labels form
   ======================================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 16px;
  margin-top: 6px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  font: 400 13px var(--font-body);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.15);
}
.field textarea { resize: vertical; min-height: 60px; }
.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}
.allergen-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
}
.allergen-pick label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-2);
}
.allergen-pick label:hover { color: var(--text); border-color: var(--accent); }
.allergen-pick input[type="checkbox"] { accent-color: var(--accent); margin: 0; }

/* ========================================
   Food Safety — Prep Labels list
   ======================================== */
.label-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}
.label-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--line-2);
  border-radius: var(--radius-sm);
  transition: border-color 150ms;
}
.label-row:hover { border-color: var(--line); }
.label-row.label-fresh { border-left-color: var(--success); }
.label-row.label-soon { border-left-color: var(--warn); }
.label-row.label-expired {
  border-left-color: var(--error);
  background: rgba(232, 90, 79, 0.04);
}
.label-row-main { flex: 1; min-width: 0; }
.label-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.label-row-head strong {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.label-row-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.label-row-meta .sep { color: var(--text-faint); margin: 0 6px; }
.label-row-allergens {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.label-row-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.label-row-actions .ghost-btn { padding: 5px 9px; font-size: 11px; }

.tag-allergen {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(232, 90, 79, 0.1);
  border: 1px solid rgba(232, 90, 79, 0.3);
  color: #e89a93;
  font-weight: 600;
}

/* ========================================
   Prep Label — 4x2" thermal print
   ======================================== */
.label-print-root { display: none; }

@media print {
  @page { size: 4in 2in; margin: 0; }
  body.printing-label > *:not(#label-print-root) { display: none !important; }
  body.printing-label .main,
  body.printing-label .sidebar,
  body.printing-label .topbar,
  body.printing-label .demo-banner { display: none !important; }
  body.printing-label #label-print-root {
    display: block !important;
    position: static;
    width: 4in;
    height: 2in;
    background: #fff;
    color: #000;
  }
}

.plabel {
  width: 4in;
  height: 2in;
  padding: 0.12in 0.14in;
  box-sizing: border-box;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #000;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.04in;
  line-height: 1.15;
}
.plabel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #000;
  padding-bottom: 0.03in;
  font-size: 9pt;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.plabel-type {
  background: #000;
  color: #fff;
  padding: 1px 6px;
  border-radius: 2px;
}
.plabel-tenant {
  color: #000;
  font-size: 8pt;
  font-weight: 600;
}
.plabel-item {
  font-size: 15pt;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0.02in 0;
}
.plabel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.06in;
  font-size: 8.5pt;
}
.plabel-grid > div { display: flex; flex-direction: column; }
.plabel-useby {
  border-left: 2px solid #000;
  padding-left: 0.06in;
}
.plabel-useby .plabel-v {
  font-size: 11pt;
  font-weight: 800;
}
.plabel-foot {
  margin-top: auto;
  font-size: 7.5pt;
  color: #000;
  border-top: 1px dashed #666;
  padding-top: 0.03in;
  display: flex;
  flex-direction: column;
  gap: 0.02in;
}
.plabel-alg { font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.plabel-notes { font-style: italic; color: #333; }
.plabel-k {
  font-size: 7pt;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
}
.plabel-v {
  font-size: 9pt;
  font-weight: 600;
  color: #000;
}

/* Responsive: single column form on narrow screens */
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .label-row { flex-direction: column; }
  .label-row-actions { flex-direction: row; width: 100%; }
}

/* =========================================================================
   INVOICES & AP — dropzone, list cards, review table, variance pills
   ========================================================================= */

.inv-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 900px) { .inv-kpi-row { grid-template-columns: repeat(2, 1fr); } }

/* Dropzone */
.dropzone {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface) 0%, rgba(28, 26, 21, 0.6) 100%);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
  outline: none;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 163, 61, 0.15); }
.dropzone.drag {
  border-color: var(--accent);
  background: rgba(232, 163, 61, 0.06);
  transform: translateY(-1px);
}
.dropzone-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dropzone-icon { font-size: 32px; opacity: 0.8; }
.dropzone-title { font-size: 15px; font-weight: 600; color: var(--text); }
.dropzone-sub { font-size: 13px; color: var(--text-muted); }
.dropzone-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: inline-block;
}
.dropzone-status.err { color: var(--error); border-color: rgba(232, 90, 79, 0.4); background: rgba(232, 90, 79, 0.08); }
.dropzone-status.ok { color: var(--accent-3); border-color: rgba(59, 110, 59, 0.4); background: rgba(59, 110, 59, 0.1); }

.btn-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(232, 163, 61, 0.4);
}
.btn-link:hover { text-decoration-color: var(--accent); }

/* Invoice list */
.invoice-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.invoice-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 140ms ease, transform 140ms ease;
}
.invoice-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.invoice-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.invoice-vendor { font-weight: 600; font-size: 14px; color: var(--text); }
.invoice-meta { font-size: 12px; margin-top: 2px; }
.invoice-right { text-align: right; }
.invoice-total { font-family: var(--font-mono, 'JetBrains Mono', monospace); font-size: 15px; font-weight: 600; color: var(--text); }
.invoice-status-row { margin-top: 6px; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.invoice-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; border-top: 1px dashed var(--line);
}

/* Empty state */
.empty-state {
  padding: 28px 16px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* Review panel */
.review-actions { display: flex; gap: 8px; }
.review-header { margin-bottom: 14px; }
.review-header label .lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 4px; }
.review-header input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 10px;
  font: 13px var(--font-body);
}
.review-header input:focus { outline: none; border-color: var(--accent); }

.invoice-review-table-wrap { overflow-x: auto; margin-top: 8px; }
.invoice-review-table { min-width: 820px; }
.invoice-review-table td.num, .invoice-review-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-review-table td .desc { color: var(--text); font-weight: 500; }
.invoice-review-table td.tight { width: 36px; color: var(--text-muted); }
.invoice-review-table .match-cell { min-width: 220px; }
.invoice-review-table .match-select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 8px;
  font: 12px var(--font-body);
}
.invoice-review-table .match-select:focus { outline: none; border-color: var(--accent); }
.invoice-review-table .tiny { font-size: 11px; }

/* Variance pills */
.variance-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.variance-pill.ok   { background: rgba(59, 110, 59, 0.1);  color: #7fb27f;     border-color: rgba(59, 110, 59, 0.35); }
.variance-pill.warn { background: rgba(240, 180, 41, 0.1); color: var(--warn); border-color: rgba(240, 180, 41, 0.35); }
.variance-pill.err  { background: rgba(232, 90, 79, 0.12); color: var(--error); border-color: rgba(232, 90, 79, 0.4); }

/* Match confidence */
.match-confidence-high { color: #7fb27f; font-weight: 600; }
.match-confidence-med  { color: var(--warn); font-weight: 600; }
.match-confidence-low  { color: var(--text-muted); font-weight: 500; }

/* Tiny util */
.tiny { font-size: 11px; }

/* -------------------------------------------------------------------------- */
/* TIME CLOCK (tablet mode) + PIN PAD                                         */
/* -------------------------------------------------------------------------- */
.view[data-view="clock"] { padding: 0; }
.view[data-view="clock"].active { padding: 0; }

.clock-stage {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background:
    radial-gradient(circle at 20% 10%, rgba(232, 163, 61, 0.10), transparent 55%),
    radial-gradient(circle at 85% 80%, rgba(201, 48, 44, 0.10), transparent 60%),
    linear-gradient(180deg, #1a1612 0%, #0f0d0a 100%);
  border-radius: 16px;
  border: 1px solid var(--line);
}

/* PIN pad */
.clock-pin-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.clock-brand { text-align: center; }
.clock-brand-name {
  font-family: "Fraunces", serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.clock-brand-sub {
  color: var(--text-muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 4px;
}
.clock-clock {
  font-family: "JetBrains Mono", monospace;
  font-size: 44px;
  color: var(--accent);
  margin: 4px 0 12px;
  letter-spacing: 0.02em;
}
.pin-label {
  color: var(--text-muted);
  font-size: 15px;
  text-align: center;
  min-height: 22px;
  transition: color 150ms ease;
}
.pin-label.pin-err { color: var(--error); font-weight: 600; }

.pin-dots {
  display: flex;
  gap: 18px;
  margin: 4px 0 12px;
}
.pin-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--line);
  transition: background 140ms ease, transform 140ms ease, border-color 140ms ease;
}
.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.08);
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
  max-width: 360px;
}
.pin-key {
  height: 80px;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 100ms ease, background 140ms ease, border-color 140ms ease;
  font-family: "Inter", sans-serif;
}
.pin-key:hover { background: rgba(232, 163, 61, 0.12); border-color: var(--accent); }
.pin-key:active { transform: scale(0.96); background: rgba(232, 163, 61, 0.22); }
.pin-key.pin-ghost {
  font-size: 18px;
  color: var(--text-muted);
  background: transparent;
}
.pin-key.pin-ghost:hover { background: rgba(255, 255, 255, 0.04); color: var(--text); }

.pin-hint { margin-top: 10px; text-align: center; }

/* Employee card */
.clock-card-wrap {
  width: 100%;
  max-width: 440px;
  display: flex;
  justify-content: center;
}
.clock-card-wrap[hidden], .clock-pin-wrap[hidden], .emp-timer[hidden] { display: none !important; }
.clock-employee-card {
  width: 100%;
  padding: 36px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}
.emp-avatar {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #c9302c);
  color: #fff;
  font-family: "Fraunces", serif;
  font-size: 40px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  box-shadow: 0 8px 18px rgba(232, 163, 61, 0.35);
}
.emp-name {
  font-family: "Fraunces", serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.emp-role {
  color: var(--text-muted);
  text-transform: capitalize;
  letter-spacing: 0.04em;
  font-size: 14px;
}
.emp-status {
  margin-top: 8px;
  color: var(--text);
  font-size: 16px;
  text-align: center;
  min-height: 22px;
}
.emp-timer {
  font-family: "JetBrains Mono", monospace;
  font-size: 44px;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin: 4px 0;
}
.emp-hours-today { color: var(--text-muted); font-size: 13px; }
.clock-action-btn {
  width: 100%;
  padding: 22px 24px;
  margin-top: 14px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 14px;
  color: #fff;
  cursor: pointer;
  transition: transform 100ms ease, filter 160ms ease;
}
.clock-action-btn.clock-in {
  background: linear-gradient(135deg, #3b8f4f, #2c6b3b);
  box-shadow: 0 10px 24px rgba(59, 143, 79, 0.32);
}
.clock-action-btn.clock-out {
  background: linear-gradient(135deg, #e8a33d, #c9302c);
  box-shadow: 0 10px 24px rgba(232, 163, 61, 0.32);
}
.clock-action-btn:hover { filter: brightness(1.08); }
.clock-action-btn:active { transform: scale(0.98); }
.clock-action-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* -------------------------------------------------------------------------- */
/* PUBLISH SCHEDULE MODAL                                                     */
/* -------------------------------------------------------------------------- */
.publish-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
}
.publish-backdrop[hidden] { display: none !important; }
.publish-dialog {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  font-family: "Fraunces", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.modal-body {
  padding: 16px 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.modal-foot #publish-status {
  margin-right: auto;
  text-align: left;
}
.publish-hint { margin-bottom: 14px; }
.publish-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.publish-row:last-child { border-bottom: none; }
.publish-row.dim { opacity: 0.55; }
.publish-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.publish-body {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  margin: 0;
}

/* Scheduler publish button spacing */
.sched-controls .btn-primary { margin-left: 8px; }

/* Small viewport tablet tweaks */
@media (max-width: 520px) {
  .pin-key { height: 68px; font-size: 24px; }
  .clock-clock { font-size: 36px; }
  .emp-name { font-size: 24px; }
  .emp-timer { font-size: 36px; }
}

/* Button variants used by new features */
.btn-primary {
  background: var(--accent);
  color: #1a120a;
  border: 0;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font: 600 13px var(--font-body);
  cursor: pointer;
  transition: background .15s;
}
.btn-primary:hover { background: #f0b75b; }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
