/* ============================================================================
   Rasoi design system
   ----------------------------------------------------------------------------
   Deep charcoal canvas, one premium metal accent, Outfit. Saffron carries the
   brand; every colour below is a token so an outlet can be re-skinned without
   touching a component.

   Everything below assumes it is being touched by someone standing up, in a
   hurry, with wet hands: 44px minimum targets, no hover-only affordances,
   and type that survives a greasy screen at arm's length.
   ============================================================================ */

/* ── fonts ──────────────────────────────────────────────────────────────── */
/* Self-hosted: the CSP blocks third-party origins, the outlet's internet is
   unreliable, and a POS should not show unstyled text because a CDN is slow. */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
                 U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+1E00-1E9F, U+2020, U+20A0-20AB,
                 U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Devanagari: menu items and the guest UI are routinely in Hindi. Outfit has
   no Devanagari, so Mukta carries it — geometric enough to sit beside Outfit
   without looking like a fallback. */
@font-face {
  font-family: 'Mukta';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/mukta-400.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC;
}
@font-face {
  font-family: 'Mukta';
  font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/mukta-600.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC;
}
@font-face {
  font-family: 'Mukta';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/mukta-700.woff2') format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+25CC;
}
/* Bengali is a different block entirely — U+0980–09FF. Mukta does not cover it,
   so without this every Bengali string fell back to whatever the device had,
   which on most Androids is a visibly different face at a different weight.
   Hind Siliguri is from the same foundry as Mukta and sits beside Outfit
   without looking like a substitution. */
@font-face {
  font-family: 'Hind Siliguri';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/hindsiliguri-400.woff2') format('woff2');
  unicode-range: U+0980-09FF, U+200C-200D, U+20B9, U+25CC;
}
@font-face {
  font-family: 'Hind Siliguri';
  font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/hindsiliguri-600.woff2') format('woff2');
  unicode-range: U+0980-09FF, U+200C-200D, U+20B9, U+25CC;
}
@font-face {
  font-family: 'Hind Siliguri';
  font-style: normal; font-weight: 700; font-display: swap;
  src: url('/fonts/hindsiliguri-700.woff2') format('woff2');
  unicode-range: U+0980-09FF, U+200C-200D, U+20B9, U+25CC;
}

/* ── tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* surfaces — deep charcoal, never pure black */
  --bg:          #131315;
  --surface:     #1C1C1E;
  --surface-2:   #242427;
  --surface-3:   #2E2E32;
  --hairline:    #35353A;
  --hairline-2:  #45454C;

  /* brand — saffron */
  --brand:       #E8963C;
  --brand-hot:   #F2A855;
  --brand-deep:  #C46A16;
  --brand-ember: #8C3A12;
  --brand-tint:  #2A1B10;
  --cream:       #FDF1E0;

  /* secondary */
  --teal:        #0D9488;

  /* semantic */
  --ok:          #3FBF77;
  --ok-tint:     #10251A;
  --warn:        #E8B34A;
  --warn-tint:   #2A2110;
  --bad:         #EF5F52;
  --bad-tint:    #2C1211;
  --info:        #5B9DF9;

  /* ink */
  --ink:         #F2EFEA;
  --ink-2:       #A9A29A;
  --ink-3:       #6E6862;
  --ink-invert:  #17140F;

  /* type */
  /* Both Indic faces are in the default stack, not only behind a class: a
     dish name, a toast, or a model reply can contain Bengali anywhere, and
     unicode-range means listing them costs nothing when the text is Latin. */
  --font: 'Outfit', 'Hind Siliguri', 'Mukta', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  /* One Indic stack for both scripts — unicode-range selects per glyph, so a
     line mixing Bengali, Devanagari and Latin renders in three faces correctly. */
  --font-indic: 'Hind Siliguri', 'Mukta', 'Outfit', sans-serif;
  --font-deva: var(--font-indic);
  --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;

  /* geometry */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --r-xl: 26px;

  /* elevation — two layers, the way macOS does it: a tight contact shadow
     plus a wide ambient one. A single blur reads flat. */
  --e1: 0 1px 2px rgba(0,0,0,.34), 0 0 0 .5px rgba(0,0,0,.30);
  --e2: 0 2px 5px rgba(0,0,0,.34), 0 8px 24px -6px rgba(0,0,0,.46);
  --e3: 0 4px 10px rgba(0,0,0,.36), 0 22px 50px -12px rgba(0,0,0,.58);

  /* motion — a short spring; anything longer feels laggy under the thumb */
  --spring: cubic-bezier(.22,1.2,.36,1);
  --ease: cubic-bezier(.4,0,.2,1);

  --tap: 44px;
  --header-h: 56px;
  --tabbar-h: calc(56px + env(safe-area-inset-bottom));
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F6F1E9; --surface: #FFFFFF; --surface-2: #FBF6EE; --surface-3: #F2EADD;
    --hairline: #E5DACA; --hairline-2: #D3C4AE;
    --ink: #1F1B16; --ink-2: #6B6157; --ink-3: #9B9086;
    --brand-tint: #FDF0E1; --ink-invert: #FFFFFF;
    --ok-tint: #E8F7EE; --warn-tint: #FDF3DE; --bad-tint: #FDECEA;
    --e1: 0 1px 2px rgba(80,60,30,.10), 0 0 0 .5px rgba(80,60,30,.09);
    --e2: 0 2px 5px rgba(80,60,30,.10), 0 8px 24px -6px rgba(80,60,30,.16);
    --e3: 0 4px 10px rgba(80,60,30,.12), 0 22px 50px -12px rgba(80,60,30,.22);
  }
}

/* ── reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* No rubber-band scroll behind a fixed app chrome, and no text selection
     on a POS where every tap is a command. */
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}
body.app { user-select: none; }
body.app input, body.app textarea { user-select: text; }

:lang(hi), :lang(mr), :lang(ne), :lang(bn), :lang(as), .deva, .indic { font-family: var(--font-indic); }

h1, h2, h3, p, figure { margin: 0; }
a { color: var(--brand); text-decoration: none; }
img, svg { display: block; max-width: 100%; }

::selection { background: color-mix(in srgb, var(--brand) 32%, transparent); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ── app chrome ─────────────────────────────────────────────────────────── */
.appbar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  display: flex; align-items: center; gap: 12px;
  /* Vibrancy: the content scrolls under a frosted bar rather than vanishing
     behind an opaque one. */
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--hairline);
}
.appbar .title { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.appbar .sub { font-size: 13px; color: var(--ink-2); }
.appbar .spacer { flex: 1; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 18px 16px calc(28px + var(--tabbar-h)); }
.wrap.wide { max-width: none; }
@media (min-width: 900px) { .wrap { padding-bottom: 40px; } }

.page-title { font-size: 30px; font-weight: 720; letter-spacing: -.035em; margin: 4px 0 16px; }

/* ── brand lockup ───────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; box-shadow: var(--e1); flex: none; }
.brand .word { height: 19px; color: var(--ink); }
.brand .word svg { height: 100%; width: auto; fill: currentColor; }

/* ── surfaces ───────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: .5px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--e1);
  padding: 16px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-title {
  font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}

.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.cols-auto { grid-template-columns: repeat(auto-fill, minmax(min(240px,100%), 1fr)); }
@media (max-width: 820px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

/* ── buttons — the macOS control ────────────────────────────────────────── */
/* A real Aqua-lineage button is four things: a vertical gradient, a 1px inner
   top highlight, a hairline border a shade darker than the fill, and a contact
   shadow. Miss any one and it reads as a flat rectangle. */
a.btn { text-decoration: none; }
.btn, button {
  -webkit-appearance: none; appearance: none;
  font: inherit; font-weight: 560; font-size: 14.5px;
  letter-spacing: -.01em;
  min-height: 36px;
  padding: 8px 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 9px;
  border: .5px solid var(--hairline-2);
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  box-shadow: var(--e1), inset 0 1px 0 rgba(255,255,255,.06);
  color: var(--ink);
  cursor: pointer;
  transition: transform .12s var(--spring), filter .14s var(--ease), box-shadow .14s var(--ease);
  white-space: nowrap;
}
.btn:hover, button:hover:not(:disabled) { filter: brightness(1.14); }
.btn:active, button:active:not(:disabled) { transform: scale(.965); filter: brightness(.92); }
.btn:disabled, button:disabled { opacity: .38; cursor: not-allowed; }

.btn.primary, button.primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--brand-hot), var(--brand-deep));
  box-shadow: var(--e2), inset 0 1px 0 rgba(255,255,255,.28);
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.22);
}
.btn.ghost, button.ghost {
  background: transparent; box-shadow: none;
  border-color: var(--hairline);
}
.btn.plain, button.plain { background: none; border: none; box-shadow: none; padding: 6px 8px; color: var(--ink-2); }
.btn.danger, button.danger { color: var(--bad); }
.btn.sm, button.sm { min-height: 30px; padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.lg, button.lg { min-height: var(--tap); padding: 12px 22px; font-size: 16px; border-radius: 12px; }
.btn.block, button.block { width: 100%; }
.btn.icon, button.icon { width: 36px; padding: 0; }

/* ── segmented control ──────────────────────────────────────────────────── */
.seg {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2);
  border: .5px solid var(--hairline);
  border-radius: 11px;
  overflow-x: auto; scrollbar-width: none; max-width: 100%;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  min-height: 30px; padding: 5px 13px; font-size: 13.5px; font-weight: 560;
  border: none; background: none; box-shadow: none; border-radius: 8px;
  color: var(--ink-2);
}
.seg button[aria-selected="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--e1);
}

