/*
  Shemify App Styles — Tesla/iOS Grade
  ==========================================
  Production class names from index.html.
  All styles target the real HTML structure.
*/

/* ═══════════════════════════════════════════
   APP VIEW STATES
   ═══════════════════════════════════════════ */
body[data-app-view="auth"] #dashboard-section { display: none !important; }
body[data-app-view="dashboard"] #auth-section { display: none !important; }
body[data-app-view="dashboard"] header.app-header:not(.nui-app-header) { display: none !important; }
body[data-app-view="dashboard"] footer { display: none !important; }
body[data-app-view="dashboard"] #app { padding: 0; }

/* Auth header */
header.app-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 24px;
  background: var(--base); border-bottom: 1px solid var(--ink-5);
}
header.app-header svg { width: 20px; height: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--gold), var(--gold-bright)); display: flex; align-items: center; justify-content: center; color: var(--void); font-weight: 800; font-size: 16px; }
.brand-text { display: flex; flex-direction: column; }
.brand-text-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.brand-text-sub { font-size: 10px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.tagline { font-size: 12px; color: var(--ink-3); display: none; }
@media (min-width: 768px) { .tagline { display: block; } }
.header-actions { display: flex; align-items: center; gap: 8px; }
#theme-toggle { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); border: none; background: rgba(255,255,255,.04); color: var(--ink-3); cursor: pointer; }
#theme-toggle svg { width: 18px; height: 18px; }

/* Strip card chrome from top-level sections */
#dashboard-section.card,
#auth-section.card,
#onboarding-section.card,
#force-password-section.card {
  border: none; border-radius: 0; box-shadow: none; background: transparent;
}

/* ═══════════════════════════════════════════
   SHELL — sidebar + content grid
   ═══════════════════════════════════════════ */
.dashboard-shell {
  display: grid;
  grid-template-columns: var(--nui-sidebar-width, 258px) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ═══════════════════════════════════════════
   SIDEBAR — glassmorphic layer
   ═══════════════════════════════════════════ */
.sidebar {
  background: var(--glass-sb);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  background-image:
    linear-gradient(180deg, rgba(30,30,40,.65) 0%, rgba(10,10,14,.85) 100%),
    radial-gradient(ellipse 80% 30% at 50% 0%, rgba(200,160,76,.04), transparent);
  box-shadow:
    inset -1px 0 0 rgba(255,255,255,.06),
    1px 0 60px rgba(0,0,0,.5);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 20;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-5) transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--ink-5); border-radius: 10px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

/* Sidebar header — brand area */
.sidebar-header {
  padding: 20px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sidebar-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--ink-4);
}

/* Brand area injected by newappui_app.js */
.nui-sidebar-brand {
  padding: 24px 18px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.nui-sidebar-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 50%, #A07830 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--void);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.03em;
  animation: logo-breathe 3s ease-in-out infinite;
  flex-shrink: 0;
  position: relative;
}
.nui-sidebar-brand-mark::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 16px;
  background: transparent;
  box-shadow: 0 0 20px rgba(200,160,76,.15), 0 0 40px rgba(200,160,76,.05);
  opacity: .6;
  z-index: -1;
}
.nui-sidebar-brand-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
  text-shadow: 0 0 20px rgba(200,160,76,.08);
}

/* Plan chip */
.plan-chip {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(200,160,76,.12), rgba(200,160,76,.06));
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.15), 0 0 10px rgba(200,160,76,.05);
  white-space: nowrap;
  flex-shrink: 0;
}
.plan-chip.free { opacity: .7; }

/* ═══ NAV STRUCTURE ═══ */
.menu {
  flex: 1;
  padding: 4px 8px;
  list-style: none;
  margin: 0;
}

/* Section group labels */
.nui-menu-section-title {
  padding: 20px 14px 7px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--ink-5);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nui-menu-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.03);
}

/* Nav list item */
.menu-item { list-style: none; }

/* Nav button */
.menu-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  margin: 2px 0;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all .22s var(--spring);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  font-family: var(--font);
}
.menu-button:hover {
  color: var(--ink-2);
  background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  transform: translateX(3px);
}

/* Active nav item — golden glow with left bar indicator */
.menu-button.active {
  color: var(--gold);
  background: linear-gradient(90deg, rgba(200,160,76,.12) 0%, rgba(200,160,76,.03) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(200,160,76,.12),
    0 0 24px rgba(200,160,76,.06),
    4px 0 24px rgba(200,160,76,.04);
}
/* Ambient glow bleed behind active */
.menu-button.active::after {
  content: '';
  position: absolute;
  left: -20px;
  top: -20px;
  width: 80px;
  height: calc(100% + 40px);
  background: radial-gradient(ellipse at left center, rgba(200,160,76,.08), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
/* Golden left bar indicator */
.menu-button.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  width: 3px;
  height: 22px;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-radius: 0 4px 4px 0;
  box-shadow:
    0 0 12px rgba(200,160,76,.6),
    0 0 24px rgba(200,160,76,.3),
    4px 0 16px rgba(200,160,76,.15);
}

/* Menu label row */
.menu-label {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

/* Dots — hidden in production */
.menu-dot { display: none; }

/* Icon containers */
.nui-menu-icon {
  display: flex;
  width: 19px;
  height: 19px;
  color: inherit;
  flex-shrink: 0;
  opacity: .3;
  transition: all .22s var(--spring);
  position: relative;
  z-index: 1;
}
.nui-menu-icon svg { width: 19px; height: 19px; stroke-width: 1.5; }
.menu-button:hover .nui-menu-icon { opacity: .55; transform: scale(1.05); }
.menu-button.active .nui-menu-icon {
  opacity: 1;
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(200,160,76,.4));
  transform: scale(1.05);
}

/* PRO badge */
.menu-badge {
  display: none;
}
.menu-badge.premium,
.menu-badge.nui-text-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 3px 8px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .05em;
  background: linear-gradient(135deg, rgba(200,160,76,.12), rgba(200,160,76,.06));
  color: var(--gold);
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.15), 0 0 10px rgba(200,160,76,.05);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   CONTENT AREA
   ═══════════════════════════════════════════ */
.content {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Content header — glass bar */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--glass-hd);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow:
    inset 0 -1px 0 rgba(255,255,255,.07),
    0 1px 0 rgba(0,0,0,.4),
    0 8px 32px rgba(0,0,0,.3);
  flex-shrink: 0;
  gap: 12px;
}

/* Welcome text block */
.welcome-text-main {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
  text-shadow: 0 0 30px rgba(200,160,76,.06);
  line-height: 1.2;
}
.welcome-text-sub {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: .01em;
}

/* Topbar right-side actions */
.topbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

/* Content tagline — page title bar */
.content-tagline {
  padding: 14px 40px 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.content-tagline #current-page-tagline {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0;
}

/* Main content container */
.content-placeholder,
#dashboard-placeholder {
  padding: 28px 40px 80px;
  flex: 1;
}

/* ═══════════════════════════════════════════
   ICON BUTTONS (header / topbar)
   ═══════════════════════════════════════════ */
.icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  border: none;
  background: rgba(255,255,255,.04);
  color: var(--ink-4);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 2px 8px rgba(0,0,0,.15);
  cursor: pointer;
  transition: all .2s var(--spring);
  position: relative;
  font-family: var(--font);
}
.icon-btn:hover {
  background: rgba(255,255,255,.08);
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), 0 4px 16px rgba(0,0,0,.25);
  transform: scale(1.05);
}
.icon-btn svg { width: 17px; height: 17px; }

/* Label pill (connected status) */
.label-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--ink-4);
  font-weight: 500;
}
.pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(74,222,128,.5);
  animation: pulse-green 2.8s ease-in-out infinite;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════
   MOBILE NAV OVERLAY
   ═══════════════════════════════════════════ */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,6,8,.7);
  backdrop-filter: blur(4px);
  z-index: 19;
  cursor: pointer;
}
.mobile-nav-overlay.visible,
.mobile-nav-overlay.show {
  display: block;
}

/* ═══════════════════════════════════════════
   LIGHT THEME — Sidebar
   ═══════════════════════════════════════════ */
html[data-theme="light"] .sidebar,
html.light .sidebar {
  background: rgba(250,250,248,.9);
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(250,250,248,.85)),
    radial-gradient(ellipse 80% 30% at 50% 0%, rgba(150,117,10,.03), transparent);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  box-shadow: inset -1px 0 0 rgba(0,0,0,.06), 2px 0 30px rgba(0,0,0,.03);
}

html[data-theme="light"] .nui-sidebar-brand-mark,
html.light .nui-sidebar-brand-mark {
  background: linear-gradient(135deg, #96750A, #B8930E);
  color: #fff;
  box-shadow: 0 4px 16px rgba(150,117,10,.2), 0 0 30px rgba(150,117,10,.06);
}
html[data-theme="light"] .nui-sidebar-brand-mark::after,
html.light .nui-sidebar-brand-mark::after {
  box-shadow: 0 0 16px rgba(150,117,10,.1), 0 0 32px rgba(150,117,10,.04);
}
html[data-theme="light"] .nui-sidebar-brand-title,
html.light .nui-sidebar-brand-title {
  color: var(--ink);
  text-shadow: none;
}

html[data-theme="light"] .nui-menu-section-title,
html.light .nui-menu-section-title { color: var(--ink-4); }
html[data-theme="light"] .nui-menu-section-title::after,
html.light .nui-menu-section-title::after { background: rgba(0,0,0,.04); }

html[data-theme="light"] .menu-button,
html.light .menu-button { color: var(--ink-3); }
html[data-theme="light"] .menu-button:hover,
html.light .menu-button:hover {
  background: linear-gradient(90deg, rgba(0,0,0,.03), rgba(0,0,0,.015));
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
html[data-theme="light"] .menu-button.active,
html.light .menu-button.active {
  color: var(--gold);
  background: linear-gradient(90deg, rgba(150,117,10,.08), rgba(150,117,10,.02));
  box-shadow: inset 0 0 0 1px rgba(150,117,10,.1), 0 0 20px rgba(150,117,10,.04);
}
html[data-theme="light"] .menu-button.active::before,
html.light .menu-button.active::before {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(150,117,10,.4), 0 0 20px rgba(150,117,10,.15);
}
html[data-theme="light"] .menu-button.active::after,
html.light .menu-button.active::after {
  background: radial-gradient(ellipse at left center, rgba(150,117,10,.05), transparent 70%);
}
html[data-theme="light"] .menu-button.active .nui-menu-icon,
html.light .menu-button.active .nui-menu-icon {
  color: var(--gold);
  filter: drop-shadow(0 0 4px rgba(150,117,10,.2));
}
html[data-theme="light"] .menu-badge.premium,
html[data-theme="light"] .menu-badge.nui-text-badge,
html.light .menu-badge.premium,
html.light .menu-badge.nui-text-badge {
  background: linear-gradient(135deg, rgba(150,117,10,.08), rgba(150,117,10,.04));
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(150,117,10,.1);
}

/* Light content header */
html[data-theme="light"] .content-header,
html.light .content-header {
  background: var(--glass-hd);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.06), 0 1px 0 rgba(0,0,0,.04);
}
html[data-theme="light"] .icon-btn,
html.light .icon-btn {
  background: rgba(0,0,0,.03);
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
html[data-theme="light"] .icon-btn:hover,
html.light .icon-btn:hover {
  background: rgba(0,0,0,.06);
  color: var(--ink);
}

/* ═══════════════════════════════════════════
   RESPONSIVE — Mobile layout
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--nui-sidebar-width, 258px);
    transform: translateX(-100%);
    transition: transform .28s var(--spring);
    z-index: 20;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 60px rgba(0,0,0,.6);
  }
  .content-header {
    padding: 0 16px;
  }
  .content-placeholder,
  #dashboard-placeholder {
    padding: 16px 16px 80px;
  }
  .content-tagline {
    padding: 12px 16px 0;
    font-size: 18px;
  }
  .mobile-only { display: flex !important; }
}
@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}

/* ═══════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════ */
.modal { display: none; }
.modal.show, .modal.visible { display: flex; }

.pos-modal-backdrop,
.history-modal-backdrop { display: none; }
.pos-modal-backdrop.show,
.history-modal-backdrop.show { display: flex; }

[class$="-backdrop"]:not(.mobile-nav-overlay) { display: none; }
[class$="-backdrop"].show {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(6,6,8,.75);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card,
.modal .card {
  background: linear-gradient(180deg, rgba(22,22,28,1) 0%, rgba(14,14,20,1) 100%);
  border-radius: var(--r-lg);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.07),
    0 8px 32px rgba(0,0,0,.5),
    0 32px 80px rgba(0,0,0,.4);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
html[data-theme="light"] .modal-card,
html.light .modal-card {
  background: var(--raised);
  box-shadow: 0 0 0 1px rgba(0,0,0,.07), 0 8px 32px rgba(0,0,0,.08);
}

.cmdk-modal { display: none; }
.cmdk-modal[aria-hidden="false"] { display: flex; }

.nui-superadmin-modal { display: none; }
.nui-superadmin-modal.show { display: flex; }

/* ═══════════════════════════════════════════
   KEYFRAMES
   ═══════════════════════════════════════════ */
@keyframes pulse-green {
  0%,100% { box-shadow: 0 0 0 0 rgba(74,222,128,.6), 0 0 10px rgba(74,222,128,.5); opacity: 1; }
  50% { box-shadow: 0 0 0 4px rgba(74,222,128,0), 0 0 6px rgba(74,222,128,.3); opacity: .7; }
}
@keyframes logo-breathe {
  0%,100% { box-shadow: 0 4px 20px rgba(200,160,76,.25), 0 0 50px rgba(200,160,76,.1); }
  50% { box-shadow: 0 4px 30px rgba(200,160,76,.4), 0 0 80px rgba(200,160,76,.18); }
}
@keyframes notif-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(248,113,113,.7), 0 0 8px rgba(248,113,113,.5); }
  70% { box-shadow: 0 0 0 5px rgba(248,113,113,0), 0 0 4px rgba(248,113,113,.2); }
}
@keyframes wlc-shift {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ═══════════════════════════════════════════
   THEME TOGGLE (in header)
   ═══════════════════════════════════════════ */
.theme-toggle {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: none;
  background: rgba(255,255,255,.04); color: var(--ink-3);
  cursor: pointer; transition: all .2s; font-family: var(--font);
}
html[data-theme="light"] .theme-toggle,
html.light .theme-toggle { background: rgba(0,0,0,.04); color: var(--ink-3); }
.theme-toggle:hover { background: rgba(255,255,255,.08); color: var(--ink); }
html[data-theme="light"] .theme-toggle:hover,
html.light .theme-toggle:hover { background: rgba(0,0,0,.08); color: var(--ink); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html[data-theme="light"] .theme-toggle .icon-sun,
html.light .theme-toggle .icon-sun { display: block; }
html[data-theme="light"] .theme-toggle .icon-moon,
html.light .theme-toggle .icon-moon { display: none; }

/* Smooth theme transition */
html.transitioning,
html.transitioning *,
html.transitioning *::before,
html.transitioning *::after {
  transition: background .4s ease, color .4s ease, border-color .4s ease, box-shadow .4s ease !important;
}

/* ═══════════════════════════════════════════
   POS LAYOUT
   ═══════════════════════════════════════════ */
.pos-page { display: flex; flex-direction: column; }
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 358px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(22,22,30,1) 0%, rgba(16,16,22,1) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.06),
    0 2px 8px rgba(0,0,0,.4),
    0 12px 40px rgba(0,0,0,.4),
    0 40px 100px rgba(0,0,0,.3),
    0 0 80px rgba(200,160,76,.03);
}
html[data-theme="light"] .pos-layout,
html.light .pos-layout {
  background: linear-gradient(180deg, #FFFFFF, #FAFAF8);
  box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 8px 32px rgba(0,0,0,.06);
}

/* POS search bar */
.pos-search {
  padding: 18px 24px;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.04);
  display: flex;
  align-items: center;
  gap: 12px;
}
.pos-search input {
  flex: 1; border: none; outline: none;
  font-size: 15px; font-weight: 400;
  color: var(--ink); background: transparent;
  font-family: var(--font); letter-spacing: -.01em;
}
.pos-search input::placeholder { color: var(--ink-5); }
.pos-search svg { width: 18px; height: 18px; color: var(--gold); opacity: .4; flex-shrink: 0; }

/* Category tabs */
.pos-tabs {
  display: flex;
  gap: 3px;
  padding: 12px 24px;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.03);
  overflow-x: auto;
  scrollbar-width: none;
}
.pos-tabs::-webkit-scrollbar { display: none; }

