/* ==========================================================================
   DREAMERR LAB — STUDIO OS WORKSPACE THEME
   Ambient Moving Gradients, Tactile Micro-Surfaces, Multi-Board & Dashboard
   ========================================================================== */

:root {
  /* Dark Space & Obsidian Palette */
  --bg-app: #07090E;
  --bg-surface: #10131B;
  --bg-surface-elevated: #151923;
  --bg-surface-card: #12151F;
  --bg-surface-inset: #0A0C11;
  --bg-surface-hover: #181C28;
  --bg-glass: rgba(13, 16, 23, 0.95);

  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-medium: rgba(255, 255, 255, 0.09);
  --border-card: rgba(255, 255, 255, 0.06);
  --border-focus: #6366F1;

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  /* Studio Glow Colors */
  --accent-purple: #6366F1;
  --accent-purple-dark: #4F46E5;
  --accent-purple-glow: rgba(99, 102, 241, 0.35);

  --accent-brand: #5A78FF;
  --accent-success: #10B981;
  --accent-warning: #F59E0B;
  --accent-danger: #EF4444;
  --accent-cyan: #06B6D4;
  --accent-magenta: #A855F7;
  --accent-gold: #FBBF24;

  /* Priority Palette */
  --priority-high: #EF4444;
  --priority-medium: #F59E0B;
  --priority-low: #10B981;

  /* Typography */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Radii */
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --neu-flat: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --neu-raised: 5px 5px 18px rgba(0, 0, 0, 0.65), -2px -2px 10px rgba(255, 255, 255, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --neu-pressed: inset 3px 3px 8px rgba(0, 0, 0, 0.7), inset -1px -1px 4px rgba(255, 255, 255, 0.03);

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.dark-lab-theme {
  font-family: var(--font-main);
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* Ambient Moving Background */
.ambient-glow-mesh {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient-dot-grid {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.07) 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  opacity: 0.75;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.28;
  animation: orbPulse 14s infinite alternate ease-in-out;
}

.orb-1 { width: 550px; height: 550px; background: radial-gradient(circle, #6366F1 0%, rgba(99, 102, 241, 0) 70%); top: -150px; left: 20%; animation-duration: 16s; }
.orb-2 { width: 600px; height: 600px; background: radial-gradient(circle, #3B82F6 0%, rgba(59, 130, 246, 0) 70%); bottom: -150px; right: 15%; animation-duration: 20s; animation-delay: -5s; }
.orb-3 { width: 400px; height: 400px; background: radial-gradient(circle, #A855F7 0%, rgba(168, 85, 247, 0) 70%); top: 40%; right: 40%; animation-duration: 18s; animation-delay: -10s; }

@keyframes orbPulse {
  0% { transform: translate(0, 0) scale(1); opacity: 0.22; }
  50% { transform: translate(40px, -30px) scale(1.18); opacity: 0.35; }
  100% { transform: translate(-30px, 30px) scale(0.95); opacity: 0.25; }
}

/* Celebration Canvas */
.celebration-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 50;
  pointer-events: none;
}

/* ==========================================================================
   LUXURY OBSIDIAN STUDIO LOGIN PORTAL
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-app);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  z-index: 99999;
  overflow-y: auto;
}

.login-overlay:not(.active) {
  display: none !important;
}

html.user-session-active .login-overlay {
  display: none !important;
}

html.user-session-active .app-layout {
  display: flex !important;
}

.login-cosmic-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.orbital-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, 0.12);
  pointer-events: none;
}

.ring-1 {
  width: 900px; height: 900px;
  top: 50%; left: 55%;
  transform: translate(-50%, -50%);
  border-color: rgba(99, 102, 241, 0.14);
}

.ring-2 {
  width: 1300px; height: 1300px;
  top: 50%; left: 55%;
  transform: translate(-50%, -50%);
  border-color: rgba(168, 85, 247, 0.08);
}

.ring-3 {
  width: 1700px; height: 1700px;
  top: 50%; left: 55%;
  transform: translate(-50%, -50%);
  border-color: rgba(255, 255, 255, 0.03);
}

.celestial-horizon-glow {
  position: absolute;
  bottom: -200px; right: -100px;
  width: 800px; height: 500px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35) 0%, rgba(99, 102, 241, 0.15) 40%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
}

.celestial-planet-arc {
  position: absolute;
  bottom: -450px; right: -250px;
  width: 900px; height: 900px;
  border-radius: 50%;
  border-top: 2px solid rgba(168, 85, 247, 0.5);
  box-shadow: 0 -10px 40px rgba(168, 85, 247, 0.4), inset 0 20px 60px rgba(99, 102, 241, 0.2);
  pointer-events: none;
}

.pulsing-star {
  position: absolute;
  width: 4px; height: 4px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 0 10px #FFFFFF, 0 0 20px #A855F7;
  animation: starPulse 4s infinite alternate ease-in-out;
}

.star-1 { top: 48%; left: 45%; }
.star-2 { top: 25%; right: 18%; animation-delay: -2s; }

@keyframes starPulse {
  0% { transform: scale(0.8); opacity: 0.4; }
  100% { transform: scale(1.6); opacity: 1; }
}

.login-portal-wrapper {
  position: relative;
  z-index: 10;
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 60px;
  align-items: center;
  margin: 0 auto;
}

.login-hero-pane {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-right: 20px;
}

.login-brand-capsule { display: inline-flex; align-items: center; }
.login-hero-headline h1 { font-size: 2.8rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.03em; color: var(--text-primary); margin-bottom: 14px; }
.gradient-text-purple { background: linear-gradient(135deg, #A855F7 0%, #818CF8 50%, #C084FC 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; display: inline-block; }
.hero-subline { font-size: 1.05rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 10px; }
.hero-body { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; max-width: 520px; }

.login-features-list { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.feature-item { display: flex; align-items: center; gap: 14px; background: rgba(16, 19, 27, 0.45); border: 1px solid var(--border-subtle); padding: 10px 14px; border-radius: var(--radius-md); box-shadow: var(--neu-pressed); max-width: 480px; }
.feature-icon-box { width: 34px; height: 34px; background: rgba(99, 102, 241, 0.12); border: 1px solid rgba(99, 102, 241, 0.25); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: #A5B4FC; flex-shrink: 0; box-shadow: 0 0 12px rgba(99, 102, 241, 0.2); }
.feature-text { display: flex; flex-direction: column; }
.feature-title { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.feature-desc { font-size: 0.72rem; color: var(--text-muted); }

.login-card-pod {
  background: rgba(16, 19, 27, 0.75);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--border-medium);
  border-top: 1px solid rgba(168, 85, 247, 0.6);
  border-radius: 20px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 -2px 24px rgba(168, 85, 247, 0.2), 0 24px 60px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.05);
  position: relative;
}

.login-card-pod::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #A855F7, #6366F1, transparent);
  border-radius: 9999px;
  box-shadow: 0 0 16px #A855F7;
}

.login-pod-header { display: flex; flex-direction: column; gap: 4px; }
.pod-title { font-size: 1.55rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.pod-subtitle { font-size: 0.82rem; color: var(--text-muted); }
.form-group-luxury { display: flex; flex-direction: column; gap: 6px; }
.form-group-luxury label { font-size: 0.76rem; font-weight: 700; color: var(--text-secondary); }
.input-with-icon { position: relative; display: flex; align-items: center; }
.field-icon { position: absolute; left: 14px; color: var(--text-muted); pointer-events: none; transition: var(--transition-fast); }
.input-with-icon input { width: 100%; background-color: var(--bg-surface-inset); border: 1px solid var(--border-medium); color: var(--text-primary); font-family: var(--font-main); font-size: 0.84rem; padding: 11px 40px 11px 42px; border-radius: var(--radius-sm); outline: none; box-shadow: var(--neu-pressed); transition: var(--transition-fast); }
.input-with-icon input:focus { border-color: var(--accent-purple); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25), var(--neu-pressed); }
.btn-toggle-password { position: absolute; right: 12px; background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; }
.btn-toggle-password:hover { color: var(--text-primary); }
.login-form-options { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.forgot-link { font-size: 0.74rem; font-weight: 600; color: #A5B4FC; text-decoration: none; transition: var(--transition-fast); }
.btn-enter-studio { padding: 12px 18px; font-size: 0.88rem; font-weight: 800; border-radius: var(--radius-sm); margin-top: 6px; box-shadow: 0 0 20px rgba(99, 102, 241, 0.45); }
.login-divider { display: flex; align-items: center; text-align: center; color: var(--text-muted); font-size: 0.72rem; font-weight: 600; margin: 2px 0; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; border-bottom: 1px solid var(--border-subtle); }
.login-divider span { padding: 0 10px; }
.sso-buttons-group { display: flex; flex-direction: column; gap: 8px; }
.btn-sso { display: flex; align-items: center; justify-content: center; gap: 10px; background: var(--bg-surface-inset); border: 1px solid var(--border-medium); color: var(--text-primary); font-family: var(--font-main); font-size: 0.8rem; font-weight: 700; padding: 10px 14px; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition-fast); box-shadow: var(--neu-pressed); }
.btn-sso:hover { background: var(--bg-surface-hover); border-color: rgba(255, 255, 255, 0.15); transform: translateY(-1px); }
.login-footer-action { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); padding-top: 4px; }
.request-access-link { color: #A5B4FC; font-weight: 700; text-decoration: none; }

/* ==========================================================================
   DISTINCTIVE BOARD HERO BANNER & CINEMATIC TRANSITIONS
   ========================================================================== */
.board-hero-banner {
  margin: 12px 20px 0 20px;
  padding: 14px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.board-hero-banner.type-client {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.06) 0%, rgba(16, 19, 27, 0.95) 100%);
  border-color: rgba(16, 185, 129, 0.25);
}

.board-hero-banner.type-projects {
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.06) 0%, rgba(16, 19, 27, 0.95) 100%);
  border-color: rgba(99, 102, 241, 0.25);
}

.board-hero-banner.type-admin {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.06) 0%, rgba(16, 19, 27, 0.95) 100%);
  border-color: rgba(245, 158, 11, 0.25);
}

.board-hero-left { display: flex; flex-direction: column; gap: 4px; }
.board-hero-badge { font-size: 0.64rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #A5B4FC; }
.board-hero-title { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); letter-spacing: -0.01em; }
.board-hero-right { display: flex; align-items: center; gap: 12px; }

.board-hero-pill-stat {
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.btn-drive-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-drive-link:hover {
  border-color: var(--accent-purple);
  background: rgba(99, 102, 241, 0.12);
  color: #FFFFFF;
}

.btn-drive-link .icon-ext-link {
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.btn-drive-link:hover .icon-ext-link {
  opacity: 1;
}

/* Cinematic Board Switch Animation */
.board-container.switching {
  animation: boardSwitchAnim 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes boardSwitchAnim {
  0% { opacity: 0.2; transform: translateY(8px) scale(0.99); filter: blur(4px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

/* ==========================================================================
   GAMIFICATION REWARDS TRIGGER & POPOVER
   ========================================================================== */
.gamification-wrapper { position: relative; display: flex; align-items: center; }

.btn-gamification-pill {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #E2E8F0;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.2);
  transition: var(--transition-fast);
}

.btn-gamification-pill:hover {
  border-color: #A855F7;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
  transform: scale(1.02);
}

.trophy-gradient-icon {
  stroke: #C084FC;
  filter: drop-shadow(0 0 4px #A855F7);
  flex-shrink: 0;
}

.gamification-mini-progress {
  width: 44px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  display: inline-block;
}

.gamification-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #A855F7 0%, #6366F1 100%);
  border-radius: 9999px;
  box-shadow: 0 0 6px #A855F7;
  transition: width 0.3s ease;
}

.gamification-popover { width: 350px; padding: 14px; }
.popover-section-header-flex { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.badge-bonus-total { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 800; color: #34D399; background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.35); padding: 2px 8px; border-radius: 4px; }

.gamification-challenges-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; }
.challenge-card {
  background: var(--bg-surface-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: help;
  transition: var(--transition-fast);
}

.challenge-card:hover {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(26, 31, 46, 0.9);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.challenge-card.completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.05);
}

.challenge-header { display: flex; align-items: center; justify-content: space-between; }
.challenge-title { font-size: 0.80rem; font-weight: 700; color: var(--text-primary); }
.challenge-reward-badge { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 800; color: #FBBF24; background: rgba(245, 158, 11, 0.15); padding: 2px 7px; border-radius: 4px; border: 1px solid rgba(245, 158, 11, 0.3); }
.challenge-desc { font-size: 0.70rem; color: var(--text-muted); line-height: 1.3; }

.challenge-progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.challenge-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366F1 0%, #A855F7 100%);
  border-radius: 9999px;
  box-shadow: 0 0 8px #A855F7;
}

.gamification-badges-row { display: flex; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.trophy-badge { font-size: 0.65rem; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: var(--bg-surface-inset); border: 1px solid var(--border-subtle); color: var(--text-muted); cursor: help; }
.trophy-badge.active { border-color: rgba(168, 85, 247, 0.4); color: #C084FC; background: rgba(168, 85, 247, 0.12); }

/* Assignee selection box in card modal */
.assignee-select-box {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.assignee-bubbles-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.assignee-bubbles-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.assignee-bubble-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 800;
  color: #FFFFFF;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.assignee-bubble-item:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

.assignee-bubble-remove {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: #EF4444;
  border-radius: 50%;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bg-app);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.assignee-bubble-item:hover .assignee-bubble-remove {
  display: flex;
}

.btn-add-assignee-bubble {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface-inset);
  border: 1.5px dashed var(--accent-purple);
  color: #C084FC;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add-assignee-bubble:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: #FFFFFF;
  color: #FFFFFF;
  transform: scale(1.1);
}

.assignee-picker-popover {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 8px;
  width: 220px;
  box-shadow: var(--neu-floating);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.assignee-popover-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2px;
}

.assignee-popover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.76rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.assignee-popover-item:hover {
  background: var(--bg-surface-hover);
  color: #FFFFFF;
}

.card-assignees-cluster {
  display: flex;
  align-items: center;
}

.card-assignees-cluster .card-assignee-avatar {
  margin-left: -6px;
  border: 1.5px solid var(--bg-surface-card);
  transition: transform 0.15s ease;
}

.card-assignees-cluster .card-assignee-avatar:first-child {
  margin-left: 0;
}

.card-assignees-cluster:hover .card-assignee-avatar {
  transform: translateX(2px);
}

/* ==========================================================================
   APP LAYOUT & SIDEBAR
   ========================================================================== */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.sidebar-feed {
  width: 275px;
  min-width: 275px;
  height: 100%;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-medium);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-normal), min-width var(--transition-normal), opacity var(--transition-normal), padding var(--transition-normal);
  z-index: 600;
  overflow-y: auto;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
}

.sidebar-feed.collapsed {
  width: 0;
  min-width: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  border-right: none;
}

.feed-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface-elevated);
}

.feed-title { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.05em; color: var(--text-muted); text-transform: uppercase; }
.feed-section { padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 10px; }
.feed-section.flex-1 { flex: 1; }
.feed-section-title { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.04em; }

.feed-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.feed-stat-card {
  background: var(--bg-surface-inset);
  border: 1px solid var(--border-subtle);
  padding: 10px;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--neu-pressed);
}

.feed-stat-label { font-size: 0.64rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
.feed-stat-value { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); }
.feed-stat-sub { font-size: 0.62rem; color: var(--text-secondary); }

.feed-boards-list { display: flex; flex-direction: column; gap: 6px; }
.feed-board-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-surface-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}

.feed-board-item:hover { background: var(--bg-surface-hover); border-color: var(--accent-purple); }
.feed-board-item.active { background: rgba(99, 102, 241, 0.14); border-color: var(--accent-purple); }
.feed-board-info { display: flex; flex-direction: column; overflow: hidden; }
.feed-board-name { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-board-type-tag { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; }
.feed-board-type-tag.client { color: #10B981; }
.feed-board-type-tag.projects { color: #6366F1; }
.feed-board-type-tag.admin { color: #F59E0B; }
.feed-footer { padding: 12px 16px; border-top: 1px solid var(--border-subtle); }

.main-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-width: 0;
  position: relative;
}

/* ==========================================================================
   TOP NAVBAR
   ========================================================================== */
.navbar {
  min-height: 56px;
  height: auto;
  background-color: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
  position: relative;
  z-index: 800;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 auto;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.btn-feed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 0.76rem;
  font-weight: 700;
  flex-shrink: 0;
}

.brand-badge { display: flex; align-items: center; flex-shrink: 0; cursor: pointer; }
.brand-logo-svg { height: 30px; width: auto; max-width: 170px; filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.12)); transition: transform var(--transition-fast); }
.brand-logo-svg:hover { transform: scale(1.02); filter: drop-shadow(0 0 14px rgba(99, 102, 241, 0.4)); }

.project-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-inset);
  border: 1px solid var(--border-medium);
  padding: 4px 10px 4px 8px;
  border-radius: var(--radius-full);
  box-shadow: var(--neu-pressed);
  flex-shrink: 1;
  min-width: 0;
}

.selector-tag { font-size: 0.64rem; font-weight: 800; color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.select-container { display: flex; align-items: center; gap: 8px; min-width: 0; }
.select-container select {
  appearance: none; background: transparent; color: var(--text-primary); border: none;
  font-family: var(--font-main); font-size: 0.78rem; font-weight: 700; cursor: pointer; outline: none;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.project-dot { width: 7px; height: 7px; background-color: var(--accent-purple); border-radius: 50%; box-shadow: 0 0 8px var(--accent-purple); flex-shrink: 0; }

.view-segmented-toggle {
  display: flex;
  background-color: var(--bg-surface-inset);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
  box-shadow: var(--neu-pressed);
  flex-shrink: 0;
}

.view-tab-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px;
  font-family: var(--font-main); font-size: 0.74rem; font-weight: 700; color: var(--text-secondary);
  background: transparent; border: none; border-radius: var(--radius-full); cursor: pointer; transition: var(--transition-fast);
  white-space: nowrap;
}

.view-tab-btn:hover { color: var(--text-primary); }
.view-tab-btn.active {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  color: #FFFFFF;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.4);
}

.sync-status {
  display: flex; align-items: center; gap: 6px; background-color: var(--bg-surface-inset);
  padding: 5px 12px; border-radius: var(--radius-full); border: 1px solid var(--border-subtle); box-shadow: var(--neu-pressed);
}

.status-pulse { width: 7px; height: 7px; background-color: var(--accent-success); border-radius: 50%; box-shadow: 0 0 8px var(--accent-success); }
.status-pulse.syncing { background-color: var(--accent-warning); box-shadow: 0 0 8px var(--accent-warning); animation: pulseAnim 1s infinite alternate; }
.status-pulse.error { background-color: var(--accent-danger); box-shadow: 0 0 8px var(--accent-danger); }
@keyframes pulseAnim { 0% { opacity: 0.3; } 100% { opacity: 1; } }
.status-text { font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px;
  font-family: var(--font-main); font-size: 0.78rem; font-weight: 700; border-radius: var(--radius-full);
  cursor: pointer; outline: none; border: none; transition: var(--transition-fast); text-decoration: none; flex-shrink: 0; user-select: none;
}

.btn-purple-glow {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

.btn-purple-glow:hover {
  background: linear-gradient(135deg, #7477FF 0%, #5B52FF 100%);
  box-shadow: 0 0 24px rgba(99, 102, 241, 0.55);
}

.btn-neu-icon { background: var(--bg-surface-elevated); color: var(--text-secondary); border: 1px solid var(--border-subtle); padding: 6px 12px; border-radius: var(--radius-full); font-size: 0.76rem; }
.btn-neu-icon:hover { color: var(--text-primary); border-color: var(--border-medium); }

.btn-secondary { background: var(--bg-surface-elevated); color: var(--text-primary); border: 1px solid var(--border-medium); }
.btn-secondary:hover { background-color: var(--bg-surface-hover); }

.btn-outline { background-color: transparent; color: var(--text-secondary); border: 1px dashed var(--border-medium); }
.btn-outline:hover { color: var(--text-primary); border-color: var(--accent-purple); }

.btn-sm { padding: 4px 10px; font-size: 0.72rem; }
.w-100 { width: 100%; }

.btn-close { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 6px; border-radius: var(--radius-xs); display: flex; align-items: center; justify-content: center; }
.btn-close:hover { color: var(--text-primary); }

/* User Session Pill & Popovers */
.user-session-wrapper, .settings-dropdown-wrapper { position: relative; display: flex; align-items: center; }
.user-session-pill { display: flex; align-items: center; gap: 8px; background: var(--bg-surface-inset); border: 1px solid var(--border-medium); padding: 3px 10px 3px 4px; border-radius: var(--radius-full); cursor: pointer; box-shadow: var(--neu-pressed); transition: var(--transition-fast); }
.user-session-pill:hover { border-color: var(--accent-purple); }

.user-avatar { width: 26px; height: 26px; background-color: var(--accent-purple); color: #FFFFFF; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.72rem; font-weight: 800; box-shadow: 0 0 10px rgba(99, 102, 241, 0.4); flex-shrink: 0; text-transform: uppercase; }
.avatar-xs { width: 22px; height: 22px; font-size: 0.65rem; }
.avatar-md { width: 36px; height: 36px; font-size: 0.95rem; }
.avatar-large { width: 52px; height: 52px; font-size: 1.3rem; }

.user-meta { display: flex; align-items: center; gap: 6px; }
.user-name { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.role-badge { font-size: 0.62rem; font-weight: 800; padding: 1px 6px; border-radius: 4px; letter-spacing: 0.04em; }
.role-badge.admin { background-color: rgba(245, 158, 11, 0.2); color: #F59E0B; border: 1px solid rgba(245, 158, 11, 0.35); }
.role-badge.designer { background-color: rgba(99, 102, 241, 0.2); color: #A5B4FC; border: 1px solid rgba(99, 102, 241, 0.35); }
.role-badge.client { background-color: rgba(16, 185, 129, 0.2); color: #10B981; border: 1px solid rgba(16, 185, 129, 0.35); }

/* DROPDOWN POPOVERS: CRITICAL HIGH Z-INDEX */
.neu-dropdown-popover {
  position: absolute; top: 48px; right: 0;
  background-color: var(--bg-surface-elevated); border: 1px solid var(--border-medium);
  border-radius: var(--radius-md); box-shadow: 0 16px 45px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);
  width: 290px; padding: 8px; display: none; flex-direction: column; gap: 4px; z-index: 1200 !important; animation: fadeInPop 0.15s ease-out;
}

.neu-dropdown-popover.active { display: flex; }
@keyframes fadeInPop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.popover-section-header { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 6px 8px 4px 8px; }
.popover-divider { height: 1px; background-color: var(--border-subtle); margin: 4px 0; }

.dropdown-item-btn {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-xs);
  background: transparent; border: 1px solid transparent; color: var(--text-primary); font-family: var(--font-main);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; text-align: left; transition: var(--transition-fast); width: 100%;
}

.dropdown-item-btn:hover { background-color: var(--bg-surface-hover); border-color: var(--border-subtle); }
.dropdown-item-btn svg { color: var(--accent-purple); flex-shrink: 0; }
.btn-logout-action svg { color: var(--accent-danger) !important; }
.item-text-group { display: flex; flex-direction: column; overflow: hidden; }
.item-title { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.item-desc { font-size: 0.68rem; color: var(--text-muted); }

.user-popover-header { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.user-popover-info { display: flex; flex-direction: column; overflow: hidden; }
.popover-name { font-size: 0.84rem; font-weight: 700; color: var(--text-primary); }
.popover-email { font-size: 0.7rem; color: var(--text-muted); }

/* ==========================================================================
   TOOLBAR: SEARCH ⌘K, DRIVE FOLDER CAPSULE & CATEGORIES
   ========================================================================== */
.toolbar {
  padding: 12px 20px; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; flex-shrink: 0; position: relative; z-index: 10;
}

.toolbar-left-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }
.toolbar-right-group { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.search-box {
  display: flex; align-items: center; gap: 8px; background-color: var(--bg-surface-inset);
  border: 1px solid var(--border-medium); padding: 6px 12px; border-radius: var(--radius-full);
  width: 250px; color: var(--text-muted); box-shadow: var(--neu-pressed); transition: var(--transition-fast);
}

.search-box:focus-within { border-color: var(--accent-purple); color: var(--text-primary); box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2); }
.search-box input { background: transparent; border: none; outline: none; font-family: var(--font-main); font-size: 0.78rem; color: var(--text-primary); width: 100%; }

.cmd-k-badge { font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700; background-color: rgba(255, 255, 255, 0.08); color: var(--text-muted); padding: 2px 6px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, 0.06); }

.filter-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chip {
  border: none !important; color: var(--text-secondary);
  font-family: var(--font-main); font-size: 0.74rem; font-weight: 700; padding: 6px 15px; border-radius: var(--radius-full);
  cursor: pointer; box-shadow: var(--neu-pressed); transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); display: inline-flex; align-items: center; gap: 5px;
}

.chip:hover { color: var(--text-primary); transform: translateY(-1px); }
.chip.active { border: none !important; color: #FFFFFF !important; }

.drive-folder-capsule { display: flex; align-items: center; gap: 6px; background: var(--bg-surface-inset); border: 1px solid rgba(99, 102, 241, 0.3); padding: 5px 12px; border-radius: var(--radius-full); font-size: 0.72rem; font-weight: 700; color: #A5B4FC; box-shadow: var(--neu-pressed); }
.drive-folder-capsule svg { color: #818CF8; }

.view-meta { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; font-weight: 700; color: var(--text-secondary); background: var(--bg-surface-inset); padding: 5px 14px; border-radius: var(--radius-full); border: 1px solid var(--border-medium); box-shadow: var(--neu-pressed); }
.client-dot { width: 7px; height: 7px; background-color: var(--accent-purple); border-radius: 50%; box-shadow: 0 0 8px var(--accent-purple); }

/* ==========================================================================
   KANBAN BOARD VIEWPORT & GHOST SKELETON CARDS
   ========================================================================== */
.workspace-viewport { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; z-index: 1; }
.board-container { flex: 1; padding: 14px 20px; overflow-x: auto; overflow-y: hidden; display: flex; }

.kanban-board { display: flex; gap: 14px; align-items: flex-start; min-width: 100%; height: calc(100vh - 190px); }

.column {
  width: 300px; min-width: 300px; max-width: 300px; background-color: rgba(16, 19, 27, 0.92);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md); display: flex; flex-direction: column; max-height: 100%;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); overflow: hidden; position: relative;
  transform: translateZ(0);
}

.column-top-stripe { height: 4px; width: 100%; background: linear-gradient(90deg, var(--stage-color, #6366F1) 0%, rgba(18, 22, 32, 0.4) 100%); flex-shrink: 0; box-shadow: 0 1px 6px var(--stage-color, #6366F1); }
.column-header { padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-subtle); background: rgba(18, 22, 32, 0.95); }
.column-header-left { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.column-title { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-count { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); margin-left: 2px; }

.column-cards-container { padding: 10px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 120px; }
.column-cards-container.drag-over { background-color: rgba(99, 102, 241, 0.05); border: 1px dashed var(--accent-purple); border-radius: var(--radius-sm); }

.btn-column-add-bottom {
  margin: 0 10px 10px 10px; padding: 8px 12px; background: transparent; border: 1px dashed var(--border-medium);
  border-radius: var(--radius-sm); color: var(--text-muted); font-family: var(--font-main); font-size: 0.74rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; transition: var(--transition-fast);
}
.btn-column-add-bottom:hover { background-color: rgba(99, 102, 241, 0.08); border-color: var(--accent-purple); color: #FFFFFF; }

/* SKELETON / GHOST CARDS LOADING ANIMATION */
.card-skeleton {
  background-color: var(--bg-surface-card); border: 1px solid var(--border-card);
  border-radius: var(--radius-md); padding: 0; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); position: relative;
  min-height: 135px; pointer-events: none; animation: skeletonPulseFade 1.6s infinite alternate ease-in-out;
}

.card-skeleton.cascade-anim {
  animation: skeletonCascadeIn 0.38s cubic-bezier(0.16, 1, 0.3, 1) both, skeletonPulseFade 1.6s infinite alternate ease-in-out;
}

@keyframes skeletonCascadeIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-skeleton:nth-child(1) { animation-delay: 0.04s, 0.04s; }
.card-skeleton:nth-child(2) { animation-delay: 0.12s, 0.12s; }
.card-skeleton:nth-child(3) { animation-delay: 0.20s, 0.20s; }
.card-skeleton:nth-child(4) { animation-delay: 0.28s, 0.28s; }

@keyframes skeletonPulseFade { 0% { opacity: 0.55; } 100% { opacity: 0.95; } }

.card-skeleton::after {
  content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(168, 85, 247, 0.08) 35%, rgba(99, 102, 241, 0.16) 50%, rgba(168, 85, 247, 0.08) 65%, transparent 100%);
  transform: translateX(-100%); animation: skeletonShimmer 1.8s infinite cubic-bezier(0.4, 0, 0.2, 1); pointer-events: none;
}

@keyframes skeletonShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.skeleton-banner { height: 44px; background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(99, 102, 241, 0.08) 100%); border-bottom: 1px solid rgba(255, 255, 255, 0.03); }
.skeleton-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 10px; background: rgba(255, 255, 255, 0.06); border-radius: 4px; }
.skeleton-line.title { width: 85%; height: 13px; background: rgba(255, 255, 255, 0.08); }
.skeleton-line.short { width: 50%; height: 9px; }
.skeleton-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.03); }
.skeleton-pill { width: 55px; height: 16px; background: rgba(255, 255, 255, 0.05); border-radius: 4px; }
.skeleton-avatar { width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, 0.07); }

/* Real Cards */
.card {
  background-color: var(--bg-surface-card); border: 1px solid var(--border-card);
  border-radius: var(--radius-md); padding: 0; cursor: grab; position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); transition: box-shadow 0.15s ease, border-color 0.15s ease;
  user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; overflow: visible;
  touch-action: none;
}

.card:hover { border-color: rgba(255, 255, 255, 0.18); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55); }
.card:active { cursor: grabbing; }
.card.dragging {
  opacity: 0.45;
  cursor: grabbing !important;
  border: 1px dashed var(--accent-purple) !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.4) !important;
  transition: none !important;
}

.card-cover-banner {
  height: 48px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between;
  border-radius: 11px 11px 0 0; position: relative; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.card-cover-banner::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 14px; background: linear-gradient(to bottom, transparent, rgba(18, 21, 31, 0.85)); pointer-events: none; }
.card-body-content { padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }

.card-value-badge {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(16, 19, 27, 0.9) 100%);
  border: 1px solid rgba(99, 102, 241, 0.4); padding: 4px 8px; border-radius: 6px; margin-bottom: 2px;
}

.value-badge-label { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; color: #A5B4FC; }
.value-badge-amount { font-family: var(--font-mono); font-size: 0.95rem; font-weight: 800; color: #FFFFFF; }

.card.has-recent-activity {
  border-color: rgba(168, 85, 247, 0.75) !important;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.45), 0 4px 14px rgba(0, 0, 0, 0.5) !important;
  animation: recentActivityGlow 2.5s infinite alternate ease-in-out;
}

@keyframes recentActivityGlow { 0% { box-shadow: 0 0 12px rgba(168, 85, 247, 0.3); } 100% { box-shadow: 0 0 22px rgba(168, 85, 247, 0.65); } }

.recent-activity-badge {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px;
  background: linear-gradient(135deg, #A855F7 0%, #7C3AED 100%); border: 2px solid var(--bg-app);
  border-radius: 50%; color: #FFFFFF; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.8); z-index: 10; animation: bouncePulse 2s infinite ease-in-out;
}

@keyframes bouncePulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

.card-header-row { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.card-header-left { display: flex; align-items: center; gap: 6px; }

.badge-category { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; background: rgba(10, 12, 17, 0.75); backdrop-filter: blur(6px); color: #FFFFFF; border: 1px solid rgba(255, 255, 255, 0.15); padding: 2px 7px; border-radius: 4px; }
.badge-version { font-family: var(--font-mono); font-size: 0.64rem; font-weight: 600; background: rgba(10, 12, 17, 0.65); color: #E2E8F0; padding: 2px 5px; border-radius: 3px; }
.card-title { font-size: 0.84rem; font-weight: 700; color: var(--text-primary); line-height: 1.35; }
.card-priority-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 1px; }

.priority-pill { font-size: 0.62rem; font-weight: 800; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; }
.priority-pill.high { background-color: rgba(239, 68, 68, 0.16); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.priority-pill.medium { background-color: rgba(245, 158, 11, 0.16); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.3); }
.priority-pill.low { background-color: rgba(99, 102, 241, 0.16); color: #A5B4FC; border: 1px solid rgba(99, 102, 241, 0.3); }
.priority-pill.approved { background-color: rgba(16, 185, 129, 0.16); color: #34D399; border: 1px solid rgba(16, 185, 129, 0.3); }
.priority-pill.delivered { background-color: rgba(168, 85, 247, 0.16); color: #C084FC; border: 1px solid rgba(168, 85, 247, 0.3); }

.due-badge { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; display: inline-flex; align-items: center; gap: 3px; }
.due-badge.due-soon { background: rgba(245, 158, 11, 0.2); color: #FBBF24; border: 1px solid rgba(245, 158, 11, 0.4); }
.due-badge.due-today { background: rgba(249, 115, 22, 0.22); color: #FB923C; border: 1px solid rgba(249, 115, 22, 0.45); }
.due-badge.overdue { background: rgba(239, 68, 68, 0.2); color: #F87171; border: 1px solid rgba(239, 68, 68, 0.4); }

.card-deadline-row { display: flex; align-items: center; gap: 4px; font-size: 0.68rem; color: var(--text-muted); }
.card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.04); margin-top: 2px; }
.card-metrics { display: flex; align-items: center; gap: 10px; }
.metric-item { display: flex; align-items: center; gap: 4px; font-size: 0.7rem; color: var(--text-muted); }
.card-assignee-avatar { width: 22px; height: 22px; color: #FFFFFF; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 800; box-shadow: 0 0 6px rgba(0, 0, 0, 0.4); }

/* ==========================================================================
   CLIENT BOARDS VS PROJECT BOARDS: DUAL HEIGHT & DISTINCT AESTHETICS
   ========================================================================== */

/* 1. Client Board Cards: Double height, visual portfolio style (~200px) */
.card.card-client,
.board-type-client .card {
  min-height: 185px;
}

.card.card-client .card-cover-banner,
.board-type-client .card .card-cover-banner {
  height: 95px;
  padding: 10px 12px;
  align-items: flex-start;
}

.card.card-client .card-body-content,
.board-type-client .card .card-body-content {
  padding: 12px 14px 10px 14px;
  gap: 8px;
}

.card.card-client .card-title,
.board-type-client .card .card-title {
  font-size: 0.90rem;
  font-weight: 700;
  line-height: 1.4;
  min-height: 38px;
}

.card.card-client .card-assignee-avatar,
.board-type-client .card .card-assignee-avatar {
  width: 26px;
  height: 26px;
  font-size: 0.74rem;
  font-weight: 800;
}

/* 2. Projects Board Cards: Compact, high-density kanban style (~95px) */
.card.card-projects,
.board-type-projects .card {
  min-height: 90px;
}

.card.card-projects .card-cover-banner,
.board-type-projects .card .card-cover-banner {
  height: 28px;
  padding: 0 8px;
}

.card.card-projects .card-body-content,
.board-type-projects .card .card-body-content {
  padding: 7px 10px;
  gap: 4px;
}

.card.card-projects .card-title,
.board-type-projects .card .card-title {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card.card-projects .card-assignee-avatar,
.board-type-projects .card .card-assignee-avatar {
  width: 18px;
  height: 18px;
  font-size: 0.60rem;
}

/* Profile Avatar Customizer */
.avatar-customizer-box {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-surface-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.avatar-large {
  width: 54px;
  height: 54px;
  font-size: 1.4rem;
  font-weight: 800;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  transition: background-color 0.2s ease;
}

.avatar-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.color-palette-swatches {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.color-swatch-circle:hover {
  transform: scale(1.18);
}

.color-swatch-circle.active {
  border-color: #FFFFFF;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  transform: scale(1.15);
}

.color-picker-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-picker-inline input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  padding: 0;
}
.color-picker-inline input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker-inline input[type="color"]::-webkit-color-swatch { border: 1px solid var(--border-medium); border-radius: 50%; }

.custom-color-label {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.admin-dashboard-container { flex: 1; overflow-y: auto; padding: 22px 28px; display: flex; flex-direction: column; background-color: var(--bg-main); }
.dashboard-content-scroll { display: flex; flex-direction: column; gap: 20px; max-width: 1400px; margin: 0 auto; width: 100%; }

.dashboard-header-banner {
  display: flex; align-items: center; justify-content: space-between; background: var(--bg-surface);
  border: 1px solid var(--border-medium); padding: 18px 24px; border-radius: var(--radius-md); box-shadow: var(--neu-flat);
  flex-wrap: wrap; gap: 16px;
}

.dashboard-header-left { display: flex; flex-direction: column; gap: 4px; }
.dash-crown-tag { font-family: var(--font-mono); font-size: 0.65rem; font-weight: 800; color: #FBBF24; letter-spacing: 0.08em; text-transform: uppercase; }
.dashboard-title { font-size: 1.35rem; font-weight: 800; color: var(--text-primary); }
.dashboard-subtitle { font-size: 0.78rem; color: var(--text-muted); max-width: 680px; }

.dashboard-header-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dashboard-badge-date { font-family: var(--font-mono); font-size: 0.76rem; font-weight: 700; color: #A5B4FC; background: rgba(99, 102, 241, 0.15); border: 1px solid rgba(99, 102, 241, 0.3); padding: 5px 14px; border-radius: var(--radius-full); }
.dash-quick-actions { display: flex; align-items: center; gap: 8px; }

.dash-metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.dash-card { background: var(--bg-surface); border: 1px solid var(--border-card); border-radius: var(--radius-md); padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35); }

.metric-card-label { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.04em; }
.metric-card-value { font-family: var(--font-mono); font-size: 1.55rem; font-weight: 800; color: var(--text-primary); }
.metric-card-trend { font-size: 0.68rem; color: var(--text-secondary); }
.metric-card-trend.positive { color: #34D399; }
.text-amber { color: #FBBF24; }
.text-purple { color: #C084FC; }
.text-emerald { color: #34D399; }
.text-blue { color: #60A5FA; }
.text-danger { color: #EF4444; }

.card-header-flex { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-subtle); padding-bottom: 12px; margin-bottom: 4px; }
.card-header-sub { font-size: 0.70rem; color: var(--text-muted); margin-top: 2px; }
.dash-card-title { font-size: 0.88rem; font-weight: 700; color: var(--text-primary); }
.badge-sm { font-size: 0.66rem; font-weight: 700; color: var(--text-muted); background: var(--bg-surface-inset); border: 1px solid var(--border-subtle); padding: 3px 10px; border-radius: 4px; }

.dash-table-wrapper { overflow-x: auto; margin-top: 4px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.dash-table th { text-align: left; padding: 10px 12px; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border-subtle); letter-spacing: 0.04em; }
.dash-table td { padding: 11px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.03); color: var(--text-secondary); vertical-align: middle; }
.dash-table tr:hover td { background: var(--bg-surface-hover); color: var(--text-primary); }

.interactive-table tr { cursor: pointer; }
.interactive-table tr:hover { background: rgba(99, 102, 241, 0.08); }

.dash-board-type-tag {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 800; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.03em;
}
.dash-board-type-tag.client { color: #34D399; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.3); }
.dash-board-type-tag.projects { color: #60A5FA; background: rgba(59, 130, 246, 0.12); border: 1px solid rgba(59, 130, 246, 0.3); }
.dash-board-type-tag.admin { color: #FBBF24; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3); }

.folio-code-tag {
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 800; color: #818CF8; background: rgba(99, 102, 241, 0.12); padding: 2px 6px; border-radius: 3px; border: 1px solid rgba(99, 102, 241, 0.25);
}

/* Financial Card Inset Box in Modal */
.financial-card-box {
  background: var(--bg-surface-inset); border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--neu-pressed);
}

/* ==========================================================================
   USER PAYOUT LEDGER MODAL
   ========================================================================== */
.payout-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; max-height: 80vh; overflow-y: auto; }
.payout-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.payout-summary-card {
  background: var(--bg-surface-elevated); border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--neu-flat);
}

.payout-card-label { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); }
.payout-card-val { font-family: var(--font-mono); font-size: 1.4rem; font-weight: 800; }
.payout-card-sub { font-size: 0.7rem; color: var(--text-muted); }

.payout-drive-folder-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700;
  color: #A5B4FC; text-decoration: none; padding: 4px 0;
}
.payout-drive-folder-link:hover { color: #FFFFFF; text-decoration: underline; }

.payout-action-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(16, 19, 27, 0.95) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35); border-radius: var(--radius-md); padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

.payout-action-left { display: flex; flex-direction: column; gap: 2px; }
.payout-action-title { font-size: 0.92rem; font-weight: 800; color: #FFFFFF; }
.payout-action-desc { font-size: 0.74rem; color: var(--text-secondary); max-width: 480px; }

.payout-action-right { display: flex; align-items: center; gap: 10px; }
.payout-amount-input-wrap {
  display: flex; align-items: center; background: var(--bg-surface-inset);
  border: 1px solid var(--border-medium); border-radius: var(--radius-sm); padding: 4px 10px; gap: 6px; box-shadow: var(--neu-pressed);
}

.payout-amount-input-wrap input {
  background: transparent; border: none; outline: none; font-family: var(--font-mono);
  font-size: 1.05rem; font-weight: 800; color: #FFFFFF; width: 85px; text-align: right;
}

.currency-sign, .currency-code { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700; color: var(--text-muted); }
.btn-disburse-submit { padding: 9px 16px; font-size: 0.8rem; }

.payout-tabs-header { display: flex; gap: 8px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 6px; }
.payout-tab-btn { background: transparent; border: none; color: var(--text-muted); font-family: var(--font-main); font-size: 0.8rem; font-weight: 700; padding: 6px 12px; border-radius: var(--radius-xs); cursor: pointer; }
.payout-tab-btn.active { background: var(--bg-surface-elevated); color: #FFFFFF; border: 1px solid var(--border-subtle); }

/* ==========================================================================
   OFFICIAL PAYMENT RECEIPT / VOUCHER (PRINTABLE)
   ========================================================================== */
.receipt-header-actions { display: flex; align-items: center; gap: 8px; }
.receipt-preview-container { padding: 24px; background: #0A0C11; overflow-y: auto; max-height: 75vh; }

.receipt-document-sheet {
  max-width: 640px; margin: 0 auto; background: #10131B;
  border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 12px; padding: 32px 28px;
  display: flex; flex-direction: column; gap: 20px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
}

.receipt-doc-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 16px; }
.receipt-brand-name { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; color: #FFFFFF; }
.receipt-brand-sub { font-size: 0.74rem; color: var(--text-muted); }
.receipt-folio-box { font-family: var(--font-mono); font-size: 0.84rem; font-weight: 700; color: #818CF8; background: rgba(99, 102, 241, 0.15); padding: 4px 10px; border-radius: 4px; border: 1px solid rgba(99, 102, 241, 0.3); }

.receipt-meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.receipt-meta-cell { display: flex; flex-direction: column; gap: 2px; }
.receipt-meta-label { font-size: 0.65rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); }
.receipt-meta-val { font-size: 0.84rem; font-weight: 700; color: #FFFFFF; }

.receipt-items-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-top: 4px; }
.receipt-items-table th { text-align: left; padding: 8px; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.receipt-items-table td { padding: 9px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); color: var(--text-secondary); }

.receipt-total-banner {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(99, 102, 241, 0.12); border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 8px; padding: 14px 18px; margin-top: 8px;
}

.receipt-total-label { font-size: 0.84rem; font-weight: 800; color: #A5B4FC; letter-spacing: 0.02em; }
.receipt-total-value { font-family: var(--font-mono); font-size: 1.45rem; font-weight: 800; color: #FFFFFF; }
.receipt-doc-footer { text-align: center; font-size: 0.7rem; color: var(--text-muted); border-top: 1px solid rgba(255, 255, 255, 0.06); padding-top: 14px; font-family: var(--font-mono); }

/* Print Rules */
@media print {
  body * { visibility: hidden; }
  #paymentReceiptModal, #paymentReceiptModal * { visibility: visible; }
  #paymentReceiptModal { position: absolute; left: 0; top: 0; width: 100%; background: #FFFFFF !important; }
  .modal-container { box-shadow: none; border: none; width: 100%; max-width: 100%; background: #FFFFFF; }
  .receipt-document-sheet { background: #FFFFFF !important; color: #000000 !important; border: 1px solid #CCCCCC; box-shadow: none; }
  .receipt-brand-name, .receipt-meta-val, .receipt-total-value { color: #000000 !important; }
  .receipt-header-actions, .modal-header { display: none !important; }
}

/* ==========================================================================
   CUSTOM DARK CALENDAR DATEPICKER
   ========================================================================== */
.custom-datepicker-popover {
  position: absolute; top: 100px; left: 100px; background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium); border-radius: var(--radius-md); box-shadow: 0 16px 45px rgba(0, 0, 0, 0.9);
  width: 270px; padding: 14px; display: none; flex-direction: column; gap: 10px; z-index: 10000 !important; animation: fadeInPop 0.15s ease-out;
}

.custom-datepicker-popover.active { display: flex; }
.datepicker-header { display: flex; align-items: center; justify-content: space-between; }
.picker-month-label { font-size: 0.8rem; font-weight: 700; color: var(--text-primary); }
.btn-picker-nav { background: var(--bg-surface-inset); border: 1px solid var(--border-subtle); color: var(--text-secondary); width: 24px; height: 24px; border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.btn-picker-nav:hover { background: var(--accent-purple); color: #FFFFFF; }

.datepicker-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 0.65rem; font-weight: 800; color: var(--text-muted); }
.datepicker-days-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

.picker-day { height: 28px; display: flex; align-items: center; justify-content: center; font-size: 0.74rem; font-weight: 600; color: var(--text-primary); border-radius: 4px; cursor: pointer; transition: var(--transition-fast); }
.picker-day:hover { background: var(--bg-surface-hover); color: #FFFFFF; }
.picker-day.other-month { color: var(--text-muted); opacity: 0.4; }
.picker-day.today { border: 1px solid var(--accent-purple); }
.picker-day.selected { background: var(--accent-purple); color: #FFFFFF; font-weight: 800; box-shadow: 0 0 10px rgba(99, 102, 241, 0.5); }

.datepicker-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border-subtle); padding-top: 8px; }
.picker-preset-btn { background: transparent; border: none; font-size: 0.66rem; font-weight: 700; color: #A5B4FC; cursor: pointer; }
.picker-preset-btn:hover { color: #FFFFFF; text-decoration: underline; }

/* ==========================================================================
   MODAL WINDOWS: HIGHEST Z-INDEX (9999)
   ========================================================================== */
.modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 9999 !important;
  opacity: 0; pointer-events: none; transition: opacity var(--transition-fast);
}

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

.modal-container {
  background-color: var(--bg-surface); border: 1px solid var(--border-medium); border-radius: var(--radius-lg);
  width: 880px; max-width: 95vw; max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08); overflow: hidden;
  transform: scale(0.96); transition: transform var(--transition-fast);
}

.modal-backdrop.active .modal-container { transform: scale(1); }
.modal-container.modal-sm { width: 480px; }
.modal-container.modal-md { width: 620px; }
.modal-container.modal-lg { width: 840px; }
.modal-container.modal-xl { width: 980px; }

.modal-header { padding: 14px 20px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; background: var(--bg-surface-elevated); }
.modal-header-meta { display: flex; align-items: center; gap: 8px; }
.card-id-tag { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; color: #A5B4FC; background-color: rgba(99, 102, 241, 0.15); padding: 2px 8px; border-radius: 4px; }
.modal-value-pill { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 800; color: #34D399; background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.35); padding: 2px 8px; border-radius: 4px; }

.modal-stage-select-wrapper { position: relative; display: flex; align-items: center; }
.modal-stage-badge-select {
  appearance: none; background-color: var(--bg-surface-inset); border: 1px solid var(--border-medium);
  color: #FFFFFF; font-family: var(--font-main); font-size: 0.74rem; font-weight: 700; padding: 3px 22px 3px 8px; border-radius: 4px;
  cursor: pointer; outline: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 6px center;
}

.modal-version-editable { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 600; background-color: var(--bg-surface-inset); color: #A5B4FC; border: 1px solid var(--border-subtle); padding: 2px 6px; border-radius: 4px; width: 54px; outline: none; text-align: center; }

.modal-body-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; flex: 1; overflow-y: auto; }
.modal-col-left { padding: 20px; border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 16px; }
.modal-col-right { padding: 20px; background-color: var(--bg-surface-elevated); display: flex; flex-direction: column; gap: 16px; }

.title-input-wrapper { width: 100%; }
.modal-card-title-input { width: 100%; font-family: var(--font-main); font-size: 1.18rem; font-weight: 700; color: var(--text-primary); background: transparent; border: 1px solid transparent; border-radius: var(--radius-xs); padding: 2px 4px; outline: none; transition: var(--transition-fast); }
.modal-card-title-input:focus { border-color: var(--accent-purple); background: var(--bg-surface-inset); }

.card-color-banner-stage { height: 75px; border-radius: var(--radius-sm); background: linear-gradient(135deg, #6366F1 0%, #10131B 100%); display: flex; align-items: flex-end; justify-content: flex-end; padding: 10px; position: relative; }
.cover-palette-wrapper { position: relative; }
.btn-cover-palette-trigger { background: rgba(10, 12, 17, 0.85); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.18); border-radius: var(--radius-full); padding: 4px 10px; color: #FFFFFF; font-size: 0.7rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.cover-palette-popover { position: absolute; bottom: 34px; right: 0; background: var(--bg-surface-elevated); border: 1px solid var(--border-medium); border-radius: var(--radius-md); padding: 8px 10px; display: none; flex-direction: column; gap: 6px; z-index: 50; min-width: 180px; }
.cover-palette-popover.active { display: flex; }
.popover-palette-title { font-size: 0.62rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); }
.banner-swatches { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.banner-swatch { width: 18px; height: 18px; border-radius: 50%; cursor: pointer; }

/* Rich Description Section */
.rich-description-section { display: flex; flex-direction: column; gap: 8px; background: var(--bg-surface-inset); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 12px; box-shadow: var(--neu-pressed); }
.desc-heading-wrap { display: flex; align-items: center; gap: 8px; }
.btn-edit-desc { background: transparent; border: 1px solid var(--border-subtle); color: #A5B4FC; font-family: var(--font-main); font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.btn-edit-desc:hover { background: rgba(99, 102, 241, 0.15); border-color: var(--accent-purple); }
.drive-target-tag { font-family: var(--font-mono); font-size: 0.64rem; color: var(--text-muted); }
.rich-desc-preview { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.55; min-height: 48px; }
.rich-desc-preview b, .rich-desc-preview strong { color: var(--text-primary); }
.rich-desc-preview ul, .rich-desc-preview ol { padding-left: 18px; margin: 4px 0; }
.rich-desc-preview h4 { color: var(--text-primary); margin: 6px 0 2px 0; font-size: 0.86rem; }

.rich-desc-editor-box { display: flex; flex-direction: column; gap: 8px; }
.desc-format-toolbar { display: flex; align-items: center; gap: 4px; background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 4px 6px; border-radius: 4px; }
.toolbar-tool-btn { background: transparent; border: none; color: var(--text-secondary); font-family: var(--font-main); font-size: 0.72rem; font-weight: 700; padding: 3px 8px; border-radius: 3px; cursor: pointer; }
.toolbar-tool-btn:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.rich-desc-contenteditable { background: var(--bg-surface); border: 1px solid var(--border-medium); border-radius: 4px; padding: 8px 10px; color: var(--text-primary); font-family: var(--font-main); font-size: 0.82rem; min-height: 80px; outline: none; }
.rich-desc-contenteditable:focus { border-color: var(--accent-purple); }
.desc-editor-actions { display: flex; justify-content: flex-end; gap: 6px; }

/* Specifications Grid */
.meta-section, .files-section { display: flex; flex-direction: column; gap: 10px; }
.section-title { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.specs-edit-hint { font-size: 0.66rem; color: var(--text-muted); font-weight: 600; }
.section-header-flex { display: flex; align-items: center; justify-content: space-between; }
.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.meta-item { background-color: var(--bg-surface-inset); border: 1px solid var(--border-medium); padding: 8px 12px; border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 3px; box-shadow: var(--neu-pressed); }
.meta-label { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }
.meta-lock-icon { font-size: 0.65rem; opacity: 0.6; }

.spec-inline-select { appearance: none; background: transparent; border: none; color: var(--text-primary); font-family: var(--font-main); font-size: 0.86rem; font-weight: 700; outline: none; cursor: pointer; width: 100%; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0 center; }
.spec-date-trigger-btn { background: transparent; border: none; color: var(--text-primary); font-family: var(--font-main); font-size: 0.84rem; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 2px 0; text-align: left; }
.spec-date-trigger-btn svg { color: #A5B4FC; }
.meta-readonly-value { font-size: 0.86rem; font-weight: 700; color: var(--text-primary); padding: 1px 0; }

/* Files Dropzone & Upload */
.upload-dropzone { background-color: var(--bg-surface-inset); border: 1px dashed var(--border-medium); border-radius: var(--radius-sm); padding: 12px; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.file-input-hidden { display: none; }
.dropzone-content { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-muted); }
.browse-link { color: #A5B4FC; text-decoration: underline; font-weight: 700; }
.dropzone-sub { font-size: 0.66rem; color: var(--text-muted); }

.files-list { display: flex; flex-direction: column; gap: 6px; }
.file-item { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; background: var(--bg-surface-elevated); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); font-size: 0.78rem; }
.file-info { display: flex; align-items: center; gap: 8px; overflow: hidden; }
.file-ext { font-family: var(--font-mono); font-size: 0.65rem; font-weight: 700; background-color: var(--bg-surface-inset); color: #A5B4FC; padding: 1px 5px; border-radius: 3px; }
.file-name { color: var(--text-primary); font-weight: 500; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-link { color: var(--text-muted); text-decoration: none; font-size: 0.72rem; }

/* Comments Timeline & @Mentions */
.comments-counter { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.comment-form { background-color: var(--bg-surface-inset); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--neu-pressed); }
.form-row-author-pill { display: flex; align-items: center; justify-content: space-between; background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 4px 8px; border-radius: 4px; }
.active-commenter-badge { display: flex; align-items: center; gap: 7px; }
.commenter-name { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }
.comment-type-selector { background: transparent; border: none; color: #A5B4FC; font-family: var(--font-main); font-size: 0.74rem; font-weight: 700; outline: none; cursor: pointer; }

.comment-input-relative-wrap { position: relative; width: 100%; }
.comment-form textarea { width: 100%; background-color: var(--bg-surface); border: 1px solid var(--border-subtle); color: var(--text-primary); font-family: var(--font-main); font-size: 0.8rem; padding: 8px; border-radius: 4px; resize: vertical; outline: none; }

.mention-autocomplete-popover {
  position: absolute; bottom: 100%; left: 0; background: var(--bg-surface-elevated); border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85); width: 240px; padding: 6px; display: flex; flex-direction: column; gap: 3px; z-index: 1000; margin-bottom: 6px;
}
.mention-list-header { font-size: 0.64rem; font-weight: 800; text-transform: uppercase; color: var(--text-muted); padding: 4px 6px; }
.mention-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; transition: var(--transition-fast); }
.mention-item:hover { background: var(--bg-surface-hover); }
.mention-name { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }
.mention-role { font-size: 0.64rem; color: var(--text-muted); }
.mention-tag { background: rgba(99, 102, 241, 0.2); border: 1px solid rgba(99, 102, 241, 0.4); color: #A5B4FC; padding: 1px 5px; border-radius: 3px; font-weight: 700; }

.timeline { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow-y: auto; }
.timeline-item { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.timeline-header { display: flex; align-items: center; justify-content: space-between; }
.timeline-header-left { display: flex; align-items: center; gap: 8px; }
.timeline-note-avatar { width: 22px; height: 22px; border-radius: 50%; color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 0.64rem; font-weight: 800; }
.timeline-author { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }
.timeline-type { font-size: 0.62rem; font-weight: 800; padding: 1px 6px; border-radius: 3px; text-transform: uppercase; }
.timeline-type.Correction { background-color: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }
.timeline-type.Approval { background-color: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.timeline-type.Note { background-color: rgba(99, 102, 241, 0.15); color: #A5B4FC; }
.timeline-content { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.45; white-space: pre-wrap; }
.timeline-time { font-size: 0.66rem; color: var(--text-muted); align-self: flex-end; }

/* Modal Forms & RBAC */
.modal-form { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 0.74rem; font-weight: 700; color: var(--text-secondary); }
.form-group input, .form-group select {
  background-color: var(--bg-surface-inset); border: 1px solid var(--border-medium); color: var(--text-primary); font-family: var(--font-main); font-size: 0.82rem;
  padding: 7px 11px; border-radius: var(--radius-sm); outline: none; box-shadow: var(--neu-pressed);
}
.input-hint { font-size: 0.65rem; color: var(--text-muted); }
.form-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* Stage Manager List & Order Buttons */
.stage-manager-body, .permissions-manager-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.manager-intro, .permissions-intro { font-size: 0.78rem; color: var(--text-secondary); background-color: var(--bg-surface-inset); padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); }
.stages-edit-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; }
.stage-edit-row { display: flex; align-items: center; gap: 8px; background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 8px 12px; border-radius: var(--radius-sm); }
.stage-order-buttons { display: flex; flex-direction: column; gap: 2px; }
.btn-order-arrow { background: var(--bg-surface-inset); border: 1px solid var(--border-subtle); color: var(--text-secondary); font-size: 0.6rem; width: 20px; height: 15px; display: flex; align-items: center; justify-content: center; border-radius: 3px; cursor: pointer; }
.stage-id-badge { font-family: var(--font-mono); font-size: 0.7rem; font-weight: 600; color: #A5B4FC; background-color: rgba(99, 102, 241, 0.15); padding: 3px 8px; border-radius: 4px; width: 85px; text-align: center; }
.stage-name-input { flex: 1; background-color: var(--bg-surface-inset); border: 1px solid var(--border-subtle); color: var(--text-primary); font-family: var(--font-main); font-size: 0.82rem; padding: 6px 10px; border-radius: 4px; outline: none; }
.stage-color-picker { width: 28px; height: 28px; border: none; background: transparent; cursor: pointer; }
.btn-remove-stage { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }
.stage-manager-actions, .permissions-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--border-subtle); padding-top: 14px; }

/* Permissions Matrix */
.role-settings-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 8px; }
.role-tab { background: transparent; border: 1px solid transparent; color: var(--text-secondary); font-family: var(--font-main); font-size: 0.82rem; font-weight: 700; padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer; }
.role-tab.active { background: var(--bg-surface); border-color: var(--accent-purple); color: #A5B4FC; }
.permissions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.permission-checkbox-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.perm-title { font-size: 0.78rem; font-weight: 700; color: var(--text-primary); }
.perm-desc { font-size: 0.68rem; color: var(--text-muted); }
.stages-permission-section { background-color: var(--bg-surface-inset); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.stages-perm-title { font-size: 0.76rem; font-weight: 700; color: var(--text-secondary); }
.stages-checkbox-row { display: flex; flex-wrap: wrap; gap: 8px; }
.stage-check-item { display: flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 600; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--border-subtle); padding: 4px 10px; border-radius: var(--radius-sm); cursor: pointer; }

/* Swatches */
.color-palette-swatches { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.color-swatch-item { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: var(--transition-fast); }
.color-swatch-item:hover { transform: scale(1.15); }
.color-swatch-item.active { border-color: #FFFFFF; box-shadow: 0 0 10px rgba(255, 255, 255, 0.5); }
.color-picker-inline { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.color-picker-inline input[type="color"] { width: 26px; height: 26px; border: none; background: transparent; cursor: pointer; }
.custom-color-label { font-size: 0.72rem; color: var(--text-secondary); }

/* User Manager Roster */
.user-manager-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; flex: 1; overflow: hidden; max-height: 520px; }
.user-manager-list-pane { padding: 18px 20px; border-right: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.user-manager-form-pane { padding: 18px 20px; background-color: var(--bg-surface-elevated); display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.users-roster-list { display: flex; flex-direction: column; gap: 8px; }
.user-roster-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; }
.roster-user-left { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.roster-meta { display: flex; flex-direction: column; overflow: hidden; }
.roster-name { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.roster-email { font-size: 0.7rem; color: var(--text-muted); }
.board-access-picker { display: grid; gap: 8px; max-height: 176px; overflow-y: auto; padding: 8px; background: var(--bg-surface-inset); border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); }
.board-access-option { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 7px; color: var(--text-primary); background: rgba(255, 255, 255, 0.025); cursor: pointer; }
.board-access-option:hover { background: rgba(99, 102, 241, 0.11); }
.board-access-option input { accent-color: var(--accent-purple); }
.board-access-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.76rem; font-weight: 650; }
.board-access-kind { color: var(--text-muted); font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.04em; }
.board-access-empty { padding: 8px; color: var(--text-muted); font-size: 0.72rem; text-align: center; }
.form-help, .invite-security-note { color: var(--text-muted); font-size: 0.68rem; line-height: 1.45; }
.invite-security-note { margin: 0; text-align: center; }
.board-hero-brand-logo { width: auto; max-width: 150px; height: 30px; object-fit: contain; object-position: left center; margin-bottom: 5px; }

/* Toast & Alert */
.toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 10000; pointer-events: none; }
.toast { background-color: var(--bg-surface-elevated); border: 1px solid var(--border-medium); color: var(--text-primary); padding: 9px 14px; border-radius: var(--radius-sm); font-size: 0.8rem; font-weight: 700; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6); display: flex; align-items: center; gap: 8px; animation: slideInToast 0.25s ease-out; pointer-events: auto; }
.toast.success { border-left: 3px solid var(--accent-success); }
.toast.error { border-left: 3px solid var(--accent-danger); }
.toast.info { border-left: 3px solid var(--accent-purple); }
@keyframes slideInToast { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.sync-alert-banner { background: linear-gradient(90deg, #881337 0%, #4C0519 100%); border-bottom: 1px solid #BE123C; color: #FFE4E6; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 0.8rem; font-weight: 600; z-index: 45; }
.alert-content { display: flex; align-items: center; gap: 10px; }
.btn-alert-action { background-color: #FFFFFF; color: #9F1239; border: none; font-size: 0.74rem; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-xs); cursor: pointer; }
.btn-alert-dismiss { background: transparent; border: none; color: #FDA4AF; font-size: 0.9rem; cursor: pointer; }

/* Responsive Layout & Anti-Collision System */
@media (max-width: 1200px) {
  .selector-tag { display: none; }
  .select-container select { max-width: 130px; }
  .brand-logo-svg { max-width: 140px; }
  .gamification-pill-label { max-width: 95px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 1080px) {
  .login-overlay { align-items: flex-start; padding: 24px; }
  .login-portal-wrapper { grid-template-columns: 1fr; gap: 36px; max-width: 540px; }
  .login-hero-pane { padding-right: 0; text-align: center; align-items: center; }
  .login-hero-headline h1 { font-size: 2.2rem; }
  .login-features-list { width: 100%; }
  .feature-item { max-width: 100%; text-align: left; }
  .dash-metrics-grid, .payout-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .login-overlay { padding: 16px; }
  .login-portal-wrapper { gap: 24px; }
  .login-hero-pane { gap: 20px; }
  .login-hero-headline h1 { font-size: 1.9rem; }
  .hero-subline { font-size: 0.92rem; }
  .login-card-pod { padding: 26px 20px; }
}

@media (max-width: 900px) {
  .brand-badge { display: none; }
  .status-text { display: none; }
  .btn-settings-trigger span { display: none; }
  .user-name { display: none; }
}

@media (max-width: 768px) {
  .navbar { height: auto; padding: 10px 14px; flex-wrap: wrap; }
  .nav-left, .nav-right { width: 100%; justify-content: space-between; }
  .modal-body-grid, .user-manager-layout { grid-template-columns: 1fr; }
  .sidebar-feed { position: fixed; top: 0; left: 0; bottom: 0; z-index: 950; }
  .payout-action-box { flex-direction: column; align-items: stretch; }
  .payout-action-right { justify-content: flex-end; }
}

/* =========================================================================
   CONFIRMATION MODAL & ACTION BUTTONS
   ========================================================================= */
.modal-confirm { max-width: 440px; background-color: var(--bg-surface-elevated); border: 1px solid rgba(239, 68, 68, 0.3); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(239, 68, 68, 0.15); border-radius: var(--radius-md); }
.btn-danger-glow { background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%); color: #FFFFFF; border: none; font-family: var(--font-main); font-size: 0.82rem; font-weight: 700; padding: 8px 18px; border-radius: var(--radius-sm); cursor: pointer; box-shadow: 0 0 15px rgba(239, 68, 68, 0.35); transition: var(--transition-fast); }
.btn-danger-glow:hover { transform: translateY(-1px); box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
.btn-outline-danger { background: transparent; border: 1px solid rgba(239, 68, 68, 0.4); color: #F87171; font-family: var(--font-main); font-size: 0.76rem; font-weight: 700; padding: 5px 12px; border-radius: var(--radius-xs); cursor: pointer; transition: var(--transition-fast); }
.btn-outline-danger:hover { background: rgba(239, 68, 68, 0.12); border-color: #EF4444; color: #FFFFFF; }

/* =========================================================================
   QUICK COMMAND PALETTE / BOARD SWITCHER (Cmd+K)
   ========================================================================= */
.modal-quick-switcher { max-width: 560px; background: #0E111A; border: 1px solid var(--border-medium); border-radius: var(--radius-md); box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(99, 102, 241, 0.15); overflow: hidden; }
.quick-switcher-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border-subtle); background: rgba(255, 255, 255, 0.02); }
.quick-switcher-header input { flex: 1; background: transparent; border: none; outline: none; color: #FFFFFF; font-family: var(--font-main); font-size: 0.95rem; font-weight: 500; }
.quick-switcher-header input::placeholder { color: var(--text-muted); }
.kbd-badge { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); background: var(--bg-surface-inset); border: 1px solid var(--border-subtle); padding: 3px 6px; border-radius: 4px; }
.quick-switcher-body { padding: 12px 14px; max-height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.quick-switcher-section-title { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 6px 8px 2px 8px; }
.quick-switcher-list { display: flex; flex-direction: column; gap: 4px; }
.quick-switcher-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: var(--transition-fast); }
.quick-switcher-item:hover, .quick-switcher-item.selected { background: rgba(99, 102, 241, 0.14); color: #FFFFFF; border-left: 2px solid var(--accent-purple); }
.quick-switcher-item-left { display: flex; align-items: center; gap: 10px; }
.quick-switcher-item-title { font-size: 0.84rem; font-weight: 600; }
.quick-switcher-item-tag { font-size: 0.68rem; padding: 2px 6px; border-radius: 4px; background: var(--bg-surface-inset); color: var(--text-muted); font-weight: 600; text-transform: uppercase; }

/* =========================================================================
   DYNAMIC GANTT CHART ENGINE
   ========================================================================= */
.gantt-chart-wrapper { display: flex; flex-direction: column; width: 100%; height: 100%; overflow: auto; background: var(--bg-surface); border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.gantt-timeline-header-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--border-medium); background: var(--bg-surface-elevated); position: sticky; top: 0; z-index: 10; min-width: 800px; }
.gantt-col-task-name { width: 240px; min-width: 240px; padding: 12px 16px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); border-right: 1px solid var(--border-subtle); display: flex; align-items: center; }
.gantt-timeline-intervals { display: flex; flex: 1; }
.gantt-interval-cell { flex: 1; text-align: center; font-size: 0.68rem; font-weight: 700; color: var(--text-muted); border-right: 1px solid rgba(255, 255, 255, 0.04); padding: 10px 4px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.gantt-interval-cell.today-interval { background: rgba(99, 102, 241, 0.08); color: #A5B4FC; }
.gantt-body-container { display: flex; flex-direction: column; min-width: 800px; }
.gantt-card-row { display: flex; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, 0.04); height: 46px; transition: background 0.15s ease; cursor: pointer; }
.gantt-card-row:hover { background: rgba(255, 255, 255, 0.03); }
.gantt-card-meta { width: 240px; min-width: 240px; padding: 0 16px; display: flex; align-items: center; gap: 8px; border-right: 1px solid var(--border-subtle); height: 100%; }
.gantt-card-title-text { font-size: 0.78rem; font-weight: 700; color: #FFFFFF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.gantt-card-track { flex: 1; height: 100%; position: relative; display: flex; align-items: center; padding: 0 8px; }
.gantt-bar-item { position: absolute; height: 26px; border-radius: 6px; display: flex; align-items: center; padding: 0 10px; gap: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); transition: transform 0.15s ease, filter 0.15s ease; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-bar-item:hover { transform: translateY(-1px); filter: brightness(1.15); box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35); }
.gantt-bar-label { font-size: 0.7rem; font-weight: 700; color: #FFFFFF; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gantt-bar-date-tag { font-family: var(--font-mono); font-size: 0.62rem; color: rgba(255, 255, 255, 0.8); background: rgba(0, 0, 0, 0.3); padding: 1px 4px; border-radius: 3px; }

/* =========================================================================
   RESPONSIVE FINANCIAL TABLES (STACKED ON MOBILE)
   ========================================================================= */
@media (max-width: 768px) {
  .ledger-table, .payout-table, .receipt-items-table {
    display: block;
    width: 100%;
  }
  .ledger-table thead, .payout-table thead, .receipt-items-table thead {
    display: none;
  }
  .ledger-table tbody, .payout-table tbody, .receipt-items-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .ledger-table tr, .payout-table tr, .receipt-items-table tr {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px;
    gap: 6px;
  }
  .ledger-table td, .payout-table td, .receipt-items-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border: none;
    font-size: 0.8rem;
  }
  .ledger-table td::before, .payout-table td::before, .receipt-items-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
  }
}

/* =========================================================================
   ACCESSIBILITY: PREFERS-REDUCED-MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ambient-glow-mesh, .glow-orb, .orbital-ring, .cosmic-particle, .celebration-canvas {
    display: none !important;
  }
}

/* =========================================================================
   EXECUTIVE OVERVIEW ADMIN DASHBOARD (MODERN DARK UI)
   ========================================================================= */
.admin-dashboard-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 24px 32px;
  background: #0A0D14;
}

.dashboard-content-scroll {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.dash-hero-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 4px;
  flex-wrap: wrap;
  gap: 16px;
}

.dash-greeting-pill {
  font-size: 0.8rem;
  font-weight: 700;
  color: #818CF8;
  letter-spacing: 0.02em;
  display: block;
  margin-bottom: 4px;
}

.dash-main-title {
  font-size: 2rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.03em;
  margin: 0 0 4px 0;
  line-height: 1.1;
}

.dash-main-desc {
  font-size: 0.85rem;
  color: #94A3B8;
  margin: 0;
}

.dash-hero-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-period-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  padding: 8px 16px;
  border-radius: 24px;
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.dash-period-selector:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.dash-btn-new-project {
  border-radius: 24px;
  padding: 8px 18px;
  font-size: 0.82rem;
}

.dash-btn-more {
  border-radius: 50%;
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 3 Top KPI Cards */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.dash-kpi-card {
  background: rgba(18, 21, 31, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dash-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(129, 140, 248, 0.25);
}

.dash-kpi-info {
  display: flex;
  flex-direction: column;
}

.dash-kpi-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #94A3B8;
  letter-spacing: 0.05em;
}

.dash-kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 8px 0 4px 0;
}

.dash-kpi-val {
  font-size: 1.85rem;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
  font-family: var(--font-mono);
}

.dash-kpi-val.text-amber {
  color: #FBBF24;
}

.dash-kpi-currency {
  font-size: 0.9rem;
  font-weight: 700;
  color: #818CF8;
}

.dash-kpi-sub {
  font-size: 0.75rem;
  color: #94A3B8;
}

.dash-kpi-sub.positive {
  color: #10B981;
  font-weight: 600;
}

.dash-kpi-graphic {
  width: 90px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.dash-kpi-graphic.flex-col-end {
  flex-direction: column;
  justify-content: center;
}

.sparkline-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.4));
}

.mini-equalizer-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 32px;
}

.mini-equalizer-bars span {
  width: 3px;
  background: #F59E0B;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.dash-kpi-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.dash-kpi-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366F1, #818CF8);
  box-shadow: 0 0 8px rgba(129, 140, 248, 0.6);
  border-radius: 4px;
}

/* Middle Section */
.dash-main-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 20px;
}

.featured-project-card {
  background: rgba(18, 21, 31, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
}

.featured-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: #818CF8;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.featured-hero-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.featured-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  flex-shrink: 0;
}

.featured-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.featured-name-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.featured-project-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}

.status-pill.in-production {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.04em;
}

.featured-project-sub {
  font-size: 0.76rem;
  color: #94A3B8;
}

.featured-details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.featured-sub-group {
  display: flex;
  flex-direction: column;
}

.featured-field-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94A3B8;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.featured-field-link {
  font-size: 0.78rem;
  color: #E2E8F0;
  font-family: var(--font-mono);
}

.featured-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.featured-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.featured-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366F1, #818CF8);
  box-shadow: 0 0 6px rgba(129, 140, 248, 0.5);
  border-radius: 4px;
}

.featured-pct-text {
  font-size: 0.7rem;
  color: #94A3B8;
  white-space: nowrap;
}

.featured-date-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #CBD5E1;
  font-family: var(--font-mono);
}

.featured-financials-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.financial-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fin-col-label {
  font-size: 0.68rem;
  color: #94A3B8;
}

.fin-col-val-pill {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fin-col-val {
  font-size: 1rem;
  font-weight: 800;
  color: #FFFFFF;
  font-family: var(--font-mono);
}

.fin-col-val.text-amber {
  color: #FBBF24;
}

.fin-badge-pct {
  font-size: 0.62rem;
  font-weight: 800;
  color: #10B981;
  background: rgba(16, 185, 129, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
}

.fin-col-cur {
  font-size: 0.65rem;
  color: #94A3B8;
  font-weight: 600;
}

.featured-footer-action {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.btn-subtle-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 7px 16px;
  border-radius: 20px;
  color: #E2E8F0;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-subtle-pill:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  color: #FFFFFF;
}

/* Side Widgets */
.dash-side-widgets {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.widget-team-card, .widget-activity-card {
  background: rgba(18, 21, 31, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(12px);
}

.widget-header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.widget-title-sm {
  font-size: 0.72rem;
  font-weight: 800;
  color: #94A3B8;
  letter-spacing: 0.05em;
}

.btn-widget-link {
  background: none;
  border: none;
  color: #818CF8;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.btn-widget-link:hover {
  color: #FFFFFF;
  background: rgba(99, 102, 241, 0.15);
}

.widget-team-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.team-count-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.team-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818CF8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.team-count-big {
  font-size: 1.6rem;
  font-weight: 800;
  color: #FFFFFF;
  display: block;
  line-height: 1;
}

.team-count-label {
  font-size: 0.72rem;
  color: #94A3B8;
}

.team-radial-gauge-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.radial-gauge-svg {
  width: 72px;
  height: 48px;
}

.gauge-meta {
  display: flex;
  flex-direction: column;
}

.gauge-pct {
  font-size: 1.3rem;
  font-weight: 800;
  color: #FFFFFF;
  display: block;
  line-height: 1;
  font-family: var(--font-mono);
}

.gauge-label {
  font-size: 0.68rem;
  color: #94A3B8;
}

.recent-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.activity-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: var(--transition-fast);
}

.activity-item-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(129, 140, 248, 0.2);
}

.activity-avatar {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #FFFFFF;
  flex-shrink: 0;
}

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

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

.activity-sub {
  font-size: 0.68rem;
  color: #94A3B8;
}

.activity-time-group {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: #94A3B8;
  white-space: nowrap;
}

.btn-full-subtle {
  width: 100%;
  padding: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: #94A3B8;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-full-subtle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

/* Bottom Collapsible Accordion */
.dash-accordion-card {
  background: rgba(18, 21, 31, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  margin-top: 4px;
}

.dash-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.dash-accordion-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.dash-accordion-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #E2E8F0;
}

.accordion-chevron-icon {
  color: #94A3B8;
  transition: transform 0.2s ease;
}

.dash-accordion-card.open .accordion-chevron-icon {
  transform: rotate(180deg);
}

.dash-accordion-body {
  padding: 0 22px 20px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 1024px) {
  .dash-kpi-grid {
    grid-template-columns: 1fr;
  }
  .dash-main-grid {
    grid-template-columns: 1fr;
  }
}
