/* ==========================================================================
   TRISHA Hotel POS • Shared UI System
   - Light/Dark theme variables (body.dark)
   - Layout (topbar/sidebar/content)
   - Cards, buttons, forms, tables, badges
   - Modals, pagination, utilities
   ========================================================================== */

:root {
  --font-sans: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-user: var(--font-sans);
  --font-clock: var(--font-sans);

  --bg: #f6f7fb;
  --bg-elev: rgba(255, 255, 255, 0.9);
  --panel: #ffffff;
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.7);
  --border: rgba(15, 23, 42, 0.12);

  --shadow-sm: 0 10px 30px rgba(2, 6, 23, 0.08);
  --shadow-md: 0 18px 60px rgba(2, 6, 23, 0.12);
  --shadow-lg: 0 28px 110px rgba(2, 6, 23, 0.18);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --brand-1: #6366f1;
  --brand-2: #ec4899;
  --brand-3: #06b6d4;
  --good: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;

  --grad: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  --grad-2: linear-gradient(135deg, var(--brand-1), var(--brand-3));
  --ring: 0 0 0 3px rgba(99, 102, 241, 0.22);

  --sidebar-w: 284px;
  --topbar-h: 70px;
}

body.dark {
  /* Dark theme tuned for better contrast + softer panels */
  --bg: #070b15;
  --bg-elev: rgba(15, 23, 42, 0.62);
  --panel: rgba(15, 23, 42, 0.74);
  --text: #e2e8f0;
  --muted: rgba(226, 232, 240, 0.68);
  --border: rgba(148, 163, 184, 0.18);
  --shadow-sm: 0 16px 50px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 22px 80px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 34px 130px rgba(0, 0, 0, 0.7);
  --ring: 0 0 0 3px rgba(99, 102, 241, 0.32);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 18% 10%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(900px 600px at 86% 18%, rgba(236, 72, 153, 0.14), transparent 55%),
    radial-gradient(1100px 700px at 70% 92%, rgba(6, 182, 212, 0.12), transparent 55%),
    var(--bg);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

/* ================= Sidebar ================= */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 16px;
  background: rgba(255, 255, 255, 0.72);
  border-right: 1px solid var(--border);
  box-shadow: 0 10px 60px rgba(2, 6, 23, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden auto;
}

body.dark .sidebar {
  background: rgba(2, 6, 23, 0.76);
  box-shadow: 0 14px 80px rgba(0, 0, 0, 0.55);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 14px;
}

.brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 14px 50px rgba(99, 102, 241, 0.28);
  position: relative;
  overflow: hidden;
}

.brand__logo::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.28), transparent 58%);
  transform: rotate(12deg);
  pointer-events: none;
}

.brand__logo::after {
  content: "";
  position: absolute;
  left: -18px;
  top: -18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.22), transparent 62%);
  pointer-events: none;
}

.brand__logoMark {
  position: relative;
  z-index: 1;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.brand__title {
  display: grid;
  line-height: 1.1;
}

.brand__wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.1;
}

.brand__name {
  font-weight: 600;
  letter-spacing: 0.16em;
  background: linear-gradient(135deg, #0ea5e9, #6366f1, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 18px 60px rgba(99, 102, 241, 0.18);
}

/* (Removed POS/product marker to keep brand as TRISHA only) */

.brand__tag {
  font-size: 12px;
  color: var(--muted);
}

.sidebar__section { margin-top: 14px; }
.sidebar__label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 10px 10px 6px;
}