/* Product grid */
.pos-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
  align-content: start;
}

/* ═══════════════════════════════════════════
   LEGACY SUPPORT — ALL PRESERVED
   ═══════════════════════════════════════════ */
.hidden { display: none !important; }
#app { min-height: 100vh; }

/* Generic button bridge */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px; min-height: var(--sfy-touch-target, 44px);
  font-family: var(--font); font-size: 14px; font-weight: 500;
  color: var(--ink); background: rgba(255,255,255,.04);
  border: none; border-radius: var(--r-sm);
  cursor: pointer; white-space: nowrap; transition: all .15s var(--spring);
}
.btn:hover { background: rgba(255,255,255,.07); }
.btn-primary { background: var(--gold); color: var(--void); }
.btn-primary:hover { background: var(--gold-bright); box-shadow: 0 4px 20px rgba(200,160,76,.2); }
.btn-secondary { background: rgba(255,255,255,.04); color: var(--ink); }
.btn-danger { background: var(--red-glow); color: var(--red); }
.btn-small { padding: 6px 12px; min-height: 32px; font-size: 12px; }
.btn-sm { padding: 6px 12px; min-height: 32px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-text { background: none; color: var(--gold); padding: 4px 8px; min-height: auto; }

html[data-theme="light"] .btn,
html.light .btn { background: rgba(0,0,0,.04); color: var(--ink); }
html[data-theme="light"] .btn:hover,
html.light .btn:hover { background: rgba(0,0,0,.07); }
html[data-theme="light"] .btn-primary,
html.light .btn-primary { background: var(--gold); color: #fff; }
html[data-theme="light"] .btn-primary:hover,
html.light .btn-primary:hover { background: var(--gold-bright); }

/* Generic input bridge */
.input,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not(.pos-ct):not(.ui-input):not(.hd-srch):not(.ui-slider),
textarea,
select {
  width: 100%; padding: 10px 14px; min-height: var(--sfy-touch-target, 44px);
  font-family: var(--font); font-size: 14px; color: var(--ink);
  background: rgba(255,255,255,.03); border: none; border-radius: var(--r-sm);
  outline: none; transition: box-shadow .2s, background .15s;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
}
input:focus, textarea:focus, select:focus, .input:focus {
  box-shadow: 0 0 0 2px var(--gold-glow-ring), 0 0 30px rgba(200,160,76,.04);
  background: rgba(255,255,255,.05);
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
html[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(.ui-input),
html[data-theme="light"] textarea,
html[data-theme="light"] select,
html.light input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not(.ui-input),
html.light textarea,
html.light select {
  background: rgba(0,0,0,.03);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
html[data-theme="light"] input:focus,
html[data-theme="light"] textarea:focus,
html[data-theme="light"] select:focus,
html.light input:focus,
html.light textarea:focus,
html.light select:focus {
  background: rgba(0,0,0,.02);
  box-shadow: 0 0 0 2px rgba(150,117,10,.1);
}

/* Text helpers */
.text-muted, .pos-mini, .caption, .meta, .hint { font-size: 12px; color: var(--ink-3); }
.text-accent { color: var(--gold); }

/* Card bridge */
.card {
  background: var(--raised);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 4px 16px rgba(0,0,0,.2);
}
html[data-theme="light"] .card,
html.light .card {
  background: var(--raised);
  box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}

/* Misc legacy */
.error-box { padding: 12px; border-radius: var(--r-sm); background: var(--red-glow); color: var(--red); font-size: 13px; }
.success-box { padding: 12px; border-radius: var(--r-sm); background: var(--green-glow); color: var(--green); font-size: 13px; }
.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-group label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.form-grid { display: flex; flex-direction: column; gap: 16px; }
.empty-state { padding: 32px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ═══════════════════════════════════════════
   DASHBOARD — Tesla/iOS Grade
   ═══════════════════════════════════════════ */

/* Page hero banner */
.nui-page-hero {
  padding: 28px 40px 20px;
  background: transparent;
  position: relative;
}
.nui-page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 100% at 60% 0%, rgba(200,160,76,.06), transparent);
  pointer-events: none;
}
.nui-page-hero-title {
  font-size: 26px;
  font-weight: 300;
  letter-spacing: -.04em;
  color: var(--ink);
  margin: 0 0 4px;
}
.nui-page-hero-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* Connection status pill */
.label-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-4);
  background: rgba(255,255,255,.03);
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

/* Page title in topbar */
#current-page-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--ink);
}

/* Welcome text */
.welcome-text-main {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.025em;
  color: var(--ink);
  text-shadow: 0 0 30px rgba(200,160,76,.06);
  line-height: 1.2;
}
.welcome-text-sub {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 2px;
  font-weight: 500;
  letter-spacing: .01em;
}

/* ─── Dashboard shell ─── */
.dash-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dash-v2 {
  gap: 20px;
}

/* ─── Cards ─── */
.dash-card {
  background: var(--raised);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.05),
    0 1px 0 rgba(255,255,255,.03),
    0 4px 24px rgba(0,0,0,.25),
    0 1px 4px rgba(0,0,0,.15);
  position: relative;
  overflow: hidden;
}
.dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent);
  pointer-events: none;
}
html[data-theme="light"] .dash-card,
html.light .dash-card {
  background: var(--raised);
  box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
}
html[data-theme="light"] .dash-card::before,
html.light .dash-card::before { display: none; }

/* ─── Card title ─── */
.dash-card-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.dash-card-title-inner {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-card-title h3 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0;
}

/* ─── Subtitles ─── */
.dash-sub {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--ink-4);
  margin-top: 2px;
}

/* ─── Section label style ─── */
.dash-section-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* ─── Grids ─── */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .dash-grid-2 { grid-template-columns: 1fr; }
}

/* ─── KPI grid ─── */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.03);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
html[data-theme="light"] .dash-kpi-grid,
html.light .dash-kpi-grid {
  background: rgba(0,0,0,.04);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}
@media (max-width: 900px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── KPI tiles ─── */
.dash-kpi {
  background: var(--elevated);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background .18s var(--spring);
}
.dash-kpi:hover {
  background: var(--floating);
}
html[data-theme="light"] .dash-kpi,
html.light .dash-kpi {
  background: var(--base);
}
html[data-theme="light"] .dash-kpi:hover,
html.light .dash-kpi:hover {
  background: var(--void);
}

.dash-kpi-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.dash-kpi-value {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -.04em;
  color: var(--ink);
  line-height: 1.1;
}

/* ─── Chart containers ─── */
.dash-chart-box {
  position: relative;
}
.dash-chart-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.dash-busiest-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dash-chart-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -.01em;
}
.dash-busiest-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.dash-busiest-sub {
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: .01em;
}
.dash-canvas-wrap {
  position: relative;
  height: 200px;
}
.dash-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.dash-chart-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─── Chart select + filters ─── */
.dash-select {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  background: rgba(255,255,255,.04);
  border: none;
  border-radius: var(--r-sm);
  padding: 6px 10px;
  cursor: pointer;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07);
  transition: all .18s var(--spring);
  appearance: none;
  -webkit-appearance: none;
  min-height: 32px;
}
.dash-select:hover {
  background: rgba(255,255,255,.07);
  color: var(--ink-2);
}
.dash-select:focus {
  box-shadow: 0 0 0 2px var(--gold-glow-ring);
}
html[data-theme="light"] .dash-select,
html.light .dash-select {
  background: rgba(0,0,0,.04);
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.dash-chart-filter-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-3);
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}
.dash-chart-filter-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-height: unset;
  accent-color: var(--gold);
  cursor: pointer;
}

/* ─── DOW wrap ─── */
.dash-dow-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-dow-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-4);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ─── Lists ─── */
.dash-list { display: flex; flex-direction: column; }
.dash-list-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 14px;
}
.dash-list-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.02);
  transition: background .16s var(--spring);
}
.dash-list-item:hover {
  background: rgba(255,255,255,.04);
}
html[data-theme="light"] .dash-list-item { background: rgba(0,0,0,.02); }
html[data-theme="light"] .dash-list-item:hover { background: rgba(0,0,0,.04); }
.dash-li-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-li-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-li-sub {
  font-size: 11px;
  color: var(--ink-4);
}
.dash-li-right {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── Stats row (biz widgets) ─── */
.dash-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: rgba(255,255,255,.03);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.dash-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  background: var(--elevated);
  min-width: 120px;
  flex: 1;
}
.dash-stat-wide { flex: 2; }
.dash-stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.dash-stat-value {
  font-size: 18px;
  font-weight: 300;
  letter-spacing: -.03em;
  color: var(--ink);
}

/* ─── Top products ─── */
.dash-top-products {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-prod {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.02);
  transition: background .16s var(--spring);
}
.dash-prod:hover { background: rgba(255,255,255,.04); }
.dash-rank-1 { background: rgba(200,160,76,.04) !important; }
.dash-rank-1:hover { background: rgba(200,160,76,.07) !important; }
html[data-theme="light"] .dash-prod { background: rgba(0,0,0,.02); }
html[data-theme="light"] .dash-prod:hover { background: rgba(0,0,0,.04); }
.dash-prod-img {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.dash-prod-img img { width: 100%; height: 100%; object-fit: cover; }
.dash-prod-img span {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-3);
}
.dash-prod-info { flex: 1; min-width: 0; }
.dash-prod-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-prod-meta {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 2px;
}
.dash-prod-meta strong { color: var(--ink-2); font-weight: 600; }
.dash-badge-rank {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-4);
  letter-spacing: .04em;
  flex-shrink: 0;
}
.dash-rank-1 .dash-badge-rank { color: var(--gold); }

/* ─── Loading state ─── */
.dash-loading {
  font-size: 11px;
  color: var(--ink-5);
  letter-spacing: .04em;
  padding: 12px 0;
}

/* ─── Empty state (inline) ─── */
.empty-state {
  padding: 40px 16px;
  text-align: center;
  color: var(--ink-4);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.sfy-empty__svg {
  width: 48px;
  height: 48px;
  color: var(--ink-5);
  opacity: .7;
}
.sfy-empty__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
}
.sfy-empty__desc {
  font-size: 12px;
  color: var(--ink-4);
  max-width: 260px;
  line-height: 1.5;
}

/* ─── Rollup status ─── */
#dash-rollup-status {
  margin-top: 2px;
  display: none;
}

/* ─── Insights section ─── */
.dash-insights {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dash-insights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.dash-insights-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .dash-insights-grid,
  .dash-insights-grid-2 { grid-template-columns: 1fr; }
}

/* ─── NUI card head (insights cards) ─── */
.nui-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.nui-card-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}
.nui-card-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-4);
  margin-top: 3px;
}

/* ─── NUI pill group (range tabs) ─── */
.nui-pill-group {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}
.nui-pill {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-4);
  background: rgba(255,255,255,.03);
  border: none;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  transition: all .16s var(--spring);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}
.nui-pill:hover { color: var(--ink-2); background: rgba(255,255,255,.06); }
.nui-pill.active {
  color: var(--gold);
  background: var(--gold-glow);
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.18);
}
html[data-theme="light"] .nui-pill { background: rgba(0,0,0,.04); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
html[data-theme="light"] .nui-pill.active { background: var(--gold-glow); box-shadow: inset 0 0 0 1px rgba(150,117,10,.15); }

/* ─── NUI link button ─── */
.nui-link-btn {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all .15s var(--spring);
  flex-shrink: 0;
}
.nui-link-btn:hover {
  background: var(--gold-glow);
  color: var(--gold-bright);
}

/* ─── Chart canvas containers ─── */
.nui-chart-canvas {
  position: relative;
  height: 180px;
}
.nui-chart-canvas canvas {
  width: 100% !important;
  height: 100% !important;
}
.nui-chart-short { height: 160px; }

/* ─── Donut chart layout ─── */
.nui-donut-layout {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nui-donut-wrap {
  width: 130px;
  height: 130px;
  flex-shrink: 0;
  position: relative;
}
.nui-donut-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
.nui-donut-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ─── Business Health ─── */
.nui-health-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.nui-health-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-glow);
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(74,222,128,.15);
  white-space: nowrap;
  flex-shrink: 0;
}
.nui-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

/* ─── Profit list ─── */
.nui-profit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nui-profit-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nui-profit-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(255,255,255,.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-3);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.nui-profit-name-wrap {
  flex: 1;
  min-width: 0;
}
.nui-profit-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}
.nui-profit-bar {
  height: 4px;
  background: rgba(255,255,255,.05);
  border-radius: 4px;
  overflow: hidden;
}
.nui-profit-bar span {
  display: block;
  height: 100%;
  background: var(--bar-color, var(--gold));
  border-radius: 4px;
  transition: width .5s var(--spring);
}
.nui-profit-amount {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.nui-profit-amount.pos { color: var(--green); }
.nui-profit-amount.neg { color: var(--red); }

/* ─── Heatmap ─── */
.nui-heat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.nui-heat-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.nui-heat-legend .item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  color: var(--ink-4);
  font-weight: 500;
}
.nui-heat-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
/* Swatch colors via class instead of inline style */
.nui-heat-swatch--loss { background: rgba(239,68,68,0.8); }
.nui-heat-swatch--neutral { background: rgba(148,163,184,0.55); }
.nui-heat-swatch--profit { background: rgba(34,197,94,0.8); }
.nui-heat-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.nui-heat-day {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
  color: var(--ink-5);
  text-transform: uppercase;
  padding-bottom: 4px;
}
.nui-heat-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  transition: transform .15s var(--spring);
  cursor: default;
}
.nui-heat-cell:hover { transform: scale(1.15); }
.nui-heat-cell--ghost { opacity: 0.2; }

