/* ==========================================================================
   THE LAB // Apple Spatial Glassmorphic Design System
   Inspired by Apple VisionOS / macOS Tahoe Spatial Liquid Glass UI
   ========================================================================== */

:root {
  /* Core Apple Spatial Glass Tokens */
  --glass-bg: rgba(255, 255, 255, 0.13);
  --glass-bg-hover: rgba(255, 255, 255, 0.2);
  --glass-bg-elevated: rgba(255, 255, 255, 0.18);
  --glass-bg-subtle: rgba(255, 255, 255, 0.08);
  --glass-surface: rgba(20, 32, 54, 0.45);
  
  /* Refractive Glass Edges & Rim Highlights */
  --glass-border: rgba(255, 255, 255, 0.32);
  --glass-border-light: rgba(255, 255, 255, 0.48);
  --glass-border-subtle: rgba(255, 255, 255, 0.18);
  --glass-shine: inset 0 1px 1px 0 rgba(255, 255, 255, 0.65);
  --glass-shadow: 0 25px 70px -10px rgba(0, 15, 40, 0.38), 0 0 40px rgba(80, 180, 255, 0.22);
  
  /* Apple Palette & Vibrant Accents */
  --apple-blue: #007aff;
  --apple-blue-hover: #0066d6;
  --apple-blue-glow: rgba(0, 122, 255, 0.45);
  --apple-cyan: #32d74b;
  --apple-green: #30d158;
  --apple-green-glow: rgba(48, 209, 88, 0.4);
  --apple-orange: #ff9f0a;
  --apple-orange-glow: rgba(255, 159, 10, 0.35);
  --apple-red: #ff453a;
  --apple-purple: #bf5af2;
  --apple-indigo: #5e5ce6;
  --apple-teal: #64d2ff;

  /* Typography Colors */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.82);
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-faint: rgba(255, 255, 255, 0.4);

  /* Fonts */
  --font-apple: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Plus Jakarta Sans", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Monaco, monospace;

  /* Blur settings */
  --blur-window: blur(36px) saturate(190%);
  --blur-card: blur(24px) saturate(170%);
  --blur-modal: blur(48px) saturate(200%);

  /* Radii */
  --radius-window: 28px;
  --radius-card: 16px;
  --radius-pill: 9999px;
  --radius-sm: 8px;
  --radius-md: 12px;

  /* Transitions */
  --spring-fast: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --spring-normal: 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  height: 100%;
}

body.vision-stage {
  font-family: var(--font-apple);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-color: #0c1424;
}

/* ==========================================================================
   Spatial Background Scene (Architectural Atrium)
   ========================================================================== */
.spatial-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.backdrop-image {
  position: absolute;
  inset: -10px;
  background-image: 
    url('assets/background.jpg'),
    url('https://images.unsplash.com/photo-1519681393784-d120267933ba?auto=format&fit=crop&w=2600&q=80');
  background-size: cover;
  background-position: center 30%;
  filter: contrast(102%) brightness(96%);
}

.backdrop-gradient {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 70%),
    linear-gradient(to bottom, rgba(10, 18, 35, 0.1) 0%, rgba(10, 18, 35, 0.45) 80%, rgba(8, 14, 28, 0.75) 100%);
}

/* ==========================================================================
   Viewport & Floating Glass Window Container
   ========================================================================== */
.spatial-window-viewport {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.2rem 2rem 3.5rem;
}

.spatial-glass-window {
  width: 100%;
  max-width: 1540px;
  min-height: 840px;
  border-radius: var(--radius-window);
  background: var(--glass-bg);
  backdrop-filter: var(--blur-window);
  -webkit-backdrop-filter: var(--blur-window);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow), var(--glass-shine);
  display: grid;
  grid-template-columns: 210px 1fr 280px;
  overflow: hidden;
  position: relative;
}

/* Subtle Rim Glow */
.spatial-glass-window::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  pointer-events: none;
}

/* Floor Reflection Mirror */
.spatial-floor-reflection {
  width: 96%;
  max-width: 1480px;
  height: 90px;
  margin-top: -12px;
  border-radius: 40px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.09) 0%, transparent 100%);
  filter: blur(16px);
  opacity: 0.7;
  pointer-events: none;
  transform: perspective(600px) rotateX(45deg);
}

