/* ============================================================
   BLACKBOX LMS — NEW DESIGN OVERLAY (v8.3)
   ------------------------------------------------------------
   Applies the blackbox-design system fully to the existing LMS
   markup. Loaded AFTER bridge.css so it wins the cascade.

   Relies on tokens from blackbox-design/styles/tokens.css:
   --ink-*, --signal-*, --font-display (Fraunces), --el-*, etc.
   ============================================================ */

/* ── Atmosphere — noise + radial wash on body ──────────────── */
body {
  background: var(--ink-900);
  color: var(--ink-50);
  font-family: var(--font-ui);
  position: relative;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: overlay;
  opacity: 0.5;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 1200px 600px at 15% 0%, rgba(0, 144, 255, 0.08), transparent 60%),
    radial-gradient(ellipse 800px 400px at 85% 100%, rgba(124, 92, 255, 0.06), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.app, .login-wrap, .modal-bg, .toast-stack { position: relative; z-index: 2; }

/* ── LMS .main is a vertical scroll column. The new design's .main rule
      uses display:flex (POS layout). Scope to body[data-app="lms"]
      so BlackBox's POS pages keep their flex side-by-side panels. ── */
body[data-app="lms"] .app > main.main,
body[data-app="lms"] .app > .main {
  display: block !important;
  flex: initial;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 24px clamp(16px, 3vw, 36px);
  min-width: 0;
  height: 100dvh;
  position: relative;
}
@media (max-width: 560px) {
  body[data-app="lms"] .app > .main { padding: 14px; }
}

/* ── Hero titles get Fraunces with italic accent ──────────── */
.hero h1, .login-card h1, .modal h3, .empty .ic + *,
.card-h h2,
h1, .setup-title, .page-title, .wizard-title,
[class*="hero"] h1, [class*="title"] h1, [class*="heading"] h1 {
  font-family: var(--font-display) !important;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 96, "SOFT" 50;
}
.hero h1 em, .login-card h1 em, .topbar__title em, h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--signal-300);
}
/* Don't override icon-only headings */
h1:has(svg:only-child), h1:empty { font-family: inherit !important; }

/* ── Sidebar branding upgrade ─────────────────────────────── */
.sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 8%),
    var(--ink-1000);
  border-right: 1px solid rgba(255,255,255,0.06);
}
/* Override new design's `.brand = 44x44 logo box` rule.
   In LMS, `.brand` is a wrapper with `.brand .logo` inside + name text. */
.sidebar > .brand {
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  border-radius: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  padding: 8px 8px 18px !important;
  margin-bottom: 14px !important;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-family: var(--font-ui) !important;
  font-weight: 400 !important;
  color: var(--ink-50) !important;
  font-size: var(--t-base) !important;
  letter-spacing: normal !important;
  box-shadow: none !important;
  position: relative;
  isolation: isolate;
}
.sidebar > .brand::after {
  content: none !important;  /* kill the pulse halo from earlier rule */
}
.sidebar > .brand > .logo {
  width: 38px !important;
  height: 38px !important;
  flex-shrink: 0 !important;
  background: linear-gradient(135deg, var(--signal-400), var(--signal-700)) !important;
  border-radius: 10px !important;
  display: grid !important;
  place-items: center !important;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: #fff !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    0 4px 12px -2px rgba(0,144,255,0.5),
    0 0 24px -4px rgba(0,144,255,0.4) !important;
  position: relative;
  z-index: 1;
}
.sidebar > .brand > .logo::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 13px;
  background: radial-gradient(circle, rgba(0,144,255,0.35), transparent 70%);
  z-index: -1;
  opacity: 0.5;
  animation: brand-pulse 3s ease-in-out infinite;
}
.sidebar > .brand > div:not(.logo) {
  flex: 1;
  min-width: 0;
  display: block !important;
}
.sidebar > .brand .name {
  font-size: 15px !important;
  line-height: 1.2 !important;
  font-weight: 700;
  color: var(--ink-50);
  font-family: var(--font-ui) !important;
}
.sidebar > .brand .sub {
  font-size: 9px !important;
  color: var(--ink-300);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}