/* ─── Legend dot (donut legend rows) ─── */
.nui-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color, var(--gold));
  flex-shrink: 0;
}

/* ─── Ring (donut center) ─── */
.nui-ring {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ─── Rollup status bar ─── */
.dash-rollup-status {
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: .02em;
}

/* ─── Online business variant ─── */
.dash-online-shell { gap: 20px; }
.dash-online-top-grid {
  gap: 20px;
}

/* Mode card */
.dash-online-mode-card {
  background: linear-gradient(135deg, var(--elevated) 0%, rgba(200,160,76,.04) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(200,160,76,.08),
    0 4px 24px rgba(0,0,0,.25);
}
.dash-online-mode-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.dash-online-mode-kicker {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.dash-online-mode-copy {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}
.dash-online-mode-note {
  font-size: 11px;
  color: var(--ink-4);
  line-height: 1.6;
  padding: 10px 14px;
  background: rgba(255,255,255,.02);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

/* Online stat tiles */
.dash-online-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.03);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.dash-online-stat {
  background: var(--elevated);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: background .16s var(--spring);
}
.dash-online-stat:hover { background: var(--floating); }
.dash-online-stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.dash-online-stat-value {
  font-size: 28px;
  font-weight: 200;
  letter-spacing: -.04em;
  color: var(--ink);
  line-height: 1;
}

/* Stats grid ops variant */
.dash-online-stats-grid--ops {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 600px) {
  .dash-online-stats-grid--ops { grid-template-columns: repeat(2, 1fr); }
}

/* Online actions grid */
.dash-online-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}
.dash-online-action-grid--tight {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
}

/* Priority list right section */
.dash-online-priority-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.dash-online-order-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Empty online state */
.dash-online-empty {
  font-size: 12px;
  color: var(--ink-4);
  padding: 20px 0;
  line-height: 1.6;
}

/* Developer card */
.dash-online-dev-card {
  border: 1px dashed rgba(96,165,250,.12);
}
.dash-online-dev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.dash-online-dev-stat {
  background: rgba(96,165,250,.04);
  padding: 12px 14px;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px rgba(96,165,250,.08);
}
.dash-online-dev-stat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  opacity: .7;
  margin-bottom: 4px;
}
.dash-online-dev-stat-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  font-family: monospace;
}
.dash-online-dev-panels {
  margin-top: 16px;
}
.dash-online-dev-detail {
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.02);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  overflow: hidden;
}
.dash-online-dev-detail summary {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-online-dev-detail-actions {
  padding: 0 14px 10px;
  display: flex;
  gap: 6px;
}
.dash-online-dev-detail--wide {
  grid-column: span 2;
}
.dash-online-code {
  font-size: 11px;
  color: var(--ink-3);
  background: var(--void);
  padding: 12px 14px;
  margin: 0;
  overflow-x: auto;
  max-height: 240px;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  line-height: 1.6;
  scrollbar-width: thin;
}

/* ─── Status pills ─── */
.sf-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.sf-pill--accent {
  background: linear-gradient(135deg, rgba(200,160,76,.15), rgba(200,160,76,.07));
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.2);
}
.sf-pill--green {
  background: var(--green-glow);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(74,222,128,.15);
}
.sf-pill--red {
  background: var(--red-glow);
  color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(248,113,113,.15);
}
.sf-pill--muted {
  background: rgba(255,255,255,.04);
  color: var(--ink-4);
}

/* Shop order badges */
.shop-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.shop-badge-ok { background: var(--green-glow); color: var(--green); }
.shop-badge-warn { background: var(--amber-glow); color: var(--amber); }
.shop-badge-bad { background: var(--red-glow); color: var(--red); }
.shop-badge-muted { background: rgba(255,255,255,.04); color: var(--ink-4); }

/* ─── Flex utilities (used in toolbar) ─── */
.sfy-flex { display: flex; }
.sfy-items-center { align-items: center; }
.sfy-gap-3 { gap: 12px; }
.sfy-flex-wrap { flex-wrap: wrap; }
.sfy-justify-end { justify-content: flex-end; }

/* ─── Light overrides for dashboard ─── */
html[data-theme="light"] .dash-kpi,
html.light .dash-kpi {
  background: var(--base);
}
html[data-theme="light"] .dash-kpi-grid,
html.light .dash-kpi-grid {
  background: rgba(0,0,0,.04);
}
html[data-theme="light"] .dash-online-stat,
html.light .dash-online-stat {
  background: var(--base);
}
html[data-theme="light"] .dash-online-stats-grid,
html.light .dash-online-stats-grid {
  background: rgba(0,0,0,.04);
}
html[data-theme="light"] .nui-pill.active,
html.light .nui-pill.active {
  color: var(--gold);
  background: var(--gold-glow);
}
html[data-theme="light"] .dash-select,
html.light .dash-select {
  background: rgba(0,0,0,.04);
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
html[data-theme="light"] .dash-select option,
html.light .dash-select option {
  background: var(--raised);
  color: var(--ink);
}

@media (max-width: 768px) {
  .nui-page-hero { padding: 20px 16px 14px; }
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-online-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .nui-donut-layout { flex-direction: column; }
  .nui-donut-wrap { width: 120px; height: 120px; }
  .dash-card { padding: 18px 16px; }
}

/* Skip link accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 9999;
  padding: 8px 16px;
  background: var(--gold);
  color: var(--void);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ═══════════════════════════════════════════
   REMAINING PAGES — Tesla/iOS grade
   ═══════════════════════════════════════════ */

/* ── Shared page panel foundation ── */
.page-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.page-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.page-panel-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.page-panel-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 2px;
}
.page-surface {
  background: var(--raised);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 4px 24px rgba(0,0,0,.22);
  padding: 20px;
}
html.light .page-surface,
html[data-theme="light"] .page-surface {
  background: var(--raised);
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}

/* ── DEBTS PAGE ── */
#debts-page {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}
.debt-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.debt-stat-card {
  background: var(--raised);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 2px 12px rgba(0,0,0,.18);
}
.debt-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.debt-stat-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.debts-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 768px) {
  .debts-layout { grid-template-columns: 1fr; }
}
.debts-list-panel {
  background: var(--raised);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
  overflow: hidden;
}
.debts-list-panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--ink-5);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
}
.debts-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink-5);
  cursor: pointer;
  transition: background 150ms var(--spring);
}
.debts-item:last-child { border-bottom: none; }
.debts-item:hover { background: rgba(255,255,255,.03); }
.debts-item.active {
  background: var(--gold-glow);
  box-shadow: inset 3px 0 0 var(--gold);
}
.debts-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.debts-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.debts-item-meta {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
}
.debt-detail-panel {
  background: var(--raised);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 4px 20px rgba(0,0,0,.2);
}
.debt-detail-header { margin-bottom: 16px; }
.debt-detail-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.debt-detail-meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.debt-detail-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (max-width: 480px) {
  .debt-detail-cards { grid-template-columns: 1fr 1fr; }
}
.mini-card {
  background: var(--elevated);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.mini-card-label {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 4px;
}
.mini-card-value { font-size: 16px; font-weight: 800; color: var(--ink); }
.mini-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.simple-list {
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--ink-5);
}
.simple-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid var(--ink-5);
}
.simple-list-row:last-child { border-bottom: none; }
.simple-list-row:nth-child(even) { background: rgba(255,255,255,.015); }
.simple-list-amount { font-weight: 700; }
.debt-payments-section { margin-top: 10px; }
.dash-alert {
  background: var(--raised);
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: inset 0 0 0 1px rgba(248,113,113,.2), 0 2px 12px rgba(248,113,113,.06);
  margin-bottom: 10px;
}
.dash-alert-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.dash-alert-content { min-width: 220px; }
.dash-alert-title { font-weight: 700; font-size: 13px; color: var(--ink); }
.dash-alert-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.dash-alert-actions { display: flex; gap: 8px; align-items: center; }

/* ── TIMECLOCK PAGE ── */
#timeclock-page {
  padding: 24px;
  max-width: 960px;
  margin: 0 auto;
}
.tc-hero {
  background: var(--raised);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 4px 24px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}
.tc-status-text { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.tc-clock-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.tc-btn-in {
  background: var(--green-glow);
  color: var(--green);
  border: 1px solid rgba(74,222,128,.25);
  border-radius: var(--r);
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 150ms var(--spring), background 150ms;
  min-height: 44px;
}
.tc-btn-in:hover {
  background: rgba(74,222,128,.22);
  box-shadow: 0 0 20px rgba(74,222,128,.2);
}
.tc-btn-out {
  background: var(--red-glow);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.25);
  border-radius: var(--r);
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: box-shadow 150ms var(--spring), background 150ms;
  min-height: 44px;
}
.tc-btn-out:hover {
  background: rgba(248,113,113,.2);
  box-shadow: 0 0 20px rgba(248,113,113,.18);
}
.tc-selfie-thumb {
  cursor: pointer;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--ink-5);
  transition: box-shadow 150ms;
}
.tc-selfie-thumb:hover { box-shadow: 0 0 0 2px var(--gold-glow-ring); }
.tc-loc-link {
  color: inherit;
  text-decoration: none;
  opacity: .9;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tc-loc-link:hover { opacity: 1; text-decoration: underline; }
.tc-shift-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-3);
}
.tc-admin-wrap {
  background: var(--raised);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 4px 20px rgba(0,0,0,.18);
  margin-top: 20px;
}
.tc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tc-table th {
  background: var(--elevated);
  color: var(--ink-3);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 12px;
  text-align: left;
}
.tc-table th:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.tc-table th:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.tc-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--ink-5);
  color: var(--ink);
  vertical-align: middle;
}
.tc-table tr:last-child td { border-bottom: none; }
.tc-table tr:hover td { background: rgba(255,255,255,.015); }
.pro-title { font-size: 18px; font-weight: 700; color: var(--ink); }
.pro-sub { font-size: 13px; color: var(--ink-3); margin-top: 8px; }

/* ── LOYALTY PAGE ── */
.loy-panel {
  background: var(--raised);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 4px 24px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.loy-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.loy-field-label { font-size: 13px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.loy-field-hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.loy-form-grid { display: grid; gap: 10px; margin-top: 12px; }
.loy-customer-card {
  background: var(--elevated);
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
.loy-customer-name { font-size: 14px; font-weight: 800; color: var(--ink); }
.loy-customer-meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.loy-customer-bonus { font-size: 12px; color: var(--amber); margin-top: 6px; }
.flag-danger {
  background: var(--red-glow);
  border: 1px solid rgba(248,113,113,.2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  margin-top: 10px;
  color: var(--red);
  font-size: 13px;
}
.loy-table-cell-right { text-align: right; font-weight: 800; }
.loy-table-cell-center { text-align: center; }
.loy-checkbox-cell { text-align: center; }
.loy-redemption-section { margin-top: 12px; }
.loy-gift-select-wrap { margin-top: 8px; }

/* ── GIFT CARDS PAGE ── */
.gc-panel {
  background: var(--raised);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 4px 24px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.gc-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.gc-panel-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.gc-panel-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.gc-section-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gc-field-row { margin-top: 10px; }
.gc-item-meta { min-width: 0; }
.gc-canvas-empty { padding: 12px; font-size: 13px; color: var(--ink-3); }
.gc-el-label-sm { font-size: 13px; font-weight: 700; color: var(--ink); }
.gc-designer-section { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.gc-designer-row-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gc-designer-field { margin-top: 10px; }
.gc-print-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.gc-print-sub { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.pp-card-modal__body { display: flex; flex-direction: column; gap: 12px; }
.pp-card-amount { font-size: 15px; font-weight: 700; color: var(--ink); }
.pp-card-subtitle { font-size: 12px; color: var(--ink-3); }
.pp-card-wrap { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.pp-card-terms { font-size: 12px; color: var(--ink-3); }

/* ── ONLINE STORE / SHOP PAGE ── */
.shop-card {
  background: var(--raised);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 4px 20px rgba(0,0,0,.18);
}
.shop-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.shop-card-header h3 { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0; }
.shop-check-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.shop-link-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.shop-link-hint { font-size: 12px; color: var(--ink-3); }
.shop-progress-meta { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.shop-draft-address-wrap { margin-top: 10px; }
.shop-draft-lines { margin-top: 12px; }
.shop-order-modal-card {
  background: var(--elevated);
  border-radius: var(--r);
  padding: 14px 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  margin-top: 12px;
}
.shop-order-status-select { min-width: 220px; }
.shop-order-form-lines { margin-top: 12px; }
.shop-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.shop-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
@media (max-width: 640px) {
  .shop-grid-2 { grid-template-columns: 1fr; }
  .shop-grid-3 { grid-template-columns: 1fr 1fr; }
}
.shop-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--elevated);
  font-size: 12px;
  color: var(--ink-2);
  border: 1px solid var(--ink-5);
  margin: 4px 4px 0 0;
}
.shop-chip-accent { background: var(--gold-glow); color: var(--gold); border-color: var(--gold-glow-ring); }
.shop-customers-stats { margin-top: 10px; }
.shop-customers-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.shop-discounts-summary { margin-top: 10px; }
.shop-discounts-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.shop-cust-meta { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.shop-cust-segments { margin-top: 6px; }
.shop-detail-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.shop-discount-detail { margin-top: 6px; }
.shop-payment-note { font-size: 12px; color: var(--ink-3); margin-top: 10px; }
.shop-grapes-info { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.shop-theme-import-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.shop-theme-import-status { font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.shop-theme-summary { margin-top: 12px; }
.shop-cms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 12px; }
.shop-cms-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.shop-cms-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
@media (max-width: 768px) { .shop-cms-columns { grid-template-columns: 1fr; } }
.shop-cms-col-label { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 8px; }
.shop-cms-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--elevated);
  font-size: 12px;
  color: var(--ink-2);
  border: 1px solid var(--ink-5);
}
.shop-content-action-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.shop-content-action-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.shop-content-action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.shop-content-json {
  margin-top: 10px;
  width: 100%;
  border-radius: 22px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
}
.shop-content-json-status { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.shop-content-files-status { font-size: 12px; color: var(--ink-3); margin-top: 8px; }

/* ── SUPPORT PAGE ── */
.support-card {
  background: var(--raised);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 4px 24px rgba(0,0,0,.2);
  max-width: 860px;
  margin: 24px auto;
}
.support-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.support-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.support-method {
  background: var(--elevated);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.support-method-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.support-modal { max-width: 460px; }
.support-modal-wide { max-width: 600px; }
.support-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.support-modal-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.support-contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
@media (max-width: 560px) { .support-contact-grid { grid-template-columns: 1fr; } }
.support-textarea { resize: vertical; min-height: 100px; }

/* mt- helpers used by injected HTML */
.mt-8  { margin-top: 8px !important; }
.mt-12 { margin-top: 12px !important; }
.muted { color: var(--ink-3) !important; }

/* ── WEBPAGE / BUSINESS PAGE EDITOR ── */
#webpage-page {
  padding: 24px;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.webpage-card {
  background: var(--raised);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 4px 20px rgba(0,0,0,.2);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.webpage-card-title { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.webpage-field-row { display: flex; flex-direction: column; gap: 6px; }
.webpage-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.webpage-color-row { display: flex; align-items: center; gap: 8px; }
.webpage-header-preview {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--elevated);
  aspect-ratio: 16 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.webpage-header-preview img { width: 100%; height: 100%; object-fit: cover; }
.webpage-links-card { background: var(--elevated); border-radius: var(--r); padding: 14px 16px; }
.webpage-link-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.webpage-save-status { font-size: 12px; padding: 4px 0; }
.webpage-save-status.status-ok  { color: var(--green); }
.webpage-save-status.status-warn { color: var(--amber); }
.webpage-save-status.status-bad  { color: var(--red); }

/* ── Light mode overrides ── */
html.light .debt-stat-card,
html[data-theme="light"] .debt-stat-card,
html.light .debts-list-panel,
html[data-theme="light"] .debts-list-panel,
html.light .debt-detail-panel,
html[data-theme="light"] .debt-detail-panel,
html.light .loy-panel,
html[data-theme="light"] .loy-panel,
html.light .gc-panel,
html[data-theme="light"] .gc-panel,
html.light .shop-card,
html[data-theme="light"] .shop-card,
html.light .support-card,
html[data-theme="light"] .support-card,
html.light .webpage-card,
html[data-theme="light"] .webpage-card,
html.light .tc-admin-wrap,
html[data-theme="light"] .tc-admin-wrap,
html.light .tc-hero,
html[data-theme="light"] .tc-hero {
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}
html.light .mini-card,
html[data-theme="light"] .mini-card,
html.light .loy-customer-card,
html[data-theme="light"] .loy-customer-card,
html.light .shop-order-modal-card,
html[data-theme="light"] .shop-order-modal-card,
html.light .support-method,
html[data-theme="light"] .support-method,
html.light .webpage-links-card,
html[data-theme="light"] .webpage-links-card {
  background: var(--base);
  box-shadow: 0 0 0 1px rgba(0,0,0,.05);
}
html.light .debts-item:hover,
html[data-theme="light"] .debts-item:hover { background: rgba(0,0,0,.02); }
html.light .simple-list,
html[data-theme="light"] .simple-list { border-color: rgba(0,0,0,.08); }
html.light .simple-list-row,
html[data-theme="light"] .simple-list-row { border-color: rgba(0,0,0,.06); }
html.light .tc-table th,
html[data-theme="light"] .tc-table th { background: var(--elevated); }
html.light .tc-table td,
html[data-theme="light"] .tc-table td { border-color: rgba(0,0,0,.06); }
html.light .tc-table tr:hover td,
html[data-theme="light"] .tc-table tr:hover td { background: rgba(0,0,0,.015); }
html.light .simple-list-row:nth-child(even),
html[data-theme="light"] .simple-list-row:nth-child(even) { background: rgba(0,0,0,.01); }


/* ═══ ORDERS / HISTORY / REPORTS PAGES ═══ */

/* ── Shared page shell ── */
.history-page,
.reports-page {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ── History & Reports: two-panel layout ── */
.history-layout,
.reports-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  flex: 1;
  min-height: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--raised);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}
@media (max-width: 900px) {
  .history-layout,
  .reports-layout { grid-template-columns: 1fr; }
}

/* ── Sidebar panels ── */
.history-sidebar,
.reports-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--raised);
  border-right: 1px solid rgba(255,255,255,.04);
  overflow: hidden;
}
html[data-theme="light"] .history-sidebar,
html.light .history-sidebar,
html[data-theme="light"] .reports-sidebar,
html.light .reports-sidebar { border-right-color: rgba(0,0,0,.06); }

/* ── Summary mini bar ── */
.history-summary-bar,
.reports-summary-bar {
  padding: 12px 16px 10px;
  font-size: 11px;
  color: var(--ink-3);
  border-bottom: 1px solid rgba(255,255,255,.04);
  flex-shrink: 0;
}

/* ── Search + filter toolbar ── */
.history-toolbar,
.reports-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  flex-shrink: 0;
}
.history-toolbar label,
.reports-toolbar label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-4);
  margin-bottom: 2px;
}

/* Search input — gold focus ring */
#history-search,
#reports-search {
  width: 100%;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: box-shadow .15s, border-color .15s;
}
#history-search:focus,
#reports-search:focus {
  box-shadow: 0 0 0 2px var(--gold-glow-ring);
  border-color: rgba(200,160,76,.35);
}
html[data-theme="light"] #history-search,
html.light #history-search {
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.1);
}

#history-range,
#reports-year {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  cursor: pointer;
  transition: box-shadow .15s;
}
#history-range:focus,
#reports-year:focus { box-shadow: 0 0 0 2px var(--gold-glow-ring); }
html[data-theme="light"] #history-range,
html.light #history-range,
html[data-theme="light"] #reports-year,
html.light #reports-year {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.1);
}