/* ==========================================================================
   LEFT SIDEBAR: Spatial Glass Navigation Panel
   ========================================================================== */
.window-sidebar {
  border-right: 1px solid var(--glass-border-subtle);
  background: rgba(255, 255, 255, 0.04);
  padding: 1.75rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Brand Cube Icon */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.4rem;
}

.brand-cube-wrap {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.brand-cube-icon {
  width: 18px;
  height: 18px;
  color: #ffffff;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
}

/* Navigation items */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  margin-top: 0.5rem;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-apple);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--spring-fast);
  text-align: left;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  color: inherit;
  flex-shrink: 0;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  transform: translateX(2px);
}

/* Active Electric Blue Pill (like screenshot) */
.nav-item.active {
  background: var(--apple-blue);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 18px var(--apple-blue-glow), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.nav-item.active svg {
  color: #ffffff;
}

/* Sidebar Footer Slogan */
.sidebar-footer {
  padding: 0.5rem 0.4rem;
}

.slogan-text {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.slogan-bar {
  width: 28px;
  height: 2px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   CENTER: Main Workspace View
   ========================================================================== */
.window-main-content {
  padding: 1.85rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
  overflow-y: auto;
}

/* Main Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.header-titles {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.page-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Floating Search Pill */
.spatial-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 260px;
}

.spatial-search-bar .search-icon {
  position: absolute;
  left: 0.85rem;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.spatial-search-bar input {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 0.5rem 2.2rem 0.5rem 2.4rem;
  color: #ffffff;
  font-family: var(--font-apple);
  font-size: 0.86rem;
  backdrop-filter: blur(12px);
  transition: all var(--spring-fast);
}

.spatial-search-bar input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.35);
}

.spatial-search-bar input::placeholder {
  color: var(--text-muted);
}

.search-clear-btn {
  position: absolute;
  right: 0.65rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.search-clear-btn svg {
  width: 14px;
  height: 14px;
}

/* Glass Circle Buttons */
.glass-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all var(--spring-fast);
}

.glass-icon-btn svg {
  width: 16px;
  height: 16px;
}

.glass-icon-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: scale(1.05);
}

/* Admin Profile Pill */
.admin-profile-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.75rem 0.3rem 0.35rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all var(--spring-fast);
}

.admin-profile-pill:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
}

.profile-avatar-wrap {
  position: relative;
  width: 28px;
  height: 28px;
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.profile-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--apple-green);
  border: 1.5px solid #1a2538;
}

.profile-status-dot.locked {
  background: var(--apple-orange);
}

.profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
}

.profile-caret {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* Apple Primary Button */
.btn-apple-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--apple-blue);
  color: #ffffff;
  font-family: var(--font-apple);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.52rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px var(--apple-blue-glow), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all var(--spring-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn-apple-primary svg {
  width: 16px;
  height: 16px;
}

.btn-apple-primary:hover {
  background: var(--apple-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--apple-blue-glow);
}

.btn-apple-primary:active {
  transform: translateY(0);
}

.btn-apple-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-family: var(--font-apple);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all var(--spring-fast);
  text-decoration: none;
}

.btn-apple-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ==========================================================================
   METRIC CARDS ROW (Exact match to screenshot)
   ========================================================================== */
.spatial-metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem;
}

.spatial-metric-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  backdrop-filter: var(--blur-card);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 8px 24px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: all var(--spring-normal);
}

.spatial-metric-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-light);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6), 0 12px 30px rgba(0, 0, 0, 0.18);
}

.metric-icon-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.metric-icon-box svg {
  width: 20px;
  height: 20px;
}

.box-folder {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.box-active {
  background: rgba(48, 209, 88, 0.2);
  color: var(--apple-green);
  border-color: rgba(48, 209, 88, 0.4);
}

.pulsing-green-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 12px var(--apple-green);
}

.box-hold {
  background: rgba(255, 159, 10, 0.2);
  color: var(--apple-orange);
  border-color: rgba(255, 159, 10, 0.4);
}

.box-completed {
  background: rgba(100, 210, 255, 0.2);
  color: var(--apple-teal);
  border-color: rgba(100, 210, 255, 0.4);
}

.metric-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
}

.metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.metric-number-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.metric-number {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  font-feature-settings: "tnum";
}

