
:root {
  --rr-bg: #0A0118;
  --rr-violet: #200230;
  --rr-violet-2: #2B0D42;
  --rr-pink: #F239F7;
  --rr-cyan: #58F9F4;
  --rr-yellow: #FFF140;
  --rr-light-cyan: #9BF8F4;
  --rr-light-pink: #F65EF8;
  --rr-magenta: #AA235C;
  --rr-text: #FFFFFF;
  --rr-text-dim: #9BF8F4;
  --rr-text-muted: rgba(255,255,255,0.55);
  --rr-border: rgba(242,57,247,0.18);
  --rr-border-cyan: rgba(88,249,244,0.18);
  --rr-panel: rgba(43,13,66,0.55);
  --rr-panel-2: rgba(32,2,48,0.85);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--rr-bg);
  color: var(--rr-text);
  font-family: 'Space Grotesk', -apple-system, system-ui, sans-serif;
  font-size: 14px;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(242,57,247,0.10) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(88,249,244,0.08) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(43,13,66,0.4) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.app {
  position: relative;
  display: flex;
  min-height: 100vh;
  z-index: 1;
}

/* ======================== SIDEBAR ======================== */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--rr-violet) 0%, var(--rr-bg) 100%);
  border-right: 1px solid var(--rr-border);
  /* Top padding respects iPhone Dynamic Island / status bar via safe-area-inset-top */
  padding: max(22px, calc(env(safe-area-inset-top, 0px) + 12px)) 0 max(22px, env(safe-area-inset-bottom, 0px));
  position: sticky; top: 0;
  height: 100vh;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 22px 22px;
  border-bottom: 1px solid var(--rr-border);
  margin-bottom: 16px;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--rr-pink), var(--rr-magenta));
  display: grid; place-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  color: white;
  box-shadow: 0 0 22px rgba(242,57,247,0.6), inset 0 0 8px rgba(255,255,255,0.15);
}
.brand-text { line-height: 1.1; }
.brand-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--rr-pink), var(--rr-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub {
  font-size: 10px;
  color: var(--rr-text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

.nav-section {
  padding: 0 14px;
  margin-bottom: 10px;
}
/* Master tabs (group headers) — high-visibility yellow pills on the dark purple
   sidebar. Every master tab reads as a bright yellow bubble; the OPEN section
   gets a stronger fill + glow so active vs inactive stays distinguishable. */
.nav-section-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px;
  letter-spacing: 1.4px;
  font-weight: 700;
  color: var(--rr-yellow);
  text-transform: uppercase;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,241,64,0.10);
  border: 1px solid rgba(255,241,64,0.28);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.nav-section-title:hover {
  background: rgba(255,241,64,0.20);
  border-color: rgba(255,241,64,0.5);
  color: var(--rr-yellow);
}
/* Open (expanded) section = the "active" master tab: brighter pill + soft glow. */
.nav-section:not(.collapsed) > .nav-section-title {
  background: linear-gradient(90deg, rgba(255,241,64,0.30), rgba(255,241,64,0.10));
  border-color: rgba(255,241,64,0.6);
  box-shadow: 0 0 14px rgba(255,241,64,0.22), inset 0 0 0 1px rgba(255,241,64,0.15);
}
.nav-caret {
  font-size: 11px; opacity: 0.85;
  transition: transform 0.2s ease;
}
.nav-section.collapsed .nav-caret { transform: rotate(-90deg); }
.nav-section-body {
  overflow: hidden;
  max-height: 1400px;
  transition: max-height 0.25s ease;
}
.nav-section.collapsed .nav-section-body {
  max-height: 0;
}
.nav-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--rr-text);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.15s ease;
  user-select: none;
}
.nav-item:hover { background: rgba(242,57,247,0.08); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(242,57,247,0.18), rgba(88,249,244,0.05));
  border: 1px solid rgba(242,57,247,0.35);
  box-shadow: 0 0 14px rgba(242,57,247,0.15);
}
.nav-item .ico { width: 18px; height: 18px; opacity: 0.85; }
.nav-item-left { display: flex; align-items: center; gap: 10px; }
.nav-badge {
  background: var(--rr-pink); color: white;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
  box-shadow: 0 0 8px rgba(242,57,247,0.6);
}
.nav-badge.cyan { background: var(--rr-cyan); color: var(--rr-violet); box-shadow: 0 0 8px rgba(88,249,244,0.5); }
.nav-badge.yellow { background: var(--rr-yellow); color: var(--rr-violet); box-shadow: 0 0 8px rgba(255,241,64,0.5); }

.sidebar-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--rr-border);
  margin-top: auto;
  font-size: 11px;
  color: var(--rr-text-muted);
}
.store-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(88,249,244,0.06);
  border: 1px solid var(--rr-border-cyan);
  margin-bottom: 8px;
}
.store-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2BFF95;
  box-shadow: 0 0 8px #2BFF95;
}
.store-pill .label { font-size: 12px; color: var(--rr-text); font-weight: 500; }

/* ======================== MAIN AREA ======================== */
.main {
  flex: 1;
  min-width: 0;
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  /* Use safe-area-inset-top so iOS PWA status bar doesn't overlap the hamburger / time */
  padding: max(18px, calc(env(safe-area-inset-top, 0px) + 12px)) 32px 18px;
  padding-left: max(32px, env(safe-area-inset-left, 0px));
  padding-right: max(32px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--rr-border);
  background: rgba(10,1,24,0.7);
  backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 10;
}
.crumb {
  display: flex; align-items: center; gap: 14px;
  color: var(--rr-text-muted);
  font-size: 13px;
}
.crumb b { color: var(--rr-text); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.chip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(43,13,66,0.6);
  border: 1px solid var(--rr-border);
  font-size: 12px;
}
.chip.alert { border-color: rgba(255,241,64,0.45); color: var(--rr-yellow); }
.chip.live { border-color: rgba(88,249,244,0.45); color: var(--rr-cyan); }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rr-cyan); box-shadow: 0 0 6px var(--rr-cyan); }
.chip.alert .dot { background: var(--rr-yellow); box-shadow: 0 0 6px var(--rr-yellow); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rr-cyan), var(--rr-pink));
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--rr-violet);
  box-shadow: 0 0 12px rgba(88,249,244,0.35);
}

/* ---- Access-Level View Switcher (exec-only) -------------------------------
   A chip-style dropdown in the top-right that lets an exec PREVIEW RI as any
   access level. Visual preview only — real permissions are untouched. The
   .is-previewing amber ring is a persistent reminder in the sticky topbar. */
.rr-view-switch {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 8px 5px 11px;
  border-radius: 999px;
  background: rgba(43,13,66,0.6);
  border: 1px solid var(--rr-border);
  font-size: 12px;
}
.rr-view-switch-eye { font-size: 12px; opacity: 0.85; line-height: 1; }
.rr-view-switch select {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: none; outline: none;
  color: var(--rr-text);
  font: inherit; font-size: 12px;
  padding-right: 14px; max-width: 168px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23c9b8e0' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0 center;
}
.rr-view-switch select option { color: #111; }  /* native menu renders on white */
.rr-view-switch.is-previewing {
  border-color: rgba(255,241,64,0.7);
  background: rgba(255,241,64,0.10);
  box-shadow: 0 0 10px rgba(255,241,64,0.25);
}
.rr-view-switch.is-previewing .rr-view-switch-eye { opacity: 1; }

/* Slim banner under the topbar while previewing — the obvious "you're in a
   preview" reminder with a one-tap exit. */
#rr-preview-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 8px max(32px, env(safe-area-inset-left, 0px));
  background: rgba(255,241,64,0.12);
  border-bottom: 1px solid rgba(255,241,64,0.4);
  color: var(--rr-yellow);
  font-size: 12.5px;
}
#rr-preview-banner .rr-preview-text { color: var(--rr-text); }
#rr-preview-banner .rr-preview-text b { color: var(--rr-yellow); }
#rr-preview-banner .rr-preview-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--rr-yellow); box-shadow: 0 0 7px var(--rr-yellow);
  animation: pulse 2s infinite; flex: none;
}
#rr-preview-banner .rr-preview-exit {
  margin-left: auto;
  padding: 4px 12px; border-radius: 999px;
  background: rgba(255,241,64,0.18);
  border: 1px solid rgba(255,241,64,0.5);
  color: var(--rr-yellow);
  font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
#rr-preview-banner .rr-preview-exit:hover { background: rgba(255,241,64,0.3); }

.content { padding: 28px 32px calc(80px + env(safe-area-inset-bottom, 0px)); }
.view { display: none; }
.view.active { display: block; }

.greeting h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.greeting .sub {
  color: var(--rr-text-muted);
  font-size: 13.5px;
  margin-bottom: 24px;
}
.greeting .wave { display: inline-block; }

/* ======================== TILES (KPIs) ======================== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}
.kpi {
  background: var(--rr-panel);
  border: 1px solid var(--rr-border);
  border-radius: 14px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--rr-pink), var(--rr-cyan));
}
.kpi.warn::before { background: linear-gradient(90deg, var(--rr-yellow), var(--rr-pink)); }
.kpi.alert::before { background: linear-gradient(90deg, #FF4D6D, var(--rr-pink)); }
.kpi-label {
  font-size: 10.5px;
  color: var(--rr-text-muted);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.kpi-val {
  font-size: 28px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.5px;
}
.kpi-val.cyan { color: var(--rr-cyan); }
.kpi-val.pink { color: var(--rr-pink); }
.kpi-val.yellow { color: var(--rr-yellow); }
/* Product Mix tile headlines a product name, not a number — shrink so it fits one tile. */
.kpi-val.name { font-size: 17px; font-weight: 600; letter-spacing: 0; line-height: 1.18; word-break: break-word; }
.kpi-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--rr-text-muted);
}
.kpi-meta .up { color: #2BFF95; }
.kpi-meta .down { color: #FF6B8A; }
.kpi-tabs { display: flex; gap: 4px; }
.kpi-tab {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.kpi-tab.active {
  background: var(--rr-cyan);
  color: var(--rr-violet);
}

/* ======================== PANELS ======================== */
.grid-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.panel {
  background: var(--rr-panel);
  border: 1px solid var(--rr-border);
  border-radius: 14px;
  padding: 20px;
}
.panel-cyan {
  border-color: var(--rr-border-cyan);
}
.panel-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.panel-h h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.panel-h .sub { font-size: 11px; color: var(--rr-text-muted); }

/* Action items */
.action-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.action-item:hover { background: rgba(242,57,247,0.06); border-color: var(--rr-border); }
.action-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.action-icon.pink { background: rgba(242,57,247,0.15); color: var(--rr-pink); }
.action-icon.cyan { background: rgba(88,249,244,0.15); color: var(--rr-cyan); }
.action-icon.yellow { background: rgba(255,241,64,0.15); color: var(--rr-yellow); }
.action-body { flex: 1; min-width: 0; }
.action-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.action-meta { font-size: 11.5px; color: var(--rr-text-muted); }
.action-tag {
  font-size: 10px; font-weight: 700;
  padding: 4px 9px; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.tag-pink { background: rgba(242,57,247,0.18); color: var(--rr-pink); }
.tag-cyan { background: rgba(88,249,244,0.18); color: var(--rr-cyan); }
.tag-yellow { background: rgba(255,241,64,0.2); color: var(--rr-yellow); }

/* AI insight box */
.insight {
  display: flex; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(90deg, rgba(242,57,247,0.10), rgba(88,249,244,0.05));
  border: 1px solid var(--rr-border);
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 13px;
  line-height: 1.5;
}
.insight .bot {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--rr-pink), var(--rr-cyan));
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 14px;
}

/* Day forecast strip */
.day-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.day-card {
  flex: 1; min-width: 92px;
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(255,255,255,0.05);
  text-align: center;
}
.day-card.high { border-color: rgba(242,57,247,0.4); background: rgba(242,57,247,0.08); }
.day-card.peak { border-color: var(--rr-pink); background: rgba(242,57,247,0.16); box-shadow: 0 0 14px rgba(242,57,247,0.25); }
.day-card.elev { border-color: rgba(88,249,244,0.3); background: rgba(88,249,244,0.06); }
.day-name { font-size: 10.5px; color: var(--rr-text-muted); letter-spacing: 0.5px; text-transform: uppercase; }
.day-num { font-size: 16px; font-weight: 700; margin: 2px 0 4px; }
.day-rev { font-size: 13px; font-weight: 600; color: var(--rr-cyan); }
.day-staff { font-size: 11px; color: var(--rr-text-muted); margin-top: 2px; }
.day-tag { font-size: 9.5px; color: var(--rr-yellow); margin-top: 4px; font-weight: 600; }

/* Tables */
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
table.data th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--rr-text-muted);
  border-bottom: 1px solid var(--rr-border);
}
table.data td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
table.data tr:hover td { background: rgba(242,57,247,0.04); }