/* ── Transaction / reports list ── */
.history-list,
.reports-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* ── History list items ── */
.history-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background .12s;
}
.history-item:hover { background: rgba(255,255,255,.025); }
.history-item.active { background: rgba(200,160,76,.07); }
html[data-theme="light"] .history-item:hover,
html.light .history-item:hover { background: rgba(0,0,0,.03); }
html[data-theme="light"] .history-item.active,
html.light .history-item.active { background: rgba(150,117,10,.06); }

.history-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.history-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}
.history-item-meta {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.4;
}
.history-item-right { text-align: right; flex-shrink: 0; }
.history-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.history-status {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* ── Reports list items ── */
.reports-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background .12s;
}
.reports-item:hover { background: rgba(255,255,255,.025); }
.reports-item.active { background: rgba(200,160,76,.07); }
html[data-theme="light"] .reports-item:hover,
html.light .reports-item:hover { background: rgba(0,0,0,.03); }
html[data-theme="light"] .reports-item.active,
html.light .reports-item.active { background: rgba(150,117,10,.06); }

.reports-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.reports-item-meta {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* ── Detail panels ── */
.history-detail,
.reports-detail {
  background: var(--elevated);
  overflow-y: auto;
  padding: 20px;
}

.history-detail-empty,
.reports-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  text-align: center;
  padding: 64px 24px;
  color: var(--ink-3);
  font-size: 14px;
  font-weight: 500;
}

/* ── History detail header ── */
.history-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.history-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.history-detail-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
}
.history-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ── Key-value grid (Transaction metadata) ── */
.history-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  margin-bottom: 18px;
  font-size: 12px;
}
.history-kv .k {
  color: var(--ink-4);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: 3px 0;
  white-space: nowrap;
}
.history-kv .v {
  color: var(--ink);
  font-size: 12px;
  padding: 3px 0;
  word-break: break-all;
}

/* ── Transaction table ── */
.history-table-wrap {
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  margin-bottom: 18px;
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.history-table thead tr { background: var(--elevated); }
.history-table thead th {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.04);
  white-space: nowrap;
}
.history-table th.col-right,
.history-table td.col-right { text-align: right; }
.history-table .col-qty   { width: 70px; }
.history-table .col-price { width: 90px; }
.history-table .col-total { width: 110px; }
.history-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background .12s;
}
.history-table tbody tr:last-child { border-bottom: none; }
.history-table tbody tr:hover { background: rgba(255,255,255,.02); }
.history-table td {
  padding: 10px 14px;
  color: var(--ink);
  vertical-align: middle;
}
html[data-theme="light"] .history-table thead tr,
html.light .history-table thead tr { background: rgba(0,0,0,.03); }
html[data-theme="light"] .history-table thead th,
html.light .history-table thead th { border-bottom-color: rgba(0,0,0,.06); }
html[data-theme="light"] .history-table tbody tr:hover,
html.light .history-table tbody tr:hover { background: rgba(0,0,0,.02); }

/* ── Summary totals ── */
.history-summary {
  background: var(--raised);
  border-radius: var(--r);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.history-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink);
}
.history-summary-row.total {
  font-size: 15px;
  font-weight: 700;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 4px;
}
html[data-theme="light"] .history-summary,
html.light .history-summary { box-shadow: 0 0 0 1px rgba(0,0,0,.06); }

/* ── Status / refund badges ── */
.badge-paid    { background: var(--green-glow); color: var(--green); }
.badge-unpaid  { background: var(--amber-glow); color: var(--amber); }
.badge-refund  { background: var(--blue-glow);  color: var(--blue);  }
.badge-void    { background: var(--red-glow);   color: var(--red);   }
.badge-paid,.badge-unpaid,.badge-refund,.badge-void {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1.6;
}
.pill.pill-info {
  background: var(--blue-glow);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-left: 6px;
}

/* ── Reports tabs ── */
.reports-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
  flex-shrink: 0;
}
.reports-tab {
  flex: 1;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.04);
  color: var(--ink-3);
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: var(--font);
}
.reports-tab:hover { background: rgba(255,255,255,.07); color: var(--ink); }
.reports-tab.active { background: var(--gold-glow-strong); color: var(--gold); }
html[data-theme="light"] .reports-tab,
html.light .reports-tab { background: rgba(0,0,0,.04); color: var(--ink-3); }
html[data-theme="light"] .reports-tab.active,
html.light .reports-tab.active { background: var(--gold-glow); color: var(--gold); }

/* ── Reports detail ── */
.reports-detail {
  background: var(--elevated);
  overflow-y: auto;
  padding: 20px;
}
.reports-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-3);
  font-size: 13px;
}

/* ── Reports summary cards ── */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.reports-card {
  background: var(--raised);
  border-radius: var(--r);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.reports-card-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
}
.reports-card-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}
.reports-card-sub { font-size: 11px; color: var(--ink-3); }
html[data-theme="light"] .reports-card,
html.light .reports-card {
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
}

/* ── Chart containers ── */
.reports-chart-wrap {
  background: var(--raised);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  padding: 16px;
  margin-bottom: 16px;
}
.reports-chart-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 12px;
}

/* ── Reports controls row ── */
.reports-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  flex-shrink: 0;
}
html[data-theme="light"] .reports-controls,
html.light .reports-controls { border-bottom-color: rgba(0,0,0,.06); }

/* ── Export buttons row ── */
.reports-export-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ── Upgrade hint ── */
.reports-upgrade-hint {
  margin: 12px;
  padding: 14px 16px;
  background: var(--gold-glow);
  border-radius: var(--r);
  border: 1px solid rgba(200,160,76,.18);
  font-size: 13px;
  color: var(--gold);
}

/* ── Refund modal rows ── */
.refund-row {
  display: grid;
  grid-template-columns: 20px 1fr auto auto auto;
  gap: 10px 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  font-size: 13px;
}
.refund-row:last-child { border-bottom: none; }
.refund-row-name { font-weight: 700; color: var(--ink); }
.refund-row-meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.refund-row-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-4);
  margin-bottom: 2px;
}
.refund-row-line { font-weight: 800; color: var(--ink); }
.refund-items-empty { padding: 10px; color: var(--ink-3); font-size: 13px; }
html[data-theme="light"] .refund-row,
html.light .refund-row { border-bottom-color: rgba(0,0,0,.06); }

/* ── History empty state ── */
.history-empty { text-align: center; padding: 48px 20px; }
.history-empty-icon { font-size: 40px; margin-bottom: 10px; opacity: .45; }
.history-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.history-empty-sub { font-size: 13px; color: var(--ink-3); line-height: 1.5; }

/* ── Orders page ── */
.orders-page { display: flex; flex-direction: column; height: 100%; }

.orders-list-wrap {
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  background: var(--raised);
}
.orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.orders-table thead tr { background: var(--elevated); }
.orders-table thead th {
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-4);
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.04);
  white-space: nowrap;
}
.orders-table tbody tr {
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background .12s;
}
.orders-table tbody tr:last-child { border-bottom: none; }
.orders-table tbody tr:hover { background: rgba(255,255,255,.02); }
.orders-table td { padding: 10px 14px; color: var(--ink); vertical-align: middle; }
html[data-theme="light"] .orders-table thead tr,
html.light .orders-table thead tr { background: rgba(0,0,0,.03); }
html[data-theme="light"] .orders-table tbody tr:hover,
html.light .orders-table tbody tr:hover { background: rgba(0,0,0,.02); }

/* Order status badges */
.order-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  line-height: 1.6;
}
.order-badge-open    { background: var(--blue-glow);   color: var(--blue);   }
.order-badge-closed  { background: var(--green-glow);  color: var(--green);  }
.order-badge-void    { background: var(--red-glow);    color: var(--red);    }
.order-badge-pending { background: var(--amber-glow);  color: var(--amber);  }

/* Order detail card */
.order-detail-card {
  background: var(--raised);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  padding: 20px;
  margin-top: 16px;
}
.order-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.order-detail-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.order-detail-sub   { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.order-actions      { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-fulfill {
  background: var(--green-glow);
  color: var(--green);
  border: 1px solid rgba(74,222,128,.2);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  font-family: var(--font);
}
.btn-fulfill:hover { background: rgba(74,222,128,.22); }

.btn-void-order {
  background: var(--red-glow);
  color: var(--red);
  border: 1px solid rgba(248,113,113,.18);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  font-family: var(--font);
}
.btn-void-order:hover { background: rgba(248,113,113,.2); }

html[data-theme="light"] .order-detail-card,
html.light .order-detail-card {
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
}

/* ── Utility: margin helpers for inline-style removals ── */
.error-box-mt { margin-top: 10px; }
.error-box-mb { margin-bottom: 10px; }
.detail-msg-mt { margin-top: 8px; }

/* modal footer row */
.modal-footer-row { display:flex; gap:10px; justify-content:flex-end; margin-top:12px; }

/* reports-tabs top spacing */
.reports-tabs { margin-top: 8px; }

/* reports_full chart helpers */
.reports-chart-header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.reports-chart-canvas { height: 260px; }
.reports-chart-body { margin-top: 10px; }

/* ═══════════════════════════════════════════════════════════════════════
   AUTH PAGE — Tesla/iOS Grade
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Glass header bar ─────────────────────────────────────────────────── */
body[data-app-view="auth"] header.app-header {
  background: var(--glass-hd);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-bottom: 1px solid rgba(255,255,255,.06);
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 4px 24px rgba(0,0,0,.35);
}
html.light body[data-app-view="auth"] header.app-header,
html[data-theme="light"] body[data-app-view="auth"] header.app-header {
  background: rgba(242,241,238,.88);
  border-bottom: 1px solid rgba(0,0,0,.07);
  box-shadow: 0 1px 0 rgba(255,255,255,.6), 0 4px 16px rgba(0,0,0,.04);
}

/* Brand mark — golden gradient with breathing glow */
body[data-app-view="auth"] .brand-mark {
  background: linear-gradient(140deg, var(--gold-bright) 0%, var(--gold) 60%, #9A7630 100%);
  box-shadow: 0 2px 12px rgba(200,160,76,.28), 0 0 0 1px rgba(200,160,76,.14);
  animation: logo-breathe 3.5s ease-in-out infinite;
}

/* Theme toggle sizing */
body[data-app-view="auth"] #theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: var(--ink-3);
  transition: background 150ms var(--spring), color 150ms var(--spring);
}
body[data-app-view="auth"] #theme-toggle svg { width: 18px; height: 18px; }
body[data-app-view="auth"] #theme-toggle:hover { background: rgba(255,255,255,.09); color: var(--ink); }
html.light body[data-app-view="auth"] #theme-toggle,
html[data-theme="light"] body[data-app-view="auth"] #theme-toggle {
  background: rgba(0,0,0,.04);
  border-color: rgba(0,0,0,.08);
}

/* ── Auth page centering wrapper ─────────────────────────────────────── */
body[data-app-view="auth"] main#main-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 64px;
  min-height: calc(100dvh - 60px);
  background-image:
    radial-gradient(ellipse 70% 55% at 30% 0%, rgba(200,160,76,.07), transparent),
    radial-gradient(ellipse 50% 40% at 80% 80%, rgba(96,165,250,.04), transparent);
}