.metric-trend {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-pill);
}

.trend-up {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.15);
}

.trend-neutral {
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   SEGMENTED CONTROL & TOOLBAR
   ========================================================================== */
.spatial-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

/* Segmented Control Pills */
.segmented-pills-wrap {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 3px;
}

.seg-pill {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-apple);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.35rem 0.95rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--spring-fast);
}

.seg-pill:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.seg-pill.active {
  background: var(--apple-blue);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 10px var(--apple-blue-glow);
}

.toolbar-right-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* View Switch Glass */
.view-switch-glass {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--spring-fast);
}

.view-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.view-toggle-btn:hover {
  color: #ffffff;
}

.view-toggle-btn.active {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

/* Sort Dropdown */
.custom-sort-dropdown {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.sort-prefix {
  font-weight: 500;
  color: var(--text-muted);
}

.sort-select-input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-apple);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.sort-select-input option {
  background: #19273c;
  color: #ffffff;
}

/* ==========================================================================
   STREAM LIST VIEW: Sleek Floating Glass Rows (Exact Screenshot Look)
   ========================================================================== */
.spatial-content-area {
  min-height: 420px;
}

.projects-stream-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.stream-row-card {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 0.95rem 1.35rem;
  display: grid;
  grid-template-columns: 82px 1fr 140px 180px auto;
  align-items: center;
  gap: 1.25rem;
  backdrop-filter: var(--blur-card);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35), 0 6px 18px rgba(0, 0, 0, 0.1);
  transition: all var(--spring-normal);
  position: relative;
}

.stream-row-card:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--glass-border-light);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55), 0 12px 28px rgba(0, 0, 0, 0.2);
}

/* Thumbnail Column */
.stream-thumb-wrap {
  width: 76px;
  height: 54px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  position: relative;
}

.stream-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Details Column */
.stream-details-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.stream-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.stream-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stream-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

/* Tag Pills */
.stream-tags-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.apple-tag-pill {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.apple-tag-pill .tag-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--apple-cyan);
}

.tag-dot.blue { background: var(--apple-blue); }
.tag-dot.green { background: var(--apple-green); }
.tag-dot.purple { background: var(--apple-purple); }
.tag-dot.amber { background: var(--apple-orange); }

/* Progress Gauge Column */
.stream-progress-col {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.progress-circle-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.progress-circle-wrap svg {
  transform: rotate(-90deg);
}

.circle-bg {
  stroke: rgba(255, 255, 255, 0.15);
}

.circle-bar {
  stroke: var(--apple-green);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}

.circle-bar.blue { stroke: var(--apple-blue); }
.circle-bar.orange { stroke: var(--apple-orange); }

.progress-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
}

.progress-label-wrap {
  display: flex;
  flex-direction: column;
}

.progress-status-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
}

.progress-sub-text {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Date & Status Column */
.stream-meta-col {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stream-date-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.stream-date-row svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

/* Apple Status Chips */
.apple-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.73rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  width: fit-content;
}

.apple-status-chip.on-track {
  background: rgba(48, 209, 88, 0.2);
  color: #4ade80;
  border: 1px solid rgba(48, 209, 88, 0.4);
}

.apple-status-chip.at-risk {
  background: rgba(255, 159, 10, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(255, 159, 10, 0.4);
}

.apple-status-chip.planning {
  background: rgba(100, 210, 255, 0.2);
  color: #67e8f9;
  border: 1px solid rgba(100, 210, 255, 0.4);
}

/* Actions Column */
.stream-actions-col {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  justify-content: flex-end;
}

.btn-stream-launch {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.35), rgba(48, 209, 88, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--spring-fast);
}

.btn-stream-launch svg {
  width: 13px;
  height: 13px;
  color: #67e8f9;
}

.btn-stream-launch:hover {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.6), rgba(48, 209, 88, 0.4));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.35);
}

.btn-icon-dots {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--spring-fast);
}

.btn-icon-dots:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

/* Card Grid Mode (Alternate) */
.projects-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.spatial-grid-card {
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  backdrop-filter: var(--blur-card);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.35);
  transition: all var(--spring-normal);
}

.spatial-grid-card:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--glass-border-light);
  transform: translateY(-3px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.55), 0 14px 30px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   RIGHT SIDEBAR: Floating Glass Widgets
   ========================================================================== */