/* (legacy duplicate brand rules consolidated into .sidebar > .brand block above) */
@keyframes brand-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.15); }
}

/* ── Nav items — refined active state ─────────────────────── */
.nav-item.active {
  background: linear-gradient(90deg, rgba(0,144,255,0.18), rgba(0,144,255,0.05));
  border-color: rgba(0,144,255,0.3);
  color: var(--ink-0);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -14px; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--signal-500);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px rgba(0,144,255,0.5);
}
.nav-item { position: relative; }

/* ── Primary buttons get the new electric gradient + glow ──── */
.btn-pri,
button.btn-pri {
  background: linear-gradient(180deg, var(--signal-400), var(--signal-600)) !important;
  border: 1px solid rgba(255,255,255,0.20) !important;
  color: var(--ink-0) !important;
  font-weight: 600 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    0 1px 2px rgba(0,0,0,0.4),
    0 0 0 1px rgba(0,144,255,0.4),
    0 8px 24px -8px rgba(0,144,255,0.6) !important;
  transition: all .18s cubic-bezier(0.25, 1, 0.5, 1);
}
.btn-pri:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 2px 4px rgba(0,0,0,0.4),
    0 0 0 1px rgba(0,144,255,0.5),
    0 12px 32px -8px rgba(0,144,255,0.7) !important;
}
.btn-pri:active { transform: scale(0.97); transition-duration: 80ms; }

/* Default ghost-ish buttons */
.btn:not(.btn-pri):not(.btn-danger) {
  background: var(--ink-700);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--ink-50);
  box-shadow: var(--el-1, 0 1px 2px rgba(0,0,0,0.4));
}
.btn:not(.btn-pri):not(.btn-danger):hover {
  background: var(--ink-600);
  border-color: rgba(255,255,255,0.16);
}

/* ── Cards & tiles — layered shadows ─────────────────────── */
.card, .tile {
  background: var(--ink-800) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 4px 8px -2px rgba(0,0,0,0.4),
    0 2px 4px -2px rgba(0,0,0,0.3) !important;
  border-radius: 14px !important;
}
.tile.click:hover, button.tile:hover, a.tile:hover {
  background: var(--ink-700) !important;
  border-color: rgba(0,144,255,0.4) !important;
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 12px 24px -8px rgba(0,0,0,0.5),
    0 4px 8px -4px rgba(0,0,0,0.3) !important;
}

/* Tile values — Fraunces for the big numbers */
.tile .tval {
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
  letter-spacing: -0.02em !important;
  color: var(--ink-0) !important;
  font-size: 28px !important;
  line-height: 1.1;
}

/* Force tile grid responsiveness — 4-5 cols on desktop, 2 on tablet, 1 on phone */
.tiles {
  display: grid !important;
  gap: 12px !important;
}
@media (min-width: 480px) and (max-width: 959px) {
  .tiles { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (min-width: 960px) {
  .tiles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important; }
}

/* ── Login card — premium look ───────────────────────────── */
.login-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 30%),
    var(--ink-800) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 24px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 24px 48px -16px rgba(0,0,0,0.6),
    0 8px 16px -8px rgba(0,0,0,0.4) !important;
}
.login-card .logo-big {
  background: linear-gradient(135deg, var(--signal-400), var(--signal-700)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    0 4px 12px -2px rgba(0,144,255,0.5),
    0 0 32px -4px rgba(0,144,255,0.4) !important;
}

/* ── Modals ──────────────────────────────────────────────── */
.modal {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), transparent 30%),
    var(--ink-800) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  border-radius: 20px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 24px 48px -16px rgba(0,0,0,0.6) !important;
}