.nav { display: grid; gap: 6px; }
.nav a {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  color: rgba(15, 23, 42, 0.86);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}
body.dark .nav a { color: rgba(226, 232, 240, 0.9); }
.nav a:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.16);
  transform: translateY(-1px);
}
.nav a.is-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(236, 72, 153, 0.12));
  border-color: rgba(99, 102, 241, 0.22);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.14);
}
.nav__icon {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
body.dark .nav__icon {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
.nav__badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(6, 182, 212, 0.18);
  color: rgba(2, 6, 23, 0.82);
}
body.dark .nav__badge { color: rgba(226, 232, 240, 0.88); }

/* ================= Main ================= */
.app-main {
  min-width: 0;
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
body.dark .topbar { background: rgba(2, 6, 23, 0.68); border-bottom-color: rgba(148, 163, 184, 0.14); }
.topbar__left { display: flex; align-items: center; gap: 10px; }
.topbar__left, .topbar__right, .page-title { min-width: 0; }
.hamburger {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  cursor: pointer;
  display: none;
  box-shadow: var(--shadow-sm);
}
body.dark .hamburger { background: rgba(30, 41, 59, 0.35); }
.hamburger:focus-visible { outline: none; box-shadow: var(--ring); }
.page-title { display: grid; line-height: 1.15; }
.page-title strong { font-size: 14px; font-weight: 800; }
.page-title span { font-size: 12px; color: var(--muted); }
.topbar__right { display: flex; align-items: center; gap: 10px; position: relative; }
.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
body.dark .theme-toggle { background: rgba(30, 41, 59, 0.35); }
.theme-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.theme-toggle:empty::before {
  content: "🌙";
  display: inline-block;
  font-size: 16px;
  line-height: 1;
}
body.dark .theme-toggle:empty::before { content: "☀️"; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
body.dark .user-chip { background: rgba(30, 41, 59, 0.35); }
.user-chip:hover { filter: brightness(1.02); transform: translateY(-1px); }
.user-chip:active { transform: translateY(0); }
.user-chip:focus-visible { outline: none; box-shadow: var(--ring); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--grad-2);
}
.user-chip__meta { display: grid; line-height: 1.15; min-width: 0; }
.user-chip__meta strong {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.user-chip__meta span { font-size: 11px; color: var(--muted); }

.btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease, background 140ms ease, border-color 140ms ease;
  box-shadow: var(--shadow-sm);
}
body.dark .btn {
  background: rgba(15, 23, 42, 0.56);
  border-color: rgba(148, 163, 184, 0.20);
}
body.dark .btn:hover { background: rgba(15, 23, 42, 0.66); }
.btn:hover { transform: translateY(-1px); filter: brightness(1.02); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn--primary {
  border-color: rgba(99, 102, 241, 0.25);
  background: var(--grad);
  color: #fff;
}
.btn--danger {
  border-color: rgba(239, 68, 68, 0.25);
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
}
.btn--ghost { background: transparent; box-shadow: none; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.content { padding: 18px; min-width: 0; }
.grid { display: grid; gap: 14px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 16px;
  min-width: 0;
}
body.dark .card { background: rgba(15, 23, 42, 0.50); border-color: rgba(148, 163, 184, 0.18); }
.card__title { margin: 0 0 10px; font-size: 14px; font-weight: 800; letter-spacing: 0.2px; }
.card__sub { margin: 0; color: var(--muted); font-size: 12px; }

.stat { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stat__value { font-size: 26px; font-weight: 900; letter-spacing: 0.2px; }
.stat__meta { color: var(--muted); font-size: 12px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: rgba(99, 102, 241, 0.12);
  color: rgba(15, 23, 42, 0.86);
  font-size: 12px;
  white-space: nowrap;
}
body.dark .pill { color: rgba(226, 232, 240, 0.9); }
.pill--good { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.24); }
.pill--warn { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.24); }
.pill--bad  { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.24); }

/* ================= Forms ================= */
.form-row {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  min-width: 0;
}

/* Page-specific: center Orders filters within the card */
#orderFilterForm {
  width: 100%;
  margin-inline: auto;
  /* Keep original input sizing, but center the grid */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  align-items: end;
}

#orderFilterForm .field { flex: 0 0 240px; }
#orderFilterForm .actions { flex: 0 0 100%; justify-content: center; }

/* Page-specific: make Reports filters medium + centered */
#reportFilterForm.is-centered {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  align-items: end;
}
#reportFilterForm.is-centered .field { flex: 0 0 240px; }
#reportFilterForm.is-centered .actions { flex: 0 0 100%; }
#reportFilterForm.is-centered .actions { justify-content: center; }
.col-12 { grid-column: span 12; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }

.field { min-width: 0; }
.field label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
body.dark .field input, body.dark .field select, body.dark .field textarea {
  background: rgba(2, 6, 23, 0.46);
  border-color: rgba(148, 163, 184, 0.18);
}

/* Date picker icon visibility in dark theme (Chrome/Edge/WebKit) */
body.dark input[type="date"] { color-scheme: dark; }