.window-right-column {
  border-left: 1px solid var(--glass-border-subtle);
  background: rgba(255, 255, 255, 0.04);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Widget 1: Quote / Vision Showcase Card (from screenshot) */
.vision-quote-card {
  position: relative;
  height: 140px;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.quote-card-bg {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?auto=format&fit=crop&w=800&q=80');
  background-size: cover;
  background-position: center;
  filter: brightness(80%) contrast(110%);
}

.quote-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 20, 38, 0.85) 0%, rgba(10, 20, 38, 0.3) 100%);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.quote-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.quote-card-icon svg {
  width: 15px;
  height: 15px;
}

.quote-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Widget General Card */
.vision-widget-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  backdrop-filter: var(--blur-card);
}

.vision-widget-card.flex-1 {
  flex: 1;
}

.widget-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.widget-icon {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.widget-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* Quick Filters rows */
.quick-filters-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.quick-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-apple);
  font-size: 0.83rem;
  cursor: pointer;
  transition: all var(--spring-fast);
}

.quick-filter-row:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.quick-filter-row.active {
  background: rgba(0, 122, 255, 0.25);
  color: #ffffff;
  border: 1px solid rgba(0, 122, 255, 0.4);
}

.qf-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.qf-icon {
  width: 14px;
  height: 14px;
}

.qf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-green { background: var(--apple-green); }
.dot-blue { background: var(--apple-blue); }
.dot-yellow { background: var(--apple-orange); }
.dot-purple { background: var(--apple-purple); }

.qf-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  font-feature-settings: "tnum";
}

/* Recent Activity List */
.activity-timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  max-height: 280px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.activity-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ffffff;
}

.activity-icon-wrap svg {
  width: 13px;
  height: 13px;
}

.activity-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.activity-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-time {
  font-size: 0.68rem;
  color: var(--text-faint);
  margin-top: 0.1rem;
}

/* ==========================================================================
   BOTTOM FOOTER BAR
   ========================================================================== */
.spatial-footer-bar {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--glass-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-left-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sqlite-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border-subtle);
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.chip-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--apple-green);
  box-shadow: 0 0 6px var(--apple-green);
}

.footer-right-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.glass-link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-apple);
  font-size: 0.78rem;
  cursor: pointer;
  transition: color var(--spring-fast);
}

.glass-link-btn:hover {
  color: #ffffff;
  text-decoration: underline;
}

.glass-link-btn.danger:hover {
  color: var(--apple-red);
}

.dot-sep {
  color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   APPLE-GRADE MODALS & SHEETS
   ========================================================================== */
.apple-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 10, 25, 0.55);
  backdrop-filter: var(--blur-modal);
  -webkit-backdrop-filter: var(--blur-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--spring-normal);
}

.apple-modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.apple-modal-dialog {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius-window);
  background: rgba(25, 38, 62, 0.75);
  border: 1px solid var(--glass-border-light);
  box-shadow: 0 35px 80px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  backdrop-filter: var(--blur-modal);
  transform: scale(0.95) translateY(12px);
  transition: transform var(--spring-normal);
}

.apple-modal-backdrop.show .apple-modal-dialog {
  transform: scale(1) translateY(0);
}

.apple-modal-header {
  padding: 1.35rem 1.75rem;
  border-bottom: 1px solid var(--glass-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dialog-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dialog-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.dialog-icon-badge.badge-blue {
  background: rgba(0, 122, 255, 0.25);
  color: #60a5fa;
  border-color: rgba(0, 122, 255, 0.4);
}

.dialog-icon-badge.badge-shield {
  background: rgba(48, 209, 88, 0.2);
  color: #4ade80;
  border-color: rgba(48, 209, 88, 0.4);
}

.dialog-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
}

.dialog-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.apple-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--spring-fast);
}

.apple-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.apple-modal-body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.apple-modal-footer {
  padding: 1.15rem 1.75rem;
  border-top: 1px solid var(--glass-border-subtle);
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Forms & Inputs */
.form-grid-2 {
  display: flex;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.apple-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.apple-label.required::after {
  content: ' *';
  color: var(--apple-red);
}

.opt-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

.apple-input, .apple-select, .apple-textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  color: #ffffff;
  font-family: var(--font-apple);
  font-size: 0.88rem;
  transition: all var(--spring-fast);
}

.apple-input:focus, .apple-select:focus, .apple-textarea:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.35);
  border-color: var(--apple-blue);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.3);
}