/* ── Inputs ──────────────────────────────────────────────── */
.field input, .field select, .field textarea, .inp {
  background: var(--ink-900) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 10px !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus, .inp:focus {
  border-color: rgba(0,144,255,0.5) !important;
  box-shadow:
    inset 0 1px 2px rgba(0,0,0,0.3),
    0 0 0 3px rgba(0,144,255,0.10) !important;
}

/* ── Status badges — redesigned with crisp colours ──────── */
.badge.active, .badge.green {
  background: rgba(46, 207, 128, 0.15) !important;
  color: var(--state-success) !important;
  border: 1px solid rgba(46, 207, 128, 0.30) !important;
}
.badge.expired, .badge.revoked, .badge.red {
  background: rgba(255, 84, 112, 0.15) !important;
  color: var(--state-danger) !important;
  border: 1px solid rgba(255, 84, 112, 0.30) !important;
}
.badge.amber, .badge.suspended {
  background: rgba(245, 165, 36, 0.15) !important;
  color: var(--state-warning) !important;
  border: 1px solid rgba(245, 165, 36, 0.30) !important;
}
.badge.cyan, .badge.pro, .badge.enterprise {
  background: rgba(0, 144, 255, 0.15) !important;
  color: var(--signal-300) !important;
  border: 1px solid rgba(0, 144, 255, 0.30) !important;
}
.badge.purple, .badge.admin {
  background: rgba(124, 92, 255, 0.15) !important;
  color: var(--state-info) !important;
  border: 1px solid rgba(124, 92, 255, 0.30) !important;
}
.badge.gold {
  background: rgba(255, 205, 85, 0.15) !important;
  color: var(--gold, #ffcd55) !important;
  border: 1px solid rgba(255, 205, 85, 0.30) !important;
}

/* ── Hero eyebrow becomes signal-blue micro-label ────────── */
.hero .eyebrow, .login-card .lhint {
  color: var(--signal-400) !important;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 600;
}

/* ── Typography refinement on tile labels ─────────────────── */
.tile .tlabel, .info-row .k, .kv-row .k {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-300);
}

/* ── Mono code style for license IDs / TXIDs ──────────────── */
.mono-key, code, .mono {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" on, "lnum" on;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap table th {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-300);
  border-bottom: 1px solid var(--ink-700);
}
.table-wrap table td {
  border-bottom: 1px solid var(--ink-800);
  color: var(--ink-100);
}
.table-wrap table tr:hover td {
  background: rgba(255,255,255,0.02);
  color: var(--ink-50);
}

/* ── Drawer/sidebar mobile transition ─────────────────────── */
.drawer-bg.open {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}

/* ── Pricing cards — premium editorial treatment ─────────── */
#planGrid .card {
  position: relative;
  overflow: hidden;
  transition: all .25s cubic-bezier(0.25, 1, 0.5, 1);
}
#planGrid .card:hover {
  transform: translateY(-4px);
  border-color: rgba(0,144,255,0.40) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    0 24px 48px -8px rgba(0,144,255,0.15),
    0 0 0 1px rgba(0,144,255,0.2) !important;
}
#planGrid .card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,144,255,0.5), transparent);
}

/* Status pill with pulse */
.pill .dot { box-shadow: 0 0 0 3px rgba(46,207,128,0.18); }

/* ── Q-Manager dashboard tile colour rail ─────────────────── */
.tile.green::before,
.tile.red::before,
.tile.amber::before,
.tile.purple::before,
.tile.cyan::before {
  width: 3px !important;
  border-radius: 0 1px 1px 0;
}

/* ── Topbar subtle hairline ───────────────────────────────── */
.mhead {
  background: rgba(5,7,13,0.92);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mhead .mhead-brand .logo-sm {
  background: linear-gradient(135deg, var(--signal-400), var(--signal-700));
  font-family: var(--font-display);
  font-weight: 600;
}

/* ── Smooth focus rings ─────────────────────────────────── */
.btn:focus-visible, .nav-item:focus-visible, .tile:focus-visible {
  outline: 2px solid var(--signal-400);
  outline-offset: 2px;
}

/* ── Animation: subtle fade-up on cards ──────────────────── */
@keyframes qp-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.scroll > .card,
#planGrid .card {
  animation: qp-fade-up .35s cubic-bezier(0.25, 1, 0.5, 1) both;
}
.scroll > .card:nth-child(1) { animation-delay: 40ms; }
.scroll > .card:nth-child(2) { animation-delay: 80ms; }
.scroll > .card:nth-child(3) { animation-delay: 120ms; }
.scroll > .card:nth-child(4) { animation-delay: 160ms; }
#planGrid .card:nth-child(1) { animation-delay: 60ms; }
#planGrid .card:nth-child(2) { animation-delay: 120ms; }
#planGrid .card:nth-child(3) { animation-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  .scroll > .card, #planGrid .card { animation: none; }
}