/* Chromium/WebKit: ensure native calendar icon is visible on dark backgrounds */
@supports selector(input::-webkit-calendar-picker-indicator) {
  body.dark input[type="date"]::-webkit-calendar-picker-indicator,
  body.dark .field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1) saturate(0) brightness(1.9) contrast(1.25) !important;
    opacity: 1 !important;
  }
  body.dark input[type="date"]::-webkit-clear-button { filter: invert(1) opacity(0.9) !important; }
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  box-shadow: var(--ring);
  border-color: rgba(99, 102, 241, 0.35);
}
.field .hint { margin-top: 6px; font-size: 11px; color: var(--muted); }

/* ================= Ultra Premium Checkbox ================= */
.premium-check { display: flex; align-items: center; }
.field label.premium-check__label {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  user-select: none;
  width: 100%;
  min-height: 42px;
  margin: 0;
}
body.dark .field label.premium-check__label {
  background: rgba(2, 6, 23, 0.46);
  border-color: rgba(148, 163, 184, 0.18);
}
.premium-check__label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.premium-check__box {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.10);
  box-shadow: 0 8px 18px rgba(99, 102, 241, 0.14);
  display: grid;
  place-items: center;
  flex: 0 0 18px;
}
.premium-check__box::after {
  content: "✓";
  font-size: 12px;
  font-weight: 900;
  color: transparent;
  transform: scale(0.7);
  transition: transform 120ms ease, color 120ms ease;
}
.premium-check__label:has(input[type="checkbox"]:checked) .premium-check__box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(236, 72, 153, 0.65));
  border-color: rgba(99, 102, 241, 0.65);
}
.premium-check__label:has(input[type="checkbox"]:checked) .premium-check__box::after {
  color: #fff;
  transform: scale(1);
}
.premium-check__text {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.premium-check__label:focus-within { box-shadow: var(--ring); border-color: rgba(99, 102, 241, 0.35); }

/* ================= Ultra Premium Select ================= */
.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(15, 23, 42, 0.55) 50%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.55) 50%, transparent 50%),
    linear-gradient(135deg, rgba(99, 102, 241, 0.10), rgba(236, 72, 153, 0.06));
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
  transition: filter 140ms ease, transform 140ms ease, border-color 140ms ease;
}
body.dark .field select {
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(226, 232, 240, 0.72) 50%),
    linear-gradient(135deg, rgba(226, 232, 240, 0.72) 50%, transparent 50%),
    linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(6, 182, 212, 0.10));
}
.field select:hover { filter: brightness(1.02); transform: translateY(-1px); }
.field select:active { transform: translateY(0); }

/* ================= Custom Dropdown (Login-style) =================
   Applied to all <select> via js/common.js enhancer.
   Keeps native select for forms, but uses premium trigger + list UI.
*/
.trisha-select { position: relative; }
.trisha-select select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.trisha-select {
  --sel-accent: #6366f1;
  --sel-accent-rgb: 99, 102, 241;
  --sel-accent2: #ec4899;
  --sel-accent2-rgb: 236, 72, 153;
}