/* ── Section width constraints ───────────────────────────────────────── */
#auth-section,
#force-password-section,
#onboarding-section {
  width: 100%;
  max-width: 1100px;
}

/* ── Tab switcher — pill style ───────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--raised);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  width: fit-content;
  margin: 0 auto 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 4px 16px rgba(0,0,0,.2);
}
html.light .auth-tabs,
html[data-theme="light"] .auth-tabs {
  background: var(--raised);
  border-color: rgba(0,0,0,.07);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.04);
}

.auth-tab {
  padding: 8px 20px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 13.5px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: background 160ms var(--spring), color 160ms var(--spring), box-shadow 160ms var(--spring);
  white-space: nowrap;
  min-height: 44px;
}
.auth-tab:hover { color: var(--ink); background: rgba(255,255,255,.04); }
.auth-tab.active {
  background: linear-gradient(135deg, rgba(200,160,76,.18) 0%, rgba(200,160,76,.10) 100%);
  color: var(--gold);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(200,160,76,.22), 0 2px 8px rgba(200,160,76,.12);
}
html.light .auth-tab.active,
html[data-theme="light"] .auth-tab.active {
  background: rgba(150,117,10,.09);
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(150,117,10,.18);
}

/* ── Two-column auth layout ──────────────────────────────────────────── */
.auth-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-benefits.auth-hero-rail { display: none; }
}

/* ── Form shell — glass card ─────────────────────────────────────────── */
.auth-form-shell {
  background: var(--glass-card);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.07),
    0 8px 40px rgba(0,0,0,.35),
    0 2px 8px rgba(0,0,0,.2);
  position: relative;
  overflow: hidden;
}
.auth-form-shell::before {
  content: "";
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,160,76,.35), transparent);
  border-radius: 0 0 4px 4px;
}
html.light .auth-form-shell,
html[data-theme="light"] .auth-form-shell {
  background: rgba(255,255,255,.9);
  border-color: rgba(0,0,0,.07);
  box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.06);
}
html.light .auth-form-shell::before,
html[data-theme="light"] .auth-form-shell::before {
  background: linear-gradient(90deg, transparent, rgba(150,117,10,.25), transparent);
}
@media (max-width: 480px) { .auth-form-shell { padding: 24px 20px; } }

/* ── Panel header ────────────────────────────────────────────────────── */
.auth-panel-header { margin-bottom: 24px; }

.kicker {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
  opacity: .85;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
@media (max-width: 480px) { .auth-title { font-size: 19px; } }

.auth-subtitle {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.55;
  margin-bottom: 16px;
}

/* ── Method chips ────────────────────────────────────────────────────── */
.auth-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.auth-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(200,160,76,.08);
  border: 1px solid rgba(200,160,76,.16);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .02em;
}
html.light .auth-chip,
html[data-theme="light"] .auth-chip {
  background: rgba(150,117,10,.06);
  border-color: rgba(150,117,10,.14);
}

/* ── Social block spacing ────────────────────────────────────────────── */
.auth-social-block { margin-bottom: 20px; }

/* ── Google button ───────────────────────────────────────────────────── */
.nui-google-btn {
  display: flex !important;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px !important;
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.10) !important;
  border-radius: var(--r-sm) !important;
  cursor: pointer;
  text-align: left;
  transition: background 160ms var(--spring), border-color 160ms var(--spring), box-shadow 160ms var(--spring);
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  min-height: 56px;
}
.nui-google-btn:hover {
  background: rgba(255,255,255,.07) !important;
  border-color: rgba(200,160,76,.28) !important;
  box-shadow: 0 0 0 3px rgba(200,160,76,.10), 0 4px 16px rgba(0,0,0,.2) !important;
}
html.light .nui-google-btn,
html[data-theme="light"] .nui-google-btn {
  background: var(--raised) !important;
  border-color: rgba(0,0,0,.10) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.06) !important;
}
html.light .nui-google-btn:hover,
html[data-theme="light"] .nui-google-btn:hover {
  border-color: rgba(150,117,10,.3) !important;
  box-shadow: 0 0 0 3px rgba(150,117,10,.08), 0 4px 12px rgba(0,0,0,.06) !important;
}

.google-mark {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.google-mark svg { width: 18px; height: 18px; display: block; }

.google-copy { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.google-copy strong { font-size: 14px; font-weight: 600; color: var(--ink); display: block; }
.google-copy small { font-size: 11.5px; color: var(--ink-3); display: block; }

.google-arrow {
  flex-shrink: 0;
  color: var(--ink-4);
  display: flex; align-items: center;
  transition: transform 160ms var(--spring), color 160ms var(--spring);
}
.google-arrow svg { width: 18px; height: 18px; }
.nui-google-btn:hover .google-arrow { transform: translateX(3px); color: var(--gold); }

.auth-microcopy {
  font-size: 11.5px; color: var(--ink-4);
  text-align: center; margin-top: 8px; line-height: 1.4;
}

/* ── Or divider ──────────────────────────────────────────────────────── */
.divider-or { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.divider-line { flex: 1; height: 1px; background: var(--ink-5); }
.divider-text {
  font-size: 11.5px; color: var(--ink-4);
  white-space: nowrap; font-weight: 500; letter-spacing: .02em;
}

/* ── Form grid ───────────────────────────────────────────────────────── */
.auth-form-grid { display: flex; flex-direction: column; gap: 14px; }

.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label {
  font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); letter-spacing: .01em;
}
.field-group input,
.field-group select,
.field-group textarea {
  height: 44px;
  padding: 0 13px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 160ms var(--spring), box-shadow 160ms var(--spring), background 160ms var(--spring);
  -webkit-appearance: none;
  appearance: none;
}
.field-group select { cursor: pointer; }
.field-group textarea { height: auto; padding: 11px 13px; resize: vertical; }
.field-group input::placeholder,
.field-group textarea::placeholder { color: var(--ink-4); }
.field-group input:hover,
.field-group select:hover { border-color: rgba(255,255,255,.13); background: rgba(255,255,255,.04); }
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: rgba(200,160,76,.45);
  background: rgba(200,160,76,.04);
  box-shadow: 0 0 0 3px rgba(200,160,76,.12);
}
html.light .field-group input,
html[data-theme="light"] .field-group input,
html.light .field-group select,
html[data-theme="light"] .field-group select,
html.light .field-group textarea,
html[data-theme="light"] .field-group textarea {
  background: var(--base); border-color: rgba(0,0,0,.10); color: var(--ink);
}
html.light .field-group input:focus,
html[data-theme="light"] .field-group input:focus,
html.light .field-group select:focus,
html[data-theme="light"] .field-group select:focus,
html.light .field-group textarea:focus,
html[data-theme="light"] .field-group textarea:focus {
  border-color: rgba(150,117,10,.4);
  background: rgba(150,117,10,.03);
  box-shadow: 0 0 0 3px rgba(150,117,10,.10);
}

/* ── Inline actions row ──────────────────────────────────────────────── */
.auth-inline-actions {
  display: flex; align-items: center;
  justify-content: space-between; gap: 8px; margin: -4px 0 2px;
}
.auth-inline-note { font-size: 11px; color: var(--ink-4); }
.btn-text {
  background: none; border: none; padding: 4px 0;
  font-size: 12.5px; font-weight: 500; color: var(--gold);
  cursor: pointer; font-family: var(--font);
  transition: opacity 150ms; min-height: 44px;
}
.btn-text:hover { opacity: .75; }

/* ── Primary submit button ───────────────────────────────────────────── */
.auth-submit-btn,
.auth-form-shell .btn-primary.btn-block {
  width: 100%;
  height: 48px;
  padding: 0 20px;
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 60%, #9A7630 100%);
  color: #1A1200;
  border: none;
  border-radius: var(--r-sm);
  font-size: 14.5px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  letter-spacing: .01em;
  box-shadow: 0 2px 12px rgba(200,160,76,.3), 0 0 0 1px rgba(200,160,76,.15);
  transition: opacity 160ms var(--spring), box-shadow 160ms var(--spring), transform 120ms var(--spring);
  position: relative;
  overflow: hidden;
}
.auth-submit-btn::after,
.auth-form-shell .btn-primary.btn-block::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.18) 0%, transparent 60%);
  pointer-events: none;
}
.auth-submit-btn:hover,
.auth-form-shell .btn-primary.btn-block:hover {
  opacity: .92;
  box-shadow: 0 4px 20px rgba(200,160,76,.4), 0 0 0 1px rgba(200,160,76,.2);
  transform: translateY(-1px);
}
.auth-submit-btn:active,
.auth-form-shell .btn-primary.btn-block:active { transform: translateY(0); opacity: 1; }

/* ── Demo button ─────────────────────────────────────────────────────── */
.auth-demo-btn {
  display: flex !important;
  align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 10px; height: 44px;
  background: rgba(255,255,255,.03) !important;
  border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: var(--r-sm) !important;
  color: var(--ink-3) !important;
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 160ms var(--spring), color 160ms var(--spring), border-color 160ms var(--spring);
}
.auth-demo-btn svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--gold); opacity: .8; }
.auth-demo-btn:hover {
  background: rgba(255,255,255,.06) !important;
  color: var(--ink) !important;
  border-color: rgba(255,255,255,.13) !important;
}
html.light .auth-demo-btn,
html[data-theme="light"] .auth-demo-btn {
  background: var(--base) !important;
  border-color: rgba(0,0,0,.08) !important;
}

/* ── Error / success boxes ───────────────────────────────────────────── */
.error-box {
  margin-top: 14px; padding: 11px 14px;
  background: var(--red-glow);
  border: 1px solid rgba(248,113,113,.22);
  border-radius: var(--r-sm);
  color: var(--red); font-size: 13px; line-height: 1.45;
}
.success-box {
  margin-top: 14px; padding: 11px 14px;
  background: var(--green-glow);
  border: 1px solid rgba(74,222,128,.22);
  border-radius: var(--r-sm);
  color: var(--green); font-size: 13px; line-height: 1.45;
}
html.light .error-box,
html[data-theme="light"] .error-box { background: rgba(220,38,38,.05); border-color: rgba(220,38,38,.18); }
html.light .success-box,
html[data-theme="light"] .success-box { background: rgba(13,148,72,.05); border-color: rgba(13,148,72,.18); }

/* ── Sign-up next steps ──────────────────────────────────────────────── */
.auth-next-steps {
  display: flex; flex-direction: column; gap: 12px;
  margin-top: 20px; padding: 16px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.05);
  border-radius: var(--r-sm);
}
.auth-next-step { display: flex; align-items: flex-start; gap: 12px; }
.auth-step-badge {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(200,160,76,.15); border: 1px solid rgba(200,160,76,.25);
  color: var(--gold); font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.auth-next-step > div { display: flex; flex-direction: column; gap: 2px; }
.auth-next-step strong { font-size: 13px; font-weight: 600; color: var(--ink); }
.auth-next-step span { font-size: 12px; color: var(--ink-3); line-height: 1.45; }

/* ── Benefits rail ───────────────────────────────────────────────────── */
.auth-benefits.auth-hero-rail {
  padding: 36px 28px;
  background: rgba(255,255,255,.02);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-lg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  position: sticky; top: 80px;
  display: flex; flex-direction: column; gap: 20px;
}
html.light .auth-benefits.auth-hero-rail,
html[data-theme="light"] .auth-benefits.auth-hero-rail {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.06);
}

.mini-tag {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  background: rgba(200,160,76,.10); border: 1px solid rgba(200,160,76,.18);
  border-radius: 100px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--gold); width: fit-content;
}
.auth-benefits-title {
  font-size: 20px; font-weight: 700; color: var(--ink);
  line-height: 1.28; letter-spacing: -.02em;
}
.auth-hero-copy { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }

/* Proof grid */
.auth-proof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 1100px) { .auth-proof-grid { grid-template-columns: 1fr; } }
.auth-proof-item {
  padding: 14px;
  background: rgba(255,255,255,.025);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-sm);
  display: flex; flex-direction: column; gap: 4px;
}
html.light .auth-proof-item,
html[data-theme="light"] .auth-proof-item {
  background: rgba(0,0,0,.02);
  border-color: rgba(0,0,0,.06);
}
.auth-proof-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em;
  color: var(--gold); opacity: .8;
}
.auth-proof-item strong { font-size: 13px; font-weight: 700; color: var(--ink); }
.auth-proof-item p { font-size: 12px; color: var(--ink-3); line-height: 1.45; margin: 0; }

/* Preview shell */
.auth-preview-shell {
  background: var(--raised); border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-sm); padding: 16px; overflow: hidden;
}
html.light .auth-preview-shell,
html[data-theme="light"] .auth-preview-shell {
  background: var(--raised); border-color: rgba(0,0,0,.07);
}
.auth-preview-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 8px; margin-bottom: 14px;
}
.auth-preview-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-4); display: block; margin-bottom: 3px;
}
.auth-preview-title { font-size: 12.5px; font-weight: 600; color: var(--ink); margin: 0; line-height: 1.35; }
.auth-live-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  background: var(--green-glow); border: 1px solid rgba(74,222,128,.2);
  border-radius: 100px; font-size: 11px; font-weight: 600; color: var(--green);
  white-space: nowrap; flex-shrink: 0;
}
.auth-live-pill .pulse-dot {
  width: 6px; height: 6px; background: var(--green); border-radius: 50%;
  animation: pulse-green 2s ease-in-out infinite;
  display: inline-block; flex-shrink: 0;
}

.auth-preview-grid { display: grid; grid-template-columns: 1fr 0.6fr; gap: 10px; }
.auth-preview-card {
  background: var(--elevated); border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px; padding: 12px;
}
html.light .auth-preview-card,
html[data-theme="light"] .auth-preview-card { background: var(--base); border-color: rgba(0,0,0,.06); }
.auth-preview-card-kicker {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-4); display: block; margin-bottom: 8px;
}
.auth-preview-bars { display: flex; align-items: flex-end; gap: 4px; height: 40px; margin-bottom: 10px; }
.auth-preview-bars span {
  flex: 1; height: var(--bar, 50%);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border-radius: 3px 3px 0 0; opacity: .75;
}
.auth-preview-statline { display: flex; flex-direction: column; gap: 2px; }
.auth-preview-statline strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.auth-preview-statline span { font-size: 11px; color: var(--ink-3); line-height: 1.35; }
.auth-preview-card-stack {
  display: flex; flex-direction: column;
  justify-content: space-around; gap: 8px;
}
.auth-preview-metric { display: flex; flex-direction: column; gap: 1px; }
.auth-preview-metric b { font-size: 16px; font-weight: 700; color: var(--gold); }
.auth-preview-metric span { font-size: 10.5px; color: var(--ink-3); line-height: 1.3; }