/* ═══════════════════════════════════════════════════════════════
   BLACKBOX — module-specific overrides
   Apply new design treatment to all 13 page wrappers
   ═══════════════════════════════════════════════════════════════ */

/* Page wrappers — all get atmospheric padding + max-width */
.dash-wrap, .pos-layout, .kitchen-wrap, .bar-page, .deposit-page,
.staff-page, .stock-page, .delivery-wrap, .inv-page, .mgr-page,
.ws-page, .section-wrap {
  position: relative;
  z-index: 2;
}

/* Topbar — sticky header with backdrop blur + Signal Blue accent */
.topbar {
  background: rgba(10, 14, 26, 0.85) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  padding: 0 24px !important;
  height: 64px !important;
}
.topbar::after { content: none !important; }

/* Topbar title — Fraunces with italic accent */
.topbar h1, .topbar .title, .topbar .topbar-title, .topbar .app-name {
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
  letter-spacing: -0.02em !important;
  color: var(--ink-50) !important;
  font-size: 18px !important;
}

/* Topbar nav buttons */
.topbar-nav button {
  padding: 8px 14px !important;
  border-radius: 10px !important;
  font-weight: 500 !important;
  color: var(--ink-200) !important;
  transition: all .18s cubic-bezier(0.25, 1, 0.5, 1) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
}
.topbar-nav button:hover {
  background: var(--ink-700) !important;
  color: var(--ink-50) !important;
}
.topbar-nav button[aria-current="page"] {
  background: linear-gradient(135deg, rgba(0,144,255,0.15), rgba(0,144,255,0.05)) !important;
  color: var(--signal-300) !important;
  border-color: rgba(0,144,255,0.3) !important;
  box-shadow: 0 0 0 1px rgba(0,144,255,0.2),
              0 4px 12px -2px rgba(0,144,255,0.2) !important;
}

/* Bottom nav (mobile) */
.app-bottom-nav, .botnav, .botbar {
  background: rgba(10, 14, 26, 0.92) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
}
.app-bottom-nav button, .botnav button {
  color: var(--ink-300) !important;
  transition: color .15s ease !important;
}
.app-bottom-nav button[aria-current="page"], .botnav button.active {
  color: var(--signal-400) !important;
}

/* PageHero (.cc-* / .page-hero) — apply Fraunces + new tokens */
.page-hero, .cc {
  position: relative;
  z-index: 2;
}
.page-hero h1, .cc-title, .cc h1,
.cc-tile-hero .cc-tile-value,
.admin-hero-greet-title, .admin-hero-metric-value {
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
  letter-spacing: -0.02em !important;
  color: var(--ink-0) !important;
}
.page-hero .eyebrow, .cc-eyebrow,
.admin-hero-greet-eyebrow, .cc-tile-label,
.admin-hero-metric-label {
  color: var(--signal-400) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.18em !important;
}

/* PageHero feature tile (large hero metric) */
.cc-tile-hero, .admin-hero-metric {
  background: linear-gradient(135deg, var(--ink-800), var(--ink-700)) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 14px !important;
  padding: 20px !important;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 4px 8px -2px rgba(0,0,0,0.4),
    0 2px 4px -2px rgba(0,0,0,0.3) !important;
}
.cc-tile-hero::before, .admin-hero-metric::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--tile-color, var(--signal-500));
}

/* PageHero drill tiles */
.cc-tile {
  background: var(--ink-800) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 14px !important;
  padding: 16px !important;
  transition: all .18s cubic-bezier(0.25, 1, 0.5, 1) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 2px 4px rgba(0,0,0,0.3) !important;
  position: relative;
  overflow: hidden;
}
.cc-tile:hover, .cc-tile[role="button"]:hover {
  background: var(--ink-700) !important;
  border-color: rgba(0,144,255,0.4) !important;
  transform: translateY(-2px) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 12px 24px -8px rgba(0,0,0,0.5),
    0 4px 8px -4px rgba(0,0,0,0.3) !important;
}
.cc-tile-value {
  font-family: var(--font-display) !important;
  font-weight: 500 !important;
  letter-spacing: -0.02em !important;
  color: var(--ink-0) !important;
}