/* Value-based accents (extend as needed) */
.trisha-select[data-value="active"] { --sel-accent: #22c55e; --sel-accent-rgb: 34, 197, 94; --sel-accent2: #06b6d4; --sel-accent2-rgb: 6, 182, 212; }
.trisha-select[data-value="inactive"] { --sel-accent: #ef4444; --sel-accent-rgb: 239, 68, 68; --sel-accent2: #f97316; --sel-accent2-rgb: 249, 115, 22; }
.trisha-select[data-value="new"] { --sel-accent: #06b6d4; --sel-accent-rgb: 6, 182, 212; --sel-accent2: #6366f1; --sel-accent2-rgb: 99, 102, 241; }
.trisha-select[data-value="running"] { --sel-accent: #f59e0b; --sel-accent-rgb: 245, 158, 11; --sel-accent2: #ec4899; --sel-accent2-rgb: 236, 72, 153; }
.trisha-select[data-value="served"] { --sel-accent: #22c55e; --sel-accent-rgb: 34, 197, 94; --sel-accent2: #06b6d4; --sel-accent2-rgb: 6, 182, 212; }
.trisha-select[data-value="billed"] { --sel-accent: #6366f1; --sel-accent-rgb: 99, 102, 241; --sel-accent2: #ec4899; --sel-accent2-rgb: 236, 72, 153; }
.trisha-select[data-value="cancelled"] { --sel-accent: #ef4444; --sel-accent-rgb: 239, 68, 68; --sel-accent2: #f97316; --sel-accent2-rgb: 249, 115, 22; }
.trisha-select[data-value="veg"] { --sel-accent: #22c55e; --sel-accent-rgb: 34, 197, 94; --sel-accent2: #06b6d4; --sel-accent2-rgb: 6, 182, 212; }
.trisha-select[data-value="non_veg"] { --sel-accent: #ef4444; --sel-accent-rgb: 239, 68, 68; --sel-accent2: #f97316; --sel-accent2-rgb: 249, 115, 22; }
.trisha-select[data-value="nonveg"] { --sel-accent: #ef4444; --sel-accent-rgb: 239, 68, 68; --sel-accent2: #f97316; --sel-accent2-rgb: 249, 115, 22; }
.trisha-select[data-value="non-veg"] { --sel-accent: #ef4444; --sel-accent-rgb: 239, 68, 68; --sel-accent2: #f97316; --sel-accent2-rgb: 249, 115, 22; }
.trisha-select[data-value="non veg"] { --sel-accent: #ef4444; --sel-accent-rgb: 239, 68, 68; --sel-accent2: #f97316; --sel-accent2-rgb: 249, 115, 22; }
.trisha-select[data-value="available"] { --sel-accent: #22c55e; --sel-accent-rgb: 34, 197, 94; --sel-accent2: #06b6d4; --sel-accent2-rgb: 6, 182, 212; }
.trisha-select[data-value="occupied"] { --sel-accent: #ef4444; --sel-accent-rgb: 239, 68, 68; --sel-accent2: #f97316; --sel-accent2-rgb: 249, 115, 22; }
.trisha-select[data-value="reserved"] { --sel-accent: #f59e0b; --sel-accent-rgb: 245, 158, 11; --sel-accent2: #ec4899; --sel-accent2-rgb: 236, 72, 153; }
.trisha-select[data-value="payment"] { --sel-accent: #6366f1; --sel-accent-rgb: 99, 102, 241; --sel-accent2: #06b6d4; --sel-accent2-rgb: 6, 182, 212; }
.trisha-select[data-value="blocked"] { --sel-accent: #64748b; --sel-accent-rgb: 100, 116, 139; --sel-accent2: #334155; --sel-accent2-rgb: 51, 65, 85; }

/* Role-based accents (match login role dropdown theme) */
.trisha-select[data-value="admin"] { --sel-accent: #6366f1; --sel-accent-rgb: 99, 102, 241; --sel-accent2: #ec4899; --sel-accent2-rgb: 236, 72, 153; }
.trisha-select[data-value="captain"] { --sel-accent: #06b6d4; --sel-accent-rgb: 6, 182, 212; --sel-accent2: #22c55e; --sel-accent2-rgb: 34, 197, 94; }
.trisha-select[data-value="waiter"] { --sel-accent: #ec4899; --sel-accent-rgb: 236, 72, 153; --sel-accent2: #fb7185; --sel-accent2-rgb: 251, 113, 133; }
.trisha-select[data-value="kitchen"] { --sel-accent: #f97316; --sel-accent-rgb: 249, 115, 22; --sel-accent2: #ef4444; --sel-accent2-rgb: 239, 68, 68; }
.trisha-select[data-value="cashier"] { --sel-accent: #22c55e; --sel-accent-rgb: 34, 197, 94; --sel-accent2: #06b6d4; --sel-accent2-rgb: 6, 182, 212; }
.trisha-select[data-value="accountant"] { --sel-accent: #6366f1; --sel-accent-rgb: 99, 102, 241; --sel-accent2: #22c55e; --sel-accent2-rgb: 34, 197, 94; }
.trisha-select[data-value="manager"] { --sel-accent: #0ea5e9; --sel-accent-rgb: 14, 165, 233; --sel-accent2: #f59e0b; --sel-accent2-rgb: 245, 158, 11; }

.trisha-trigger {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid transparent;
  outline: none;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, transform 180ms ease, filter 180ms ease, background 180ms ease;
}
body.dark .trisha-trigger {
  background: rgba(2, 6, 23, 0.46);
  border-color: rgba(148, 163, 184, 0.18);
}
.trisha-trigger:hover { border-color: rgba(var(--sel-accent2-rgb), 0.55); filter: brightness(1.02); transform: translateY(-1px); }
.trisha-trigger:active { transform: translateY(0); }
.trisha-trigger:focus-visible { box-shadow: var(--ring); }

.trisha-trigger::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  flex: 0 0 8px;
  border-right: 2px solid var(--sel-accent);
  border-bottom: 2px solid var(--sel-accent);
  transform: rotate(45deg);
  opacity: 0.95;
  transition: transform 0.2s ease;
}

.trisha-select.is-open .trisha-trigger {
  border-color: var(--sel-accent);
  background-color: rgba(var(--sel-accent-rgb), 0.10);
  box-shadow: 0 0 0 3px rgba(var(--sel-accent-rgb), 0.18), var(--shadow-sm);
}
.trisha-select.is-open .trisha-trigger::after { transform: rotate(-135deg); }

.trisha-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 16px;
  z-index: 70;
  max-height: 260px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  isolation: isolate;
  background-clip: padding-box;
}
body.dark .trisha-list {
  background: rgba(2, 6, 23, 0.94);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.60);
}
.trisha-list.is-hidden { display: none; }
.trisha-select.is-up .trisha-list { top: auto; bottom: calc(100% + 10px); }

/* ================= Role Dropdown (Login-style) ================= */
.role-dropdown { position: relative; }
.role-dropdown {
  --role-accent: #6366f1;
  --role-accent-rgb: 99, 102, 241;
  --role-accent2: #ec4899;
  --role-accent2-rgb: 236, 72, 153;
}
.role-dropdown[data-role="admin"] { --role-accent: #f59e0b; --role-accent-rgb: 245, 158, 11; --role-accent2: #a855f7; --role-accent2-rgb: 168, 85, 247; }
.role-dropdown[data-role="captain"] { --role-accent: #06b6d4; --role-accent-rgb: 6, 182, 212; --role-accent2: #6366f1; --role-accent2-rgb: 99, 102, 241; }
.role-dropdown[data-role="waiter"] { --role-accent: #ec4899; --role-accent-rgb: 236, 72, 153; --role-accent2: #fb7185; --role-accent2-rgb: 251, 113, 133; }
.role-dropdown[data-role="kitchen"] { --role-accent: #f97316; --role-accent-rgb: 249, 115, 22; --role-accent2: #ef4444; --role-accent2-rgb: 239, 68, 68; }
.role-dropdown[data-role="cashier"] { --role-accent: #22c55e; --role-accent-rgb: 34, 197, 94; --role-accent2: #06b6d4; --role-accent2-rgb: 6, 182, 212; }
.role-dropdown[data-role="accountant"] { --role-accent: #6366f1; --role-accent-rgb: 99, 102, 241; --role-accent2: #22c55e; --role-accent2-rgb: 34, 197, 94; }
.role-dropdown[data-role="manager"] { --role-accent: #0ea5e9; --role-accent-rgb: 14, 165, 233; --role-accent2: #f59e0b; --role-accent2-rgb: 245, 158, 11; }

.role-dropdown select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.role-trigger {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid transparent;
  outline: none;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms ease, transform 180ms ease, filter 180ms ease, background 180ms ease;
}
body.dark .role-trigger { background: rgba(2, 6, 23, 0.46); border-color: rgba(148, 163, 184, 0.18); }
.role-trigger:hover { border-color: rgba(var(--role-accent2-rgb), 0.55); filter: brightness(1.02); transform: translateY(-1px); }
.role-trigger:active { transform: translateY(0); }
.role-trigger:focus-visible { box-shadow: var(--ring); }

.role-trigger::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  flex: 0 0 8px;
  border-right: 2px solid var(--role-accent);
  border-bottom: 2px solid var(--role-accent);
  transform: rotate(45deg);
  opacity: 0.95;
  transition: transform 0.2s ease;
}

.role-dropdown.is-open .role-trigger {
  border-color: var(--role-accent);
  background-color: rgba(var(--role-accent-rgb), 0.10);
  box-shadow: 0 0 0 3px rgba(var(--role-accent-rgb), 0.18), var(--shadow-sm);
}
.role-dropdown.is-open .role-trigger::after { transform: rotate(-135deg); }

.role-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 16px;
  z-index: 80;
  max-height: 260px;
  overflow: auto;
  overflow-x: hidden;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  isolation: isolate;
  background-clip: padding-box;
}
body.dark .role-list {
  background: rgba(2, 6, 23, 0.94);
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.60);
}
.role-list[data-portaled="1"] {
  left: auto;
  right: auto;
}
.role-list.is-hidden { display: none; }
.role-dropdown.is-up .role-list { top: auto; bottom: calc(100% + 10px); }

.role-option {
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
body:not(.dark) .role-option { color: #0f172a; }
.role-option:hover { background: rgba(var(--role-accent-rgb), 0.18); }
body.dark .role-option:hover { background: rgba(var(--role-accent-rgb), 0.22); }
.role-option:active { transform: scale(0.99); }
.role-option.is-selected {
  background: linear-gradient(135deg, rgba(var(--role-accent-rgb), 0.22), rgba(var(--role-accent2-rgb), 0.18));
  border: 1px solid rgba(var(--role-accent-rgb), 0.25);
}

.trisha-option {
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
body:not(.dark) .trisha-option { color: #0f172a; }
body.dark .trisha-option { color: rgba(226, 232, 240, 0.92); }
.trisha-option:hover { background: rgba(var(--sel-accent-rgb), 0.14); }
body.dark .trisha-option:hover { background: rgba(var(--sel-accent-rgb), 0.18); }
.trisha-option:active { transform: scale(0.99); }
.trisha-option.is-selected {
  background: linear-gradient(135deg, rgba(var(--sel-accent-rgb), 0.22), rgba(var(--sel-accent2-rgb), 0.18));
  border: 1px solid rgba(var(--sel-accent-rgb), 0.25);
}
body.dark .trisha-option.is-selected {
  background: linear-gradient(135deg, rgba(var(--sel-accent-rgb), 0.26), rgba(var(--sel-accent2-rgb), 0.20));
  border-color: rgba(var(--sel-accent-rgb), 0.32);
}

.actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }

/* ================= Tables ================= */
.table-wrap {
  overflow: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow-md);
}
body.dark .table-wrap { background: rgba(15, 23, 42, 0.44); border-color: rgba(148, 163, 184, 0.16); }

/* Hide scrollbars by default (show on hover) */
.table-wrap { scrollbar-width: none; }
.table-wrap::-webkit-scrollbar { width: 0; height: 0; }
.table-wrap:hover { scrollbar-width: thin; }
.table-wrap:hover::-webkit-scrollbar { width: 10px; height: 10px; }
.table-wrap:hover { scrollbar-color: rgba(99, 102, 241, 0.35) transparent; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(99, 102, 241, 0.35));
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 16px rgba(15, 23, 42, 0.18);
}
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(99, 102, 241, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 10px 22px rgba(15, 23, 42, 0.22);
}
body.dark .table-wrap:hover { scrollbar-color: rgba(129, 140, 248, 0.35) transparent; }
body.dark .table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.22), rgba(129, 140, 248, 0.22));
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 1px 0 rgba(226, 232, 240, 0.18), 0 8px 18px rgba(0, 0, 0, 0.28);
}

/* ================= Premium scrollbars (global) ================= */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
}
body.dark html { scrollbar-color: rgba(129, 140, 248, 0.35) transparent; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(99, 102, 241, 0.35));
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 16px rgba(15, 23, 42, 0.18);
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(99, 102, 241, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 10px 22px rgba(15, 23, 42, 0.22);
}
body.dark *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(226, 232, 240, 0.22), rgba(129, 140, 248, 0.22));
  border-color: rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 1px 0 rgba(226, 232, 240, 0.18), 0 8px 18px rgba(0, 0, 0, 0.28);
}

table { width: 100%; border-collapse: collapse; }
.table-wrap table { min-width: 720px; }
th, td { padding: 12px 12px; border-bottom: 1px solid rgba(15, 23, 42, 0.08); text-align: left; vertical-align: top; }
body.dark th, body.dark td { border-bottom-color: rgba(255, 255, 255, 0.08); }
th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.02);
}
body.dark th { background: rgba(255, 255, 255, 0.03); }
tr:hover td { background: rgba(99, 102, 241, 0.04); }
body.dark tr:hover td { background: rgba(99, 102, 241, 0.06); }

/* Customer premium row visuals live in css/customer.css */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
}
body.dark .badge { background: rgba(2, 6, 23, 0.25); }
.badge--good { border-color: rgba(34, 197, 94, 0.3); background: rgba(34, 197, 94, 0.12); }
.badge--warn { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.12); }
.badge--bad  { border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.12); }
.badge--info { border-color: rgba(6, 182, 212, 0.3); background: rgba(6, 182, 212, 0.12); }

/* Menu item type badges (global) */
.badge.veg { border-color: rgba(34, 197, 94, 0.25); background: rgba(34, 197, 94, 0.12); }
.badge.nonveg,
.badge.non_veg,
.badge.non-veg { border-color: rgba(239, 68, 68, 0.25); background: rgba(239, 68, 68, 0.12); }

.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-xs { padding: 7px 10px; border-radius: 12px; font-size: 12px; box-shadow: var(--shadow-sm); }

/* Responsive stacked table */
@media (max-width: 720px) {
  /* Ensure any plain table never overflows the viewport on mobile */
  table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table:not(.table--stack) { display: table; overflow: visible; }
  /* Stacked tables should not keep desktop min-width (removes horizontal empty space) */
  .table-wrap table.table--stack { min-width: 0; }
  table.table--stack thead { display: none; }
  table.table--stack, table.table--stack tbody, table.table--stack tr, table.table--stack td { display: block; width: 100%; }
  table.table--stack tr { border-bottom: 1px solid rgba(15, 23, 42, 0.08); padding: 10px 10px; }
  body.dark table.table--stack tr { border-bottom-color: rgba(255, 255, 255, 0.08); }
  table.table--stack td {
    border: none;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
    overflow-wrap: anywhere;
  }
  table.table--stack td::before {
    content: attr(data-label);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    min-width: 110px;
  }
}

/* ================= Pagination ================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
}
.pagination__meta { color: var(--muted); font-size: 12px; }
.pagination__controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pagination__controls .btn { padding: 8px 12px; border-radius: 12px; }
.page-size { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.page-size select {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
}
body.dark .page-size select { background: rgba(2, 6, 23, 0.35); color: var(--text); }
.page-size .trisha-trigger {
  width: 120px;
  padding: 8px 12px;
  border-radius: 12px;
}

/* ================= Modal ================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  /* Avoid modals going off-screen on mobile: top-align + allow scroll */
  place-items: center;
  overflow-x: hidden;
  overflow-y: auto;
  height: 100vh;
  height: 100dvh;
  padding:
    calc(16px + env(safe-area-inset-top))
    16px
    calc(16px + env(safe-area-inset-bottom));
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
body.dark .modal { background: rgba(2, 6, 23, 0.7); }
.modal.is-hidden { display: none; }
.modal__panel {
  width: 760px;
  max-width: 100%;
  /* Prevent modal content from going off-screen on small devices */
  max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
body.dark .modal__panel { background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(2, 6, 23, 0.86)); }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  flex: 0 0 auto;
}
body.dark .modal__header { border-bottom-color: rgba(255, 255, 255, 0.08); }
.modal__header h3 { margin: 0; font-size: 14px; font-weight: 800; }
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { background: rgba(99, 102, 241, 0.08); }
.modal__body {
  padding: 14px 16px;
  overflow: auto;
  overflow-x: hidden;
  min-height: 0; /* allow flex child to shrink for scrolling */
  flex: 1 1 auto;
}
.modal__footer { padding: 14px 16px; border-top: 1px solid rgba(15, 23, 42, 0.08); flex: 0 0 auto; }
body.dark .modal__footer { border-top-color: rgba(255, 255, 255, 0.08); }

/* ================= Portion picker (ultra premium) ================= */
@keyframes portionOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes portionPanelIn {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(0.985); filter: blur(6px); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0px); }
}
@keyframes portionContentIn {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.modal.modal--portion {
  background:
    radial-gradient(900px 480px at 50% 0%, rgba(99, 102, 241, 0.22), rgba(15, 23, 42, 0) 60%),
    radial-gradient(900px 480px at 50% 100%, rgba(16, 185, 129, 0.14), rgba(15, 23, 42, 0) 60%),
    rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  animation: portionOverlayIn 180ms ease-out both;
}
body.dark .modal.modal--portion {
  background:
    radial-gradient(900px 480px at 50% 0%, rgba(99, 102, 241, 0.18), rgba(2, 6, 23, 0) 60%),
    radial-gradient(900px 480px at 50% 100%, rgba(16, 185, 129, 0.10), rgba(2, 6, 23, 0) 60%),
    rgba(2, 6, 23, 0.72);
}

.modal__panel.modal__panel--portion {
  width: 620px;
  border-radius: 22px;
  border: 1px solid rgba(99, 102, 241, 0.18);
  box-shadow:
    0 20px 60px rgba(15, 23, 42, 0.22),
    0 8px 20px rgba(15, 23, 42, 0.12);
  animation: portionPanelIn 260ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
  will-change: transform, opacity, filter;
}
body.dark .modal__panel.modal__panel--portion {
  border-color: rgba(99, 102, 241, 0.18);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.45),
    0 10px 24px rgba(0, 0, 0, 0.25);
}
.modal.modal--portion .modal__body { animation: portionContentIn 300ms ease-out 70ms both; }

.portion-picker { display: grid; gap: 14px; }
.portion-picker__top {
  padding: 14px 14px 4px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.10), rgba(99, 102, 241, 0.03));
  border: 1px solid rgba(99, 102, 241, 0.14);
}
body.dark .portion-picker__top {
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.14), rgba(2, 6, 23, 0.0));
  border-color: rgba(99, 102, 241, 0.18);
}
.portion-picker__kicker { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.portion-picker__title { margin-top: 6px; font-size: 16px; font-weight: 900; }
.portion-picker__hint { margin-top: 6px; font-size: 12px; }

.portion-picker__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 520px) {
  .portion-picker__grid { grid-template-columns: 1fr; }
}

.btn.portion-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.10);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74));
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition:
    transform 160ms cubic-bezier(0.2, 0.9, 0.2, 1),
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    filter 180ms ease;
  will-change: transform;
}
body.dark .btn.portion-option {
  border-color: rgba(255, 255, 255, 0.10);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.62), rgba(2, 6, 23, 0.55));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}
.btn.portion-option:hover {
  transform: translate3d(0, -1px, 0);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
  filter: saturate(1.02);
}
.btn.portion-option:active { transform: translate3d(0, 0, 0) scale(0.99); }

.btn.portion-option.portion-option--selected {
  border-color: rgba(99, 102, 241, 0.55);
  background:
    radial-gradient(600px 120px at 50% 0%, rgba(99, 102, 241, 0.18), rgba(99, 102, 241, 0.0) 60%),
    linear-gradient(180deg, rgba(99, 102, 241, 0.10), rgba(255, 255, 255, 0.82));
  box-shadow:
    0 18px 44px rgba(99, 102, 241, 0.18),
    0 10px 24px rgba(15, 23, 42, 0.10);
}
body.dark .btn.portion-option.portion-option--selected {
  background:
    radial-gradient(600px 120px at 50% 0%, rgba(99, 102, 241, 0.20), rgba(2, 6, 23, 0.0) 60%),
    linear-gradient(180deg, rgba(99, 102, 241, 0.12), rgba(2, 6, 23, 0.52));
  box-shadow:
    0 18px 44px rgba(99, 102, 241, 0.18),
    0 10px 24px rgba(0, 0, 0, 0.30);
}

@media (max-width: 520px) {
  .modal {
    padding:
      calc(10px + env(safe-area-inset-top))
      10px
      calc(10px + env(safe-area-inset-bottom));
  }
  .modal__panel {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 20px;
  }
  .modal__panel.modal__panel--portion {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 20px;
  }
  .modal__body { padding: 12px 12px; }
  .modal__footer { padding: 12px 12px; }
}

/* ================= Utilities ================= */
.muted { color: var(--muted); }
.hidden { display: none !important; }
.hr { height: 1px; background: rgba(15, 23, 42, 0.08); margin: 12px 0; }
body.dark .hr { background: rgba(255, 255, 255, 0.08); }
.empty-state {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.07);
  color: var(--muted);
}

/* ================= Mobile sidebar ================= */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
}
body.dark .sidebar-overlay { background: rgba(2, 6, 23, 0.65); }
.sidebar-overlay.is-show { display: block; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .hamburger { display: inline-grid; place-items: center; }
  .sidebar {
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform 220ms ease;
    width: min(var(--sidebar-w), 90vw);
  }
  .sidebar.is-open { transform: translateX(0); }
}
@media (max-width: 920px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .content { padding: 14px; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .col-6, .col-4, .col-3 { grid-column: span 12; }
  .user-chip__meta strong { max-width: 120px; }
  .page-title span { display: none; }
  .page-title strong { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .actions { justify-content: stretch; }
  .actions .btn { flex: 1 1 auto; }
  .pagination { flex-direction: column; align-items: stretch; }
  .pagination__controls { justify-content: space-between; width: 100%; }
}