.apple-select option {
  background: #18253b;
  color: #fff;
}

.font-mono {
  font-family: var(--font-mono) !important;
}

.path-quick-chips {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.chips-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.apple-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--spring-fast);
}

.apple-chip:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* Launcher Preview & Channels */
.launcher-preview-panel {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.launcher-preview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.apple-kind-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.launcher-preview-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.launcher-preview-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.launcher-folder-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.65rem;
  font-size: 0.78rem;
  color: #cbd5e1;
}

.launcher-folder-row svg {
  width: 14px;
  height: 14px;
  color: var(--apple-blue);
  flex-shrink: 0;
}

.btn-copy-chip {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-copy-chip:hover {
  color: #ffffff;
}

.launch-channels-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.launch-channel-tile {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.tile-icon-box {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tile-icon-box svg {
  width: 16px;
  height: 16px;
}

.blue-tile { background: rgba(0, 122, 255, 0.2); color: #60a5fa; }
.cyan-tile { background: rgba(100, 210, 255, 0.2); color: #38bdf8; }
.purple-tile { background: rgba(191, 90, 242, 0.2); color: #c084fc; }
.green-tile { background: rgba(48, 209, 88, 0.2); color: #4ade80; }

.tile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.tile-info strong {
  font-size: 0.84rem;
  color: #ffffff;
}

.tile-info span {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
}

.btn-full {
  width: 100%;
}

/* Admin Modal specific */
.admin-glass-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 122, 255, 0.12);
  border: 1px solid rgba(0, 122, 255, 0.3);
  border-radius: var(--radius-md);
  color: #ffffff;
  font-size: 0.8rem;
}

.admin-glass-notice svg {
  width: 18px;
  height: 18px;
  color: #60a5fa;
  flex-shrink: 0;
  margin-top: 2px;
}

.input-with-eye {
  position: relative;
  display: flex;
  align-items: center;
}

.btn-eye {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.btn-plain-link {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-apple);
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-plain-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.btn-plain-link.danger:hover {
  color: var(--apple-red);
}

.admin-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
}

/* SQL Console Modal */
.sql-preset-chips {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sql-editor-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sql-code-editor {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #67e8f9;
  font-size: 0.85rem;
  line-height: 1.45;
  resize: vertical;
}

.sql-run-bar {
  display: flex;
  justify-content: flex-end;
}

.sql-output-container {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  max-height: 240px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.sql-placeholder {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.apple-sql-table {
  width: 100%;
  border-collapse: collapse;
}

.apple-sql-table th {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
}

.apple-sql-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
}

/* Toasts */
.apple-toast-shelf {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.apple-toast {
  pointer-events: auto;
  background: rgba(25, 38, 62, 0.85);
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  backdrop-filter: var(--blur-modal);
  transform: translateX(100px);
  opacity: 0;
  transition: all var(--spring-normal);
}

.apple-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.apple-toast svg {
  width: 16px;
  height: 16px;
}

.toast-success svg { color: var(--apple-green); }
.toast-info svg { color: var(--apple-teal); }
.toast-error svg { color: var(--apple-red); }

/* Empty state */
.spatial-empty-state {
  padding: 4.5rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-card);
}

.empty-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

/* Visitor Mode Locks */
.visitor-lock-hide {
  display: none !important;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1380px) {
  .spatial-glass-window {
    grid-template-columns: 190px 1fr;
  }
  .window-right-column {
    display: none;
  }
}

@media (max-width: 1080px) {
  .spatial-metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .stream-row-card {
    grid-template-columns: 76px 1fr auto;
  }
  .stream-progress-col, .stream-meta-col {
    display: none;
  }
}

@media (max-width: 840px) {
  .spatial-window-viewport {
    padding: 1rem 0.5rem;
  }
  .spatial-glass-window {
    grid-template-columns: 1fr;
    border-radius: var(--radius-card);
  }
  .window-sidebar {
    display: none;
  }
  .spatial-metrics-row {
    grid-template-columns: 1fr;
  }
}