/* Status pills */
.cc-pill, .admin-hero-tag {
  background: rgba(0, 144, 255, 0.10) !important;
  border: 1px solid rgba(0, 144, 255, 0.25) !important;
  color: var(--signal-300) !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
}
.cc-pill.live, .admin-hero-live {
  background: rgba(46, 207, 128, 0.12) !important;
  border-color: rgba(46, 207, 128, 0.30) !important;
  color: var(--state-success) !important;
}

/* Cards across all pages */
.card, .stat-card, .glass-card,
.menu-card, .table-card, .pos-table-card, .pos-menu-card,
.delivery-platform-card, .deliveryorder-card,
.kitchen-card, .kt-card,
.kt-ticket, .kt-ticket-card,
.bar-card, .bar-seat-card,
.deposit-bill-card, .order-card,
.invoice-card, .ws-perf-card,
.staff-card, .shift-card,
.ingredient-card, .stock-card {
  background: var(--ink-800) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 14px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 4px 8px -2px rgba(0,0,0,0.4),
    0 2px 4px -2px rgba(0,0,0,0.3) !important;
}

/* Card headers */
.card-head, .card-h, .stat-card-h,
[class*="-card-head"], [class*="-header"]:not(.app-header):not(.cc-header) {
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  padding: 14px 16px !important;
}
.card-head .label, .card-h h2, .card-h h3 {
  color: var(--ink-50) !important;
  font-weight: 600 !important;
}

/* Hover states on interactive cards */
.menu-card:hover, .table-card:hover, .pos-table-card:hover,
.pos-menu-card:hover, .kt-ticket:hover, .order-card:hover,
.bar-seat-card:hover, .ingredient-card:hover, .ws-perf-card:hover {
  border-color: rgba(0, 144, 255, 0.4) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 12px 24px -8px rgba(0,0,0,0.5),
    0 0 0 1px rgba(0, 144, 255, 0.15) !important;
}

