/* Restaurant "banana leaf" theme. Loaded last in <head> on restaurant staff + guest pages (includes/leaf_theme.php).
   Light: chilli red + turmeric on warm cream. Dark (user choice): paper tickets on a warm charcoal rail. (Tokens keep the old --leaf names.) */

html.leaf {
  --leaf: #A3221C;
  --leaf-deep: #7F1A15;
  --leaf-tint: #FBE9E3;
  --turmeric: #E8A317;
  --turmeric-tint: #FDF2D8;
  --chilli: #B93A26;
  --chilli-tint: #FBE9E5;
  --steel: #9AA5AE;
  --ink: #2A1812;
  --ink-2: #5E4A3F;
  --line: #EBDDC4;
  --page: #FBF6EC;
  --paper: #FFFFFF;
  --leaf-font: "Atkinson Hyperlegible", "Noto Sans Tamil", system-ui, sans-serif;
}

/* Light tokens: every page's own variable names, remapped */
html.leaf:root[data-theme="light"],
html.leaf:root.light-mode {
  color-scheme: light;
  --bg: var(--page); --bg-dark: var(--page); --bg-color: var(--page); --bg-body: var(--page);
  --surface: var(--paper); --surface2: #FFFBF3; --surface3: var(--leaf-tint);
  --sf: var(--paper); --sf2: #FFFBF3; --card: var(--paper); --card-bg: var(--paper);
  --border: var(--line); --bd: var(--line); --card-border: var(--line);
  --borderFocus: rgba(163, 34, 28, .45);
  --text: var(--ink); --text-primary: var(--ink); --tx: var(--ink);
  --text2: var(--ink-2); --text-secondary: var(--ink-2); --tx2: var(--ink-2);
  --muted: #7A675B; --mu: #7A675B; --text-muted: #7A675B;
  --indigo: var(--leaf); --in: var(--leaf); --violet: var(--leaf); --accent: var(--leaf); --accent2: var(--leaf-deep);
  --accent-violet: var(--leaf); --accent-glow: rgba(163, 34, 28, .08);
  --green: #2F7D4F; --gn: #2F7D4F; --emerald: #2F7D4F; --accent-emerald: #2F7D4F;
  --amber: #B7790A; --am: #B7790A; --accent-amber: #B7790A;
  --orange: #C25E12; --or: #C25E12;
  --red: var(--chilli); --rd: var(--chilli); --rose: var(--chilli); --accent-rose: var(--chilli);
  --blue: #2C6A8A; --bl: #2C6A8A; --sky: #2C6A8A;
  --shadow: 0 1px 0 rgba(42, 24, 18, .06), 0 2px 6px rgba(42, 24, 18, .05);
  --glass: rgba(42, 24, 18, .03); --glass-line: rgba(42, 24, 18, .12); --inset: rgba(42, 24, 18, .04);
  --ok-text: #1D6B42; --warn-text: #7A4B00; --bad-text: #A3221C; --info-text: #1F4E69; --text-muted: #6B5648;
  --input-bg: #FFFFFF; --input-bg-solid: #FFFFFF; --input-border: var(--line); --input-text: var(--ink);
  --radius: 12px; --radiusSm: 8px; --r: 12px; --rs: 8px;
}

/* Dark tokens (anyone who picks dark) */
html.leaf:root[data-theme="dark"]:not(.light-mode) {
  color-scheme: dark;
  --bg: #17100C; --bg-dark: #17100C; --bg-color: #17100C; --bg-body: #17100C;
  --surface: #211812; --surface2: #2A1F18; --surface3: #33261D;
  --sf: #211812; --sf2: #2A1F18; --card: #211812; --card-bg: #211812;
  --border: rgba(246, 238, 230, .09); --bd: rgba(246, 238, 230, .09); --card-border: rgba(246, 238, 230, .09);
  --text: #F6EEE6; --text-primary: #F6EEE6; --tx: #F6EEE6;
  --text2: #BFAC9E; --text-secondary: #BFAC9E; --tx2: #BFAC9E;
  --muted: #948272; --mu: #948272; --text-muted: #948272;
  --indigo: #EF6B5C; --in: #EF6B5C; --violet: #EF6B5C; --accent: #EF6B5C; --accent2: #D4503F;
  --accent-violet: #EF6B5C; --accent-glow: rgba(239, 107, 92, .12);
  --green: #5FB383; --gn: #5FB383; --emerald: #5FB383; --accent-emerald: #5FB383;
  --amber: var(--turmeric); --am: var(--turmeric); --accent-amber: var(--turmeric);
  --red: #E0674F; --rd: #E0674F; --rose: #E0674F; --accent-rose: #E0674F;
  --glass: rgba(246, 238, 230, .05); --glass-line: rgba(246, 238, 230, .12); --inset: rgba(0, 0, 0, .28);
  --ok-text: #7BCB9B; --warn-text: #F2C14E; --bad-text: #F08A7B; --info-text: #8FC1E3; --text-muted: #A9998C;
  --input-bg: rgba(246, 238, 230, .06); --input-bg-solid: #2A1F18; --input-border: rgba(246, 238, 230, .16); --input-text: #F6EEE6;
  --radius: 12px; --radiusSm: 8px; --r: 12px; --rs: 8px;
}