/* Checklist */
.auth-checklist { list-style: none; display: flex; flex-direction: column; gap: 10px; padding: 0; margin: 0; }
.auth-checklist li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: var(--ink-3); line-height: 1.5;
}
.auth-check-icon { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--green); margin-top: 1px; }
.auth-checklist strong { color: var(--ink); font-weight: 600; }

/* Badge trial */
.badge-trial {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: rgba(74,222,128,.06); border: 1px solid rgba(74,222,128,.14);
  border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-3); line-height: 1.45;
}
.badge-trial .pulse-dot {
  width: 7px; height: 7px; background: var(--green); border-radius: 50%;
  animation: pulse-green 2.5s ease-in-out infinite; flex-shrink: 0;
}
.badge-trial strong { color: var(--ink); font-weight: 600; }

/* ── Force password section ──────────────────────────────────────────── */
#force-password-section { max-width: 480px; margin: 0 auto; }
#force-password-section.card {
  background: var(--glass-card);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-lg);
  padding: 36px 32px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 40px rgba(0,0,0,.3);
}
#force-password-section .auth-title { font-size: 20px; margin-bottom: 8px; }
#force-password-section .auth-subtitle { margin-bottom: 20px; }
#force-password-section .form-grid { display: flex; flex-direction: column; gap: 14px; }

/* ── Onboarding section ──────────────────────────────────────────────── */
#onboarding-section { max-width: 900px; margin: 0 auto; }
#onboarding-section .kicker { display: block; text-align: center; margin-bottom: 8px; }
.onboarding-section-title {
  font-size: 20px; font-weight: 700; color: var(--ink);
  letter-spacing: -.018em; margin-bottom: 6px;
}
.onboarding-subtitle { font-size: 13.5px; color: var(--ink-3); line-height: 1.55; margin-bottom: 24px; }
.onboarding-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 720px) { .onboarding-layout { grid-template-columns: 1fr; } }

/* Plan grid and cards */
.plans-grid { display: flex; flex-direction: column; gap: 10px; }
.plan-card {
  position: relative; padding: 20px;
  background: var(--raised); border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-lg); cursor: pointer;
  transition: border-color 180ms var(--spring), box-shadow 180ms var(--spring), background 180ms var(--spring);
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.plan-card:hover { border-color: rgba(200,160,76,.22); box-shadow: 0 4px 20px rgba(0,0,0,.25); }
.plan-card.selected {
  border-color: rgba(200,160,76,.4);
  background: rgba(200,160,76,.06);
  box-shadow: 0 0 0 1px rgba(200,160,76,.2), 0 4px 24px rgba(200,160,76,.12);
}
html.light .plan-card,
html[data-theme="light"] .plan-card { background: var(--raised); border-color: rgba(0,0,0,.08); box-shadow: 0 1px 6px rgba(0,0,0,.05); }
html.light .plan-card.selected,
html[data-theme="light"] .plan-card.selected {
  border-color: rgba(150,117,10,.35); background: rgba(150,117,10,.05);
  box-shadow: 0 0 0 1px rgba(150,117,10,.15), 0 4px 16px rgba(150,117,10,.08);
}

.plan-badge {
  position: absolute; top: -10px; left: 16px; padding: 3px 10px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #1A1200; font-size: 10.5px; font-weight: 700;
  border-radius: 100px; letter-spacing: .04em;
  box-shadow: 0 2px 8px rgba(200,160,76,.3);
}
.plan-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); margin-bottom: 4px; }
.plan-card.selected .plan-label { color: var(--gold); }
.plan-price { font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.03em; line-height: 1; margin-bottom: 6px; }
.plan-price span { font-size: 14px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.plan-desc { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; margin-bottom: 10px; }
.plan-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.plan-list li { font-size: 12.5px; color: var(--ink-2); padding-left: 16px; position: relative; line-height: 1.4; }
.plan-list li::before { content: "✓"; position: absolute; left: 0; color: var(--gold); font-size: 11px; font-weight: 700; top: 1px; }
.plan-highlight { font-size: 11.5px; color: var(--gold); font-weight: 500; opacity: .85; }
.hint { font-size: 12px; color: var(--ink-3); line-height: 1.45; }

/* Plans loading */
.plans-loading { display: flex; align-items: center; gap: 10px; padding: 16px; color: var(--ink-3); font-size: 13px; }
.plans-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.10); border-top-color: var(--gold);
  border-radius: 50%; animation: auth-spin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* Onboarding biz col */
.onboarding-col-biz {
  background: var(--glass-card); border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-lg); padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 4px 24px rgba(0,0,0,.2);
}
html.light .onboarding-col-biz,
html[data-theme="light"] .onboarding-col-biz {
  background: var(--raised); border-color: rgba(0,0,0,.07);
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.onboarding-col-biz .form-grid { display: flex; flex-direction: column; gap: 14px; }

/* text-accent utility used in onboarding */
.text-accent { color: var(--gold); font-weight: 600; }


/* ═══ POS PAGE ═══ */

/* Page container */
.pos-page {
  display: flex; flex-direction: column;
  height: 100%; min-height: 0;
  background: var(--void); overflow: hidden;
}

/* Mobile tabs */
.pos-mobile-tabs {
  display: none;
  background: var(--base); border-bottom: 1px solid var(--ink-5);
  padding: 0 16px; gap: 4px;
}
.pos-mobile-tab {
  flex: 1; padding: 12px 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; font-family: var(--font); min-height: var(--sfy-touch-target);
  transition: color .18s var(--spring), border-color .18s var(--spring);
}
.pos-mobile-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.pos-mobile-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 10px; font-weight: 700;
  background: var(--gold); color: var(--void);
  border-radius: 20px; margin-left: 5px;
}
@media (max-width: 767px) { .pos-mobile-tabs { display: flex; } }

/* Business-mode tabs */
.pos-bizmode-tabs {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px 0; background: var(--base);
  border-bottom: 1px solid var(--ink-5);
  overflow-x: auto; scrollbar-width: none;
}
.pos-bizmode-tabs::-webkit-scrollbar { display: none; }
.pos-bizmode-tab {
  padding: 8px 16px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  font-size: 13px; font-weight: 600; color: var(--ink-3);
  background: none; border: none; border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap; font-family: var(--font); min-height: 40px;
  transition: color .18s var(--spring), background .18s var(--spring);
}
.pos-bizmode-tab:hover { color: var(--ink-2); background: rgba(255,255,255,.03); }
.pos-bizmode-tab.active {
  color: var(--gold); background: rgba(200,160,76,.07);
  border-bottom-color: var(--gold);
}

/* Active order banner */
.pos-active-order-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 20px;
  background: linear-gradient(90deg, rgba(200,160,76,.10) 0%, rgba(200,160,76,.04) 100%);
  border-bottom: 1px solid rgba(200,160,76,.18);
  box-shadow: 0 2px 12px rgba(200,160,76,.06);
}
.pos-active-order-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pos-active-order-title {
  font-size: 14px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pos-active-order-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Two-column POS layout */
.pos-layout {
  display: grid; grid-template-columns: 1fr 360px;
  flex: 1; min-height: 0; overflow: hidden;
}
@media (max-width: 1100px) { .pos-layout { grid-template-columns: 1fr 320px; } }
@media (max-width: 767px) {
  .pos-layout { grid-template-columns: 1fr; display: flex; flex-direction: column; overflow: visible; }
  [data-pos-mobile-view="products"] .pos-panel-cart { display: none; }
  [data-pos-mobile-view="cart"] .pos-panel-products { display: none; }
}

/* Panel base */
.pos-panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.pos-panel-products { background: var(--base); border-right: 1px solid var(--ink-5); }
.pos-panel-cart { background: var(--void); border-left: 1px solid rgba(255,255,255,.04); }

/* Panel head */
.pos-panel-head {
  padding: 16px 20px 12px; border-bottom: 1px solid var(--ink-5);
  background: inherit; display: flex; flex-direction: column; gap: 10px;
}
.pos-head-block { display: flex; flex-direction: column; gap: 2px; }
.pos-head-title { font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.pos-cart-head { border-bottom: 1px solid rgba(255,255,255,.05); }
.pos-cart-actions { display: flex; align-items: center; gap: 8px; }

/* Search bar */
.pos-search { display: flex; flex-direction: column; gap: 6px; }
.pos-search > label {
  font-size: 11px; font-weight: 600; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: .08em;
}
.pos-search-row {
  position: relative; display: flex; align-items: center;
  background: var(--raised); border: 1px solid var(--ink-5);
  border-radius: var(--r); padding: 0 12px;
  transition: border-color .18s var(--spring), box-shadow .18s var(--spring);
}
.pos-search-row:focus-within {
  border-color: rgba(200,160,76,.45);
  box-shadow: 0 0 0 3px var(--gold-glow), 0 2px 12px rgba(0,0,0,.2);
}
.pos-search-icon { font-size: 14px; flex-shrink: 0; opacity: .5; margin-right: 8px; }
.pos-search-row input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--ink); font-size: 14px; font-family: var(--font);
  padding: 11px 0; min-width: 0;
}
.pos-search-row input::placeholder { color: var(--ink-4); }
.pos-search-tip { color: var(--ink-4); line-height: 1.4; }
.pos-icon-btn {
  background: none; border: none; color: var(--ink-4); cursor: pointer;
  padding: 6px; border-radius: var(--r-sm); font-size: 12px; line-height: 1;
  min-width: 28px; min-height: 28px;
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s;
}
.pos-icon-btn:hover { color: var(--ink); background: rgba(255,255,255,.07); }

/* Category tabs */
.pos-tabs-wrap {
  padding: 12px 16px 8px; border-bottom: 1px solid var(--ink-5);
  background: var(--base);
}
.pos-tabs {
  display: flex; align-items: center; gap: 6px;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
}
.pos-tabs::-webkit-scrollbar { display: none; }
.pos-tab {
  padding: 6px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600; color: var(--ink-3);
  background: var(--raised); border: 1px solid var(--ink-5);
  cursor: pointer; white-space: nowrap; font-family: var(--font);
  min-height: 32px; flex-shrink: 0;
  transition: all .18s var(--spring);
}
.pos-tab:hover { color: var(--ink); background: var(--elevated); border-color: var(--ink-4); }
.pos-tab.active {
  color: var(--void);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border-color: transparent;
  box-shadow:
    0 0 0 1px rgba(200,160,76,.35),
    0 0 18px rgba(200,160,76,.25),
    0 2px 8px rgba(0,0,0,.3);
}

/* Product scroll + grid */
.pos-products-scroll {
  flex: 1; overflow-y: auto; padding: 16px;
  scrollbar-width: thin; scrollbar-color: var(--ink-5) transparent;
}
.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
}
@media (max-width: 600px) {
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
}

/* Product card */
.pos-product {
  position: relative; display: flex; flex-direction: column;
  background: rgba(255,255,255,.03); border: 1px solid var(--ink-5);
  border-radius: var(--r); overflow: hidden; cursor: pointer;
  -webkit-tap-highlight-color: transparent; user-select: none;
  transition: transform .18s var(--spring), box-shadow .18s var(--spring), border-color .18s var(--spring);
}
.pos-product:hover {
  transform: translateY(-2px); border-color: rgba(200,160,76,.35);
  box-shadow:
    0 0 0 1px rgba(200,160,76,.18),
    0 8px 24px rgba(0,0,0,.35),
    0 0 32px rgba(200,160,76,.08);
}
.pos-product:active { transform: translateY(0) scale(.98); }
.pos-product.is-soldout { opacity: .45; cursor: not-allowed; }
.pos-product.is-soldout:hover { transform: none; box-shadow: none; }
html.light .pos-product { background: var(--raised); }
html.light .pos-product:hover { border-color: var(--gold); }

.pos-product-media {
  width: 100%; aspect-ratio: 4/3; background: var(--raised);
  background-size: cover; background-position: center; background-repeat: no-repeat;
  flex-shrink: 0;
}
.pos-product-badges {
  position: absolute; top: 6px; left: 6px;
  display: flex; flex-wrap: wrap; gap: 3px;
  z-index: 1; pointer-events: none;
}
.pos-fav-btn {
  position: absolute; top: 5px; right: 5px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,6,8,.55); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08); border-radius: 50%;
  color: var(--ink-4); font-size: 13px; cursor: pointer; z-index: 2;
  transition: color .15s, background .15s, transform .15s var(--spring-bounce);
}
.pos-fav-btn:hover { background: rgba(6,6,8,.8); color: var(--gold); transform: scale(1.15); }
.pos-fav-btn.active { color: var(--gold); background: rgba(200,160,76,.18); border-color: rgba(200,160,76,.3); }

.pos-product-body { padding: 8px 10px 4px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pos-product-name {
  font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.35;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.pos-product-sub { font-size: 11px; color: var(--ink-4); }
.pos-product-footer {
  padding: 6px 8px 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  border-top: 1px solid var(--ink-5);
}
.pos-product-price { font-size: 13px; font-weight: 700; color: var(--gold); }
.pos-add-btn {
  padding: 5px 11px; border-radius: var(--r-sm);
  font-size: 11px; font-weight: 700; color: var(--void);
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  border: none; cursor: pointer; min-height: 28px; font-family: var(--font);
  transition: opacity .15s, transform .15s var(--spring-bounce), box-shadow .15s;
}
.pos-add-btn:hover:not(:disabled) {
  opacity: .9; transform: scale(1.05); box-shadow: 0 0 14px rgba(200,160,76,.35);
}
.pos-add-btn:disabled { opacity: .35; cursor: not-allowed; }

/* Status badges */
.pos-badge {
  display: inline-flex; align-items: center;
  padding: 2px 6px; border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .03em;
  white-space: nowrap; backdrop-filter: blur(6px);
}
.pos-badge-danger  { background: rgba(248,113,113,.18); color: var(--red);   border: 1px solid rgba(248,113,113,.25); }
.pos-badge-warning { background: rgba(251,191,36,.15);  color: var(--amber); border: 1px solid rgba(251,191,36,.22); }
.pos-badge-muted   { background: rgba(255,255,255,.07); color: var(--ink-3); border: 1px solid rgba(255,255,255,.06); }
.pos-badge-green   { background: rgba(74,222,128,.14);  color: var(--green); border: 1px solid rgba(74,222,128,.2); }

/* Cart scroll */
.pos-cart-scroll {
  flex: 1; overflow-y: auto; padding: 16px;
  scrollbar-width: thin; scrollbar-color: var(--ink-5) transparent;
}

/* Cart items table */
.pos-cart-items-wrap {
  background: rgba(255,255,255,.02); border: 1px solid var(--ink-5);
  border-radius: var(--r); overflow: hidden; margin-top: 4px;
}
.pos-cart-items-head {
  display: grid; grid-template-columns: 1fr auto auto auto auto;
  gap: 8px; padding: 8px 12px;
  background: rgba(255,255,255,.03); border-bottom: 1px solid var(--ink-5);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-4);
}
.pos-cart-items { display: flex; flex-direction: column; }
.pos-cart-item {
  display: grid; grid-template-columns: 36px 1fr auto auto auto;
  align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.03); transition: background .15s;
}
.pos-cart-item:last-child { border-bottom: none; }
.pos-cart-item:hover { background: rgba(255,255,255,.025); }