.status-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}
.status-ok { background: rgba(43,255,149,0.15); color: #2BFF95; }
.status-low { background: rgba(255,241,64,0.15); color: var(--rr-yellow); }
.status-crit { background: rgba(255,77,109,0.18); color: #FF6B8A; }
.status-pend { background: rgba(88,249,244,0.15); color: var(--rr-cyan); }
.status-appr { background: rgba(43,255,149,0.12); color: #2BFF95; }

.bar-meter { width: 60px; height: 6px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.bar-fill { height: 100%; border-radius: 3px; }
.bar-fill.ok { background: #2BFF95; }
.bar-fill.low { background: var(--rr-yellow); }
.bar-fill.crit { background: #FF6B8A; }

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--rr-pink), var(--rr-magenta));
  color: white;
  box-shadow: 0 0 14px rgba(242,57,247,0.35);
}
.btn-primary:hover { box-shadow: 0 0 20px rgba(242,57,247,0.55); transform: translateY(-1px); }
.btn-cyan {
  background: var(--rr-cyan);
  color: var(--rr-violet);
  box-shadow: 0 0 12px rgba(88,249,244,0.3);
}
.btn-ghost {
  background: transparent;
  color: var(--rr-text-dim);
  border: 1px solid var(--rr-border);
}
.btn-ghost:hover { border-color: var(--rr-pink); color: var(--rr-pink); }
.btn-sm { padding: 5px 10px; font-size: 11.5px; }

/* Charts */
.chart-wrap { position: relative; height: 240px; }
.chart-wrap.tall { height: 320px; }

/* Interactive scrubber readout — "Today's Sales vs. Forecast" */
.ts-scrub-hint { color: var(--rr-cyan); opacity: 0.85; }
.ts-scrub-readout {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px;
  margin: 0 2px 10px; min-height: 22px; font-size: 12px; color: var(--rr-text-muted);
}
.ts-scrub-readout .tsr-time {
  font-weight: 700; color: #fff; letter-spacing: 0.3px;
  background: rgba(242,57,247,0.16); border: 1px solid var(--rr-border);
  border-radius: 999px; padding: 2px 10px;
}
.ts-scrub-readout .tsr-item { display: inline-flex; align-items: center; gap: 6px; }
.ts-scrub-readout .tsr-item b { color: #fff; font-weight: 700; }
.ts-scrub-readout .tsr-item i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ts-scrub-readout .tsr-fcst i { background: var(--rr-cyan); }
.ts-scrub-readout .tsr-actual i { background: var(--rr-pink); }
.ts-scrub-readout .tsr-delta.up b { color: #46E39B; }
.ts-scrub-readout .tsr-delta.down b { color: #FF6BA0; }
.ts-scrub-readout .tsr-delta.flat b { color: var(--rr-text-muted); }
@media (max-width: 640px) {
  .ts-scrub-readout { font-size: 11px; gap: 6px 10px; }
}

/* Filter chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.f-chip {
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  font-weight: 500;
}
.f-chip.active {
  background: rgba(242,57,247,0.18);
  border-color: var(--rr-pink);
  color: var(--rr-pink);
}

/* Order cards (Suggested Ordering) */
.order-card {
  background: var(--rr-panel);
  border: 1px solid var(--rr-border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
}
.order-h { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.order-vendor { font-size: 15px; font-weight: 600; }
.order-due { font-size: 11.5px; color: var(--rr-text-muted); margin-top: 2px; }
.order-total { font-size: 18px; font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--rr-cyan); }
.order-delta { font-size: 11px; color: #2BFF95; margin-top: 2px; }
.order-actions { display: flex; gap: 8px; margin-top: 12px; }

/* Login overlay */
.login-link {
  position: fixed; bottom: 18px; right: 22px;
  font-size: 11.5px;
  color: var(--rr-text-muted);
  background: rgba(43,13,66,0.85);
  border: 1px solid var(--rr-border);
  padding: 7px 14px;
  border-radius: 999px;
  text-decoration: none;
  z-index: 50;
}
.login-link:hover { color: var(--rr-pink); border-color: var(--rr-pink); }

/* Section spacing */
.section-h {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-h h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.section-h .sub {
  font-size: 12.5px;
  color: var(--rr-text-muted);
  margin-top: 2px;
}

/* Roster avatars */
.avatar-sm {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rr-pink), var(--rr-cyan));
  display: inline-grid; place-items: center;
  font-size: 11px; font-weight: 700;
  color: var(--rr-violet);
  margin-right: 8px;
  vertical-align: middle;
}

/* Scoreboard */
.score-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
  margin-bottom: 6px;
}
.score-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--rr-cyan);
  font-weight: 700;
  margin-right: 10px;
}
.score-rank.gold { color: var(--rr-yellow); }
.score-name { flex: 1; font-size: 13px; font-weight: 500; }
.score-val { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; color: var(--rr-pink); }

/* Day-part rows */
.dp-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.dp-row:last-child { border-bottom: none; }
.dp-label { font-size: 12.5px; }
.dp-bar { flex: 1; margin: 0 16px; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.dp-fill { height: 100%; background: linear-gradient(90deg, var(--rr-pink), var(--rr-cyan)); border-radius: 3px; }
.dp-val { font-size: 12.5px; font-weight: 600; font-family: 'JetBrains Mono', monospace; min-width: 70px; text-align: right; }

/* Misc */
.divider { height: 1px; background: var(--rr-border); margin: 18px 0; }

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
::-webkit-scrollbar-thumb { background: rgba(242,57,247,0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--rr-pink); }

/* ============================================================
   MOBILE RESPONSIVE LAYER
   Breakpoints: 1100 (laptop), 960 (tablet), 720 (mobile), 480 (small)
   ============================================================ */

.mobile-menu-btn {
  display: none;
  background: rgba(43,13,66,0.85);
  border: 1px solid var(--rr-border);
  color: var(--rr-text);
  width: 40px; height: 40px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 22px;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mobile-menu-btn:hover { border-color: var(--rr-pink); color: var(--rr-pink); }
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
  z-index: 99;
  cursor: pointer;
}
.sidebar-close {
  display: none;
  position: absolute;
  /* Respect iOS safe-area so the X button sits below the Dynamic Island */
  top: max(12px, calc(env(safe-area-inset-top, 0px) + 8px));
  right: 12px;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--rr-border);
  color: var(--rr-text);
  font-size: 18px;
  cursor: pointer;
  align-items: center; justify-content: center;
  z-index: 1;
}

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .sidebar { width: 210px; }
  .content { padding: 22px 18px 60px; }
  .topbar { padding: 14px 18px; }
  .section-h h2 { font-size: 17px; }
  .kpi-val { font-size: 24px; }
  .day-card { min-width: 82px; }
  .panel { padding: 18px; }
  .order-actions { flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 720px) {
  /* Sidebar becomes slide-in drawer */
  .app { display: block; }
  .sidebar {
    display: block !important;
    position: fixed;
    top: 0; left: -260px;
    width: 240px;
    height: 100vh;
    z-index: 100;
    transition: left 0.25s ease;
    box-shadow: 8px 0 32px rgba(0,0,0,0.55);
  }
  body.sidebar-open .sidebar { left: 0; }
  body.sidebar-open .sidebar-backdrop { display: block; }
  body.sidebar-open .sidebar-close { display: flex; }
  .main { width: 100%; min-width: 0; }
  .mobile-menu-btn { display: inline-flex; }

  /* Topbar */
  .topbar {
    padding: max(12px, calc(env(safe-area-inset-top, 0px) + 8px)) max(14px, env(safe-area-inset-right, 0px)) 12px max(14px, env(safe-area-inset-left, 0px));
    gap: 8px;
    flex-wrap: wrap;
  }
  .topbar-right { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .topbar-right .chip { padding: 4px 9px; font-size: 10.5px; }
  .topbar-right .chip:nth-child(2),
  .topbar-right .chip:nth-child(3) { display: none; }
  .crumb { font-size: 11.5px; gap: 8px; flex: 1; min-width: 0; }
  .crumb b { font-size: 12px; }
  .avatar { width: 30px; height: 30px; font-size: 12px; }

  .content { padding: 16px 12px 90px; }

  /* Section header stacks vertically */
  .section-h { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 14px; }
  .section-h h2 { font-size: 18px; }
  .section-h .sub { font-size: 12px; }
  .section-h > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; }
  .section-h > div:last-child .btn { flex: 1; min-width: 130px; }

  /* KPI row: 2 cols on mobile */
  .kpi-row { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
  .kpi { padding: 14px 14px; }
  .kpi-val { font-size: 22px; }
  .kpi-label { font-size: 9.5px; gap: 4px; }
  .kpi-meta { font-size: 11px; }

  /* Greeting */
  .greeting h1 { font-size: 22px; }
  .greeting .sub { font-size: 12.5px; margin-bottom: 18px; }

  /* Panels */
  .panel { padding: 14px; border-radius: 12px; }
  .panel-h { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .panel-h h3 { font-size: 13.5px; }

  /* Tables */
  table.data { font-size: 11.5px; }
  table.data th, table.data td { padding: 8px 6px; }
  table.data th { font-size: 9.5px; letter-spacing: 0.5px; }

  /* Day strip stays horizontal-scroll */
  .day-strip { gap: 6px; padding-bottom: 10px; -webkit-overflow-scrolling: touch; }
  .day-card { min-width: 78px; padding: 8px 6px; }
  .day-name { font-size: 9.5px; }
  .day-num { font-size: 14px; }
  .day-rev { font-size: 11.5px; }
  .day-staff { font-size: 10px; }
  .day-tag { font-size: 8.5px; padding: 2px 5px; }

  /* Action items */
  .action-item { padding: 10px; gap: 10px; }
  .action-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 8px; }
  .action-title { font-size: 12.5px; }
  .action-meta { font-size: 11px; }
  .action-tag { font-size: 9px; padding: 3px 7px; }

  /* Buttons: bigger touch targets */
  .btn { padding: 10px 14px; font-size: 13px; min-height: 40px; }
  .btn-sm { padding: 7px 11px; font-size: 11.5px; min-height: 32px; }
  .btn-cyan, .btn-primary { font-weight: 600; }

  /* Filter chips horizontal-scroll */
  .chips { gap: 6px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; -webkit-overflow-scrolling: touch; margin-left: -2px; padding-left: 2px; }
  .f-chip { white-space: nowrap; flex-shrink: 0; padding: 6px 12px; font-size: 11.5px; }

  /* Login / Sign Out pill */
  .login-link { bottom: 12px; right: 12px; font-size: 10.5px; padding: 6px 11px; }

  /* Order cards */
  .order-card { padding: 14px; }
  .order-h { flex-direction: column; gap: 10px; align-items: flex-start; }
  .order-vendor { font-size: 13.5px; }
  .order-due { font-size: 10.5px; }
  .order-total { font-size: 16px; }
  .order-actions { flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .order-actions .btn { flex: 1 1 calc(50% - 4px); min-width: 0; }

  /* Day-part rows */
  .dp-row { padding: 9px 0; flex-wrap: wrap; gap: 4px; }
  .dp-label { font-size: 12px; flex: 1 1 100%; }
  .dp-bar { margin: 0; min-width: 0; flex: 1; }
  .dp-val { font-size: 11.5px; min-width: 60px; }

  /* Score rows */
  .score-row { padding: 8px 10px; }
  .score-name { font-size: 12px; }
  .score-val { font-size: 12px; }
  .score-rank { font-size: 11px; margin-right: 8px; }

  /* Status pills */
  .status-pill { font-size: 9.5px; padding: 2px 6px; }

  /* Bar meter */
  .bar-meter { width: 50px; }

  /* Insight bot box */
  .insight { padding: 12px 14px; gap: 10px; font-size: 12.5px; margin-bottom: 14px; }
  .insight .bot { width: 26px; height: 26px; font-size: 13px; }
}

@media (max-width: 480px) {
  /* Single-column on small phones */
  .kpi-row { grid-template-columns: 1fr; gap: 8px; }
  .content { padding: 14px 10px 90px; }
  .panel { padding: 12px; }
  .section-h h2 { font-size: 16px; }
  .day-card { min-width: 70px; padding: 6px 4px; }
  .day-num { font-size: 13px; }
  .topbar-right .chip:first-child { display: none; } /* hide live badge too */
  .order-actions .btn { flex: 1 1 100%; }
  .greeting h1 { font-size: 20px; }
  .crumb b { display: none; } /* hide brand text in crumb on tiny screens */
}

/* ============================================================
   DASHBOARD DRILL-DOWNS — drawer, tables, tiles (§1–§9)
   ============================================================ */

/* clickable cards */
.ri-click-card { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.ri-click-card:hover { transform: translateY(-2px); border-color: rgba(88,249,244,0.5); box-shadow: 0 8px 28px rgba(88,249,244,0.12); }
.ri-card-chev { color: var(--rr-cyan); font-weight: 700; font-size: 13px; opacity: .7; }
.ri-click { cursor: pointer; }

/* ---- drawer ---- */
.ri-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10,1,24,0.55); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
  display: flex; justify-content: flex-end;
}
.ri-overlay.open { opacity: 1; pointer-events: auto; }
.ri-drawer {
  width: min(720px, 94vw); height: 100%;
  background: linear-gradient(180deg, rgba(43,13,66,0.96), rgba(20,2,36,0.98));
  border-left: 1.5px solid var(--rr-cyan);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5), inset 1px 0 0 rgba(88,249,244,0.3);
  transform: translateX(40px); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
.ri-overlay.open .ri-drawer { transform: translateX(0); }
.ri-drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px; border-bottom: 1px solid var(--rr-border);
  background: linear-gradient(90deg, rgba(242,57,247,0.08), transparent);
}
.ri-drawer-head h3 { flex: 1; margin: 0; font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.ri-back, .ri-close {
  background: rgba(255,255,255,0.06); border: 1px solid var(--rr-border);
  color: var(--rr-text); width: 30px; height: 30px; border-radius: 8px;
  cursor: pointer; font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.ri-back:hover, .ri-close:hover { background: rgba(88,249,244,0.15); border-color: var(--rr-cyan); }
.ri-drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }

/* helper text colors scoped to drawer + tiles */
.ri-drawer .cyan, .ri-v.cyan { color: var(--rr-cyan); }
.ri-drawer .pink, .ri-v.pink { color: var(--rr-pink); }

/* ---- tabs ---- */
.ri-tabbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ri-tab {
  font-size: 12px; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600;
  background: rgba(255,255,255,0.05); border: 1px solid var(--rr-border); color: var(--rr-text-muted);
  transition: all .15s;
}
.ri-tab:hover { color: var(--rr-text); }
.ri-tab.active { background: var(--rr-cyan); color: var(--rr-violet); border-color: var(--rr-cyan); }

/* ---- totals / notes ---- */
.ri-total { font-size: 12px; color: var(--rr-text-muted); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--rr-border); }
.ri-note { font-size: 12px; color: var(--rr-text-muted); background: rgba(255,255,255,0.03); border: 1px solid var(--rr-border); border-radius: 10px; padding: 12px 14px; margin: 14px 0; line-height: 1.5; }
.ri-note-warn { border-color: rgba(255,107,138,0.5); color: #FFB3C2; }
.ri-note-ok { border-color: rgba(43,255,149,0.4); color: #9BF8C4; }
.ri-empty { text-align: center; color: var(--rr-text-muted); padding: 40px 20px; font-size: 13px; }
.ri-sub { font-size: 10.5px; color: var(--rr-text-muted); margin-top: 2px; }

/* ---- stat grid (drawer headers) ---- */
.ri-statgrid, .ri-detail-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px,1fr)); gap: 10px; margin-bottom: 16px; }
.ri-statgrid > div, .ri-detail-head > div { background: rgba(255,255,255,0.03); border: 1px solid var(--rr-border); border-radius: 10px; padding: 10px 12px; }
.ri-k { font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--rr-text-muted); margin-bottom: 4px; }
.ri-v { font-size: 20px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }

/* ---- tables ---- */
.ri-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.ri-table th { text-align: left; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--rr-text-muted); padding: 6px 8px; border-bottom: 1px solid var(--rr-border); }
.ri-table td { padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); vertical-align: top; }
.ri-table tbody tr.ri-click:hover { background: rgba(88,249,244,0.07); }
.ri-table .ri-num { text-align: right; font-family: 'JetBrains Mono', monospace; }
.ri-table tfoot td { border-top: 1px solid var(--rr-border); border-bottom: none; }
.ri-chev { color: var(--rr-cyan); text-align: right; font-weight: 700; width: 14px; }
.ri-mods { font-size: 10.5px; color: var(--rr-light-cyan); margin-top: 2px; }

