@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
  /* IrisIQ Light Palette — ProximaAI Executive Theme */
  --bg-page: #F4F6FA;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F8FAFC;
  --bg-muted: #EFF3F8;
  --bg-viewport: #0F172A;

  --border-light: #E2E8F0;
  --border-medium: #CBD5E1;
  --border-focus: #2563EB;

  --text-main: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --text-soft: #94A3B8;

  /* Brand & Status Accents */
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-soft: #EFF6FF;
  --primary-border: #BFDBFE;

  --indigo: #4F46E5;
  --indigo-soft: #EEF2FF;

  --emerald: #059669;
  --emerald-soft: #ECFDF5;
  --emerald-border: #A7F3D0;

  --gold: #D97706;
  --gold-soft: #FFFBEB;
  --gold-border: #FDE68A;

  --sky: #0284C7;
  --sky-soft: #F0F9FF;
  --sky-border: #BAE6FD;

  --rose: #E11D48;
  --rose-soft: #FFF1F2;
  --rose-border: #FECDD3;

  --purple: #7C3AED;
  --purple-soft: #F5F3FF;
  --purple-border: #DDD6FE;

  /* Shadows & Radii */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 45px -12px rgba(15, 23, 42, 0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Custom Clean Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}

/* =========================================================
   App Shell Layout
   ========================================================= */
.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--bg-page);
}

/* =========================================================
   Left Navigation Sidebar
   ========================================================= */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  z-index: 20;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 20px 8px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 18px;
}

.brand-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563EB 0%, #4F46E5 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.brand-title-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.1;
}

.brand-name-accent {
  color: var(--primary);
}

.brand-credit {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.nav-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  padding: 10px 12px 6px 12px;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
  width: 100%;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-border);
}

.nav-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg-muted);
  color: var(--text-secondary);
}

.nav-badge.live {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

/* Sidebar Edge Engine Footer */
.sidebar-edge-card {
  margin-top: auto;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
}

.sidebar-edge-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.sidebar-edge-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.status-dot-live {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 3px var(--emerald-soft);
  display: inline-block;
}

.status-dot-offline {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-soft);
  display: inline-block;
}

.sidebar-edge-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}

.sidebar-privacy-tag {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--emerald);
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  padding: 3px 8px;
  border-radius: 999px;
}

/* =========================================================
   Main Content Workspace & Executive Header
   ========================================================= */
.main-workspace {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

.top-header {
  height: 68px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.workspace-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.engine-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-vip-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

/* =========================================================
   Reusable Buttons, Pills & Inputs
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-medium);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: #94A3B8;
}

.btn-emerald {
  background: var(--emerald);
  color: #FFFFFF;
}
.btn-emerald:hover {
  background: #047857;
}

.btn-danger-outline {
  background: var(--bg-surface);
  color: var(--rose);
  border-color: var(--rose-border);
}
.btn-danger-outline:hover {
  background: var(--rose-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-muted);
  color: var(--text-main);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.btn-icon:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
}
.btn-icon.muted {
  color: var(--text-soft);
  background: var(--bg-muted);
}

.input-control, .select-control {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-control:focus, .select-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* =========================================================
   Scrollable Content Stage & View Switching
   ========================================================= */
.content-stage {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.view-section {
  display: none;
  height: 100%;
}

.view-section.active {
  display: block;
}

.section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* =========================================================
   VIEW 1: Live Floor HUD
   ========================================================= */
.hud-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) 390px;
  gap: 22px;
  align-items: start;
}

.card-surface {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.hero-card-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 28px;
  min-height: 490px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Standby HUD Card */
.hud-standby-box {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 12px;
}

.standby-emblem {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

.standby-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.standby-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.standby-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.standby-capabilities {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Active VIP Recognition Card (Light Executive Style) */
.vip-hero-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--gold-border);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 12px 32px rgba(217, 119, 6, 0.08);
  animation: hudSlideIn 0.25s ease-out;
}

.anon-hero-card {
  width: 100%;
  background: var(--bg-surface);
  border: 1.5px solid var(--sky-border);
  border-top: 4px solid var(--sky);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: 0 12px 32px rgba(2, 132, 199, 0.08);
  animation: hudSlideIn 0.25s ease-out;
}

@keyframes hudSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-avatar {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}

.hero-avatar.vip {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
  border: 1px solid #F59E0B;
}

.hero-avatar.anon {
  background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
  color: #0369A1;
  border: 1px solid #38BDF8;
}

.hero-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.hero-subline {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
}

.hero-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.hero-metric-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 14px;
}

.hero-metric-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hero-metric-value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.hero-guidance-box {
  background: var(--indigo-soft);
  border: 1px solid #C7D2FE;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.hero-guidance-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--indigo);
  margin-bottom: 4px;
}

.hero-guidance-text {
  font-size: 13.5px;
  color: #1E1B4B;
  line-height: 1.55;
}

.hero-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Crowd Co-Detection Companion Bar */
.crowd-companion-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  background: var(--sky-soft);
  border: 1px solid var(--sky-border);
  border-radius: 12px;
}