.pos-cart-thumb {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--raised); background-size: cover; background-position: center;
  border: 1px solid var(--ink-5); flex-shrink: 0;
}
.pos-cart-thumb-fallback {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-5); font-size: 18px; background: var(--raised);
}
.pos-cart-item-main { min-width: 0; }
.pos-cart-item-name {
  font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pos-cart-item-sub { font-size: 11px; color: var(--ink-4); margin-top: 1px; }
.pos-cart-item-qty { flex-shrink: 0; }
.pos-qty-stepper {
  display: flex; align-items: center; gap: 2px;
  background: var(--raised); border: 1px solid var(--ink-5);
  border-radius: var(--r-sm); overflow: hidden;
}
.pos-qty-btn {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--ink-3); font-size: 16px;
  cursor: pointer; font-family: var(--font); flex-shrink: 0;
  transition: background .15s, color .15s;
}
.pos-qty-btn:hover:not(:disabled) { background: rgba(255,255,255,.06); color: var(--ink); }
.pos-qty-btn:disabled { opacity: .3; cursor: not-allowed; }
.pos-qty-input {
  width: 38px; background: none; border: none; text-align: center;
  color: var(--ink); font-size: 13px; font-weight: 600;
  font-family: var(--font); outline: none; padding: 0;
}
.pos-qty-input::-webkit-inner-spin-button,
.pos-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.pos-qty-input[type=number] { -moz-appearance: textfield; }
.pos-cart-item-line { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.pos-remove-btn { color: var(--ink-4); font-size: 11px; flex-shrink: 0; }
.pos-remove-btn:hover { color: var(--red); background: var(--red-glow); }

/* Empty cart state */
.pos-cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 20px; gap: 8px;
}
.pos-cart-empty-emoji { font-size: 36px; opacity: .35; }
.pos-cart-empty-title { font-size: 15px; font-weight: 600; color: var(--ink-3); }

/* Cart footer */
.pos-cart-footer {
  padding: 14px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.05);
  background: var(--base);
  display: flex; flex-direction: column; gap: 10px;
}
.cart-summary { display: flex; flex-direction: column; gap: 5px; }
.cart-summary-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--ink-2);
}
.cart-summary-row.total {
  font-size: 16px; font-weight: 800; color: var(--ink);
  padding-top: 8px; border-top: 1px solid var(--ink-5); margin-top: 3px;
}
.cart-actions { display: flex; flex-direction: column; gap: 6px; }

/* Checkout button — golden centrepiece */
.pos-checkout-btn {
  width: 100%; padding: 15px 24px; border-radius: var(--r);
  font-size: 15px; font-weight: 700; letter-spacing: .01em; color: var(--void);
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold) 55%, #A07830 100%);
  border: none; cursor: pointer; font-family: var(--font);
  min-height: 52px; position: relative; overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(200,160,76,.35),
    0 4px 20px rgba(200,160,76,.35),
    0 8px 40px rgba(200,160,76,.15),
    inset 0 1px 0 rgba(255,255,255,.15);
  transition: opacity .18s, transform .15s var(--spring-bounce), box-shadow .18s;
}
.pos-checkout-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, transparent 60%);
  pointer-events: none;
}
.pos-checkout-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(200,160,76,.5),
    0 6px 28px rgba(200,160,76,.45),
    0 12px 48px rgba(200,160,76,.2),
    inset 0 1px 0 rgba(255,255,255,.2);
}
.pos-checkout-btn:active:not(:disabled) { transform: translateY(0) scale(.99); }
.pos-checkout-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Discount + coupon rows */
.pos-discount-row { display: flex; gap: 8px; align-items: center; }
.pos-discount-row select, .pos-discount-row input { flex: 1; }
.pos-discount-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pos-quick-chip {
  padding: 5px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  background: var(--raised); border: 1px solid var(--ink-5);
  cursor: pointer; font-family: var(--font); min-height: 28px;
  transition: all .15s var(--spring);
}
.pos-quick-chip:hover { color: var(--gold); border-color: rgba(200,160,76,.35); background: var(--gold-glow); }
.pos-coupon-row { display: flex; gap: 8px; align-items: center; }
.pos-coupon-row input { flex: 1; }

/* Biz mode panels */
.pos-bizmode-panel { padding: 16px; }
.pos-biz-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .pos-biz-split { grid-template-columns: 1fr; } }
.pos-biz-card {
  background: var(--raised); border: 1px solid var(--ink-5);
  border-radius: var(--r-lg); padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03), 0 4px 16px rgba(0,0,0,.2);
}
html.light .pos-biz-card,
html[data-theme=light] .pos-biz-card {
  background: var(--raised);
  box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 4px 12px rgba(0,0,0,.04);
}
.pos-biz-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}
.pos-biz-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.pos-biz-list { display: flex; flex-direction: column; gap: 4px; }
.pos-biz-divider { height: 1px; background: var(--ink-5); margin: 4px 0; }
.pos-biz-list-item {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.02); border: 1px solid transparent;
  cursor: pointer; min-height: var(--sfy-touch-target);
  transition: background .15s, border-color .15s;
}
.pos-biz-list-item:hover { background: rgba(255,255,255,.05); border-color: var(--ink-5); }
.pos-biz-list-item > div:first-child { min-width: 0; }
.pos-biz-item-title { font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-biz-item-amount { font-weight: 900; flex-shrink: 0; color: var(--ink); }

/* Tables + host cards */
.pos-tables-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px;
}
.pos-host-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 12px 8px; border-radius: var(--r);
  background: rgba(255,255,255,.03); border: 1px solid var(--ink-5);
  cursor: pointer; text-align: center; min-height: 80px;
  transition: background .18s, border-color .18s, box-shadow .18s, transform .15s var(--spring-bounce);
}
.pos-host-card:hover {
  background: rgba(255,255,255,.06); border-color: rgba(200,160,76,.25);
  transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,.25);
}
.pos-host-card.is-occupied { background: rgba(200,160,76,.07); border-color: rgba(200,160,76,.25); }
.pos-host-card.is-reserved { background: rgba(96,165,250,.07); border-color: rgba(96,165,250,.2); }

/* Reservation items */
.pos-res-item { cursor: pointer; }
.res-title { font-weight: 700; color: var(--ink); }
.res-badge { padding: 3px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; flex-shrink: 0; }
.res-badge-default   { background: var(--raised); color: var(--ink-3); border: 1px solid var(--ink-5); }
.res-badge-seated    { background: rgba(74,222,128,.14);  color: var(--green); border: 1px solid rgba(74,222,128,.2); }
.res-badge-cancelled { background: rgba(248,113,113,.14); color: var(--red);   border: 1px solid rgba(248,113,113,.2); }
.res-badge-completed { background: rgba(96,165,250,.12);  color: var(--blue);  border: 1px solid rgba(96,165,250,.18); }
.pos-res-overflow { min-width: 0; }
.pos-res-overflow .res-title,
.pos-res-overflow .pos-mini { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Helper utilities */
.pos-mini { font-size: 11px; color: var(--ink-4); line-height: 1.45; }
.pos-empty { padding: 32px 20px; text-align: center; font-size: 13px; color: var(--ink-4); }
.pos-field-mt    { margin-top: 10px; }
.pos-field-mt-sm { margin-top: 6px; }
.pos-field-mt-md { margin-top: 12px; }
.pos-field-mb    { margin-bottom: 10px; }
.pos-field-mb-md { margin-bottom: 12px; }
.pos-field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pos-field-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.pos-form-grid-2  { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pos-btn-row         { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pos-btn-row-start   { display: flex; gap: 8px; flex-wrap: wrap; }
.pos-btn-row-between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Print receipt helpers */
.pos-receipt-wrap      { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial; padding: 18px; }
.pos-receipt-biz-name  { font-weight: 900; font-size: 18px; }
.pos-receipt-sub       { color: #666; font-size: 12px; margin-bottom: 12px; }
.pos-receipt-table     { width: 100%; border-collapse: collapse; font-size: 12px; }
.pos-receipt-table th  { padding: 6px 0; }
.pos-receipt-table td  { padding: 4px 0; }
.pos-receipt-table th:not(:first-child),
.pos-receipt-table td:not(:first-child) { text-align: right; }
.pos-receipt-divider   { border-top: 1px solid #ddd; margin-top: 12px; padding-top: 10px; font-size: 12px; }
.pos-receipt-line      { display: flex; justify-content: space-between; }
.pos-receipt-total     { display: flex; justify-content: space-between; font-weight: 900; font-size: 14px; }
.pos-receipt-thank     { color: #666; font-size: 11px; margin-top: 10px; }

/* Light mode overrides */
html.light .pos-panel-products, html[data-theme=light] .pos-panel-products { background: var(--base); }
html.light .pos-panel-cart,     html[data-theme=light] .pos-panel-cart     { background: var(--void); }
html.light .pos-cart-footer,    html[data-theme=light] .pos-cart-footer    { background: var(--base); }
html.light .pos-tabs-wrap,      html[data-theme=light] .pos-tabs-wrap      { background: var(--base); }
html.light .pos-tab             { background: var(--raised); }
html.light .pos-host-card       { background: var(--raised); }
html.light .pos-biz-list-item:hover { background: rgba(0,0,0,.03); }

/* Narrow viewport */
@media (max-width: 1100px) {
  .pos-cart-item       { grid-template-columns: 34px 1fr auto auto auto; gap: 6px; }
  .pos-cart-items-head { grid-template-columns: 1fr auto auto auto auto; gap: 6px; }
}

/* =================================================================
   SETTINGS / STAFF / TEAM PAGES  -  Tesla/iOS Grade
   ================================================================= */

/* Settings tables */
.settings-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--raised);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 4px 24px rgba(0,0,0,.28);
  overflow: hidden;
  font-size: 13px;
}
html.light .settings-table,
html[data-theme="light"] .settings-table {
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}
.settings-table thead th {
  padding: 11px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
  background: var(--elevated);
  border-bottom: 1px solid rgba(255,255,255,.05);
  white-space: nowrap;
}
html.light .settings-table thead th,
html[data-theme="light"] .settings-table thead th {
  background: rgba(0,0,0,.025);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.settings-table tbody tr { transition: background 120ms var(--spring); }
.settings-table tbody tr:hover { background: rgba(255,255,255,.025); }
html.light .settings-table tbody tr:hover,
html[data-theme="light"] .settings-table tbody tr:hover { background: rgba(0,0,0,.02); }
.settings-table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--ink);
  vertical-align: middle;
}
html.light .settings-table td,
html[data-theme="light"] .settings-table td { border-bottom: 1px solid rgba(0,0,0,.04); }
.settings-table tbody tr:last-child td { border-bottom: none; }
.settings-table td.text-right, .settings-table th.text-right { text-align: right; }
.settings-table td.nowrap, .settings-table th.nowrap { white-space: nowrap; }
.settings-table tbody tr.active td { background: var(--gold-glow); }

/* Settings helper text */
.settings-mini-note { font-size: 12px; color: var(--ink-3); line-height: 1.55; }
.settings-mini-note strong { color: var(--ink-2); }
.settings-upgrade-box {
  padding: 16px 18px;
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--gold-glow-strong), var(--gold-glow));
  border: 1px solid rgba(200,160,76,.2);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-2);
}
.settings-upgrade-box strong { color: var(--gold); }

/* Settings form helpers */
.settings-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .settings-form-grid { grid-template-columns: 1fr; } }
.settings-form-grid .full-span { grid-column: 1 / -1; }
.field-hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.settings-biz-warn-list { margin: 0 0 0 18px; padding: 0; }
.settings-biz-warn-list li { margin: 3px 0; font-size: 13px; }
.settings-pill-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* Payroll components */
.settings-payroll-section {
  background: var(--raised);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 4px 20px rgba(0,0,0,.24);
  overflow: hidden;
}
html.light .settings-payroll-section,
html[data-theme="light"] .settings-payroll-section {
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}
.settings-payroll-header {
  padding: 14px 18px;
  background: var(--elevated);
  border-bottom: 1px solid rgba(255,255,255,.05);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
html.light .settings-payroll-header,
html[data-theme="light"] .settings-payroll-header {
  background: rgba(0,0,0,.025);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
.settings-payroll-header h3 { font-size: 13px; font-weight: 700; color: var(--ink); margin: 0; }
.settings-payroll-body { padding: 16px 18px; }
.settings-payroll-ded-row { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.settings-payroll-row-label { min-width: 90px; font-size: 11px; color: var(--ink-3); }
.settings-payroll-ded-amt,
.settings-payroll-gross,
.settings-payroll-bonus,
.settings-payroll-extra {
  background: var(--elevated);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--r-sm);
  color: var(--ink);
  padding: 6px 8px;
  font-size: 13px;
  transition: border-color 150ms var(--spring), box-shadow 150ms var(--spring);
}
.settings-payroll-ded-amt:focus,
.settings-payroll-gross:focus,
.settings-payroll-bonus:focus,
.settings-payroll-extra:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow-ring);
}
.settings-payroll-ded-amt { width: 90px; }
.settings-payroll-gross { width: 110px; }
.settings-payroll-bonus, .settings-payroll-extra { width: 90px; }
.settings-std-ded-item {
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: var(--elevated);
  border: 1px solid rgba(255,255,255,.05);
}
html.light .settings-std-ded-item,
html[data-theme="light"] .settings-std-ded-item { background: rgba(0,0,0,.025); border: 1px solid rgba(0,0,0,.06); }
.settings-std-ded-item + .settings-std-ded-item { margin-top: 6px; }
.settings-std-ded-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.settings-std-ded-meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.settings-payslip-summary { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 500px) { .settings-payslip-summary { grid-template-columns: 1fr; } }
.settings-payslip-row-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.settings-payslip-row-ytd { font-size: 11px; opacity: .85; margin-top: 4px; }

/* Cancel flow */
.settings-cancel-step { display: flex; flex-direction: column; gap: 10px; }
.settings-cancel-step-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.settings-cancel-plan-box {
  padding: 12px 14px; border-radius: var(--r);
  background: var(--elevated); border: 1px solid rgba(255,255,255,.06);
}
html.light .settings-cancel-plan-box,
html[data-theme="light"] .settings-cancel-plan-box { background: rgba(0,0,0,.025); border: 1px solid rgba(0,0,0,.06); }
.settings-cancel-plan-box + .settings-cancel-plan-box { margin-top: 10px; }
.settings-cancel-plan-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.settings-cancel-plan-hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.settings-cancel-reason-label {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: var(--r);
  border: 1px solid rgba(255,255,255,.06); cursor: pointer;
  transition: border-color 150ms var(--spring), background 150ms var(--spring);
}
.settings-cancel-reason-label:hover { border-color: rgba(200,160,76,.2); background: var(--gold-glow); }
html.light .settings-cancel-reason-label,
html[data-theme="light"] .settings-cancel-reason-label { border: 1px solid rgba(0,0,0,.07); }
.settings-cancel-reason-label input[type="radio"] { margin-top: 2px; accent-color: var(--gold); }
.settings-cancel-reason-title { font-size: 13px; font-weight: 700; color: var(--ink); }