/* ---- hour / list rows ---- */
.ri-hourrow, .ri-listrow { display: grid; grid-template-columns: 120px 1fr 150px auto; align-items: center; gap: 12px; padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); border-radius: 8px; }
.ri-listrow { grid-template-columns: auto 1fr 150px; }
.ri-hourrow.ri-click:hover, .ri-listrow.ri-click:hover { background: rgba(88,249,244,0.07); }
.ri-hourlab, .ri-listlab { font-weight: 600; font-size: 12.5px; }
.ri-hourstats { text-align: right; font-size: 11px; color: var(--rr-text-muted); display: flex; flex-direction: column; }
.ri-hourstats b { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.ri-peak { background: rgba(242,57,247,0.06); }
.ri-peaktag { font-size: 8.5px; background: var(--rr-pink); color: #fff; padding: 1px 5px; border-radius: 4px; letter-spacing: .5px; vertical-align: middle; }
.ri-rank { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--rr-text-muted); min-width: 24px; }

/* ---- bars ---- */
.ri-bartrack { background: rgba(255,255,255,0.06); border-radius: 6px; height: 8px; overflow: hidden; }
.ri-barfill { height: 100%; border-radius: 6px; transition: width .4s ease; }

/* ---- chips (mix filter) ---- */
.ri-chiprow { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ri-chip { font-size: 11px; padding: 5px 11px; border-radius: 20px; cursor: pointer; background: rgba(255,255,255,0.05); border: 1px solid var(--rr-border); color: var(--rr-text-muted); font-weight: 600; }
.ri-chip.active { background: rgba(88,249,244,0.18); border-color: var(--rr-cyan); color: var(--rr-cyan); }
.ri-sortbar { font-size: 11px; color: var(--rr-text-muted); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }

/* ---- pills ---- */
.ri-pill { font-size: 9.5px; padding: 2px 7px; border-radius: 6px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.ri-pill-pink { background: rgba(242,57,247,0.18); color: var(--rr-light-pink); }
.ri-pill-cyan { background: rgba(88,249,244,0.18); color: var(--rr-cyan); }
.ri-pill-dim { background: rgba(255,255,255,0.07); color: var(--rr-text-muted); }
.ri-live { animation: pulse 2s infinite; }
.ri-onclock-row td { background: rgba(88,249,244,0.05); }

/* ---- trend ---- */
.ri-trend { background: rgba(255,255,255,0.03); border: 1px solid var(--rr-border); border-radius: 12px; padding: 16px; margin: 14px 0; }
.ri-trend-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; margin-bottom: 10px; }
.ri-trend-head span { color: var(--rr-text-muted); font-size: 11px; }

/* ---- shimmer ---- */
.ri-shimmer { display: flex; flex-direction: column; gap: 12px; padding-top: 8px; }
.ri-shim-row { height: 44px; border-radius: 10px; background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 37%, rgba(255,255,255,0.04) 63%); background-size: 400% 100%; animation: ri-shim 1.4s ease infinite; }
@keyframes ri-shim { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---- reviews tile (§9) ---- */
.ri-reviews-tile {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  text-decoration: none; color: var(--rr-text);
  background: linear-gradient(135deg, rgba(255,241,64,0.08), rgba(242,57,247,0.06));
  border: 1px solid rgba(255,241,64,0.35); border-radius: 14px;
  padding: 16px 22px; margin-bottom: 18px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.ri-reviews-tile:hover { transform: translateY(-2px); border-color: var(--rr-yellow); box-shadow: 0 8px 28px rgba(255,241,64,0.12); }
.ri-rv-main { text-align: center; }
.ri-rv-big { font-size: 34px; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: var(--rr-yellow); line-height: 1; }
.ri-rv-cap { font-size: 9.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--rr-text-muted); margin-top: 4px; }
.ri-rv-meta { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--rr-text-muted); }
.ri-rv-meta b { color: var(--rr-text); font-size: 15px; font-family: 'JetBrains Mono', monospace; }
.ri-stars { color: var(--rr-yellow); }
.ri-rv-upd { font-size: 10.5px; color: var(--rr-cyan); }
.ri-rv-spark { margin-left: auto; }
.ri-rv-go { font-size: 11px; font-weight: 700; color: var(--rr-yellow); white-space: nowrap; }
/* Safety Net — eye-catching yellow buffer count; turns urgent red when at risk. */
.ri-rv-safety {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 18px; border-radius: 12px; text-align: center; min-width: 132px;
  border: 1px solid rgba(255,241,64,0.45);
  background: rgba(255,241,64,0.08);
}
.ri-rv-safety-num {
  font-family: 'JetBrains Mono', monospace; font-weight: 800; line-height: 1;
  font-size: 40px; color: var(--rr-yellow); text-shadow: 0 0 16px rgba(255,241,64,0.5);
}
.ri-rv-safety-lbl {
  font-size: 10px; line-height: 1.3; letter-spacing: .5px; text-transform: uppercase;
  color: var(--rr-text-muted); max-width: 150px;
}
.ri-rv-safety-lbl b { color: var(--rr-yellow); font-weight: 800; }
.ri-rv-safety.is-risk {
  border-color: rgba(255,77,109,0.65); background: rgba(255,77,109,0.14);
  animation: pulse 2s infinite;
}
.ri-rv-safety.is-risk .ri-rv-safety-num { color: #FF4D6D; text-shadow: 0 0 16px rgba(255,77,109,0.55); }
.ri-rv-safety.is-risk .ri-rv-safety-lbl b { color: #FF4D6D; }
/* Build-up rate — cyan companion: # of 5★ reviews to grow the Safety Net by +1. */
.ri-rv-safety.is-gain { border-color: rgba(88,249,244,0.45); background: rgba(88,249,244,0.07); }
.ri-rv-safety.is-gain .ri-rv-safety-num { color: var(--rr-cyan); text-shadow: 0 0 16px rgba(88,249,244,0.5); }
.ri-rv-safety.is-gain .ri-rv-safety-lbl b { color: var(--rr-cyan); }

/* ---- PHASE 2: product-mix-by-section tile ---- */
.ri-mxs-tile { cursor: pointer; }
.ri-mxs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 18px; margin-top: 6px; }
.ri-mxs-col { min-width: 0; }
.ri-mxs-h { font-size: 12px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; margin-bottom: 8px; }
.ri-mxs-row { display: grid; grid-template-columns: 16px 1fr 46px 30px; align-items: center; gap: 8px; padding: 3px 0; font-size: 12.5px; }
.ri-mxs-rank { color: var(--rr-text-muted); font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.ri-mxs-name { color: var(--rr-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-mxs-bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.07); overflow: hidden; }
.ri-mxs-bar i { display: block; height: 100%; border-radius: 4px; }
.ri-mxs-qty { text-align: right; font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--rr-text); }
.ri-mxs-empty { color: var(--rr-text-muted); font-size: 12px; padding: 4px 0; }

/* ---- PHASE 2: food cost panel (top-spend drinks) ---- */
.ri-fc-cap { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--rr-text-muted); margin: 4px 0 8px; }
.ri-fc-row { display: grid; grid-template-columns: 16px 1fr 70px 58px; align-items: center; gap: 9px; padding: 4px 0; font-size: 12.5px; }
.ri-fc-rank { color: var(--rr-text-muted); font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.ri-fc-name { color: var(--rr-text); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-fc-sub { display: block; font-size: 10.5px; color: var(--rr-text-muted); }
.ri-fc-bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.07); overflow: hidden; }
.ri-fc-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--rr-cyan), var(--rr-pink)); }
.ri-fc-cost { text-align: right; font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--rr-pink); }
.ri-fc-note { margin-top: 10px; font-size: 11px; line-height: 1.5; color: var(--rr-text-muted); border-top: 1px solid rgba(255,255,255,0.06); padding-top: 8px; }