/* ── inputs ─────────────────────────────────────────────────────────────── */
input, select, textarea {
  -webkit-appearance: none; appearance: none;
  font: inherit; font-size: 16px;   /* 16px or iOS zooms the page on focus */
  width: 100%;
  min-height: var(--tap);
  padding: 10px 13px;
  border-radius: 11px;
  border: .5px solid var(--hairline-2);
  background: var(--bg);
  color: var(--ink);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.20);
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.18), 0 0 0 3.5px color-mix(in srgb, var(--brand) 26%, transparent);
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
                    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: right 16px center, right 11px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

/* ── pills & badges ─────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2.5px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 620; letter-spacing: .01em;
  background: var(--surface-2); color: var(--ink-2);
  border: .5px solid var(--hairline);
  white-space: nowrap;
}
.pill.ok    { color: var(--ok);    background: var(--ok-tint);    border-color: color-mix(in srgb, var(--ok) 34%, transparent); }
.pill.warn  { color: var(--warn);  background: var(--warn-tint);  border-color: color-mix(in srgb, var(--warn) 34%, transparent); }
.pill.bad   { color: var(--bad);   background: var(--bad-tint);   border-color: color-mix(in srgb, var(--bad) 34%, transparent); }
.pill.brand { color: var(--brand); background: var(--brand-tint); border-color: color-mix(in srgb, var(--brand) 38%, transparent); }

/* ── lists ──────────────────────────────────────────────────────────────── */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-bottom: .5px solid var(--hairline);
  min-height: var(--tap);
}
.row:last-child { border-bottom: none; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 560; }
.row .meta { font-size: 12.5px; color: var(--ink-2); }

/* ── tables ─────────────────────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-size: 11px; font-weight: 650; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-3);
  padding: 8px 10px; border-bottom: .5px solid var(--hairline); white-space: nowrap;
}
td { padding: 10px; border-bottom: .5px solid var(--hairline); }
tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* ── utility ────────────────────────────────────────────────────────────── */
.dim  { color: var(--ink-2); }
.dim2 { color: var(--ink-3); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.flex { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wrapflex { display: flex; flex-wrap: wrap; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hidden { display: none !important; }
/* Any author `display` rule outranks the UA stylesheet's `[hidden]`, so an
   element with `display: flex` stays visible when you set `hidden`. Restore
   the meaning of the attribute once, here, rather than debugging it per page. */
[hidden] { display: none !important; }
.big { font-size: 27px; font-weight: 700; letter-spacing: -.03em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 40px 18px; text-align: center; color: var(--ink-3); font-size: 14px; }

/* ── stat tile ──────────────────────────────────────────────────────────── */
.stat {
  background: var(--surface); border: .5px solid var(--hairline);
  border-radius: var(--r); padding: 13px 15px; box-shadow: var(--e1);
}
.stat .label { font-size: 11px; font-weight: 620; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.stat .value { font-size: 23px; font-weight: 700; letter-spacing: -.03em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 12px; color: var(--ink-2); margin-top: 1px; }

/* ── bottom tab bar (phone) ─────────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: var(--tabbar-h);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(22px);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: .5px solid var(--hairline);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10.5px; font-weight: 560; color: var(--ink-3);
  text-decoration: none; padding-top: 6px;
}
.tabbar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tabbar a[aria-current="page"] { color: var(--brand); }
@media (min-width: 900px) { .tabbar { display: none; } :root { --tabbar-h: 0px; } }

/* ── toast ──────────────────────────────────────────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px);
  transform: translate(-50%, 12px);
  z-index: 90; max-width: min(440px, calc(100vw - 32px));
  padding: 11px 17px; border-radius: 13px;
  background: color-mix(in srgb, var(--surface-3) 92%, transparent);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: .5px solid var(--hairline-2);
  box-shadow: var(--e3);
  font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .28s var(--spring);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── sheet / modal ──────────────────────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  display: grid; place-items: end center;
  animation: fade .2s var(--ease);
}
@media (min-width: 700px) { .scrim { place-items: center; } }
.sheet {
  width: min(520px, 100%);
  background: var(--surface);
  border: .5px solid var(--hairline);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--e3);
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  animation: rise .34s var(--spring);
  max-height: 88vh; overflow-y: auto;
}
@media (min-width: 700px) { .sheet { border-radius: var(--r-xl); animation: pop .28s var(--spring); } }
.sheet .grabber { width: 38px; height: 4px; border-radius: 2px; background: var(--hairline-2); margin: -6px auto 14px; }

@keyframes fade { from { opacity: 0 } }
@keyframes rise { from { transform: translateY(24px); opacity: .6 } }
@keyframes pop  { from { transform: scale(.96); opacity: 0 } }

/* ── skeleton ───────────────────────────────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: var(--r-sm);
  color: transparent;
}
@keyframes shimmer { to { background-position: -200% 0 } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