html.leaf:root[data-theme="light"] body,
html.leaf:root.light-mode body { --text-primary: var(--ink); --text-secondary: var(--ink-2); --input-text: var(--ink); }

html.leaf body,
html.leaf body * {
  font-family: var(--leaf-font) !important;
}
html.leaf body { letter-spacing: 0 !important; }
html.leaf:root[data-theme="light"] body,
html.leaf:root.light-mode body {
  background: var(--page) !important;
  background-image: none !important;
  color: var(--ink) !important;
}
html.leaf:root[data-theme="dark"]:not(.light-mode) body {
  background: #17100C !important;
  background-image: none !important;
}
html.leaf .particle, html.leaf .bg-orb, html.leaf .orb, html.leaf .glow-orb { display: none !important; }

/* Sentence case everywhere: no tracked-out capital labels */
html.leaf body [class],
html.leaf body label,
html.leaf body th,
html.leaf body h1, html.leaf body h2, html.leaf body h3, html.leaf body h4, html.leaf body h5 {
  text-transform: none !important;
  letter-spacing: normal !important;
}
html.leaf .val, html.leaf .amount, html.leaf .price, html.leaf .total, html.leaf td, html.leaf .kpi-value {
  font-variant-numeric: tabular-nums;
}

/* Focus that shows */
html.leaf.no-fv a:focus, html.leaf.no-fv button:focus, html.leaf.no-fv input:focus, html.leaf.no-fv select:focus, html.leaf.no-fv textarea:focus {
  outline: 3px solid var(--turmeric) !important;
  outline-offset: 2px !important;
}
html.leaf a:focus-visible, html.leaf button:focus-visible, html.leaf input:focus-visible,
html.leaf select:focus-visible, html.leaf textarea:focus-visible, html.leaf [tabindex]:focus-visible {
  outline: 3px solid var(--turmeric) !important;
  outline-offset: 2px !important;
}