/* ---- PHASE 2: "Today at a Glance" gadget ---- */
.ri-gadget { margin-bottom: 18px; }
.ri-gadget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-top: 4px; }
.ri-gadget-cell { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 14px 16px; }
.ri-gadget-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--rr-text-muted); }
.ri-gadget-v { font-size: 22px; font-weight: 800; font-family: 'JetBrains Mono', monospace; line-height: 1.15; margin: 4px 0 2px; }
.ri-gadget-v.cyan { color: var(--rr-cyan); } .ri-gadget-v.pink { color: var(--rr-pink); } .ri-gadget-v.yellow { color: var(--rr-yellow); }
.ri-gadget-m { font-size: 11.5px; color: var(--rr-text-muted); }

/* ---- mobile: drawer becomes a bottom sheet ---- */
@media (max-width: 640px) {
  .ri-overlay { align-items: flex-end; justify-content: stretch; }
  .ri-drawer {
    width: 100%; height: 88vh; border-left: none; border-top: 1.5px solid var(--rr-cyan);
    border-radius: 18px 18px 0 0; transform: translateY(40px);
  }
  .ri-overlay.open .ri-drawer { transform: translateY(0); }
  .ri-hourrow, .ri-listrow { grid-template-columns: 1fr auto; }
  .ri-hourbar { display: none; }
  .ri-reviews-tile { gap: 14px; }
  .ri-rv-spark { display: none; }
}

/* ===================================================================
   DASHBOARDS TAB · Scoreboard director KPIs · Reviews log
   (Daily/Weekly/Monthly/Yearly roll-ups, AM/PM splits, period bars)
   =================================================================== */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .grid-4 { grid-template-columns: 1fr; } }

.panel.panel-ok { border-color: rgba(70,227,155,0.55); box-shadow: 0 0 0 1px rgba(70,227,155,0.18) inset; }