.crowd-summary-text {
  font-size: 12px;
  font-weight: 700;
  color: #0369A1;
}

.crowd-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.crowd-chip-vip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  color: #92400E;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.crowd-chip-vip:hover {
  background: #FEF3C7;
}
.crowd-chip-vip.is-focused {
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25);
}

.crowd-chip-anon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid var(--sky-border);
  color: #0369A1;
  font-size: 11.5px;
  font-weight: 600;
}

.crowd-enroll-pill {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
.crowd-enroll-pill:hover {
  background: var(--primary);
  color: #FFFFFF;
}

/* Badges */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tier-badge.vip {
  background: var(--gold-soft);
  color: #92400E;
  border: 1px solid var(--gold-border);
}
.tier-badge.platinum {
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid var(--purple-border);
}
.tier-badge.gold {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
}
.tier-badge.anon {
  background: var(--sky-soft);
  color: var(--sky);
  border: 1px solid var(--sky-border);
}

.match-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

/* Right Stack on HUD: Mini Monitor & Live Arrivals Stream */
.hud-side-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.mini-cam-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-subtle);
}

.panel-card-title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.viewport-canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-viewport);
  overflow: hidden;
}

.viewport-canvas-container canvas,
.viewport-canvas-container video,
.viewport-canvas-container img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.viewport-canvas-container canvas {
  z-index: 2;
  pointer-events: none;
}

.mini-cam-footer {
  padding: 9px 14px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hud-multi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: #0B1120;
  padding: 4px;
}

.hud-mini-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0F172A;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
}

.hud-mini-tile:hover {
  border-color: var(--primary);
}

.hud-mini-tile video,
.hud-mini-tile img,
.hud-mini-tile canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hud-mini-tile canvas {
  z-index: 2;
  pointer-events: none;
}

.hud-mini-top {
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  z-index: 5;
  pointer-events: none;
}

.hud-mini-pill {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.80);
  color: #F8FAFC;
  font-size: 9px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
}

.hud-mini-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #64748B;
  background: rgba(15, 23, 42, 0.9);
  z-index: 3;
}

.hud-role-assign-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
}

.hud-role-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.hud-role-select {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  outline: none;
  padding: 1px 2px;
}

.arrivals-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  max-height: 360px;
}

.arrivals-list {
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.arrival-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all 0.14s ease;
}

.arrival-row:hover {
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.arrival-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.arrival-avatar {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  flex-shrink: 0;
}

.arrival-avatar.vip {
  background: #FEF3C7;
  color: #92400E;
}

.arrival-avatar.anon {
  background: #E0F2FE;
  color: #0369A1;
}

.arrival-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.arrival-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.arrival-time {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  flex-shrink: 0;
}

.empty-state-box {
  padding: 28px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* =========================================================
   VIEW 2: Optical Matrix & Studio Lighting
   ========================================================= */
.matrix-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(260px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.cam-feed-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.cam-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}

.cam-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cam-title-text {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
}

.cam-viewport-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0F172A;
  overflow: hidden;
}

.cam-viewport-wrap video,
.cam-viewport-wrap img,
.cam-viewport-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cam-viewport-wrap canvas {
  z-index: 2;
  pointer-events: none;
}

.matrix-view-switch {
  display: inline-flex;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}

.matrix-view-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.matrix-view-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.matrix-multi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #0B1120;
  padding: 6px;
}

.multi-cam-tile {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0F172A;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.multi-cam-tile:hover {
  border-color: var(--primary);
}

.multi-cam-tile video,
.multi-cam-tile img,
.multi-cam-tile canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.multi-cam-tile canvas {
  z-index: 2;
  pointer-events: none;
}

.multi-cam-tile-top {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  z-index: 5;
  pointer-events: none;
}

.multi-cam-tile-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: #CBD5E1;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.95) 100%);
  z-index: 3;
}

.multi-cam-tile-empty span {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 500;
  color: #64748B;
}

.cam-placeholder-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(circle at center, rgba(30, 41, 59, 0.85) 0%, rgba(15, 23, 42, 0.96) 100%);
  color: #E2E8F0;
  z-index: 4;
}

.cam-overlay-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 5;
}

.cam-overlay-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(6px);
  color: #F8FAFC;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.camera-lighting-studio {
  padding: 14px 18px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
}

.studio-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.studio-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.studio-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cam-tool-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}
.cam-tool-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.cam-tool-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFFFFF;
}

.studio-sliders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.slider-field {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 8px 12px;
}

.slider-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.slider-field input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}

.cam-card-footer {
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface);
}

/* Secondary Hardware Slots */
.cam-slots-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cam-slot-card {
  background: var(--bg-surface);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.16s ease;
}

.cam-slot-card.active-live {
  border-style: solid;
  border-color: var(--emerald-border);
  background: #F0FDF4;
}

.cctv-connector-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.cctv-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
}