/* Session 13.7 Item 12 — Legacy CSS cleanup (V1 subset).
 * Deleted: .sa-modal-* legacy SA modal class set (orphan per
 * pre_13_7_legacy_css_dependency_map.md Group 2). Replaced wholesale by
 * .sab-modal-* in sessions 13.0+. The staff.js:1264 comment explicitly
 * called these out as "legacy SA modal markup, fully replaced". Zero
 * references in JS or HTML; the matching Tesla-era overrides at
 * shell-override.css:1245-1548 are now dead-code-no-ops (selectors
 * that match nothing) and will be removed in a 13.8 followup pass.
 *
 * Removed classes (8 selectors, ~45 lines):
 *   .sa-modal-backdrop, .sa-modal, .sa-modal-head, .sa-modal-title,
 *   .sa-modal-sub, .sa-modal-body, .sa-modal-foot, .sa-modal-error,
 *   .sa-modal-grid, .sa-modal-grid-1, .sa-flex-row, .sa-flex-row-center,
 *   .sa-seats-input-wrap
 *
 * Verification: grep across public/ confirms zero references in JS/HTML.
 */

/* Admin plan list */
.admin-list-item {
  padding: 14px 16px; border-radius: var(--r);
  background: var(--elevated); border: 1px solid rgba(255,255,255,.05);
  transition: border-color 150ms var(--spring), background 150ms var(--spring);
}
html.light .admin-list-item,
html[data-theme="light"] .admin-list-item { background: rgba(0,0,0,.02); border: 1px solid rgba(0,0,0,.06); }
.admin-list-item + .admin-list-item { margin-top: 6px; }
.admin-list-item.active { background: var(--gold-glow); border-color: rgba(200,160,76,.25); }
.admin-list-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-list-item-body { min-width: 0; }
.admin-list-item-actions { flex: 0 0 auto; }
.admin-list-item-title { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.admin-list-item-sub {
  font-size: 12px; color: var(--ink-3);
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px;
}
.admin-list-item-sub .pill {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 20px;
  background: rgba(255,255,255,.06);
  font-size: 10px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em;
}
html.light .admin-list-item-sub .pill,
html[data-theme="light"] .admin-list-item-sub .pill { background: rgba(0,0,0,.06); }
.admin-list-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* Session 13.2 — .sa-kb-publish-label, .sa-kb-actions removed (deletion plan §2). KB list re-skinned to .sab-row glass markup; legacy rules orphaned. */

/* Staff role badges */
.sa-role-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 20px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; flex-shrink: 0; }
.sa-role-badge.owner { background: var(--gold-glow-strong); color: var(--gold); border: 1px solid rgba(200,160,76,.2); }
.sa-role-badge.manager { background: var(--blue-glow); color: var(--blue); border: 1px solid rgba(96,165,250,.15); }
.sa-role-badge.cashier { background: var(--green-glow); color: var(--green); border: 1px solid rgba(74,222,128,.15); }
.sa-role-badge.partner { background: rgba(167,139,250,.1); color: #a78bfa; border: 1px solid rgba(167,139,250,.15); }
.sa-role-badge.custom { background: rgba(255,255,255,.05); color: var(--ink-3); border: 1px solid rgba(255,255,255,.08); }

/* Permission rows */
.sa-perm-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  min-height: var(--sfy-touch-target);
}
html.light .sa-perm-row,
html[data-theme="light"] .sa-perm-row { border-bottom: 1px solid rgba(0,0,0,.05); }
.sa-perm-row:last-child { border-bottom: none; }
.sa-perm-label { font-size: 13px; color: var(--ink-2); flex: 1; min-width: 0; }
.sa-perm-desc { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* Team page — employee cards */
.team2-emp-card {
  background: var(--glass-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--r-lg);
  border: 1px solid rgba(255,255,255,.06);
  padding: 14px 16px; cursor: pointer;
  transition: border-color 180ms var(--spring), box-shadow 180ms var(--spring), background 180ms var(--spring);
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
}
.team2-emp-card:hover { border-color: rgba(200,160,76,.2); box-shadow: 0 4px 20px rgba(0,0,0,.3), 0 0 0 1px rgba(200,160,76,.1); }
.team2-emp-card.active { border-color: rgba(200,160,76,.35); background: var(--gold-glow); box-shadow: 0 4px 24px rgba(0,0,0,.3), 0 0 20px var(--gold-glow); }
html.light .team2-emp-card,
html[data-theme="light"] .team2-emp-card { background: var(--raised); border: 1px solid rgba(0,0,0,.06); box-shadow: 0 1px 6px rgba(0,0,0,.05); }
html.light .team2-emp-card:hover,
html[data-theme="light"] .team2-emp-card:hover { border-color: rgba(150,117,10,.2); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.team2-emp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.team2-emp-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-glow-strong), rgba(200,160,76,.06));
  border: 1px solid rgba(200,160,76,.22);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--gold); flex-shrink: 0; text-transform: uppercase;
}
.team2-emp-name { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team2-emp-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team2-emp-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.team2-empty { padding: 24px 16px; text-align: center; font-size: 13px; color: var(--ink-3); }

/* Team status badges */
.team-tag {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 20px;
  font-size: 10px; font-weight: 600; letter-spacing: .03em;
  color: var(--ink-3); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.07);
}
html.light .team-tag,
html[data-theme="light"] .team-tag { background: rgba(0,0,0,.05); border: 1px solid rgba(0,0,0,.07); }
.team-tag.status-active { background: var(--green-glow); color: var(--green); border-color: rgba(74,222,128,.18); }
.team-tag.status-leave { background: var(--amber-glow); color: var(--amber); border-color: rgba(251,191,36,.18); }
.team-tag.status-terminated { background: var(--red-glow); color: var(--red); border-color: rgba(248,113,113,.15); }

/* Team list items */
.team-list-item { padding: 12px 14px; border-radius: var(--r-sm); background: var(--elevated); border: 1px solid rgba(255,255,255,.05); margin-bottom: 6px; }
html.light .team-list-item,
html[data-theme="light"] .team-list-item { background: rgba(0,0,0,.025); border: 1px solid rgba(0,0,0,.06); }
.team-list-item:last-child { margin-bottom: 0; }
.team-list-item-label { display: flex; gap: 10px; align-items: flex-start; }
.team-list-item-content { flex: 1; min-width: 0; }
.team-list-item-title { font-size: 13px; font-weight: 700; color: var(--ink); }
.team-list-item-foot { margin-top: 8px; display: flex; justify-content: flex-end; }
.team-doc-header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.team-doc-info { min-width: 0; }
.team-doc-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.team-doc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.team-note-text { white-space: pre-wrap; font-size: 13px; color: var(--ink-2); }

/* Org chart */
.team-org-node { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 10px 14px; background: var(--elevated); border-radius: var(--r-sm); border: 1px solid rgba(255,255,255,.05); margin-bottom: 4px; }
html.light .team-org-node,
html[data-theme="light"] .team-org-node { background: rgba(0,0,0,.025); border: 1px solid rgba(0,0,0,.06); }
.team-org-node-body { min-width: 0; }
.team-org-node-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.team-org-node-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.team-org-children { margin-left: 24px; padding-left: 16px; border-left: 2px solid rgba(255,255,255,.06); }
html.light .team-org-children,
html[data-theme="light"] .team-org-children { border-left-color: rgba(0,0,0,.06); }

/* Native select */
.team-native-select { background: var(--elevated); border: 1px solid rgba(255,255,255,.07); border-radius: var(--r-sm); color: var(--ink); padding: 8px 10px; font-size: 13px; transition: border-color 150ms var(--spring), box-shadow 150ms var(--spring); width: 100%; appearance: none; -webkit-appearance: none; }
.team-native-select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow-ring); }
html.light .team-native-select,
html[data-theme="light"] .team-native-select { background: rgba(0,0,0,.03); border-color: rgba(0,0,0,.1); color: var(--ink); }

/* Spinner in buttons */
.btn-spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.25); border-top-color: currentColor; border-radius: 50%; animation: btn-spin 0.6s linear infinite; vertical-align: middle; flex-shrink: 0; }
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-spinner-row { display: inline-flex; align-items: center; gap: 8px; }

@media (max-width: 767px) {
  .settings-payroll-body { padding: 12px 14px; }
  .settings-payroll-header { padding: 12px 14px; }
  .sa-modal-body { padding: 16px 18px; }
  .sa-modal-head { padding: 14px 18px 12px; }
  .sa-modal-foot { padding: 12px 18px; }
}

/* ═══════════════════════════════════════════════════════════════════
   SESSION 13.1 — SUPER ADMIN BUSINESSES NATIVE REBUILD
   Legacy Session 13.0 .sa-* directory primitives (shell, hero, stats,
   row-actions, kebab menus, side surface, pills, mini-tabs, empty-state)
   were superseded by .sab-* in public/app/shell-override-v2.css. See
   docs/council/archive/session_13_1/ for the rebuild scope.

   PRESERVED (still in use):
   - .is-deferred / .staff-tab--deferred — Plans + Webhooks tabs deferred
   - .sa-hero-actions — deferred tab action row
   - .sa-surface-card — deferred tab containers
   - .sa-toolbar + .admin-search-row — deferred tab search bars
   - .admin-table-wrapper / .sa-table + cell primitives — user tickets panel
   - .btn-kebab — kebab toggle (used by .sab-row-actions)
   - .role-gate-wrap / .role-gate-inline-label — permissions gating
   - .admin-title / .admin-subtitle / .admin-layout — global utilities
   ═══════════════════════════════════════════════════════════════════ */

/* ── Hide-until-ready primitives (Plans + Webhooks deferred) ───────── */
/* Doubled-class + !important defeats shell-override-v2.css
   `button.btn { display: inline-flex !important }` (specificity 0,1,1) */
.is-deferred.is-deferred { display: none !important; }
.staff-tab--deferred.staff-tab--deferred { display: none !important; }

/* ── Deferred tab action row ───────────────────────────────────────── */
.sa-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Admin title / subtitle (used by deferred tabs + global) ───────── */
.admin-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  margin: 4px 0 4px 0;
  letter-spacing: -.01em;
}
.admin-subtitle {
  font-size: 13px;
  color: var(--ink-3);
  max-width: 620px;
  line-height: 1.5;
  margin: 0;
}

/* ── Primary surface card (deferred Plans + Webhooks containers) ───── */
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1024px) { .admin-layout { grid-template-columns: 1fr; } }

.sa-surface-card {
  background: var(--raised);
  border-radius: var(--r-lg);
  padding: 20px 22px 22px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.05),
    0 4px 24px rgba(0,0,0,.20);
}

/* ── Toolbar (deferred tab search row) ─────────────────────────────── */
.sa-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 16px;
}
.admin-search-row.sa-toolbar input[type="text"],
.sa-toolbar input[type="text"] {
  flex: 1;
  min-width: 220px;
  background: var(--elevated);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-sm);
  color: var(--ink);
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font);
  transition: border-color 150ms var(--spring), box-shadow 150ms var(--spring);
}
.sa-toolbar input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow-ring);
}

/* ── Table (deferred Webhooks + visible user tickets panel) ────────── */
.admin-table-wrapper {
  overflow: visible;
  -webkit-overflow-scrolling: touch;
}
.sa-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.sa-table thead th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 10px 12px;
  background: var(--raised);
  border-bottom: 1px solid rgba(255,255,255,.05);
  position: sticky;
  top: 0;
  z-index: 2;
}
.sa-table tbody td {
  padding: 12px;
  font-size: 13px;
  color: var(--ink-2);
  border-bottom: 1px solid rgba(255,255,255,.03);
  vertical-align: middle;
}
.sa-table tbody tr:hover td { background: rgba(255,255,255,.02); }
/* Session 13.2 — .sa-cell-title, .sa-cell-sub removed (deletion plan §3). Tickets list rebuilt to .sab-row glass markup; legacy rules orphaned. */

/* ── Kebab toggle button (used by .sab-row-actions) ────────────────── */
.btn-kebab {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-sm);
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
  flex: 0 0 auto;
  transition: background 150ms var(--spring), color 150ms var(--spring), border-color 150ms var(--spring);
}
.btn-kebab:hover { background: rgba(255,255,255,.03); color: var(--ink); border-color: rgba(255,255,255,.09); }
.btn-kebab:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow-ring);
}
.btn-kebab > svg { width: 24px; height: 24px; flex: 0 0 auto; }

/* ── Role-gate affordances (tooltip + inline label) ────────────────── */
/* Net-new pattern carried from session 13.0 pilot. Wraps a disabled kebab
   item in a <span.role-gate-wrap data-tooltip="reason"> so hover/focus
   reveals the gate reason AND an inline "Super admin only" label stays
   visible on touch devices (iPad primary affordance). */
.role-gate-wrap {
  position: relative;
  display: inline-flex;
}
.role-gate-wrap[data-tooltip]:hover::after,
.role-gate-wrap[data-tooltip]:focus-within::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--elevated);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.38), inset 0 0 0 1px rgba(255,255,255,.06);
  pointer-events: none;
  z-index: 70;
}
.role-gate-inline-label {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* ── Light-mode variants (preserved surfaces only) ─────────────────── */
html.light .sa-surface-card,
html[data-theme="light"] .sa-surface-card {
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.04);
}
html.light .btn-kebab,
html[data-theme="light"] .btn-kebab { border-color: rgba(0,0,0,.08); color: var(--ink-3); }
html.light .btn-kebab:hover,
html[data-theme="light"] .btn-kebab:hover { background: rgba(0,0,0,.03); color: var(--ink); }
html.light .sa-table thead th,
html[data-theme="light"] .sa-table thead th { background: #fff; border-bottom-color: rgba(0,0,0,.06); }
html.light .sa-toolbar input[type="text"],
html[data-theme="light"] .sa-toolbar input[type="text"] { background: rgba(0,0,0,.02); border-color: rgba(0,0,0,.08); color: var(--ink); }

/* ── Mobile tweaks (375px-first) ───────────────────────────────────── */
@media (max-width: 767px) {
  .sa-surface-card { padding: 16px 14px; }
  .admin-title { font-size: 18px; }
  .admin-subtitle { font-size: 12px; }
  /* Table → card fallback on narrow viewports (user tickets + webhooks) */
  .sa-table thead { display: none; }
  .sa-table tbody td {
    display: block;
    padding: 4px 0;
    border-bottom: none;
    font-size: 12.5px;
  }
  .sa-table tbody td::before {
    content: attr(data-label);
    display: block;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-4);
    margin-bottom: 2px;
  }
  .sa-table tbody tr {
    display: block;
    padding: 14px;
    border-radius: var(--r);
    background: var(--elevated);
    margin-bottom: 10px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
  }
}