/* AM/PM split + target hit/miss */
.ri-split { margin-top: 4px; }
.ri-split-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.ri-split-name { font-size: 12px; color: var(--rr-text); font-weight: 600; }
.ri-split-val { font-family: 'JetBrains Mono', monospace; font-size: 15px; color: var(--rr-text); }
.ri-split-meta { font-size: 11px; margin-top: 5px; color: var(--rr-text-muted); }
.ri-hit { color: #46e39b; font-weight: 600; }
.ri-miss { color: var(--rr-text-muted); }

/* Director scorecard columns */
.ri-dirs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ri-dir { background: rgba(255,255,255,0.03); border: 1px solid var(--rr-border); border-radius: 10px; padding: 12px; }
.ri-dir-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.ri-dir-h b { font-size: 14px; }
.ri-dir-shift { font-size: 10px; color: var(--rr-text-muted); }
.ri-dir-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
@media (max-width: 560px) { .ri-dirs { grid-template-columns: 1fr; } }

/* Period trend bars */
.ri-pbars { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding: 8px 2px 0; }
.ri-tbar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.ri-tbar-fill { width: 70%; max-width: 28px; background: linear-gradient(180deg, var(--rr-cyan), var(--rr-pink)); border-radius: 4px 4px 2px 2px; transition: height .4s ease; }
.ri-tbar-lab { font-size: 8.5px; color: var(--rr-text-muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Reviews log table wrapper + deltas */
.ri-table-wrap { overflow-x: auto; }
.ri-delta-up { color: #46e39b; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.ri-delta-zero { color: var(--rr-text-muted); font-family: 'JetBrains Mono', monospace; }

/* Scoreboard director-KPI big numbers */
.ri-score-grid { margin-top: 4px; }
.ri-score-big { font-size: 40px; font-weight: 800; line-height: 1; margin: 6px 0 12px; color: var(--rr-text); font-family: 'JetBrains Mono', monospace; }
.ri-score-big.ok { color: #46e39b; }
.ri-score-tgt { font-size: 18px; color: var(--rr-text-muted); font-weight: 500; }

/* Topbar live indicator — stale state */
.chip.live.stale { color: #FFB3C2; }
.chip.live.stale .dot { background: #FF6B8A; box-shadow: 0 0 8px #FF6B8A; }

/* ============================================================================
   RR DESIGN SYSTEM  (Phase 1 — Global Design Mandate)
   One polished grammar: page head → grid of cards. Reuse these classes
   everywhere instead of one-off inline styles in template literals.
   Tokens come from :root above. One accent per screen (default = pink).
   ============================================================================ */

:root {
  --rr-radius: 16px;
  --rr-radius-sm: 10px;
  --rr-gap: 20px;
  --rr-shadow: 0 10px 30px rgba(0,0,0,0.35);
  --rr-shadow-soft: 0 4px 16px rgba(0,0,0,0.25);
  --rr-ok: #46E39B;
  --rr-warn: #FFC24B;
  --rr-danger: #FF6B8A;
  --rr-inner: rgba(255,255,255,0.06);   /* soft inner border */
  --rr-surface: rgba(43,13,66,0.45);
  --rr-surface-2: rgba(10,1,24,0.55);
  --rr-ease: cubic-bezier(.2,.7,.2,1);
}

/* ---- Layout grammar: page title row → grid of cards ---------------------- */
.rr-page { max-width: 1180px; margin: 0 auto; padding: 4px 2px 40px; }
.rr-page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin: 4px 0 22px;
}
.rr-page-head .rr-page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.1; }
.rr-page-head .rr-page-sub { font-size: 13px; color: var(--rr-text-muted); margin-top: 4px; }
.rr-page-head .rr-page-actions { display: flex; gap: 10px; align-items: center; }

.rr-grid { display: grid; gap: var(--rr-gap); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rr-grid--2 { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
.rr-grid--wide { grid-template-columns: 1fr; }
.rr-row { display: flex; gap: var(--rr-gap); flex-wrap: wrap; }

/* ---- Card ---------------------------------------------------------------- */
.rr-card {
  background: var(--rr-surface);
  border: 1px solid var(--rr-border);
  border-radius: var(--rr-radius);
  padding: 22px;
  box-shadow: var(--rr-shadow-soft), inset 0 0 0 1px var(--rr-inner);
  backdrop-filter: blur(8px);
  position: relative;
}
.rr-card--pad-sm { padding: 16px; }
.rr-card--tap { cursor: pointer; transition: transform .15s var(--rr-ease), border-color .15s, box-shadow .15s; }
.rr-card--tap:hover { transform: translateY(-2px); border-color: rgba(242,57,247,0.4); box-shadow: var(--rr-shadow); }
.rr-card--tap:active { transform: translateY(0); }

/* ---- Section header (title + optional right action) ---------------------- */
.rr-section { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.rr-section-title { font-size: 13px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--rr-text-muted); }

/* ---- Buttons ------------------------------------------------------------- */
.rr-btn {
  --_accent: var(--rr-pink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px; border-radius: var(--rr-radius-sm);
  font-family: inherit; font-weight: 600; font-size: 13.5px; letter-spacing: 0.2px;
  border: 1px solid var(--rr-inner); background: rgba(255,255,255,0.04); color: var(--rr-text);
  cursor: pointer; transition: transform .12s var(--rr-ease), box-shadow .15s, background .15s, border-color .15s, opacity .15s;
  user-select: none; white-space: nowrap;
}
.rr-btn:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.18); }
.rr-btn:active { transform: translateY(0); }
.rr-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(242,57,247,0.3); }
.rr-btn[disabled], .rr-btn.is-disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.rr-btn--primary {
  background: linear-gradient(135deg, var(--rr-pink), var(--rr-magenta));
  border-color: transparent; box-shadow: 0 0 22px rgba(242,57,247,0.35);
}
.rr-btn--primary:hover { box-shadow: 0 0 30px rgba(242,57,247,0.6); }
.rr-btn--ghost { background: transparent; border-color: var(--rr-border); color: var(--rr-light-pink); }
.rr-btn--ghost:hover { background: rgba(242,57,247,0.08); }
.rr-btn--danger { background: rgba(255,107,138,0.12); border-color: rgba(255,107,138,0.4); color: var(--rr-danger); }
.rr-btn--danger:hover { background: rgba(255,107,138,0.2); }
.rr-btn--lg { padding: 15px 22px; font-size: 15px; border-radius: 12px; }
.rr-btn--block { width: 100%; }
/* loading spinner */
.rr-btn.is-loading { pointer-events: none; opacity: 0.8; }
.rr-btn.is-loading::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff;
  animation: rr-spin 0.7s linear infinite;
}
@keyframes rr-spin { to { transform: rotate(360deg); } }

/* ---- Form controls ------------------------------------------------------- */
.rr-field { margin-bottom: 14px; }
.rr-label { display: block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--rr-text-muted); margin-bottom: 6px; }
.rr-input, .rr-select, .rr-textarea {
  width: 100%; padding: 11px 13px; background: var(--rr-surface-2);
  border: 1px solid var(--rr-inner); border-radius: var(--rr-radius-sm);
  color: var(--rr-text); font-family: inherit; font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.rr-input:focus, .rr-select:focus, .rr-textarea:focus { outline: none; border-color: var(--rr-pink); box-shadow: 0 0 0 3px rgba(242,57,247,0.16); }
.rr-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2358F9F4' d='M6 8 0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }
.rr-textarea { resize: vertical; min-height: 90px; }

/* ---- Status pills -------------------------------------------------------- */
.rr-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.3px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--rr-inner); color: var(--rr-text);
}
.rr-pill--ok { background: rgba(70,227,155,0.12); border-color: rgba(70,227,155,0.35); color: var(--rr-ok); }
.rr-pill--warn { background: rgba(255,194,75,0.12); border-color: rgba(255,194,75,0.35); color: var(--rr-warn); }
.rr-pill--danger { background: rgba(255,107,138,0.12); border-color: rgba(255,107,138,0.35); color: var(--rr-danger); }
.rr-pill--info { background: rgba(88,249,244,0.1); border-color: var(--rr-border-cyan); color: var(--rr-cyan); }

/* ---- Stat (big number + label) ------------------------------------------ */
.rr-stat { display: flex; flex-direction: column; gap: 4px; }
.rr-stat-num { font-family: 'JetBrains Mono', monospace; font-size: 32px; font-weight: 700; line-height: 1; color: var(--rr-text); }
.rr-stat-label { font-size: 11.5px; letter-spacing: 0.6px; text-transform: uppercase; color: var(--rr-text-muted); }
.rr-stat--accent .rr-stat-num { background: linear-gradient(90deg, var(--rr-pink), var(--rr-cyan)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---- Empty state --------------------------------------------------------- */
.rr-empty { text-align: center; padding: 40px 24px; color: var(--rr-text-muted); }
.rr-empty-icon { font-size: 30px; opacity: 0.7; margin-bottom: 10px; }
.rr-empty-title { font-size: 15px; font-weight: 600; color: var(--rr-text); margin-bottom: 4px; }
.rr-empty-sub { font-size: 13px; }

/* ---- Skeleton (loading shimmer) ----------------------------------------- */
.rr-skeleton { position: relative; overflow: hidden; background: rgba(255,255,255,0.05); border-radius: 8px; }
.rr-skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent); animation: rr-shimmer 1.3s infinite; }
@keyframes rr-shimmer { 100% { transform: translateX(100%); } }
.rr-skeleton-line { height: 12px; margin: 8px 0; }
.rr-skeleton-card { height: 120px; }

/* ---- Toasts -------------------------------------------------------------- */
#rr-toast-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.rr-toast {
  pointer-events: auto; min-width: 220px; max-width: 86vw; padding: 12px 16px;
  border-radius: 12px; font-size: 13.5px; font-weight: 500;
  background: rgba(20,4,34,0.92); border: 1px solid var(--rr-border);
  box-shadow: var(--rr-shadow); backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 10px;
  animation: rr-toast-in .25s var(--rr-ease);
}
.rr-toast.rr-out { animation: rr-toast-out .2s var(--rr-ease) forwards; }
.rr-toast--ok { border-color: rgba(70,227,155,0.4); }
.rr-toast--ok .rr-toast-ic { color: var(--rr-ok); }
.rr-toast--danger { border-color: rgba(255,107,138,0.45); }
.rr-toast--danger .rr-toast-ic { color: var(--rr-danger); }
.rr-toast-ic { font-weight: 700; }
@keyframes rr-toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rr-toast-out { to { opacity: 0; transform: translateY(12px); } }

/* ---- Tablet-first tuning for store/team screens -------------------------- */
@media (max-width: 900px) {
  .rr-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .rr-page-head { margin-bottom: 16px; }
}
@media (max-width: 600px) {
  .rr-grid, .rr-grid--2 { grid-template-columns: 1fr; }
  .rr-page-head .rr-page-actions { width: 100%; }
  .rr-page-head .rr-page-actions .rr-btn { flex: 1; }
}

/* ===== Universal Period Toggle + Time Drill-Downs ===== */
.ri-period-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: rgba(255,255,255,0.025); border: 1px solid var(--rr-border); border-radius: 14px;
  padding: 8px 10px; margin: 0 0 20px; }
.ri-period-segs { display: inline-flex; gap: 2px; background: rgba(0,0,0,0.25); border-radius: 11px; padding: 4px; }
.ri-period-seg { appearance: none; border: 0; background: transparent; color: var(--rr-text-muted);
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .3px; padding: 7px 18px; border-radius: 8px;
  cursor: pointer; transition: color .15s ease, background .15s ease; position: relative; }
.ri-period-seg:hover { color: var(--rr-text); }
.ri-period-seg.active { color: #0a0a12;
  background: linear-gradient(90deg, var(--rr-pink), var(--rr-cyan));
  box-shadow: 0 2px 14px rgba(245,94,248,0.35); }
.ri-period-nav { display: inline-flex; align-items: center; gap: 8px; }
.ri-period-when { font-size: 13px; font-weight: 700; color: var(--rr-text); min-width: 130px; text-align: center;
  font-family: 'JetBrains Mono', monospace; }
.ri-period-step { appearance: none; background: rgba(255,255,255,0.04); border: 1px solid var(--rr-border);
  color: var(--rr-cyan); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease; }
.ri-period-step:hover { border-color: rgba(88,249,244,0.5); background: rgba(88,249,244,0.08); }
.ri-period-step.disabled, .ri-period-step:disabled { opacity: .35; cursor: default; color: var(--rr-text-muted); }
.ri-period-step.disabled:hover, .ri-period-step:disabled:hover { border-color: var(--rr-border); background: rgba(255,255,255,0.04); }
/* Net / Gross basis toggle on the dashboard sales card — compact mirror of .ri-period-seg */
.ri-basis-toggle { display: inline-flex; gap: 2px; background: rgba(0,0,0,0.25); border-radius: 9px; padding: 3px; margin: 9px 0 2px; }
.ri-basis-seg { appearance: none; border: 0; background: transparent; color: var(--rr-text-muted);
  font: inherit; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; padding: 4px 12px; border-radius: 7px;
  cursor: pointer; transition: color .15s ease, background .15s ease; }
.ri-basis-seg:hover { color: var(--rr-text); }
.ri-basis-seg.active { color: #0a0a12; background: linear-gradient(90deg, var(--rr-pink), var(--rr-cyan));
  box-shadow: 0 2px 10px rgba(245,94,248,0.30); }
.ri-outside-line { font-size: 11.5px; font-weight: 600; color: var(--rr-cyan); margin: 6px 0 2px; }
/* When the basis toggle rides in a period bar / section header it shouldn't carry the card's top margin */
.ri-period-bar .ri-basis-toggle, .section-h .ri-basis-toggle { margin: 0; }
.ri-period-basis { display: inline-flex; align-items: center; }

/* history rows (drawer + inline trend panel) — 4 cols: label · bar · value · chevron */
.ri-histrow { display: grid; grid-template-columns: minmax(96px,auto) 1fr minmax(120px,150px) 16px; align-items: center;
  gap: 12px; padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,0.05); border-radius: 8px; }
.ri-histrow.ri-click { cursor: pointer; }
.ri-histrow.ri-click:hover { background: rgba(88,249,244,0.07); }
.ri-histrow .ri-hourstats { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.ri-histrow .ri-hourstats b { font-family: 'JetBrains Mono', monospace; font-size: 13px; }
.ri-histrow .ri-hourstats span { font-size: 10.5px; color: var(--rr-text-muted); }
.ri-histrow .ri-chev { color: var(--rr-cyan); opacity: .55; text-align: center; }
.ri-histrow.ri-weekend { background: rgba(245,94,248,0.04); }
.ri-histrow.ri-upcoming { opacity: .45; }
.ri-histrow.ri-upcoming .ri-hourstats span { font-style: italic; }
.ri-sub-inline { color: var(--rr-text-muted); font-weight: 400; font-size: 11px; margin-left: 4px; }
.ri-peaktag.ri-worst { background: rgba(255,255,255,0.12); color: var(--rr-text); }
.ri-recon { font-size: 11px; color: var(--rr-text-muted); margin-top: 12px; padding-top: 10px;
  border-top: 1px dashed var(--rr-border); line-height: 1.5; }

@media (max-width: 640px) {
  .ri-period-bar { padding: 8px; }
  .ri-period-seg { padding: 7px 13px; font-size: 12.5px; }
  .ri-period-nav { width: 100%; justify-content: space-between; }
  .ri-histrow { grid-template-columns: 1fr auto 16px; }
  .ri-histrow .ri-hourbar { display: none; }
}

/* ===== Dashboards tab: period navigation + clickable drill-downs ===== */
.dash-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255,255,255,0.025); border: 1px solid var(--rr-border); border-radius: 12px;
  padding: 8px 10px; margin-bottom: 12px; }