.cctv-mode-btn {
  padding: 7px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.cctv-mode-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.cctv-discovered-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.cctv-discovered-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  font-size: 11.5px;
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.cctv-discovered-chip:hover {
  background: #DBEAFE;
}

.cctv-test-banner {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.45;
}

.cctv-test-banner.ok {
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  color: #065F46;
}

.cctv-test-banner.err {
  background: var(--rose-soft);
  border: 1px solid var(--rose-border);
  color: #9F1239;
}

.cam-slot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cam-slot-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.cam-slot-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* =========================================================
   VIEW 3: Customer Directory & Privacy CRM
   ========================================================= */
.crm-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.crm-list-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 180px);
}

.crm-filters {
  padding: 14px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-subtle);
}

.crm-customers-scroll {
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crm-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.14s ease;
}

.crm-item-row:hover {
  background: var(--bg-subtle);
}

.crm-item-row.active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
}

.crm-dossier-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px;
  min-height: 440px;
}

.dossier-grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.dossier-stat-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 14px;
}

.dossier-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 18px;
}

.dossier-user-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dossier-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}

.dossier-avatar.vip {
  background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
  color: #92400E;
  border: 1px solid #F59E0B;
}
.dossier-avatar.gold {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FCD34D;
}
.dossier-avatar.anon {
  background: var(--sky-soft);
  color: var(--sky);
  border: 1px solid var(--sky-border);
}

.dossier-titles h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
}

.dossier-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.dossier-privacy-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--emerald-soft);
  border: 1px solid var(--emerald-border);
  margin-bottom: 18px;
}

.privacy-shield-meta h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--emerald);
  margin-bottom: 3px;
}

.privacy-shield-meta p {
  font-size: 12px;
  color: var(--text-secondary);
}

.hard-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--rose-border);
  background: var(--bg-surface);
  color: var(--rose);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}
.hard-delete-btn:hover {
  background: var(--rose);
  color: #FFFFFF;
}

.dossier-sections-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 18px 0;
}

.dossier-card-sub {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
}

.dossier-card-sub h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}

.order-receipt-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
}

.timeline-bars-grid {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 220px;
  padding: 20px 12px 10px 12px;
  border-bottom: 1px solid var(--border-light);
}

.timeline-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.timeline-bar-stack {
  width: 100%;
  max-width: 38px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 6px 6px 2px 2px;
  overflow: hidden;
  background: var(--bg-muted);
}

/* =========================================================
   VIEW 4: Executive Analytics (100% Live Data)
   ========================================================= */
.kpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin: 6px 0 4px 0;
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.analytics-split {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}

.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}

/* =========================================================
   VIEW 5: Edge Engine & Architecture
   ========================================================= */
.fleet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.arch-spec-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.arch-spec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  font-size: 13px;
}

.arch-spec-key {
  color: var(--text-secondary);
  font-weight: 500;
}

.arch-spec-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

/* =========================================================
   Modals (Enrollment & Compliance Certificate)
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-backdrop.open,
.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 580px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close-btn:hover {
  background: var(--bg-muted);
  color: var(--text-main);
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 75vh;
  overflow-y: auto;
}

.enroll-video-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #0F172A;
  object-fit: cover;
  border: 1px solid var(--border-light);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* =========================================================
   VIEW: Automated POS Integration & Checkout Hook
   ========================================================= */
.pos-flow-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-xs);
}

.pos-flow-step {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.pos-flow-step .step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primary-border);
  flex-shrink: 0;
}

.pos-flow-step .step-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
}

.pos-flow-step .step-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}

.pos-flow-arrow {
  font-size: 18px;
  font-weight: 700;
  color: var(--border-medium);
  padding: 0 4px;
}

.pos-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr);
  gap: 20px;
  align-items: start;
}

.pos-terminal-box {
  padding: 24px;
}

.pos-terminal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 18px;
}

.pos-items-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}

.pos-item-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border-light);
  background: var(--bg-subtle);
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pos-item-btn:hover {
  border-color: var(--primary);
}

.pos-item-btn.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.pos-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin: 18px 0;
}

.pos-telemetry-box {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pos-console-log {
  background: #0B1120;
  border-radius: 10px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #38BDF8;
  line-height: 1.6;
  min-height: 120px;
  max-height: 180px;
  overflow-y: auto;
}

.pos-console-log .log-line {
  margin-bottom: 4px;
}

.pos-console-log .log-line.text-muted {
  color: #64748B;
}

.pos-console-log .log-line.success {
  color: #10B981;
  font-weight: 700;
}

.pos-success-card {
  background: var(--emerald-soft);
  border: 1.5px solid var(--emerald-border);
  border-radius: 12px;
  padding: 16px;
  animation: hudSlideIn 0.25s ease-out;
}

/* =========================================================
   Responsive Adjustments
   ========================================================= */
@media (max-width: 1200px) {
  .hud-grid {
    grid-template-columns: 1fr;
  }
  .matrix-layout, .analytics-split, .fleet-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .crm-layout {
    grid-template-columns: 1fr;
  }
}