/* ---------- Shared floor nav (includes/restaurant_nav.php) ---------- */
html.leaf nav.gsmart-nav { backdrop-filter: none; }
html.leaf:root[data-theme="light"] nav.gsmart-nav {
  background: var(--paper) !important; border-bottom: 1px solid var(--line) !important; box-shadow: none;
}
html.leaf:root[data-theme="light"] nav.gsmart-nav a { color: var(--ink-2) !important; font-size: 13.5px; font-weight: 700; border: 1px solid transparent; }
html.leaf:root[data-theme="light"] nav.gsmart-nav a:hover { background: var(--leaf-tint) !important; color: var(--leaf) !important; }
html.leaf:root[data-theme="light"] nav.gsmart-nav a.active {
  background: var(--leaf) !important; color: #fff !important; border-color: var(--leaf) !important;
}
html.leaf:root[data-theme="dark"] nav.gsmart-nav { background: #1C130E !important; border-bottom-color: rgba(246, 238, 230,.08) !important; }
html.leaf:root[data-theme="dark"] nav.gsmart-nav a.active { background: rgba(239, 107, 92,.16) !important; color: #FFD6CF !important; border-color: rgba(239, 107, 92,.3) !important; }
html.leaf .theme-toggle svg, html.leaf .theme-toggle-btn svg { width: 17px; height: 17px; }
html.leaf:root[data-theme="light"] .theme-toggle,
html.leaf:root[data-theme="light"] .floor-actions-btn { background: var(--paper) !important; color: var(--ink) !important; border-color: var(--line) !important; }

/* ---------- Owner dashboard (includes/header.php + dashboard.php) ---------- */
html.leaf .navbar { backdrop-filter: none !important; box-shadow: none !important; }
html.leaf:root.light-mode .navbar { background: var(--paper) !important; border-bottom: 1px solid var(--line) !important; }
html.leaf .nav-logo-text { font-size: 18px !important; font-weight: 700 !important; letter-spacing: 0 !important; }
html.leaf .nav-logo-icon { background: none !important; box-shadow: none !important; }
html.leaf .tab-nav a,
html.leaf .tab-nav-more-btn,
html.leaf .tab-nav-menu-btn {
  font-size: 14px !important; font-weight: 700 !important; border-radius: 999px !important;
  box-shadow: none !important; background-image: none !important;
}
html.leaf:root.light-mode .tab-nav a,
html.leaf:root.light-mode .tab-nav-more-btn,
html.leaf:root.light-mode .tab-nav-menu-btn {
  background: var(--paper) !important; color: var(--ink-2) !important; border: 1px solid var(--line) !important;
}
html.leaf .tab-nav a.active,
html.leaf .tab-nav-more-btn.active {
  background: var(--leaf) !important; color: #fff !important; border-color: var(--leaf) !important;
}
html.leaf:root.light-mode .tab-nav a:not(.active):hover { border-color: var(--leaf) !important; color: var(--leaf) !important; }
html.leaf .tab-nav a .count { background: rgba(42, 24, 18,.08) !important; color: inherit !important; }
html.leaf .tab-nav a.active .count { background: rgba(255,255,255,.22) !important; }
html.leaf:root.light-mode .tab-nav-more-menu,
html.leaf:root.light-mode .tab-nav-menu-panel,
html.leaf:root.light-mode .notif-dropdown { background: var(--paper) !important; border-color: var(--line) !important; box-shadow: 0 12px 32px rgba(42, 24, 18,.12) !important; }
html.leaf:root.light-mode .card-panel,
html.leaf:root.light-mode .glass-card,
html.leaf:root.light-mode .card { box-shadow: none !important; border-color: var(--line) !important; }
html.leaf:root.light-mode footer { background: var(--paper) !important; }
html.leaf footer a { color: var(--leaf) !important; }

html.leaf .workspace-wrapper.workspace-single { grid-template-columns: minmax(0, 1fr) !important; max-width: 1280px !important; padding-top: 28px !important; }
html.leaf .workspace-wrapper::before { display: none !important; }
html.leaf .tab-nav { flex-wrap: wrap !important; max-width: none !important; }
html.leaf .tab-nav-wrap { max-width: none !important; }

/* Inline dark-mode boxes written into markup (rgba slate panels) */
html.leaf:root.light-mode [style*="rgba(31, 41, 55"], html.leaf:root.light-mode [style*="rgba(31,41,55"],
html.leaf:root.light-mode [style*="rgba(17, 24, 39"], html.leaf:root.light-mode [style*="rgba(17,24,39"],
html.leaf:root.light-mode [style*="rgba(15, 23, 42"], html.leaf:root.light-mode [style*="rgba(15,23,42"],
html.leaf:root.light-mode [style*="background:#0b0f19"], html.leaf:root.light-mode [style*="background: #0b0f19"],
html.leaf:root.light-mode [style*="background:#111827"], html.leaf:root.light-mode [style*="background: #111827"],
html.leaf:root.light-mode [style*="background:#1f2937"], html.leaf:root.light-mode [style*="background: #1f2937"],
html.leaf:root[data-theme="light"] [style*="rgba(31, 41, 55"], html.leaf:root[data-theme="light"] [style*="rgba(31,41,55"],
html.leaf:root[data-theme="light"] [style*="rgba(17, 24, 39"], html.leaf:root[data-theme="light"] [style*="rgba(17,24,39"],
html.leaf:root[data-theme="light"] [style*="rgba(15, 23, 42"], html.leaf:root[data-theme="light"] [style*="rgba(15,23,42"] {
  background: #FFFBF3 !important; color: var(--ink) !important; border-color: var(--line) !important;
}
html.leaf:root.light-mode [style*="color:#fff"]:not(button):not(.btn):not([class*="btn"]):not(a[style*="background"]),
html.leaf:root.light-mode [style*="color: #fff"]:not(button):not(.btn):not([class*="btn"]):not(a[style*="background"]),
html.leaf:root.light-mode [style*="color:white"]:not(button):not([class*="btn"]),
html.leaf:root.light-mode [style*="color: white"]:not(button):not([class*="btn"]),
html.leaf:root.light-mode [style*="color:#e2e8f0"], html.leaf:root.light-mode [style*="color: #e2e8f0"],
html.leaf:root.light-mode [style*="color:#f3f4f6"], html.leaf:root.light-mode [style*="color: #f3f4f6"] {
  color: var(--ink) !important;
}
/* Segmented sub-tabs (QR studio etc.) */
html.leaf:root.light-mode .sub-tab-btn-inactive { background: var(--paper) !important; color: var(--ink-2) !important; border: 1px solid var(--line) !important; }
html.leaf .sub-tab-btn-active, html.leaf [class*="sub-tab"].active { background: var(--leaf) !important; background-image: none !important; color: #fff !important; box-shadow: none !important; }

html.leaf:root.light-mode .qr-scope-tabs { background: var(--paper) !important; border: 1px solid var(--line) !important; box-shadow: none !important; }
html.leaf:root.light-mode .qr-scope-tabs a { color: var(--ink-2) !important; background: transparent !important; }
html.leaf .qr-scope-tabs a[aria-selected="true"] { background: var(--leaf) !important; color: #fff !important; }
html.leaf:root.light-mode [style*="rgba(0,0,0,0.2)"], html.leaf:root.light-mode [style*="rgba(0, 0, 0, 0.2)"],
html.leaf:root.light-mode [style*="rgba(0,0,0,0.3)"], html.leaf:root.light-mode [style*="rgba(0, 0, 0, 0.3)"],
html.leaf:root.light-mode [style*="rgba(0,0,0,.2)"], html.leaf:root.light-mode [style*="rgba(0,0,0,.3)"] {
  background: #FFFBF3 !important; color: var(--ink) !important;
}
html.leaf [style*="-webkit-background-clip: text"], html.leaf [style*="-webkit-background-clip:text"] {
  background: none !important; -webkit-text-fill-color: currentColor !important; color: var(--text-primary, var(--ink)) !important;
}
html.leaf:root.light-mode [style*="linear-gradient(135deg, rgba(99, 102, 241"],
html.leaf:root.light-mode [style*="linear-gradient(135deg,rgba(99,102,241"],
html.leaf:root.light-mode [style*="linear-gradient(135deg, rgba(139, 92, 246"],
html.leaf:root.light-mode [style*="linear-gradient(135deg,rgba(139,92,246"] {
  background: var(--leaf-tint) !important; box-shadow: none !important; border-color: #CFE0D5 !important;
}
html.leaf:root.light-mode [style*="box-shadow: 0 10px 30px"], html.leaf:root.light-mode [style*="box-shadow:0 10px 30px"] { box-shadow: none !important; }
html.leaf [style*="linear-gradient(135deg, var(--accent-violet)"], html.leaf [style*="linear-gradient(135deg,var(--accent-violet)"],
html.leaf [style*="linear-gradient(135deg, #8b5cf6"], html.leaf [style*="linear-gradient(135deg,#8b5cf6"],
html.leaf [style*="linear-gradient(135deg, #6366f1"], html.leaf [style*="linear-gradient(135deg,#6366f1"] {
  background: var(--leaf) !important; box-shadow: none !important; color: #fff !important;
}

/* Generic buttons that pages paint violet/indigo */
html.leaf:root[data-theme="light"] .btn-primary,
html.leaf:root[data-theme="light"] .btn-submit,
html.leaf:root[data-theme="light"] button[type="submit"]:not(.btn-d):not(.danger) {
  background: var(--leaf) !important; background-image: none !important; color: #fff !important;
  border-color: var(--leaf) !important; box-shadow: none !important;
}
html.leaf:root[data-theme="light"] .btn-primary:hover,
html.leaf:root[data-theme="light"] .btn-submit:hover { background: var(--leaf-deep) !important; }

/* Inputs */
html.leaf:root[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html.leaf:root[data-theme="light"] select,
html.leaf:root[data-theme="light"] textarea {
  background: var(--paper) !important; color: var(--ink) !important; border: 1px solid #D9C7A8 !important;
}
html.leaf:root[data-theme="light"] input:focus, html.leaf:root[data-theme="light"] select:focus, html.leaf:root[data-theme="light"] textarea:focus {
  border-color: var(--leaf) !important; box-shadow: 0 0 0 3px rgba(163, 34, 28,.14) !important;
}
html.leaf input[type="checkbox"], html.leaf input[type="radio"] { accent-color: var(--leaf); }

/* Inline violet styles left in markup */
html.leaf:root[data-theme="light"] [style*="139,92,246"], html.leaf:root[data-theme="light"] [style*="139, 92, 246"] {
  border-color: var(--line) !important;
}
html.leaf:root[data-theme="light"] [style*="color:#a78bfa"], html.leaf:root[data-theme="light"] [style*="color: #a78bfa"],
html.leaf:root[data-theme="light"] [style*="color:#c4b5fd"], html.leaf:root[data-theme="light"] [style*="color: #c4b5fd"] {
  color: var(--leaf) !important;
}

/* ---------- Kitchen: paper tickets on a rail ---------- */
html.leaf .dashboard-container { max-width: 1560px !important; padding: 24px !important; }
html.leaf #orders-deck, html.leaf .serial-list {
  display: grid !important; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px !important; align-items: start;
}
html.leaf #orders-deck > #empty-state { grid-column: 1 / -1; }
html.leaf .order-card {
  background: #FBFBF7 !important; color: var(--ink) !important; backdrop-filter: none !important;
  border: 0 !important; border-top: 10px solid var(--steel) !important; border-radius: 3px 3px 0 0 !important;
  box-shadow: 0 1px 0 rgba(0,0,0,.06) !important; padding: 16px 18px 26px !important; transform: none !important;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) bottom / 14px 10px repeat-x;
          mask: linear-gradient(#000 0 0) top / 100% calc(100% - 10px) no-repeat, conic-gradient(from 135deg at 50% 0, #000 90deg, #0000 0) bottom / 14px 10px repeat-x;
}
html.leaf .order-card.placed { border-top-color: var(--turmeric) !important; }
html.leaf .order-card.preparing { border-top-color: #3F9466 !important; }
html.leaf .order-card .card-header { border-bottom: 1.5px dashed #C9D3CC !important; }
html.leaf .order-card .table-badge {
  background: none !important; color: var(--ink) !important; padding: 0 !important; font-size: 26px !important; font-weight: 700 !important; line-height: 1.1;
}
html.leaf .order-card .order-time { color: #5B6B61 !important; font-size: 14px !important; }
html.leaf .order-card .serial-no { background: none !important; border: 2px solid var(--ink) !important; color: var(--ink) !important; }
html.leaf .order-card .status-badge { background: none !important; border: 0 !important; color: #5B6B61 !important; font-size: 14px !important; padding: 0 !important; margin-right: 40px; }
html.leaf .order-card .status-badge.placed { color: #8A5A00 !important; }
html.leaf .order-card .status-badge.preparing { color: #A3221C !important; }
html.leaf .order-card .dish-row { border-color: #E4E9E5 !important; background: none !important; }
html.leaf .order-card .dish-qty { color: var(--ink) !important; background: var(--turmeric-tint) !important; font-size: 17px !important; font-weight: 700 !important; border-radius: 6px; padding: 1px 7px; }
html.leaf .order-card .dish-name { color: var(--ink) !important; font-size: 18px !important; font-weight: 700 !important; }
html.leaf .order-card .dish-note { color: var(--chilli) !important; font-size: 14px !important; }
html.leaf .order-card [style*="color: var(--text-secondary)"] { color: #5B6B61 !important; font-size: 14px !important; }
html.leaf .btn-action { background-image: none !important; box-shadow: none !important; border-radius: 8px !important; font-size: 16px !important; font-weight: 700 !important; min-height: 48px; }
html.leaf .btn-action.start { background: var(--turmeric) !important; color: var(--ink) !important; border: 0 !important; }
html.leaf .btn-action.ready { background: var(--leaf) !important; color: #fff !important; border: 0 !important; }
html.leaf #empty-state > div:first-child:empty { display: none; }
html.leaf #fs-toggle-btn { background: #211812 !important; box-shadow: none !important; }
html.leaf:root[data-theme="light"] #fs-toggle-btn { background: var(--paper) !important; color: var(--ink) !important; border-color: var(--line) !important; }
html.leaf .chef-title { font-size: 20px !important; font-weight: 700 !important; }

/* ---------- Waiter: tables with a status edge ---------- */
html.leaf .tc {
  background: var(--sf) !important; border: 1px solid var(--bd) !important; border-left: 6px solid var(--steel) !important;
  border-radius: 10px !important; padding: 14px 14px 14px 16px !important; animation: none !important; transform: none !important; box-shadow: none !important;
}
html.leaf .tc::before { display: none !important; }
html.leaf .tc.available { border-left-color: #2F7D4F !important; }
html.leaf .tc.reserved { border-left-color: var(--steel) !important; }
html.leaf .tc.occupied { border-left-color: var(--turmeric) !important; }
html.leaf .tc.ready_toServe { border-left-color: #2C6A8A !important; }
html.leaf .tc.needs_attention { border-left-color: var(--chilli) !important; background: var(--chilli-tint) !important; }
html.leaf:root[data-theme="dark"] .tc.needs_attention { background: rgba(224,103,79,.12) !important; }
html.leaf .tc:hover { border-color: var(--leaf) !important; }
html.leaf .tc .ti { display: none !important; }
html.leaf .tc .tb { background: none !important; border: 0 !important; padding: 0 !important; font-size: 13px !important; font-weight: 700 !important; }
html.leaf .tc.available .tb { color: #2F7D4F !important; }
html.leaf .tc.occupied .tb { color: #8A5A00 !important; }
html.leaf .tc.ready_toServe .tb { color: #2C6A8A !important; }
html.leaf .tc.needs_attention .tb { color: var(--chilli) !important; }
html.leaf .sc { box-shadow: none !important; transform: none !important; }
html.leaf .sc .l { font-size: 13px !important; }
html.leaf .fl { font-size: 15px !important; color: var(--tx, var(--ink)) !important; }
html.leaf .ws-pill { font-size: 12px !important; }
html.leaf .ws-dot { animation: none !important; }
html.leaf .topbar { box-shadow: none !important; }
html.leaf .btn-logout { background: none !important; color: var(--chilli) !important; border: 1px solid currentColor !important; }
html.leaf:root[data-theme="dark"] .btn-logout { color: #E0674F !important; }
html.leaf .btn-chip { font-size: 13px !important; }

/* ---------- Guest menu (menu.php) ---------- */
html.leaf:root[data-theme="light"] .top-bar { background: var(--paper) !important; backdrop-filter: none !important; border-bottom: 1px solid var(--line) !important; }
html.leaf:root[data-theme="light"] .top-bar, html.leaf:root[data-theme="light"] .top-bar * { color: var(--ink); }
html.leaf:root[data-theme="light"] .top-bar a { color: var(--leaf) !important; }

/* ---------- Manager / cashier shared bits ---------- */
html.leaf .wrap > .tabs a { border-radius: 999px !important; font-size: 14px !important; font-weight: 700 !important; box-shadow: none !important; background-image: none !important; }
html.leaf:root[data-theme="light"] .wrap > .tabs a { background: var(--paper) !important; color: var(--ink-2) !important; border: 1px solid var(--line) !important; }
html.leaf .wrap > .tabs a.on { background: var(--leaf) !important; color: #fff !important; border-color: var(--leaf) !important; }
html.leaf .topbar strong { font-size: 18px !important; }
html.leaf .card { box-shadow: none !important; }
html.leaf .summary-card, html.leaf .tcard, html.leaf .panel { box-shadow: none !important; }
html.leaf .tcard {
  background: var(--surface) !important; border: 1px solid var(--border) !important; border-left: 6px solid var(--steel) !important;
  border-radius: 10px !important; padding: 14px 14px 14px 16px !important; animation: none !important; transform: none !important; box-shadow: none !important;
}
html.leaf .tcard::before { display: none !important; }
html.leaf .tcard.available { border-left-color: #2F7D4F !important; }
html.leaf .tcard.occupied { border-left-color: var(--turmeric) !important; }
html.leaf .tcard.ready_toServe { border-left-color: #2C6A8A !important; }
html.leaf .tcard.needs_attention { border-left-color: var(--chilli) !important; background: var(--chilli-tint) !important; }
html.leaf:root[data-theme="dark"] .tcard.needs_attention { background: rgba(224,103,79,.12) !important; }
html.leaf .tcard:hover { border-color: var(--leaf) !important; }
html.leaf .tcard-head [class*="badge"], html.leaf .tcard-head [class*="status"] {
  background: none !important; border: 0 !important; padding: 0 !important; font-size: 13px !important; font-weight: 700 !important;
}
html.leaf .wrap > .tabs { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; }
html.leaf .wrap > .tabs a { white-space: nowrap !important; flex: 0 0 auto; }
@media (min-width: 900px) { html.leaf .wrap > .tabs { flex-wrap: wrap !important; } }

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

/* Cashier summary tile: its own indigo "All tables" active state */
html.leaf:root[data-theme="light"] .summary-card.s-all.active,
html.leaf:root.light-mode .summary-card.s-all.active { background: var(--leaf-tint) !important; border-color: var(--leaf) !important; }
html.leaf:root[data-theme="light"] .summary-card.s-all.active .val,
html.leaf:root.light-mode .summary-card.s-all.active .val { color: var(--leaf) !important; }

/* ---------- Standard staff navigation ----------
   One pill language on every staff page: 13.5px/700 text, 999px radius, red active, quiet hover.
   Top-bar pages use nav.gsmart-nav (one row + More); floor pages use a single "Pages" menu. */
html.leaf nav.gsmart-nav { position: sticky; top: 0; z-index: 100; padding: 8px 20px; gap: 4px; flex-wrap: nowrap; }
html.leaf nav.gsmart-nav .nav-links { flex-wrap: nowrap; gap: 4px; min-width: 0; }
html.leaf nav.gsmart-nav a { padding: 7px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 700; }
html.leaf nav.gsmart-nav a[href="logout.php"] { color: var(--chilli) !important; border-color: transparent; }
html.leaf nav.gsmart-nav a[href="logout.php"]:hover { background: var(--chilli-tint) !important; }

.nav-go { position: relative; display: inline-block; }
.nav-go-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px;
  font: 700 13.5px/1.2 var(--leaf-font, system-ui); cursor: pointer;
  background: var(--paper, #fff); color: var(--ink, #2A1812); border: 1px solid var(--line, #EBDDC4);
}
.nav-go-btn:hover, .nav-go.open .nav-go-btn, .nav-go.has-active .nav-go-btn { border-color: var(--leaf, #A3221C); color: var(--leaf, #A3221C); }
.nav-go.has-active .nav-go-btn { background: var(--leaf, #A3221C); color: #fff; }
.nav-go-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 300; min-width: 200px; max-height: 70vh; overflow: auto;
  padding: 6px; border-radius: 12px; background: var(--paper, #fff); border: 1px solid var(--line, #EBDDC4);
  box-shadow: 0 12px 32px rgba(42, 24, 18, .16);
}
.nav-go.open .nav-go-menu { display: block; }
.nav-go-menu a {
  display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; white-space: nowrap;
  font: 700 14px/1.2 var(--leaf-font, system-ui); color: var(--ink, #2A1812) !important; background: none !important; border: 0 !important;
}
.nav-go-menu a:hover { background: var(--leaf-tint, #FBE9E3) !important; color: var(--leaf, #A3221C) !important; }
.nav-go-menu a:focus { background: var(--leaf-tint, #FBE9E3) !important; color: var(--leaf, #A3221C) !important; }
.nav-go-menu a.active { background: var(--leaf, #A3221C) !important; color: #fff !important; }
html.leaf:root[data-theme="dark"] .nav-go-btn { background: #211812; color: #F6EEE6; border-color: rgba(246, 238, 230, .16); }
html.leaf:root[data-theme="dark"] .nav-go-menu { background: #211812; border-color: rgba(246, 238, 230, .14); }
html.leaf:root[data-theme="dark"] .nav-go-menu a { color: #F6EEE6 !important; }
html.leaf:root[data-theme="dark"] .nav-go-menu a:hover { background: rgba(239, 107, 92, .16) !important; color: #FFD6CF !important; }
@media (max-width: 768px) { .topbar-right .nav-go, header .nav-go { position: static; } .nav-go-menu { right: 8px; top: calc(100% + 4px); position: absolute; } }

/* Pages still carry inline violet/indigo from the old theme: map them to the brand red */
html.leaf:root[data-theme="light"] :not(button):not(a)[style*="139,92,246"], html.leaf:root[data-theme="light"] :not(button):not(a)[style*="139, 92, 246"],
html.leaf:root[data-theme="light"] :not(button):not(a)[style*="99,102,241"], html.leaf:root[data-theme="light"] :not(button):not(a)[style*="99, 102, 241"] {
  background-image: none !important; background-color: var(--leaf-tint) !important; border-color: rgba(163, 34, 28, .3) !important; color: var(--leaf) !important;
}
html.leaf:root[data-theme="light"] :not(button):not(a)[style*="#a78bfa"], html.leaf:root[data-theme="light"] :not(button):not(a)[style*="#c4b5fd"] { color: var(--leaf) !important; }

/* Primary actions drawn with an inline gradient: one solid brand red in both themes */
html.leaf button[style*="linear-gradient(135deg"]:not(.danger):not(.btn-d) {
  background: var(--leaf) !important; background-image: none !important; color: #fff !important; border-color: var(--leaf) !important; box-shadow: none !important;
}
html.leaf:root[data-theme="dark"] button[style*="linear-gradient(135deg"]:not(.danger):not(.btn-d),
html.leaf:root[data-theme="dark"] button[type="submit"].btn-submit { background: #B3261E !important; border-color: #B3261E !important; }

/* Owner dashboard "Nav" and "More" menus: same plain-row menu as the floor pages' "Pages" menu */
html.leaf .tab-nav-menu-panel, html.leaf .tab-nav-more-menu {
  padding: 6px !important; border-radius: 12px !important; max-height: 70vh; overflow: auto;
  background: var(--paper, #fff) !important; border: 1px solid var(--line, #EBDDC4) !important; box-shadow: 0 12px 32px rgba(42, 24, 18, .16) !important;
}
html.leaf .tab-nav-menu-links { display: flex; flex-direction: column; gap: 0; }
html.leaf .tab-nav-menu-links a, html.leaf .tab-nav-more-menu a, html.leaf .tab-nav-menu-action {
  display: flex !important; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; box-sizing: border-box;
  padding: 10px 12px !important; border-radius: 8px !important; text-align: left; text-decoration: none; white-space: nowrap;
  font: 700 14px/1.2 var(--leaf-font, system-ui) !important; color: var(--ink, #2A1812) !important;
  background: none !important; background-image: none !important; border: 0 !important; box-shadow: none !important; cursor: pointer;
}
html.leaf .tab-nav-menu-links a:hover, html.leaf .tab-nav-more-menu a:hover, html.leaf .tab-nav-menu-action:hover {
  background: var(--leaf-tint, #FBE9E3) !important; color: var(--leaf, #A3221C) !important;
}
html.leaf .tab-nav-menu-links a:focus, html.leaf .tab-nav-more-menu a:focus {
  background: var(--leaf-tint, #FBE9E3) !important; color: var(--leaf, #A3221C) !important;
}
html.leaf .tab-nav-menu-links a.active, html.leaf .tab-nav-more-menu a.active {
  background: var(--leaf, #A3221C) !important; color: #fff !important;
}
html.leaf .tab-nav-menu-action { color: var(--ink-2, #5E4A3F) !important; font-weight: 600 !important; }
html.leaf .tab-nav-menu-sep { border: 0; border-top: 1px solid var(--line, #EBDDC4); margin: 4px 6px; }
html.leaf .tab-nav-menu-links a .count, html.leaf .tab-nav-more-menu a .count {
  margin-left: auto; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; font-size: 12px; background: rgba(42, 24, 18, .08) !important; color: inherit !important;
}
html.leaf .tab-nav-menu-links a.active .count, html.leaf .tab-nav-more-menu a.active .count { background: rgba(255, 255, 255, .24) !important; }
html.leaf:root[data-theme="dark"] .tab-nav-menu-panel, html.leaf:root[data-theme="dark"] .tab-nav-more-menu { background: #211812 !important; border-color: rgba(246, 238, 230, .14) !important; }
html.leaf:root[data-theme="dark"] .tab-nav-menu-links a, html.leaf:root[data-theme="dark"] .tab-nav-more-menu a, html.leaf:root[data-theme="dark"] .tab-nav-menu-action { color: #F6EEE6 !important; }
html.leaf:root[data-theme="dark"] .tab-nav-menu-links a:hover, html.leaf:root[data-theme="dark"] .tab-nav-more-menu a:hover, html.leaf:root[data-theme="dark"] .tab-nav-menu-action:hover { background: rgba(239, 107, 92, .16) !important; color: #FFD6CF !important; }
html.leaf:root[data-theme="dark"] .tab-nav-menu-links a.active, html.leaf:root[data-theme="dark"] .tab-nav-more-menu a.active { background: #B3261E !important; color: #fff !important; }
/* Camera / Gallery and other small tinted actions that kept their old blue and violet */
html.leaf:root[data-theme="light"] button[style*="139,92,246"], html.leaf:root[data-theme="light"] button[style*="59,130,246"] {
  background: var(--leaf-tint) !important; border-color: rgba(163, 34, 28, .3) !important; color: var(--leaf) !important;
}

html.leaf:root.light-mode .tab-nav-more-menu a, html.leaf:root[data-theme="light"] .tab-nav-more-menu a,
html.leaf:root.light-mode .tab-nav-menu-links a, html.leaf:root[data-theme="light"] .tab-nav-menu-links a { border: 0 !important; background-color: transparent !important; }
html.leaf:root.light-mode .tab-nav-more-menu a:hover, html.leaf:root.light-mode .tab-nav-menu-links a:hover { background-color: var(--leaf-tint) !important; }
html.leaf:root.light-mode .tab-nav-more-menu a.active, html.leaf:root.light-mode .tab-nav-menu-links a.active { background-color: var(--leaf) !important; }
html.leaf:root.light-mode .tab-nav-more-menu a.active, html.leaf:root.light-mode .tab-nav-menu-links a.active,
html.leaf:root[data-theme="light"] .tab-nav-more-menu a.active, html.leaf:root[data-theme="light"] .tab-nav-menu-links a.active { color: #fff !important; }
html.leaf:root.light-mode .tab-nav-more-menu a:hover:not(.active), html.leaf:root.light-mode .tab-nav-menu-links a:hover:not(.active) { color: var(--leaf) !important; }

/* Dark: buttons that were painted with the soft accent get the solid brand red so white text reads */
html.leaf:root[data-theme="dark"] button[style*="--accent-violet"], html.leaf:root[data-theme="dark"] button[style*="var(--accent)"],
html.leaf:root[data-theme="dark"] button[style*="--indigo"], html.leaf:root[data-theme="dark"] button[style*="--accent-emerald"] {
  background: #B3261E !important; background-image: none !important; color: #fff !important; border-color: #B3261E !important; box-shadow: none !important;
}
html.leaf:root[data-theme="dark"] button[style*="--accent-violet"] *, html.leaf:root[data-theme="dark"] button[style*="--accent-emerald"] * { color: #fff !important; }
:root[data-theme="light"] { --wa-text: #12803F; --amber-text: #7A4B00; }
:root[data-theme="dark"] { --wa-text: #25D366; --amber-text: #F2C14E; }

/* Footer credit link and links painted as gradient buttons */
html.leaf footer a { color: var(--leaf) !important; }
html.leaf:root[data-theme="dark"] footer a { color: #F2A89E !important; }
html.leaf a[style*="linear-gradient"], html.leaf a[style*="linear-gradient"] * { color: #fff !important; }
html.leaf a[style*="linear-gradient"] { background: var(--leaf) !important; background-image: none !important; box-shadow: none !important; }
html.leaf:root[data-theme="dark"] a[style*="linear-gradient"] { background: #B3261E !important; }
/* Light mode: bright status colours typed inline become the darker text tokens */
html.leaf:root[data-theme="light"] :not(button):not([style*="linear-gradient"])[style*="#34d399"],
html.leaf:root[data-theme="light"] :not(button):not([style*="linear-gradient"])[style*="#10b981"],
html.leaf:root[data-theme="light"] :not(button):not([style*="linear-gradient"])[style*="#86efac"],
html.leaf:root[data-theme="light"] :not(button):not([style*="linear-gradient"])[style*="#a7f3d0"] { color: var(--ok-text) !important; }
html.leaf:root[data-theme="light"] :not(button)[style*="color: #fbbf24"], html.leaf:root[data-theme="light"] :not(button)[style*="color:#fbbf24"],
html.leaf:root[data-theme="light"] :not(button)[style*="color: #f59e0b"], html.leaf:root[data-theme="light"] :not(button)[style*="color:#f59e0b"] { color: var(--warn-text) !important; }

/* The current tab must stand out in light mode too (the light pill rule was winning over .active) */
html.leaf:root.light-mode .tab-nav a.active, html.leaf:root[data-theme="light"] .tab-nav a.active,
html.leaf:root.light-mode .tab-nav-more-btn.active {
  background: var(--leaf) !important; background-image: none !important; color: #fff !important; border-color: var(--leaf) !important;
}
html.leaf .tab-nav a.active .wa-nav-chip { background: rgba(255, 255, 255, .24) !important; color: #fff !important; }
html.leaf .tab-nav a:not(.active) .wa-nav-chip.off { color: var(--warn-text) !important; }
/* Dark: every submit button is the same brand red (stock, recipes, etc. had their own green and blue) */
html.leaf:root[data-theme="dark"] button[type="submit"]:not(.danger):not(.btn-d):not([class*="del"]):not([style*="244,63,94"]):not([style*="244, 63, 94"]) {
  background: #B3261E !important; background-image: none !important; border-color: #B3261E !important; color: #fff !important; box-shadow: none !important;
}

/* One navigation group: the tab row on wide screens, a single menu button (named after the current page) on phones */
@media (min-width: 769px) {
  html.leaf .tab-nav-toolbar { display: none !important; }
  html.leaf .tab-nav-wrap.is-minimized .tab-nav { display: flex !important; }
}
@media (max-width: 768px) {
  html.leaf .tab-nav { display: none !important; }
  html.leaf .tab-nav-menu-action, html.leaf .tab-nav-menu-sep, html.leaf .tab-nav-current { display: none !important; }
  html.leaf .tab-nav-toolbar { margin-bottom: 14px; }
}

/* QR Studio scope tabs: the current one is filled */
html.leaf:root .qr-scope-tabs a[aria-selected="true"] { background: var(--leaf) !important; background-image: none !important; color: #fff !important; border: 1px solid var(--leaf) !important; }
html.leaf:root[data-theme="dark"] .qr-scope-tabs a[aria-selected="true"] { background: #B3261E !important; border-color: #B3261E !important; }
html.leaf:root .qr-scope-tabs a[aria-selected="false"] { color: var(--ink, #2A1812) !important; }
html.leaf:root[data-theme="dark"] .qr-scope-tabs a[aria-selected="false"] { color: #F6EEE6 !important; }
/* QR colour swatch for the dark default must stay dark in light mode */
html.leaf:root.light-mode span[onclick^="setQrColor"][style*="#0b0f19"] { background: #0b0f19 !important; }