/* Buttons across the app */
.btn-p, .btn-info, .btn-pri, button.btn-p {
  background: linear-gradient(180deg, var(--signal-400), var(--signal-600)) !important;
  border: 1px solid rgba(255,255,255,0.20) !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.30),
    0 1px 2px rgba(0,0,0,0.4),
    0 0 0 1px rgba(0,144,255,0.4),
    0 8px 24px -8px rgba(0,144,255,0.6) !important;
  transition: all .18s cubic-bezier(0.25, 1, 0.5, 1);
}
.btn-p:hover, .btn-info:hover, .btn-pri:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.btn-g, .btn-ghost {
  background: var(--ink-700) !important;
  border: 1px solid rgba(255,255,255,0.10) !important;
  color: var(--ink-50) !important;
}
.btn-r, .btn-danger {
  background: linear-gradient(180deg, var(--state-danger), #c0342a) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.20) !important;
}
.btn-amber, .btn-warning {
  background: linear-gradient(180deg, var(--state-warning), #d18914) !important;
  color: #1a1100 !important;
  border: 1px solid rgba(255,255,255,0.20) !important;
}

/* Inputs */
.inp, input.inp, select.inp, textarea.inp {
  background: var(--ink-900) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 10px !important;
  color: var(--ink-50) !important;
}
.inp:focus, input.inp:focus, select.inp:focus, textarea.inp:focus {
  border-color: rgba(0,144,255,0.5) !important;
  box-shadow: 0 0 0 3px rgba(0,144,255,0.10) !important;
}

/* Tables */
.dtable, .table, table.dtable {
  background: var(--ink-800) !important;
  border-radius: 12px !important;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06) !important;
}
.dtable th, .table th {
  background: var(--ink-900) !important;
  color: var(--ink-300) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.18em !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-bottom: 1px solid rgba(255,255,255,0.08) !important;
}
.dtable td, .table td {
  border-bottom: 1px solid rgba(255,255,255,0.04) !important;
  color: var(--ink-100) !important;
}
.dtable tr:hover td, .table tr:hover td {
  background: rgba(255,255,255,0.02) !important;
  color: var(--ink-50) !important;
}

/* Kitchen ticket card — premium treatment */
.kt-ticket, .kt-card {
  border-left: 3px solid var(--signal-500) !important;
}
.kt-ticket.urgent, .kt-card.urgent {
  border-left-color: var(--state-danger) !important;
}
.kt-ticket.warning, .kt-card.warning {
  border-left-color: var(--state-warning) !important;
}

/* Login screen */
.login-wrap { padding: 24px; min-height: 100dvh; display: grid; place-items: center; }
.login-card {
  max-width: 420px;
  width: 100%;
}

/* Pop-up modals (overlays) */
.modal-overlay, .modal-ov, .modal-bg, .sheet-overlay {
  background: rgba(5, 7, 13, 0.85) !important;
  -webkit-backdrop-filter: blur(8px) saturate(140%) !important;
  backdrop-filter: blur(8px) saturate(140%) !important;
}

/* Empty state */
.empty {
  padding: 48px 20px !important;
  text-align: center;
  color: var(--ink-300) !important;
}
.empty .ic, .empty-ic {
  font-size: 36px;
  opacity: 0.4;
  margin-bottom: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   POST-AUDIT FIXES (v8.5)
   ═══════════════════════════════════════════════════════════════ */

/* Fix B11: Disabled buttons must look disabled even with !important bg */
.btn-pri:disabled, .btn-p:disabled, .btn-info:disabled,
button.btn-pri:disabled, button.btn-p:disabled, button[disabled].btn-pri,
button[disabled].btn-p, .btn:disabled {
  background: var(--ink-700) !important;
  background-image: none !important;
  filter: grayscale(0.4) !important;
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
  pointer-events: none !important;
}

/* Fix E1: Mobile — collapse sidebar < 900px */
@media (max-width: 899px) {
  .app {
    grid-template-columns: 1fr !important;
  }
  body[data-app="lms"] .sidebar {
    /* LMS uses drawer pattern via .drawer-bg + .ham — keep those */
    /* Already handled in style.css; just ensure z-index is right */
    z-index: 70;
  }
}

/* Fix E2: Topbar nav must scroll horizontally on overflow (mobile) */
.topbar-nav {
  overflow-x: auto !important;
  scrollbar-width: none;
  flex-wrap: nowrap !important;
  -ms-overflow-style: none;
}
.topbar-nav::-webkit-scrollbar { display: none; }

/* Fix B4: Bump z-index of toasts and idle overlay above body::before (z=1) */
.toast-stack, .toast { z-index: 3000 !important; }
.IdleOverlay, .idle-overlay, .screensaver { z-index: 2500 !important; position: fixed; }

/* Fix B5/B6: Replace overly-broad attribute selectors — explicit list */
.menu-card-head, .table-card-head, .order-card-head,
.kt-card-head, .stat-card-h, .glass-card-head,
.delivery-platform-card-head, .deliveryorder-card-head,
.invoice-card-head, .ws-perf-card-head, .pos-table-card-head,
.pos-menu-card-head {
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  padding: 14px 16px !important;
}

/* Fix G1: drop unsupported "SOFT" axis from Fraunces (only "opsz" exists) */
.t-display, .hero h1, .login-card h1, .modal h3, .card-h h2,
.page-hero h1, .cc-title, .cc h1,
h1, .setup-title, .page-title, .wizard-title {
  font-variation-settings: "opsz" 96 !important;
  font-optical-sizing: auto;
}

/* Fix mobile dashboard hero clipping — offset for sticky topbar */
@media (max-width: 899px) {
  .page-hero, .hero, .cc {
    margin-top: 0 !important;
    padding-top: 16px;
  }
  .page-hero h1, .hero h1 {
    font-size: clamp(20px, 5vw, 24px) !important;
    line-height: 1.2 !important;
  }
}
