/* ============ FoodBooks design system ============ */
:root {
  /* neutrals — a cool, near-white surface stack instead of warm cream */
  --cream: #FAFAF9;          /* app background */
  --cream-deep: #F2F1EE;     /* subtle fills, chips, track backgrounds */
  --paper: #FFFFFF;
  --ink: #1B1A18;
  --ink-soft: #52514C;
  --ink-faint: #8B8983;
  /* terracotta stays — it is the brand */
  --primary: #B93815;
  --primary-deep: #93290C;
  --primary-soft: #FDEEE8;
  --gold: #9A6510;
  --gold-soft: #FBF2E0;
  --green: #1B6B45;
  --green-soft: #E6F3EC;
  --red: #B42318;
  --red-soft: #FDECEA;
  --border: #E8E6E1;
  --border-strong: #D6D3CD;
  /* neutral, tighter shadows — depth from hairlines, not glow */
  --shadow-sm: 0 1px 2px rgba(27,26,24,.05);
  --shadow-md: 0 4px 16px -4px rgba(27,26,24,.11);
  --shadow-lg: 0 16px 44px -12px rgba(27,26,24,.20);
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px;
  /* one modern grotesque throughout; "display" is just tighter and heavier */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3 { font-family: var(--font-display); font-weight: 650; line-height: 1.18; letter-spacing: -.021em; }
/* numbers should never jitter as they change */
.value, .amt, .num, .mlabel { font-variant-numeric: tabular-nums; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font: 560 14px/1 var(--font-body); letter-spacing: -.006em; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--cream); }
.btn-light { background: #fff; color: var(--ink); box-shadow: var(--shadow-md); }
.btn-light:hover { background: var(--cream-deep); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-lg { padding: 13px 24px; font-size: 15px; }
.btn-danger { background: transparent; color: var(--red); border-color: transparent; }
.btn-danger:hover { background: var(--red-soft); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ============ navigation ============ */
.topnav, .appnav { position: sticky; top: 0; z-index: 100; }
.topnav { background: rgba(250,250,249,.85); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.appnav { background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.topnav-inner, .appnav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px; height: 68px;
  display: flex; align-items: center; gap: 32px;
}
.brand { font: 700 22px var(--font-display); display: flex; align-items: center; gap: 9px; letter-spacing: -.02em; }
.brand span { color: var(--primary); }
.brand-mark { width: 26px; height: 26px; color: var(--primary); }
.topnav-links, .appnav-links { display: flex; gap: 6px; flex: 1; }
.topnav-links a { padding: 8px 14px; font-weight: 600; color: var(--ink-soft); border-radius: 999px; transition: all .2s; }
.topnav-links a:hover { color: var(--ink); background: var(--cream-deep); }
.appnav-links a {
  padding: 8px 16px; font-weight: 600; font-size: 15px; color: var(--ink-soft);
  border-radius: 999px; transition: all .2s;
}
.appnav-links a:hover { color: var(--ink); background: var(--cream); }
.appnav-links a.active { color: var(--primary-deep); background: var(--primary-soft); }
.topnav-right, .appnav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.navlink.subtle { color: var(--ink-faint); font-weight: 600; font-size: 14px; }
.navlink.subtle:hover { color: var(--ink); }
.method-chip {
  font: 550 11.5px/1 var(--font-body); letter-spacing: .02em; text-transform: uppercase;
  background: var(--cream-deep); color: var(--ink-soft); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: var(--r-sm);
}

/* ============ flash ============ */
.flash-stack { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(560px, calc(100vw - 40px)); }
.flash {
  display: flex; gap: 10px; align-items: center; padding: 13px 18px;
  border-radius: var(--r-md); font-weight: 600; font-size: 14.5px;
  box-shadow: var(--shadow-md); transition: all .4s ease; background: #fff;
}
.flash svg { width: 19px; height: 19px; flex-shrink: 0; }
.flash-success { color: var(--green); border: 1px solid #BFE0CE; background: var(--green-soft); }
.flash-error { color: var(--red); border: 1px solid #F1C1BC; background: var(--red-soft); }

/* ============ layout ============ */
.page { max-width: 1240px; margin: 0 auto; padding: 32px 32px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 29px; letter-spacing: -.028em; }
.page-head .sub { color: var(--ink-faint); margin-top: 6px; font-size: 14.5px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============ landing ============ */
.landing { padding: 0; max-width: none; }
.hero {
  position: relative; min-height: 640px; display: flex; align-items: center;
  color: #fff; overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; object-fit: cover; width: 100%; height: 100%; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(24,10,4,.88) 0%, rgba(24,10,4,.62) 45%, rgba(24,10,4,.25) 100%);
}
.hero-inner { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 90px 28px; width: 100%; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; font: 700 12px/1 var(--font-body);
  letter-spacing: .14em; text-transform: uppercase; color: #FFD9A8;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25);
  padding: 9px 16px; border-radius: 999px; backdrop-filter: blur(6px); margin-bottom: 26px;
}
.hero h1 { font-size: clamp(40px, 6vw, 68px); max-width: 700px; margin-bottom: 22px; font-weight: 600; }
.hero h1 em { font-style: italic; color: #FFC98B; }
.hero p { font-size: 19px; max-width: 540px; color: rgba(255,244,235,.92); margin-bottom: 36px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 13.5px; color: rgba(255,244,235,.65); }

.strip { background: var(--ink); color: #CBB9AC; }
.strip-inner { max-width: 1200px; margin: 0 auto; padding: 26px 28px; display: flex; gap: 40px; justify-content: space-between; flex-wrap: wrap; }
.strip b { display: block; font: 600 26px var(--font-display); color: #fff; }
.strip small { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }

.section { max-width: 1200px; margin: 0 auto; padding: 90px 28px; }
.section-kicker { font: 700 12.5px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--primary); margin-bottom: 14px; }
.section h2 { font-size: clamp(30px, 4vw, 44px); max-width: 620px; margin-bottom: 14px; }
.section-lede { color: var(--ink-soft); font-size: 17.5px; max-width: 560px; }

.feature-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; margin-top: 48px; }
.feature-card {
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-sm); transition: all .25s ease; display: flex; flex-direction: column;
}
.feature-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.feature-card img { height: 210px; object-fit: cover; width: 100%; }
.feature-card-body { padding: 26px 26px 30px; flex: 1; display: flex; flex-direction: column; }
.feature-card h3 { font-size: 23px; margin-bottom: 10px; }
.feature-card p { color: var(--ink-soft); font-size: 15px; flex: 1; }
.feature-card .link { margin-top: 18px; color: var(--primary); font-weight: 700; font-size: 14.5px; display: inline-flex; align-items: center; gap: 6px; }
.feature-card .link:hover { gap: 10px; }
.feature-card .link svg { width: 16px; height: 16px; transition: inherit; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.split.reverse > .split-media { order: 2; }
.split-media { border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); position: relative; }
.split-media img { width: 100%; height: 460px; object-fit: cover; }
.split h2 { font-size: clamp(28px, 3.4vw, 40px); }
.split .checklist { margin-top: 24px; display: grid; gap: 14px; list-style: none; }
.split .checklist li { display: flex; gap: 12px; align-items: flex-start; color: var(--ink-soft); font-size: 15.5px; }
.split .checklist svg { width: 20px; height: 20px; color: var(--green); flex-shrink: 0; margin-top: 2px; }
.split .checklist b { color: var(--ink); }

.cta-band { background: linear-gradient(120deg, var(--primary-deep), var(--primary)); border-radius: var(--r-lg); color: #fff; padding: 70px 60px; display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; position: relative; overflow: hidden; }
.cta-band::before { content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.08); }
.cta-band h2 { font-size: clamp(28px, 3.4vw, 40px); max-width: 520px; }
.cta-band p { color: rgba(255,240,232,.85); margin-top: 10px; max-width: 480px; }

.footer { background: var(--ink); color: #A6968A; margin-top: 40px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 54px 28px; display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; align-items: center; }
.footer .brand { color: #fff; }
.footer small { font-size: 13.5px; }

/* ============ auth ============ */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 68px); max-width: none; padding: 0; }
.auth-media { position: relative; overflow: hidden; display: none; }
.auth-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.auth-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(20deg, rgba(24,10,4,.75), rgba(24,10,4,.1)); }
.auth-quote { position: absolute; z-index: 2; bottom: 48px; left: 48px; right: 48px; color: #fff; }
.auth-quote p { font: italic 500 24px/1.4 var(--font-display); margin-bottom: 12px; }
.auth-quote small { color: rgba(255,240,232,.75); font-size: 14px; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 60px 28px; }
.auth-card { width: min(430px, 100%); }
.auth-card h1 { font-size: 34px; margin-bottom: 8px; }
.auth-card .sub { color: var(--ink-faint); margin-bottom: 32px; }
.auth-alt { margin-top: 26px; text-align: center; color: var(--ink-faint); font-size: 14.5px; }
.auth-alt a { color: var(--primary); font-weight: 700; }
@media (min-width: 900px) { .auth-media { display: block; } }

/* ============ forms ============ */
/* align-content:start keeps a field from stretching its input to fill the row
   when a neighbouring field is taller (a wrapped label or an extra hint) */
.field { display: grid; gap: 6px; margin-bottom: 16px; align-content: start; }
.field label { font-weight: 550; font-size: 13px; letter-spacing: -.003em; color: var(--ink-soft); }
.field label .req { color: var(--primary); }
.field input, .field select, .field textarea {
  font: 450 14.5px var(--font-body); color: var(--ink);
  background: var(--paper); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  padding: 9px 12px; transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
/* not scoped to .field — hints are also used loose inside modals */
.hint { font-size: 12.5px; color: var(--ink-faint); line-height: 1.5; }

/* the standalone filter dropdown that sits above a table */
.filter-select {
  font: 560 14px var(--font-body); color: var(--ink);
  background: var(--paper); border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); padding: 9px 12px; cursor: pointer;
}
.filter-select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.radio-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card {
  position: relative; display: flex; flex-direction: column; gap: 4px; cursor: pointer;
  border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 14px 16px;
  background: var(--paper); transition: all .18s ease; font-weight: 600; font-size: 14.5px;
}
.radio-card:hover { border-color: var(--ink-faint); }
.radio-card.checked { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary); }
.radio-card small { color: var(--ink-faint); font-weight: 500; font-size: 12px; }

/* ============ app shell (sidebar) ============ */
.shell { display: flex; min-height: 100vh; }
/* light rail rather than a heavy dark slab — keeps the app feeling open */
.sidebar {
  width: 236px; flex-shrink: 0; background: #1B1A18; color: #EDEBE7;
  border-right: 1px solid #1B1A18;
  display: flex; flex-direction: column; position: sticky; top: 0;
  height: 100vh; overflow-y: auto; padding: 20px 12px 14px;
}
.sidebar .brand { color: #fff; font-size: 17px; padding: 0 10px 2px; letter-spacing: -.03em; }
.sidebar .brand span { color: var(--primary); }
.sidebar .brand-mark { color: var(--primary); width: 20px; height: 20px; }
.sidebar .brand-sub { font-size: 12.5px; color: #8B8781; padding: 0 10px 20px; font-weight: 500; }
.side-links { display: grid; gap: 1px; }
.side-links a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--r-sm); font-weight: 500; font-size: 14px;
  color: #A9A6A0; transition: background .13s, color .13s;
}
.side-links a svg { width: 17px; height: 17px; flex-shrink: 0; opacity: .72; }
.side-links a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-links a.active { background: rgba(255,255,255,.10); color: #fff; font-weight: 600; }
.side-links a.active svg { opacity: 1; color: #E4713F; }
.side-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.09); display: grid; gap: 1px; }
.side-foot a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: var(--r-sm); font-weight: 500; font-size: 13.5px; color: #8B8781;
}
.side-foot a svg { width: 16px; height: 16px; }
.side-foot a:hover { color: #fff; background: rgba(255,255,255,.07); }
.side-role {
  margin: 0 10px 12px; padding: 4px 9px; border-radius: var(--r-sm); text-align: center;
  background: rgba(255,255,255,.09); color: #C9C6C0;
  font: 600 11px/1.5 var(--font-body); letter-spacing: .04em; text-transform: uppercase;
}
.shell-main { flex: 1; min-width: 0; }
.topbar {
  height: 56px; border-bottom: 1px solid var(--border); background: rgba(250,250,249,.82); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: flex-end; padding: 0 32px;
  position: sticky; top: 0; z-index: 90;
}
.topbar .rest-name { font-weight: 700; font-size: 14.5px; color: var(--ink-soft); }
.sidebar-toggle { display: none; }
.sidebar-scrim { display: none; }
@media (max-width: 900px) {
  .sidebar {
    position: fixed; z-index: 200; transform: translateX(-100%);
    transition: transform .24s cubic-bezier(.22,1,.36,1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  /* the dimmed area behind an open drawer — tapping it closes */
  .sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 190;
    background: rgba(27,26,24,.44); -webkit-tap-highlight-color: transparent;
    animation: scrim-in .24s ease both;
  }
  .sidebar-scrim[hidden] { display: none; }
  @keyframes scrim-in { from { opacity: 0 } to { opacity: 1 } }
  .sidebar-toggle {
    display: inline-flex; margin-right: auto; background: none; border: 0;
    cursor: pointer; padding: 8px; color: var(--ink); border-radius: var(--r-sm);
  }
  .sidebar-toggle svg { width: 22px; height: 22px; }
  .sidebar-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  .sidebar-scrim { animation: none; }
}

/* ============ month navigation ============ */
.month-nav { display: flex; align-items: center; gap: 14px; }
.month-nav a, .month-nav span.mbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-sm); transition: all .16s;
}
.month-nav a:hover { border-color: var(--ink-soft); }
.month-nav span.mbtn { opacity: .38; }
.month-nav svg { width: 17px; height: 17px; }
.month-nav .mlabel { font-weight: 600; font-size: 14.5px; min-width: 130px; text-align: center; letter-spacing: -.012em; }

/* ============ segmented control ============ */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--cream-deep); border-radius: var(--r-sm); }
.seg a {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 18px;
  border-radius: 4px; font-weight: 550; font-size: 13.5px; color: var(--ink-soft); transition: all .13s;
}
.seg a svg { width: 16px; height: 16px; }
.seg a:hover { color: var(--ink); }
.seg a.active { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ============ stats with icons ============ */
.stat.stat-icon { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.stat .stat-ico {
  width: 44px; height: 44px; border-radius: var(--r-md); flex-shrink: 0;
  display: grid; place-items: center; background: var(--green-soft); color: var(--green);
}
.stat .stat-ico svg { width: 21px; height: 21px; }
.stat .stat-ico.warn { background: var(--gold-soft); color: var(--gold); }
.stat .stat-ico.bad { background: var(--red-soft); color: var(--red); }
.hero-band {
  background: var(--green); color: #fff; border-radius: var(--r-lg);
  padding: 26px 30px; margin-bottom: 22px; box-shadow: var(--shadow-md);
}
.hero-band .label { font: 500 12.5px/1 var(--font-body); letter-spacing: 0; text-transform: none; opacity: .8; }
.hero-band .value { font: 650 34px var(--font-display); letter-spacing: -.03em; margin-top: 6px; }

/* ============ modal ============ */
.modal-back {
  position: fixed; inset: 0; background: rgba(27,26,24,.44); backdrop-filter: blur(3px);
  z-index: 400; display: grid; place-items: center; padding: 24px;
}
.modal-back[hidden] { display: none; }
.modal {
  background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: min(680px, 100%); max-height: 90vh; overflow-y: auto; padding: 28px;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.modal-head h2 { font-size: 22px; }
.modal-sub { color: var(--ink-faint); font-size: 14px; margin-bottom: 22px; }
.modal-x { background: none; border: 0; cursor: pointer; color: var(--ink-faint); padding: 4px; line-height: 0; }
.modal-x svg { width: 20px; height: 20px; }
.modal-x:hover { color: var(--ink); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.line-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 40px; gap: 12px;
  align-items: end; padding: 14px; background: var(--cream); border-radius: var(--r-md); margin-bottom: 10px;
}
.line-row .field { margin-bottom: 0; }
.line-del { background: none; border: 0; cursor: pointer; color: var(--red); padding: 10px 0; line-height: 0; }
.line-del svg { width: 18px; height: 18px; }
.pay-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pay-opt {
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  padding: 13px; border: 1.5px solid var(--border); border-radius: var(--r-md);
  font-weight: 600; font-size: 14px; background: var(--paper); transition: all .16s;
}
.pay-opt svg { width: 17px; height: 17px; }
.pay-opt input { position: absolute; opacity: 0; pointer-events: none; }
.pay-opt.checked { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.modal-total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0; border-top: 1px solid var(--border); margin-top: 6px; }
.modal-total .amt { font: 600 26px var(--font-display); font-variant-numeric: tabular-nums; }

/* ============ cards & stats ============ */
.card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card h2.card-title { font-size: 17.5px; margin-bottom: 3px; letter-spacing: -.018em; }
.card .card-sub { color: var(--ink-faint); font-size: 13.5px; margin-bottom: 18px; line-height: 1.5; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
/* three-up variant. As a class rather than an inline style, because an inline
   grid-template-columns outranks the responsive rules below and leaves phones
   with three squeezed columns wrapping every figure. */
.stat-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stat {
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat .label { font: 500 12.5px/1 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--ink-faint); }
.stat .value { font: 650 28px/1.15 var(--font-display); letter-spacing: -.03em; margin-top: 9px; }
.stat .value.pos { color: var(--green); }
.stat .value.neg { color: var(--red); }
.stat .foot { font-size: 12.5px; color: var(--ink-faint); margin-top: 5px; }

/* ============ tables ============ */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--paper); box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th {
  text-align: left; font: 600 12px/1.3 var(--font-body); letter-spacing: 0; text-transform: none;
  color: var(--ink-faint); padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--cream);
  white-space: nowrap;
}
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
/* a money figure or a date broken across two lines reads as two numbers —
   these columns are narrow on the ledger pages, so pin them */
table.data .num, table.data .nowrap { white-space: nowrap; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .13s; }
table.data tbody tr:hover { background: var(--cream); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th.num { text-align: right; }
table.data .item-link { font-weight: 700; color: var(--ink); }
table.data .item-link:hover { color: var(--primary); }
/* white-space:normal so a long note still wraps inside a .nowrap date cell */
.cell-sub { display: block; font-size: 12px; color: var(--ink-faint); white-space: normal; }

.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: var(--r-sm); font: 550 12px/1.5 var(--font-body); letter-spacing: 0; }
.badge-cat { background: var(--cream-deep); color: var(--ink-soft); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.badge-purchase { background: var(--green-soft); color: var(--green); }
.badge-usage { background: #E8EDF7; color: #34518C; }
.badge-waste { background: var(--red-soft); color: var(--red); }

/* ============ tabs ============ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tabs a {
  padding: 10px 14px; font-weight: 550; font-size: 14px; color: var(--ink-faint);
  border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 8px; transition: color .2s;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-color: var(--primary); }
.tabs .soon { font: 700 9.5px/1 var(--font-body); letter-spacing: .08em; background: var(--cream-deep); color: var(--ink-faint); padding: 4px 8px; border-radius: 999px; text-transform: uppercase; }

/* ============ statement ============ */
.statement { max-width: 760px; }
.statement-row { display: flex; justify-content: space-between; gap: 20px; padding: 8px 0; font-size: 14px; }
.statement-row .amt { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.statement-row.indent { padding-left: 22px; color: var(--ink-soft); font-size: 14.5px; }
.statement-row.subtotal { border-top: 1px solid var(--border); font-weight: 700; margin-top: 4px; padding-top: 14px; }
.statement-row.total { border-top: 1px solid var(--ink); font-weight: 700; font-size: 15.5px; margin-top: 6px; padding-top: 14px; }
.statement-row.total .amt.pos { color: var(--green); }
.statement-row.total .amt.neg { color: var(--red); }
.statement-head { font: 600 12px/1 var(--font-body); letter-spacing: .02em; text-transform: none; color: var(--ink-faint); padding: 18px 0 4px; }

/* ============ empty states ============ */
.empty {
  text-align: center; padding: 56px 30px; border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg); background: rgba(255,255,255,.55);
}
.empty svg { width: 44px; height: 44px; color: var(--ink-faint); margin: 0 auto 16px; }
.empty h3 { font-size: 17px; margin-bottom: 7px; letter-spacing: -.018em; }
.empty p { color: var(--ink-faint); max-width: 420px; margin: 0 auto 22px; font-size: 15px; }

/* ============ misc app ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.grid-31 { display: grid; grid-template-columns: 2.1fr 1fr; gap: 16px; align-items: start; }
/* a grid item is min-width:auto by default, so a wide table inflates its own
   column and starves the sidebar — this lets .table-wrap scroll instead */
.grid-2 > *, .grid-31 > * { min-width: 0; }
.inline-form { display: grid; gap: 14px; }
.inline-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.section-title { font-size: 17.5px; font-family: var(--font-display); letter-spacing: -.018em; margin: 30px 0 12px; }
.method-picker { display: grid; gap: 10px; }
.method-picker .radio-card { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.method-picker .radio-card div { display: grid; gap: 2px; }
.hint-text { font-size: 13px; color: var(--ink-faint); }

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.recipe-card { background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px 26px; box-shadow: var(--shadow-sm); transition: all .22s ease; display: flex; flex-direction: column; gap: 14px; }
.recipe-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.recipe-card .rc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.recipe-card h3 { font-size: 20px; }
.recipe-card .rc-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.recipe-card .rc-stats b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
/* sentence case, like every other micro-label since the restyle */
.recipe-card .rc-stats small { color: var(--ink-faint); font: 500 12.5px/1.4 var(--font-body); letter-spacing: 0; }
.rc-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: auto; }
.costbar { height: 7px; border-radius: 999px; background: var(--cream-deep); overflow: hidden; }
.costbar i { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.costbar i.warn { background: var(--gold); }
.costbar i.over { background: var(--red); }

.ingredient-rows { display: grid; gap: 10px; }
.ingredient-row { display: grid; grid-template-columns: 2.2fr 1fr auto auto; gap: 10px; align-items: center; }
.ingredient-row .cost-cell { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14px; min-width: 88px; text-align: right; }
.ingredient-row .remove { background: none; border: none; color: var(--ink-faint); cursor: pointer; padding: 8px; border-radius: 8px; }
.ingredient-row .remove:hover { color: var(--red); background: var(--red-soft); }

.setup-hero { border-radius: var(--r-lg); overflow: hidden; position: relative; min-height: 100%; }
.setup-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.setup-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(10deg, rgba(24,10,4,.8), rgba(24,10,4,.05)); }
.setup-hero .cap { position: absolute; bottom: 34px; left: 34px; right: 34px; color: #fff; z-index: 2; }
.setup-hero .cap h2 { font-size: 26px; margin-bottom: 6px; }
.setup-hero .cap p { color: rgba(255,240,232,.85); font-size: 14.5px; }

/* ============ notices & alerts ============ */
.notice { border-radius: var(--r-md); padding: 16px 20px; font-size: 14.5px; line-height: 1.55; }
.notice-ok { background: var(--green-soft); border: 1px solid #BFE0CE; color: var(--green); }
.notice-warn { background: #FFF7E8; border: 1.5px solid #EBD9AE; color: #7A5B0B; }
.warn-list { margin: 8px 0 0 0; padding-left: 20px; display: grid; gap: 7px; }
.warn-list li { color: inherit; }
.alert-banner {
  background: var(--red-soft); border: 2px solid var(--red); color: var(--red);
  border-radius: var(--r-md); padding: 13px 16px; font-weight: 700; font-size: 14px;
  animation: alert-shake .35s ease;
}
@keyframes alert-shake {
  0%,100% { transform: translateX(0); } 20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); }
}
.input-error { border-color: var(--red) !important; box-shadow: 0 0 0 4px rgba(180,35,24,.14) !important; }
tr.row-flagged td { background: var(--red-soft); }
tr.row-flagged:hover td { background: #FBDFDB; }
input[type="file"] {
  font: 500 14px var(--font-body); color: var(--ink-soft); width: 100%;
  border: 1px dashed var(--border-strong); border-radius: var(--r-sm);
  padding: 12px; background: var(--cream); cursor: pointer;
}
input[type="file"]::file-selector-button {
  font: 560 13px var(--font-body); color: var(--primary-deep); background: var(--primary-soft);
  border: none; border-radius: var(--r-sm); padding: 8px 14px; margin-right: 12px; cursor: pointer;
}

/* ============ help tooltip ============ */
.help-tip {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%; margin-left: 5px; vertical-align: 1px;
  background: var(--cream-deep); color: var(--ink-soft); border: 1px solid var(--border);
  font: 700 11px/1 var(--font-body); cursor: help;
}
.help-pop {
  position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%);
  width: 240px; background: var(--ink); color: #F3E9DF; font: 500 12.5px/1.5 var(--font-body);
  padding: 11px 13px; border-radius: 10px; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transition: opacity .18s ease; z-index: 50;
  text-transform: none; letter-spacing: normal; white-space: normal; text-align: left;
}
.help-pop::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--ink);
}
.help-tip:hover .help-pop, .help-tip:focus .help-pop { opacity: 1; visibility: visible; }

/* ============ charts ============ */
.hbar-chart { display: grid; gap: 13px; }
.hbar-row { display: grid; grid-template-columns: minmax(110px, 32%) 1fr; gap: 12px; align-items: center; }
.hbar-label { font-weight: 700; font-size: 13.5px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { position: relative; background: var(--cream-deep); border-radius: 4px; height: 26px; display: flex; align-items: center; }
.hbar-fill { height: 100%; min-width: 3px; background: var(--primary); border-radius: 4px 4px 4px 4px; }
.hbar-value { position: absolute; right: 10px; font: 700 12.5px var(--font-body); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.price-chart svg { display: block; }
.cell-zero { color: var(--ink-faint); opacity: .7; }
.drift-up { color: var(--red); font-weight: 700; }
.drift-down { color: var(--green); font-weight: 700; }

/* ============ sortable tables ============ */
th.sortable { user-select: none; transition: color .15s; }
th.sortable:hover { color: var(--ink); }
.sort-arrow { font-size: 9px; color: var(--primary); }

/* ============ responsive ============ */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-cards { grid-template-columns: 1fr; }
  .split, .grid-31, .grid-2 { grid-template-columns: 1fr; }
  .split.reverse > .split-media { order: 0; }
  .split-media img { height: 320px; }
  .appnav-links a { padding: 8px 10px; font-size: 14px; }
  .navlink.subtle { display: none; }
}
@media (max-width: 720px) {
  .topnav-inner, .appnav-inner { padding: 0 16px; gap: 12px; height: 62px; }
  .topnav-links { display: none; }
  .method-chip { display: none; }
  .page { padding: 26px 16px 60px; }
  .hero { min-height: 560px; }
  .section { padding: 60px 16px; }
  .cta-band { padding: 44px 28px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  /* three stats side by side on a phone squeeze every figure onto two lines */
  .stat-grid.cols-3 { grid-template-columns: 1fr; }
  .stat .value { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; }
  .inline-form .row { grid-template-columns: 1fr; }
  .ingredient-row { grid-template-columns: 1.6fr 1fr auto auto; }
  .page-head h1 { font-size: 27px; }
  .btn { padding: 11px 18px; }
}
/* ---------------------------------------------------------- analytics */

/* hbar variant that keeps the figure outside the bar, so the longest row
   stays readable instead of printing its value over the fill */
.hbar-row.hbar-outside { grid-template-columns: minmax(96px, 30%) 1fr auto; }
.hbar-outside > .hbar-value {
  position: static; text-align: right; min-width: 58px;
  font: 700 12.5px var(--font-body); color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* month-on-month movement next to a figure */
.delta { font: 700 12.5px var(--font-body); font-variant-numeric: tabular-nums; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.delta.flat { color: var(--ink-faint); }

/* revenue vs costs, one pair of columns per month */
.col-chart { display: flex; align-items: flex-end; gap: 18px; height: 190px; padding-top: 8px; }
.col-month { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; }
.col-pair { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 5px; }
.col-pair > div { width: 42%; max-width: 26px; min-height: 2px; border-radius: 3px 3px 0 0; }
.col-rev { background: var(--primary); }
.col-cost { background: var(--cream-deep); border: 1px solid var(--border); }
.col-label { font: 700 12px var(--font-body); color: var(--ink-faint); }
.chart-key { display: flex; gap: 16px; margin-bottom: 16px; font: 600 12.5px var(--font-body); color: var(--ink-soft); }
.chart-key span { display: inline-flex; align-items: center; gap: 7px; }
.chart-key i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* two-tone split bar (cash vs card takings) */
.split-bar { display: flex; height: 30px; border-radius: 6px; overflow: hidden; background: var(--cream-deep); margin: 6px 0 14px; }
.split-bar > div { min-width: 2px; }
.split-cash { background: var(--green); }
.split-bank { background: var(--primary); }

@media (max-width: 720px) {
  .col-chart { gap: 8px; height: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------------------------------------------------- install prompt (PWA) */
.pwa-prompt {
  position: fixed; z-index: 500; left: 16px; right: 16px; bottom: 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 14px 16px;
  transform: translateY(140%); opacity: 0;
  transition: transform .26s cubic-bezier(.22,1,.36,1), opacity .26s ease;
}
.pwa-prompt.show { transform: none; opacity: 1; }
.pwa-icon { border-radius: 10px; flex-shrink: 0; }
.pwa-text { flex: 1 1 200px; min-width: 0; }
.pwa-title { font: 600 15px var(--font-display); letter-spacing: -.015em; }
.pwa-body { font-size: 13.5px; color: var(--ink-faint); line-height: 1.45; margin-top: 2px; }
.pwa-body b { color: var(--ink-soft); }
.pwa-actions { display: flex; gap: 8px; margin-left: auto; }

@media (min-width: 640px) {
  .pwa-prompt { left: auto; right: 24px; bottom: 24px; width: 420px; }
}
/* installed app: pad for the phone's home indicator / notch */
@media (display-mode: standalone) {
  .page { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { padding-top: calc(20px + env(safe-area-inset-top)); }
  .topbar { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
}

/* ============ access paused ============
   The page a restaurant sees when its trial or subscription has lapsed. It
   stands alone rather than sitting in the app shell — someone who cannot use
   the app should not be looking at its navigation. */
body.paused-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.paused { width: 100%; max-width: 480px; text-align: center; }
.paused > .brand { justify-content: center; display: inline-flex; align-items: center; gap: 9px; }
.paused-card {
  background: var(--paper); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 40px 34px 30px; box-shadow: var(--shadow-md); margin-top: 22px;
}
.paused-ico {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 20px;
  display: grid; place-items: center; background: var(--gold-soft); color: var(--gold);
}
.paused-ico svg { width: 27px; height: 27px; }
.paused-card h1 { font-size: 25px; letter-spacing: -.028em; margin-bottom: 14px; }
.paused-lead { font-size: 16px; line-height: 1.6; color: var(--ink); }
.paused-lead b { color: var(--primary-deep); font-weight: 650; }
.paused-text { font-size: 14.5px; line-height: 1.65; color: var(--ink-soft); margin-top: 14px; }
.paused-thanks { font-size: 14.5px; color: var(--ink-soft); margin: 16px 0 24px; }
.paused-mail { font-size: 13px; color: var(--ink-faint); margin-top: 10px; }
.paused-foot { border-top: 1px solid var(--border); margin-top: 26px; padding-top: 18px; }
.paused-foot a { font-size: 13.5px; color: var(--ink-faint); font-weight: 550; }
.paused-foot a:hover { color: var(--ink); }