.dash-nav-mid { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.dash-nav-label { font-size: 14px; font-weight: 700; color: var(--rr-text); }
.dash-step { appearance: none; background: rgba(255,255,255,0.04); border: 1px solid var(--rr-border);
  color: var(--rr-cyan); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 9px; cursor: pointer;
  transition: border-color .15s ease, background .15s ease; white-space: nowrap; }
.dash-step:hover { border-color: rgba(88,249,244,0.5); background: rgba(88,249,244,0.08); }
.dash-step.disabled, .dash-step:disabled { opacity: .32; cursor: default; color: var(--rr-text-muted); }
.dash-step.disabled:hover, .dash-step:disabled:hover { border-color: var(--rr-border); background: rgba(255,255,255,0.04); }
.dash-jump { appearance: none; background: transparent; border: 0; color: var(--rr-cyan); font: inherit;
  font-size: 11.5px; font-weight: 600; cursor: pointer; padding: 2px 4px; }
.dash-jump:hover { text-decoration: underline; }
.dash-strip { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.dash-strip-cell { cursor: pointer; flex: 0 0 auto; min-width: 74px; text-align: center; padding: 10px 8px;
  border-radius: 10px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.02);
  transition: border-color .15s ease, background .15s ease; }
.dash-strip-cell:hover { border-color: rgba(88,249,244,0.45); background: rgba(88,249,244,0.06); }
.dash-strip-cell.sel { border-color: var(--rr-cyan); background: rgba(88,249,244,.12); }
.dash-strip-lab { font-size: 10.5px; color: var(--rr-text-muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.dash-strip-amt { font-size: 15px; font-weight: 700; margin-top: 3px; }
.dash-strip-cell.sel .dash-strip-amt { color: var(--rr-cyan); }
.ri-tbar-click { cursor: pointer; }
.ri-tbar-click:hover .ri-tbar-fill { filter: brightness(1.25); }

@media (max-width: 640px) {
  .dash-nav { flex-wrap: wrap; }
  .dash-nav-mid { order: -1; width: 100%; }
}

/* ======================== PHASE 7 — "feels updated" glass refresh ========================
   Subtle liquid-glass finish + smoother transitions. Keeps the neon pink/cyan brand;
   additive only (no layout changes). Opt-in .rr-glass for hero surfaces + a gentle
   global lift on interactive cards. */
.panel { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.kpi { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.ri-click-card { transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.ri-click-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(88,249,244,0.10); }

/* Liquid-glass surface — translucent, blurred, soft inner highlight. */
.rr-glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02)) , var(--rr-panel);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 10px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* RoadRunners OS panel — changelog list */
.rr-os-changelog { margin-top: 6px; }
.rr-os-rel { padding: 10px 0; border-top: 1px solid var(--rr-border); }
.rr-os-rel:first-child { border-top: 0; }
.rr-os-rel-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.rr-os-ver { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 12px; color: var(--rr-cyan); }
.rr-os-rel-title { font-weight: 600; font-size: 13px; color: var(--rr-text); }
.rr-os-rel-date { font-size: 11px; color: var(--rr-text-muted); margin-left: auto; }
.rr-os-items { margin: 0; padding-left: 18px; }
.rr-os-items li { font-size: 12.5px; color: var(--rr-text-muted); line-height: 1.7; }

/* What's New popup */
.rr-whatsnew-overlay {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(8,1,16,0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: rr-wn-fade .25s ease;
  padding: 20px;
}
@keyframes rr-wn-fade { from { opacity: 0; } to { opacity: 1; } }
.rr-whatsnew {
  max-width: 460px; width: 100%; border-radius: 20px; padding: 28px 26px 24px;
  text-align: center; position: relative;
  animation: rr-wn-pop .3s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes rr-wn-pop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.rr-whatsnew-badge {
  width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px;
  display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(135deg, var(--rr-pink), var(--rr-cyan));
  box-shadow: 0 0 26px rgba(242,57,247,0.5);
}
.rr-whatsnew-kicker { font-size: 10.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--rr-text-muted); margin-bottom: 6px; }
.rr-whatsnew-title {
  font-size: 22px; font-weight: 700; margin: 0 0 14px;
  background: linear-gradient(90deg, var(--rr-pink), var(--rr-cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rr-whatsnew-items { text-align: left; margin: 0 0 20px; padding-left: 20px; max-height: 46vh; overflow-y: auto; }
.rr-whatsnew-items li { font-size: 13px; color: var(--rr-text); line-height: 1.7; margin-bottom: 4px; }
.rr-whatsnew-close { width: 100%; }

/* ===== Loyalty — team experience (Phase 1) ============================== */
.loy-hero { display:flex; align-items:center; gap:18px; }
.loy-hero-ring { flex:0 0 auto; position:relative; }
.loy-ring { display:block; }
.loy-ring-bg { fill:none; stroke:rgba(255,255,255,.10); stroke-width:9; }
.loy-ring-fg { fill:none; stroke:var(--rr-cyan); stroke-width:9; stroke-linecap:round;
  transform:rotate(-90deg); transform-origin:60px 60px;
  transition:stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); filter:drop-shadow(0 0 6px rgba(88,249,244,.45)); }
.loy-ring-fg.is-done { stroke:var(--rr-pink); filter:drop-shadow(0 0 8px rgba(242,57,247,.55)); }
.loy-ring-num { fill:var(--rr-text); font-size:34px; font-weight:800; text-anchor:middle; }
.loy-ring-cap { fill:var(--rr-text-muted); font-size:13px; text-anchor:middle; }
.loy-ring.loy-celebrate .loy-ring-num { animation:loyPop .55s ease; }
@keyframes loyPop { 0%{transform:scale(1)} 35%{transform:scale(1.28)} 100%{transform:scale(1)} }
.loy-hero-main { flex:1 1 auto; min-width:0; }
.loy-hero-label { font-size:13px; color:var(--rr-text-muted); text-transform:uppercase; letter-spacing:.04em; }
.loy-hero-msg { font-size:18px; font-weight:700; margin:4px 0 8px; color:var(--rr-text); }
.loy-hero-meta { display:flex; flex-wrap:wrap; gap:14px; font-size:13px; color:var(--rr-text-muted); }
.loy-hero-meta b { color:var(--rr-text); }
.loy-hero-actions { display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
.loy-hero-actions .loy-tap { font-weight:800; }
/* Leaderboard */
.loy-lb { display:flex; flex-direction:column; gap:6px; }
.loy-lb-row { display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:10px;
  background:rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.05); }
.loy-lb-row.is-me { background:linear-gradient(90deg,rgba(242,57,247,.14),rgba(88,249,244,.10));
  border-color:rgba(88,249,244,.35); }
.loy-lb-pos { flex:0 0 28px; text-align:center; font-size:17px; }
.loy-lb-rank { color:var(--rr-text-muted); font-weight:700; font-size:14px; }
.loy-lb-name { flex:1 1 auto; font-weight:600; color:var(--rr-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.loy-lb-you { font-size:10px; text-transform:uppercase; letter-spacing:.05em; color:#0a0a0f;
  background:var(--rr-cyan); border-radius:6px; padding:1px 6px; margin-left:6px; font-weight:800; }
.loy-lb-count { flex:0 0 auto; font-weight:800; color:var(--rr-cyan); font-variant-numeric:tabular-nums; }
.loy-lb-row.is-me .loy-lb-count { color:var(--rr-pink); }
/* My recent */
.loy-recent { display:flex; flex-direction:column; }
.loy-recent-row { display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:9px 2px; border-bottom:1px solid rgba(255,255,255,.05); }
.loy-recent-row:last-child { border-bottom:0; }
.loy-recent-name { font-weight:600; color:var(--rr-text); }
.loy-recent-when { font-size:12px; color:var(--rr-text-muted); display:flex; align-items:center; gap:8px; }
/* Confetti burst */
.loy-confetti-layer { position:fixed; inset:0; pointer-events:none; z-index:9999; }
.loy-confetti { position:fixed; width:8px; height:8px; border-radius:2px; opacity:.95;
  transform:translate(-50%,-50%); animation:loyConfetti .9s ease-out forwards; }
@keyframes loyConfetti {
  0%   { transform:translate(-50%,-50%) scale(1); opacity:1; }
  100% { transform:translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 60px)) rotate(220deg) scale(.6); opacity:0; }
}
@media (max-width:420px) {
  .loy-hero { gap:12px; }
  .loy-ring { width:104px; height:104px; }
  .loy-hero-msg { font-size:16px; }
}

/* ===== Team Access Portal — toggle modal (Phase 2) ===================== */
.rrap-modal { max-width:560px; width:calc(100vw - 32px); }
.rrap-sub { font-size:12.5px; color:var(--rr-text-muted); margin:2px 0 12px; line-height:1.5; }
.rrap-sub b { color:var(--rr-text); }
.rrap-note { display:block; margin-top:3px; color:rgba(255,225,120,.8); }
.rrap-grid { max-height:56vh; overflow-y:auto; display:flex; flex-direction:column; gap:14px; padding-right:4px; }
.rrap-cat-h { font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--rr-cyan);
  font-weight:700; margin:0 0 6px; }
.rrap-row { display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:9px;
  background:rgba(255,255,255,.02); border:1px solid rgba(255,255,255,.05); cursor:pointer; margin-bottom:5px; }
.rrap-row.is-on { background:rgba(88,249,244,.06); border-color:rgba(88,249,244,.20); }
.rrap-row input { width:17px; height:17px; accent-color:var(--rr-cyan); cursor:pointer; flex:0 0 auto; }
.rrap-name { flex:1 1 auto; font-size:13.5px; color:var(--rr-text); }
.rrap-gate { font-size:10px; padding:1px 6px; border-radius:5px; color:var(--rr-text-muted);
  border:1px solid rgba(255,255,255,.12); white-space:nowrap; }
.rrap-gate-rls { color:rgba(255,225,120,.9); border-color:rgba(255,225,120,.3); }
.rrap-badge { font-size:10px; padding:1px 7px; border-radius:5px; font-weight:700; white-space:nowrap; min-width:54px; text-align:center; }
.rrap-grant { background:rgba(43,255,149,.16); color:#2BFF95; }
.rrap-revoke { background:rgba(242,57,247,.16); color:var(--rr-pink); }
.rrap-default { background:rgba(255,255,255,.06); color:var(--rr-text-muted); }
.rrap-off { background:transparent; color:rgba(255,255,255,.25); }
.rrap-actions { display:flex; align-items:center; gap:8px; margin-top:14px; }
.rrap-loading { padding:30px 0; text-align:center; color:var(--rr-text-muted); }

/* ===== My Hours & Pay — gross≠net fine print (Phase 3) ================= */
.rr-paynote { margin-top:12px; font-size:11px; line-height:1.5; color:var(--rr-text-muted);
  font-weight:400; opacity:.85; }

/* ===== "Sundays = Closed" — closed-day pills / cells / hero ============= */
/* Brand-style CLOSED pill (dark bg, neon pink/cyan). Used in day cells, the
   forecast strip, checklist day cards, chart cells, and KPI tiles. */
.ri-closed-pill {
  display:inline-block; padding:3px 10px; border-radius:999px;
  font-size:11px; font-weight:800; letter-spacing:.12em; text-transform:uppercase;
  color:var(--rr-cyan); background:rgba(10,1,24,0.85);
  border:1px solid var(--rr-pink);
  box-shadow:0 0 8px rgba(242,57,247,0.35), inset 0 0 6px rgba(88,249,244,0.12);
  white-space:nowrap; line-height:1.4;
}
.ri-closed-pill-lg { font-size:14px; padding:6px 16px; letter-spacing:.18em; }

/* Closed-today hero panel on the live Dashboard */
.ri-closed-hero { text-align:center; padding:34px 20px;
  background:linear-gradient(160deg, rgba(242,57,247,0.06), rgba(88,249,244,0.05)); }
.ri-closed-hero h2 { color:var(--rr-text); }

/* Forecast day-strip + checklist day card: muted closed cell */
.day-card.day-closed, .day-closed-card {
  opacity:.85; background:rgba(255,255,255,0.02);
  border:1px dashed rgba(242,57,247,0.35);
}
.day-card.day-closed { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; }

/* Daily-trend chart: a closed day reads CLOSED instead of a 0-height bar (no dip) */
.ri-tbar-closed { flex:1; display:flex; flex-direction:column; justify-content:flex-end;
  align-items:center; height:100%; min-width:0; opacity:.9; }
.ri-tbar-closedpill { writing-mode:vertical-rl; transform:rotate(180deg);
  font-size:8px; font-weight:800; letter-spacing:.14em; color:var(--rr-cyan);
  padding:5px 2px; border-radius:6px; border:1px dashed rgba(242,57,247,0.4);
  background:rgba(10,1,24,0.5); margin-bottom:2px; }

/* ======================== STORE / CONTEXT SWITCHER + EXEC COMMAND CENTER (2026-07-01) ======================== */
/* Bottom-left pill: static for everyone; a button for real execs. */
.sidebar-footer { position: relative; }
.store-pill--switch { cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.store-pill--switch:hover { border-color: rgba(242,57,247,0.45); box-shadow: 0 0 12px rgba(242,57,247,0.18); }
.store-pill .store-pill-caret { margin-left: auto; font-size: 10px; opacity: .65; }
.store-pill .dot--live { background: var(--rr-yellow); box-shadow: 0 0 8px var(--rr-yellow); }
.store-pill .dot--dim { background: rgba(255,255,255,0.28); box-shadow: none; }
.store-pill .dot--exec { background: none; box-shadow: none; width: auto; height: auto; font-size: 12px; }
.store-pill--notlive { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.12); }
.store-pill--notlive .label { color: var(--rr-text-muted); }
.store-pill--exec {
  background: linear-gradient(90deg, rgba(255,241,64,0.10), rgba(242,57,247,0.12));
  border-color: rgba(255,241,64,0.45);
  box-shadow: 0 0 14px rgba(255,241,64,0.12);
}
.store-pill--exec .label {
  font-weight: 700; font-size: 11.5px; letter-spacing: .02em;
  background: linear-gradient(90deg, var(--rr-yellow), var(--rr-pink));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rr-pill-tag {
  font-size: 8.5px; font-weight: 800; letter-spacing: .1em; white-space: nowrap;
  color: var(--rr-text-muted); border: 1px solid rgba(255,255,255,0.18);
  border-radius: 5px; padding: 2px 5px; margin-left: 6px;
}

/* Switcher popup — anchored above the pill inside the sidebar footer. */
.rr-store-menu {
  position: absolute; left: 12px; right: 12px; bottom: calc(100% - 6px);
  background: var(--rr-panel-2); border: 1px solid rgba(242,57,247,0.35);
  border-radius: 12px; padding: 6px; z-index: 60;
  box-shadow: 0 -6px 30px rgba(0,0,0,0.55), 0 0 18px rgba(242,57,247,0.15);
  backdrop-filter: blur(12px); max-height: 60vh; overflow-y: auto;
}
.rr-store-menu-item { padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.rr-store-menu-item:hover { background: rgba(242,57,247,0.10); }
.rr-store-menu-item.is-current { background: rgba(88,249,244,0.08); border: 1px solid var(--rr-border-cyan); }
.rr-store-menu-item.is-dim .rr-store-menu-name { color: var(--rr-text-muted); }
.rr-store-menu-name { font-size: 12.5px; font-weight: 600; }
.rr-store-menu-sub { font-size: 9px; font-weight: 700; letter-spacing: .09em; margin-top: 2px; }
.rr-store-menu-live { color: var(--rr-yellow); text-shadow: 0 0 8px rgba(255,241,64,0.5); }
.rr-store-menu-dim { color: var(--rr-text-muted); }
.rr-store-menu-gold {
  background: linear-gradient(90deg, var(--rr-yellow), var(--rr-pink));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rr-store-menu-div { height: 1px; background: var(--rr-border); margin: 6px 8px; }
.rr-store-menu-exec:hover { background: linear-gradient(90deg, rgba(255,241,64,0.08), rgba(242,57,247,0.10)); }

/* Exec nav group — gold title treatment, same collapsible mechanics. */
.nav-section-exec .nav-section-title span:first-child {
  background: linear-gradient(90deg, var(--rr-yellow), var(--rr-pink));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 700;
}

/* NOT-LIVE store state — the ONE standard page for non-live store contexts. */
.rr-notlive { max-width: 640px; margin: 8vh auto 0; text-align: center; padding: 0 18px; }
.rr-notlive-badge {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .14em;
  color: var(--rr-cyan); border: 1px dashed rgba(88,249,244,0.5); border-radius: 7px;
  padding: 5px 12px; margin-bottom: 18px; background: rgba(88,249,244,0.05);
}
.rr-notlive-name {
  font-size: 34px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 14px;
  background: linear-gradient(90deg, var(--rr-pink), var(--rr-cyan));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.rr-notlive-msg { font-size: 14px; line-height: 1.65; color: var(--rr-text-muted); margin-bottom: 26px; }
.rr-notlive-msg b { color: var(--rr-text); }
.rr-notlive-list {
  text-align: left; background: var(--rr-panel); border: 1px solid var(--rr-border);
  border-radius: 14px; padding: 16px 18px;
}
.rr-notlive-list-title { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; color: var(--rr-cyan); margin-bottom: 10px; text-transform: uppercase; }
.rr-notlive-li { display: flex; gap: 10px; align-items: center; font-size: 13px; padding: 6px 0; color: var(--rr-text); opacity: .85; }
.rr-notlive-li span { color: var(--rr-pink); width: 18px; text-align: center; }

/* Executive Overview + Truck Command */
.rrx-exec { max-width: 1060px; }
.rrx-exec-head { margin-bottom: 20px; }
.rrx-exec-title { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.rrx-exec-sub { font-size: 12.5px; color: var(--rr-text-muted); margin-top: 4px; }
.rrx-ov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.rrx-ov-card { background: var(--rr-panel); border: 1px solid var(--rr-border); border-radius: 14px; padding: 16px 18px; }
.rrx-ov-card--live { border-color: rgba(255,241,64,0.4); box-shadow: 0 0 18px rgba(255,241,64,0.07); cursor: pointer; }
.rrx-ov-card--live:hover { box-shadow: 0 0 22px rgba(255,241,64,0.14); }
.rrx-ov-card--works { border-color: rgba(242,57,247,0.35); cursor: pointer; }
.rrx-ov-card--works:hover { box-shadow: 0 0 18px rgba(242,57,247,0.14); }
.rrx-ov-card--dim { opacity: .8; }
.rrx-ov-cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.rrx-ov-store { font-size: 15px; font-weight: 700; }
.rrx-ov-market { font-size: 11px; color: var(--rr-text-muted); margin-bottom: 12px; }
.rrx-ov-none { font-size: 12px; color: var(--rr-text-muted); line-height: 1.55; }
.rrx-ov-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.rrx-ov-num { background: rgba(10,1,24,0.45); border: 1px solid var(--rr-border-cyan); border-radius: 10px; padding: 10px 12px; }
.rrx-ov-v { font-size: 19px; font-weight: 800; color: var(--rr-cyan); text-shadow: 0 0 12px rgba(88,249,244,0.25); }
.rrx-ov-l { font-size: 9.5px; font-weight: 700; letter-spacing: .08em; color: var(--rr-text-muted); margin-top: 3px; text-transform: uppercase; }
.rrx-exec-note { font-size: 11.5px; color: var(--rr-text-muted); margin-top: 16px; font-style: italic; }
.rr-tag { font-size: 8.5px; font-weight: 800; letter-spacing: .09em; border-radius: 5px; padding: 3px 7px; white-space: nowrap; }
.rr-tag--live { color: var(--rr-violet); background: var(--rr-yellow); box-shadow: 0 0 10px rgba(255,241,64,0.5); }
.rr-tag--building { color: var(--rr-cyan); border: 1px solid var(--rr-border-cyan); background: rgba(88,249,244,0.06); }
.rr-tag--works { color: var(--rr-pink); border: 1px solid rgba(242,57,247,0.4); background: rgba(242,57,247,0.08); }
.rr-tag--future { color: var(--rr-text-muted); border: 1px solid rgba(255,255,255,0.16); }
.rrx-truck-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.rrx-truck-proj { margin-bottom: 14px; }
.rrx-truck-proj-name { font-size: 13px; font-weight: 700; color: var(--rr-cyan); margin: 8px 0; }
.rrx-truck-stage { display: flex; align-items: center; gap: 10px; padding: 7px 2px; font-size: 12.5px; border-bottom: 1px solid rgba(255,255,255,0.05); }
.rrx-truck-stage-name { flex: 1; }
.rrx-truck-stage-due { font-size: 10.5px; color: var(--rr-text-muted); }
.rrx-st { width: 20px; text-align: center; font-weight: 800; }
.rrx-st--done { color: var(--rr-cyan); }
.rrx-st--prog { color: var(--rr-pink); }
.rrx-st--todo { color: rgba(255,255,255,0.3); }

/* ======================== EXEC COMMAND CENTER R2 (2026-07-01) ======================== */
/* Switcher moved to the TOP slot under the brand — the primary context control.
   The popup now drops DOWN from the pill instead of up from the footer. */
.rr-context-slot { position: relative; padding: 2px 16px 12px; }
.rr-context-slot .store-pill { margin-bottom: 0; }
.rr-context-slot .rr-store-menu {
  top: calc(100% - 4px); bottom: auto; left: 16px; right: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.55), 0 0 18px rgba(242,57,247,0.15);
}
/* Replay chip demoted to the footer — a toy, not a control. */
.rr-replay-chip--footer {
  display: block; width: 100%; margin: 0 0 8px;
  font-size: 10.5px; opacity: 0.55; padding: 5px 8px;
}
.rr-replay-chip--footer:hover { opacity: 0.9; }
/* Truck Program Milestones strip — compact panel above JK's MLCC module. */
.rrx-truck-strip {
  background: var(--rr-panel); border: 1px solid rgba(242,57,247,0.3);
  border-radius: 14px; padding: 14px 16px; margin-bottom: 18px;
}
.rrx-truck-strip .rrx-truck-proj { margin-bottom: 8px; }
.rrx-truck-strip .rrx-truck-proj-name { margin: 6px 0 4px; }

/* ============================================================================
   NEON GLASS — PHASE 1 CONCEPT PASS (2026-07-02, Gabe-confirmed direction)
   Neon signage glowing through frosted glass — glass adds DEPTH on top of the
   existing pink/cyan/yellow-on-violet identity; it never mutes it.
   Applied ONLY to: dashboard home (via #view-container[data-view="dashboard"]),
   the Executive Overview cards, and the sidebar/topbar/store-switcher chrome.
   Phase 2 rolls these tokens out to the remaining modules after sign-off.

   Legibility rule baked into the tokens: surfaces that sit IN FLOW (over the
   near-black page) use the lighter card tint; surfaces that float OVER
   arbitrary content (switcher menu, mobile drawer, modals) use the strong
   tint so bright content behind them can never wash the text out.
   ============================================================================ */

:root {
  /* frost */
  --ng-blur-chrome: 20px;                       /* sidebar / topbar */
  --ng-blur-card: 14px;                         /* in-flow cards */
  --ng-blur-overlay: 26px;                      /* menus / drawers / modals */
  --ng-sat: 1.35;                               /* re-saturate the neon behind glass */
  /* tint (violet family only — never gray) */
  --ng-tint-card: rgba(32,2,48,0.58);
  --ng-tint-chrome: rgba(14,2,28,0.62);
  --ng-tint-overlay: rgba(16,2,30,0.86);
  /* sheen — the light hitting the pane */
  --ng-sheen: linear-gradient(168deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.02) 30%, rgba(255,255,255,0) 60%, rgba(242,57,247,0.05) 100%);
  /* edges — specular top + the inset neon double-border motif (pink out / cyan in) */
  --ng-edge-spec: rgba(255,255,255,0.15);
  --ng-edge-pink: rgba(242,57,247,0.28);
  --ng-edge-cyan: rgba(88,249,244,0.13);
  /* elevation */
  --ng-shadow: 0 14px 40px rgba(0,0,0,0.42), 0 2px 10px rgba(0,0,0,0.25);
  --ng-shadow-overlay: 0 24px 60px rgba(0,0,0,0.6), 0 0 22px rgba(242,57,247,0.14);
  --ng-glow: 0 0 26px rgba(242,57,247,0.09);
  --ng-glow-hover: 0 0 30px rgba(242,57,247,0.16);
  /* motion */
  --ng-ease: cubic-bezier(.22,.7,.25,1);
  --ng-dur: .22s;
}

/* ---- ambient depth: slightly richer neon wash so the frost has something to
       catch (palette colors only; still a whisper, not a light show) --------- */
body::before {
  background:
    radial-gradient(circle at 15% 18%, rgba(242,57,247,0.15) 0%, transparent 42%),
    radial-gradient(circle at 86% 78%, rgba(88,249,244,0.11) 0%, transparent 46%),
    radial-gradient(circle at 8% 88%, rgba(242,57,247,0.08) 0%, transparent 38%),
    radial-gradient(circle at 50% 50%, rgba(43,13,66,0.4) 0%, transparent 60%);
}

/* ---- core recipes (Phase 2: promoted app-wide after Gabe sign-off 7/2) ----- */
.ng-glass,
.kpi, .panel, .order-card, .rr-card,
.ri-gadget-cell, .ri-reviews-tile, .ri-period-bar, .dash-nav,
.rrx-ov-card, .rrx-truck-strip {
  background: var(--ng-sheen), var(--ng-tint-card);
  -webkit-backdrop-filter: blur(var(--ng-blur-card)) saturate(var(--ng-sat));
  backdrop-filter: blur(var(--ng-blur-card)) saturate(var(--ng-sat));
  border: 1px solid var(--ng-edge-pink);
  box-shadow: inset 0 1px 0 var(--ng-edge-spec),
              inset 0 0 0 1px var(--ng-edge-cyan),
              var(--ng-shadow), var(--ng-glow);
}
/* status/variant accents keep their louder borders on top of the glass */
.ri-reviews-tile { border-color: rgba(255,241,64,0.4); }
.rrx-ov-card--live { border-color: rgba(255,241,64,0.45); }
.rrx-ov-card--works { border-color: rgba(242,57,247,0.4); }
.panel-cyan { border-color: var(--rr-border-cyan); }
.panel.panel-ok { border-color: rgba(70,227,155,0.55);
  box-shadow: inset 0 1px 0 var(--ng-edge-spec), inset 0 0 0 1px rgba(70,227,155,0.18), var(--ng-shadow); }

/* hover: interactive cards lift toward the light (transitions already exist) */
.kpi:hover, .panel:hover, .rrx-ov-card:hover,
.ri-click-card:hover, .rr-card--tap:hover {
  transform: translateY(-2px);
  border-color: rgba(242,57,247,0.45);
  box-shadow: inset 0 1px 0 var(--ng-edge-spec),
              inset 0 0 0 1px var(--ng-edge-cyan),
              var(--ng-shadow), var(--ng-glow-hover);
}
.rrx-ov-card { transition: border-color var(--ng-dur) var(--ng-ease), box-shadow var(--ng-dur) var(--ng-ease), transform var(--ng-dur) var(--ng-ease); }
.rrx-ov-num { box-shadow: inset 0 1px 0 rgba(255,255,255,0.08); }

/* drill-down drawer + toasts float over content → strong glass */
.ri-drawer {
  background: var(--ng-sheen), var(--ng-tint-overlay);
  -webkit-backdrop-filter: blur(var(--ng-blur-overlay)) saturate(var(--ng-sat));
  backdrop-filter: blur(var(--ng-blur-overlay)) saturate(var(--ng-sat));
}
.rr-toast {
  background: var(--ng-sheen), var(--ng-tint-overlay);
  -webkit-backdrop-filter: blur(var(--ng-blur-overlay)) saturate(var(--ng-sat));
  backdrop-filter: blur(var(--ng-blur-overlay)) saturate(var(--ng-sat));
  border: 1px solid var(--ng-edge-pink);
  box-shadow: inset 0 1px 0 var(--ng-edge-spec), var(--ng-shadow-overlay);
}

/* ---- chrome: sidebar + topbar become frosted panes over the neon wash ----- */
.sidebar {
  background: linear-gradient(180deg, rgba(32,2,48,0.72) 0%, rgba(10,1,24,0.58) 100%);
  -webkit-backdrop-filter: blur(var(--ng-blur-chrome)) saturate(var(--ng-sat));
  backdrop-filter: blur(var(--ng-blur-chrome)) saturate(var(--ng-sat));
  border-right: 1px solid rgba(242,57,247,0.22);
  box-shadow: inset -1px 0 0 rgba(88,249,244,0.06);
}
.topbar {
  background: rgba(10,1,24,0.55);
  -webkit-backdrop-filter: blur(var(--ng-blur-chrome)) saturate(var(--ng-sat));
  backdrop-filter: blur(var(--ng-blur-chrome)) saturate(var(--ng-sat));
  box-shadow: inset 0 -1px 0 rgba(88,249,244,0.07), 0 10px 30px rgba(0,0,0,0.22);
}

/* ---- store-switcher pill + menu ------------------------------------------- */
.store-pill {
  background: var(--ng-sheen), rgba(88,249,244,0.05);
  -webkit-backdrop-filter: blur(var(--ng-blur-card)) saturate(var(--ng-sat));
  backdrop-filter: blur(var(--ng-blur-card)) saturate(var(--ng-sat));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  transition: border-color var(--ng-dur) var(--ng-ease), box-shadow var(--ng-dur) var(--ng-ease);
}
.rr-store-menu {
  background: var(--ng-sheen), var(--ng-tint-overlay);
  -webkit-backdrop-filter: blur(var(--ng-blur-overlay)) saturate(var(--ng-sat));
  backdrop-filter: blur(var(--ng-blur-overlay)) saturate(var(--ng-sat));
  border: 1px solid var(--ng-edge-pink);
  box-shadow: inset 0 1px 0 var(--ng-edge-spec),
              inset 0 0 0 1px var(--ng-edge-cyan),
              var(--ng-shadow-overlay);
  animation: ng-pop-in .18s var(--ng-ease);
}
.rr-store-menu-item { transition: background var(--ng-dur) var(--ng-ease); }

/* ---- upgraded .rr-glass (What's New modal + hero panels) ------------------ */
.rr-glass {
  background: var(--ng-sheen), var(--ng-tint-overlay);
  -webkit-backdrop-filter: blur(var(--ng-blur-overlay)) saturate(var(--ng-sat));
  backdrop-filter: blur(var(--ng-blur-overlay)) saturate(var(--ng-sat));
  border: 1px solid var(--ng-edge-pink);
  box-shadow: inset 0 1px 0 var(--ng-edge-spec),
              inset 0 0 0 1px var(--ng-edge-cyan),
              var(--ng-shadow-overlay);
}

/* ---- motion: views ease in on mount; menus pop ---------------------------- */
#view-container > * { animation: ng-view-in .26s var(--ng-ease) both; }
@keyframes ng-view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ng-pop-in { from { opacity: 0; transform: translateY(-5px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---- restraint & resilience ----------------------------------------------- */
/* mobile / kiosk: cheaper frost (fewer, smaller blur regions) */
@media (max-width: 720px) {
  :root { --ng-blur-chrome: 16px; --ng-blur-card: 10px; --ng-blur-overlay: 20px; }
  .sidebar { background: linear-gradient(180deg, rgba(32,2,48,0.9) 0%, rgba(10,1,24,0.86) 100%); } /* drawer floats over content → strong tint */
}
/* no backdrop-filter support → fall back to the pre-glass opaque panels */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ng-glass,
  .kpi, .panel, .order-card, .rr-card,
  .ri-gadget-cell, .ri-reviews-tile, .ri-period-bar, .dash-nav,
  .rrx-ov-card, .rrx-truck-strip { background: var(--rr-panel-2); }
  .rr-store-menu, .rr-glass, .rr-toast { background: rgba(20,4,34,0.97); }
  .ri-drawer { background: linear-gradient(180deg, rgba(43,13,66,0.98), rgba(20,2,36,0.99)); }
  .sidebar { background: linear-gradient(180deg, var(--rr-violet) 0%, var(--rr-bg) 100%); }
  .topbar { background: rgba(10,1,24,0.92); }
}
@media (prefers-reduced-motion: reduce) {
  #view-container > * , .rr-store-menu { animation: none; }
}
