/* ═══════════════════════════════════════════════════════════════
   NexusForge — AI Engineering Platform
   Main Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties (Dark Theme — Default) ─── */
:root,
[data-theme="dark"] {
  /* Surface colors */
  --bg-primary:     #0a0e17;
  --bg-secondary:   #111827;
  --bg-tertiary:    #1a2236;
  --bg-card:        #151d2e;
  --bg-hover:       #1e293b;
  --bg-active:      #253149;
  --bg-input:       #0f1724;
  --bg-modal:       rgba(0, 0, 0, 0.75);
  --bg-glass:       rgba(15, 23, 42, 0.8);

  /* Border */
  --border-primary:   #1e293b;
  --border-secondary: #2a3a52;
  --border-accent:    #00d4ff33;

  /* Text */
  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-tertiary:  #64748b;
  --text-inverse:   #0a0e17;

  /* Accent */
  --accent-primary:   #00d4ff;
  --accent-secondary: #7c3aed;
  --accent-tertiary:  #06d6a0;
  --accent-warning:   #f59e0b;
  --accent-danger:    #ef4444;
  --accent-success:   #10b981;
  --accent-info:      #3b82f6;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #00d4ff, #7c3aed);
  --gradient-accent:  linear-gradient(135deg, #7c3aed, #ec4899);
  --gradient-success: linear-gradient(135deg, #10b981, #06d6a0);
  --gradient-card:    linear-gradient(145deg, #151d2e, #1a2236);

  /* Glow effects */
  --glow-primary:   0 0 20px rgba(0, 212, 255, 0.3);
  --glow-secondary: 0 0 20px rgba(124, 58, 237, 0.3);
  --glow-success:   0 0 20px rgba(16, 185, 129, 0.3);

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg:   0 10px 40px rgba(0, 0, 0, 0.5);
  --shadow-xl:   0 20px 60px rgba(0, 0, 0, 0.6);

  /* Layout */
  --sidebar-width:      260px;
  --sidebar-collapsed:  68px;
  --topbar-height:      56px;
  --right-panel-width:  380px;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;

  /* Animation */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow:   0.4s ease;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ─── Light Theme ─── */
[data-theme="light"] {
  --bg-primary:     #f1f5f9;
  --bg-secondary:   #ffffff;
  --bg-tertiary:    #f8fafc;
  --bg-card:        #ffffff;
  --bg-hover:       #e2e8f0;
  --bg-active:      #cbd5e1;
  --bg-input:       #f1f5f9;
  --bg-modal:       rgba(0, 0, 0, 0.4);
  --bg-glass:       rgba(255, 255, 255, 0.85);
  --border-primary:   #e2e8f0;
  --border-secondary: #cbd5e1;
  --border-accent:    #00b4d833;
  --text-primary:   #0f172a;
  --text-secondary: #475569;
  --text-tertiary:  #94a3b8;
  --text-inverse:   #f8fafc;
  --bg-card:        #ffffff;
  --gradient-card:  linear-gradient(145deg, #ffffff, #f8fafc);
  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg:   0 10px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl:   0 20px 60px rgba(0, 0, 0, 0.15);
}

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; cursor: pointer; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  outline: none;
  transition: border var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}
select { cursor: pointer; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-secondary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════
   LOADING SCREEN
   ═══════════════════════════════════════════════════════════════ */
.loading-screen {
  position: fixed; inset: 0; z-index: 10000;
  background: #0a0e17;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loading-screen.fade-out { opacity: 0; visibility: hidden; }
.loader-content { text-align: center; }

.hex-grid {
  display: grid;
  grid-template-columns: repeat(3, 24px);
  gap: 4px;
  justify-content: center;
  margin-bottom: 24px;
}
.hex {
  width: 24px; height: 24px;
  background: rgba(0, 212, 255, 0.15);
  border-radius: 4px;
  animation: hexPulse 1.5s ease-in-out infinite;
}
.hex:nth-child(1) { animation-delay: 0s; }
.hex:nth-child(2) { animation-delay: 0.1s; }
.hex:nth-child(3) { animation-delay: 0.2s; }
.hex:nth-child(4) { animation-delay: 0.3s; }
.hex.center { background: var(--accent-primary); box-shadow: var(--glow-primary); }
.hex:nth-child(6) { animation-delay: 0.3s; }
.hex:nth-child(7) { animation-delay: 0.2s; }
.hex:nth-child(8) { animation-delay: 0.1s; }
.hex:nth-child(9) { animation-delay: 0s; }

@keyframes hexPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1); }
}

.loader-title {
  font-size: 2rem; font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.loader-sub { color: var(--text-tertiary); margin-top: 8px; font-size: 0.85rem; }
.loader-bar {
  width: 200px; height: 3px;
  background: var(--border-primary);
  border-radius: 4px; margin: 20px auto 0;
  overflow: hidden;
}
.loader-progress {
  height: 100%; width: 0%;
  background: var(--gradient-primary);
  border-radius: 4px;
  animation: loadProgress 2s ease-in-out forwards;
}
@keyframes loadProgress { to { width: 100%; } }

/* ═══════════════════════════════════════════════════════════════
   BACKGROUND CANVAS
   ═══════════════════════════════════════════════════════════════ */
.bg-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════
   APP LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── Sidebar ─── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  transition: width var(--transition-normal);
  flex-shrink: 0;
  z-index: 100;
  position: relative;
}
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}
.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-dot,
.sidebar.collapsed .sidebar-search span,
.sidebar.collapsed .sidebar-search kbd,
.sidebar.collapsed .user-info {
  display: none;
}
.sidebar.collapsed .sidebar-header { justify-content: center; }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .nav-item i { margin-right: 0; font-size: 1.15rem; }
.sidebar.collapsed .sidebar-search { justify-content: center; }
.sidebar.collapsed .user-card { justify-content: center; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-primary);
}
.logo {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.logo-icon {
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.5));
}
.logo-text {
  font-size: 1.2rem; font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-toggle {
  padding: 6px; border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  transition: var(--transition-fast);
}
.sidebar-toggle:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar-toggle i { transition: transform var(--transition-normal); }

.sidebar-search {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 12px 8px;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition-fast);
}
.sidebar-search:hover { border-color: var(--border-secondary); background: var(--bg-hover); }
.sidebar-search kbd {
  margin-left: auto;
  padding: 2px 6px;
  background: var(--bg-hover);
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.nav-section { padding: 4px 12px; }
.nav-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  padding: 12px 12px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition-fast);
  position: relative;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active {
  background: var(--bg-active);
  color: var(--accent-primary);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent-primary);
  border-radius: 0 4px 4px 0;
}
.nav-item i { width: 18px; text-align: center; font-size: 0.9rem; }
.nav-badge {
  margin-left: auto;
  padding: 1px 8px;
  background: var(--bg-hover);
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
}
.nav-badge.urgent { background: var(--accent-danger); color: white; }
.nav-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-left: auto;
}
.nav-dot.live { background: var(--accent-danger); animation: pulse 2s infinite; }
.nav-dot.ai-pulse { background: var(--accent-primary); animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50% { opacity: 0.7; box-shadow: 0 0 0 6px transparent; }
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-primary);
}
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}
.user-card:hover { background: var(--bg-hover); }
.user-avatar { position: relative; flex-shrink: 0; }
.user-avatar img { width: 36px; height: 36px; border-radius: var(--radius-sm); }
.status-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid var(--bg-secondary);
}
.status-dot.online { background: var(--accent-success); }
.status-dot.away { background: var(--accent-warning); }
.status-dot.busy { background: var(--accent-danger); }
.status-dot.offline { background: var(--text-tertiary); }
.user-name { font-size: 0.85rem; font-weight: 600; display: block; }
.user-role { font-size: 0.7rem; color: var(--text-tertiary); display: block; }

/* ─── Main Content ─── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ─── Top Bar ─── */
.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  gap: 16px;
  z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.mobile-menu-btn { display: none; padding: 8px; font-size: 1.1rem; }
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--text-secondary);
}
.breadcrumb span:last-child { color: var(--text-primary); font-weight: 600; }
.breadcrumb .sep { color: var(--text-tertiary); }

.topbar-center { flex: 1; display: flex; justify-content: center; }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  color: var(--text-tertiary);
  font-size: 0.82rem;
  cursor: pointer;
  min-width: 280px;
  transition: var(--transition-fast);
}
.topbar-search:hover { border-color: var(--border-secondary); }
.topbar-search kbd {
  margin-left: auto;
  padding: 2px 6px;
  background: var(--bg-hover);
  border-radius: 4px;
  font-size: 0.65rem;
  font-family: var(--font-mono);
}

.topbar-right { display: flex; align-items: center; gap: 4px; }
.topbar-btn {
  position: relative;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition-fast);
  font-size: 1rem;
}
.topbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px;
  background: var(--accent-danger);
  color: white;
  font-size: 0.6rem; font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ─── Page Container ─── */
.page-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
}

/* ─── Right Panel ─── */
.right-panel {
  width: var(--right-panel-width);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: var(--transition-normal);
  z-index: 90;
}
.right-panel.hidden { width: 0; overflow: hidden; border: none; }
.right-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
}
.right-panel-header h3 { font-size: 0.95rem; font-weight: 700; }
.right-panel-header button {
  padding: 6px 8px; border-radius: var(--radius-sm);
  color: var(--text-tertiary); transition: var(--transition-fast);
}
.right-panel-header button:hover { background: var(--bg-hover); color: var(--text-primary); }
.right-panel-content { flex: 1; overflow-y: auto; }

/* ═══════════════════════════════════════════════════════════════
   CARDS & WIDGETS
   ═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.card:hover { border-color: var(--border-secondary); box-shadow: var(--shadow-md); }
.card:hover::before { opacity: 1; }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 0.95rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--accent-primary); }
.card-actions { display: flex; gap: 4px; }
.card-action {
  padding: 6px 8px; border-radius: var(--radius-sm);
  color: var(--text-tertiary); font-size: 0.8rem;
  transition: var(--transition-fast);
}
.card-action:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Stat Cards */
.stat-card {
  text-align: center;
  padding: 20px;
}
.stat-value {
  font-size: 2rem; font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { font-size: 0.8rem; color: var(--text-tertiary); margin-top: 4px; }
.stat-change {
  font-size: 0.75rem; margin-top: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 10px;
}
.stat-change.up { background: rgba(16, 185, 129, 0.15); color: var(--accent-success); }
.stat-change.down { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }

/* ─── Dashboard Grid ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.dashboard-grid .wide { grid-column: span 2; }
.dashboard-grid .tall { grid-row: span 2; }

/* Stats row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════════
   PROJECT CARDS
   ═══════════════════════════════════════════════════════════════ */
.project-card {
  cursor: pointer;
}
.project-card .project-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 14px;
}
.project-card .project-name {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 6px;
}
.project-card .project-desc {
  font-size: 0.8rem; color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 14px;
}
.project-meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.75rem; color: var(--text-tertiary);
}
.project-meta i { margin-right: 3px; }
.project-progress {
  margin-top: 14px;
}
.progress-bar {
  height: 4px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--gradient-primary);
  transition: width 0.8s ease;
}
.progress-text {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--text-tertiary);
}

/* Tags */
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  padding: 2px 8px;
  background: var(--bg-hover);
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.tag.cat-hardware { background: rgba(0, 212, 255, 0.12); color: var(--accent-primary); }
.tag.cat-software { background: rgba(124, 58, 237, 0.12); color: var(--accent-secondary); }
.tag.cat-ev { background: rgba(6, 214, 160, 0.12); color: var(--accent-tertiary); }
.tag.cat-robotics { background: rgba(245, 158, 11, 0.12); color: var(--accent-warning); }
.tag.cat-3dprint { background: rgba(236, 72, 153, 0.12); color: #ec4899; }
.tag.cat-iot { background: rgba(59, 130, 246, 0.12); color: var(--accent-info); }

/* Avatars */
.avatar-stack {
  display: flex;
}
.avatar-stack .avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--bg-card);
  margin-left: -8px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700;
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar-stack .avatar.more { font-size: 0.55rem; }

/* ═══════════════════════════════════════════════════════════════
   TASK LIST
   ═══════════════════════════════════════════════════════════════ */
.task-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
  margin-bottom: 8px;
  transition: var(--transition-fast);
  cursor: pointer;
}
.task-item:hover { background: var(--bg-hover); border-color: var(--border-secondary); }
.task-check {
  width: 20px; height: 20px;
  border: 2px solid var(--border-secondary);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
  cursor: pointer;
}
.task-check:hover { border-color: var(--accent-primary); }
.task-check.done { background: var(--accent-success); border-color: var(--accent-success); }
.task-check.done::after { content: '✓'; color: white; font-size: 0.7rem; font-weight: 700; }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 0.85rem; font-weight: 600; }
.task-title.done { text-decoration: line-through; color: var(--text-tertiary); }
.task-subtitle { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 2px; }
.task-priority {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.task-priority.critical { background: var(--accent-danger); box-shadow: 0 0 6px var(--accent-danger); }
.task-priority.high { background: var(--accent-warning); }
.task-priority.medium { background: var(--accent-info); }
.task-priority.low { background: var(--text-tertiary); }
.task-due {
  font-size: 0.7rem; color: var(--text-tertiary); white-space: nowrap;
}
.task-due.overdue { color: var(--accent-danger); }

/* Kanban Board */
.kanban-board {
  display: flex; gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}
.kanban-column {
  min-width: 280px;
  max-width: 320px;
  flex-shrink: 0;
}
.kanban-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--bg-tertiary);
  margin-bottom: 1px;
}
.kanban-header h4 {
  font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.kanban-count {
  padding: 1px 8px;
  background: var(--bg-hover);
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 600;
}
.kanban-items {
  background: var(--bg-tertiary);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 8px;
  min-height: 100px;
}
.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: grab;
  transition: var(--transition-fast);
}
.kanban-card:hover { border-color: var(--border-secondary); box-shadow: var(--shadow-sm); }
.kanban-card:active { cursor: grabbing; }
.kanban-card.dragging { opacity: 0.5; }

/* ═══════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg-modal);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.modal-dialog {
  width: 90%; max-width: 580px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: slideUp 0.3s ease;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-primary);
}
.modal-header h2 {
  font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}
.modal-header h2 i { color: var(--accent-primary); }
.modal-header button {
  padding: 6px 8px; border-radius: var(--radius-sm);
  color: var(--text-tertiary); transition: var(--transition-fast);
}
.modal-header button:hover { background: var(--bg-hover); color: var(--text-primary); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-primary);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.member-select {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.member-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  font-size: 0.78rem;
  cursor: pointer; transition: var(--transition-fast);
}
.member-chip:hover { border-color: var(--accent-primary); }
.member-chip.selected { background: rgba(0, 212, 255, 0.12); border-color: var(--accent-primary); color: var(--accent-primary); }
.member-chip img { width: 20px; height: 20px; border-radius: 50%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 600;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.btn-primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
}
.btn-primary:hover { box-shadow: var(--glow-primary); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}
.btn-secondary:hover { border-color: var(--border-secondary); }
.btn-ghost {
  color: var(--text-secondary);
  padding: 9px 14px;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-danger { background: var(--accent-danger); color: white; }
.btn-danger:hover { box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }

/* ═══════════════════════════════════════════════════════════════
   SEARCH MODAL
   ═══════════════════════════════════════════════════════════════ */
.search-dialog {
  width: 90%; max-width: 640px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  animation: slideUp 0.2s ease;
}
.search-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
}
.search-input-wrap i { color: var(--text-tertiary); font-size: 1rem; }
.search-input-wrap input {
  flex: 1; border: none; background: transparent; padding: 0;
  font-size: 1rem; font-weight: 500;
}
.search-input-wrap input:focus { box-shadow: none; }
.search-input-wrap kbd {
  padding: 4px 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}
.search-hint {
  display: flex; align-items: center; gap: 10px;
  padding: 20px;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}
.search-hint i { color: var(--accent-primary); }
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}
.search-result-item:hover { background: var(--bg-hover); }
.search-result-item i { color: var(--text-tertiary); width: 18px; text-align: center; }
.search-result-info { flex: 1; }
.search-result-title { font-size: 0.85rem; font-weight: 500; }
.search-result-sub { font-size: 0.72rem; color: var(--text-tertiary); }
.search-result-type {
  font-size: 0.68rem; color: var(--text-tertiary);
  padding: 2px 8px;
  background: var(--bg-hover);
  border-radius: 4px;
}
.search-footer {
  display: flex; gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--border-primary);
  font-size: 0.72rem; color: var(--text-tertiary);
}
.search-footer kbd { padding: 1px 5px; background: var(--bg-hover); border-radius: 3px; font-family: var(--font-mono); }

/* ═══════════════════════════════════════════════════════════════
   NOTIFICATION PANEL
   ═══════════════════════════════════════════════════════════════ */
.notif-panel {
  position: fixed; top: var(--topbar-height); right: 20px;
  width: 360px;
  max-height: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  display: flex; flex-direction: column;
  animation: slideDown 0.2s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-primary);
}
.notif-header h3 { font-size: 0.95rem; font-weight: 700; }
.notif-header button { font-size: 0.78rem; color: var(--accent-primary); font-weight: 500; }
.notif-list { flex: 1; overflow-y: auto; padding: 8px; }
.notif-item {
  display: flex; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { background: rgba(0, 212, 255, 0.04); }
.notif-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.notif-icon.info { background: rgba(59, 130, 246, 0.12); color: var(--accent-info); }
.notif-icon.success { background: rgba(16, 185, 129, 0.12); color: var(--accent-success); }
.notif-icon.warning { background: rgba(245, 158, 11, 0.12); color: var(--accent-warning); }
.notif-icon.error { background: rgba(239, 68, 68, 0.12); color: var(--accent-danger); }
.notif-icon.ai { background: rgba(0, 212, 255, 0.12); color: var(--accent-primary); }
.notif-text { flex: 1; }
.notif-title { font-size: 0.82rem; font-weight: 600; }
.notif-desc { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.notif-time { font-size: 0.65rem; color: var(--text-tertiary); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   Higext AI PANEL
   ═══════════════════════════════════════════════════════════════ */
.ai-chat { display: flex; flex-direction: column; height: 100%; }
.ai-messages { flex: 1; overflow-y: auto; padding: 16px; }
.ai-message {
  margin-bottom: 16px;
  display: flex; gap: 10px;
}
.ai-message.user { flex-direction: row-reverse; }
.ai-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; flex-shrink: 0;
}
.ai-message.bot .ai-msg-avatar { background: var(--gradient-primary); color: white; }
.ai-message.user .ai-msg-avatar { background: var(--bg-hover); color: var(--text-secondary); }
.ai-msg-content {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.6;
}
.ai-message.bot .ai-msg-content { background: var(--bg-tertiary); border: 1px solid var(--border-primary); }
.ai-message.user .ai-msg-content { background: rgba(0, 212, 255, 0.12); border: 1px solid var(--border-accent); }
.ai-msg-content code {
  font-family: var(--font-mono);
  background: var(--bg-primary);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.8rem;
}
.ai-msg-content pre {
  background: var(--bg-primary);
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 8px 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
}
.ai-input-area {
  display: flex; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-primary);
}
.ai-input-area input {
  flex: 1;
  border-radius: var(--radius-xl);
  padding: 10px 16px;
}
.ai-input-area button {
  padding: 10px 16px;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  color: white;
  font-weight: 600;
  transition: var(--transition-fast);
}
.ai-input-area button:hover { box-shadow: var(--glow-primary); }
.ai-typing {
  display: flex; gap: 4px; padding: 8px 14px;
}
.ai-typing span {
  width: 6px; height: 6px;
  background: var(--text-tertiary);
  border-radius: 50%;
  animation: typingDot 1.4s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ═══════════════════════════════════════════════════════════════
   TIMELINE
   ═══════════════════════════════════════════════════════════════ */
.timeline-container {
  position: relative;
  padding-left: 32px;
}
.timeline-container::before {
  content: '';
  position: absolute; left: 12px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border-primary);
}
.timeline-item {
  position: relative;
  margin-bottom: 24px;
  padding-bottom: 4px;
}
.timeline-dot {
  position: absolute; left: -28px; top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 3px solid var(--bg-secondary);
}
.timeline-dot.milestone { background: var(--accent-primary); box-shadow: var(--glow-primary); }
.timeline-dot.task { background: var(--accent-info); }
.timeline-dot.complete { background: var(--accent-success); }
.timeline-dot.alert { background: var(--accent-warning); }
.timeline-date { font-size: 0.7rem; color: var(--text-tertiary); margin-bottom: 4px; }
.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.timeline-title { font-size: 0.88rem; font-weight: 600; }
.timeline-desc { font-size: 0.78rem; color: var(--text-secondary); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   CHARTS / GRAPHS (CSS-based)
   ═══════════════════════════════════════════════════════════════ */
.mini-chart {
  display: flex; align-items: flex-end; gap: 3px;
  height: 60px;
}
.mini-chart .bar {
  flex: 1;
  background: var(--gradient-primary);
  border-radius: 2px 2px 0 0;
  min-height: 4px;
  transition: height 0.6s ease;
  opacity: 0.7;
}
.mini-chart .bar:hover { opacity: 1; }

.donut-chart {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.donut-chart .donut-center {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 700;
  z-index: 1;
}

/* ═══════════════════════════════════════════════════════════════
   MESSAGING / CHAT
   ═══════════════════════════════════════════════════════════════ */
.chat-container { display: flex; height: calc(100vh - var(--topbar-height) - 48px); }
.chat-sidebar {
  width: 260px;
  border-right: 1px solid var(--border-primary);
  display: flex;
  flex-direction: column;
}
.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-primary);
  display: flex; align-items: center; justify-content: space-between;
}
.chat-sidebar-header h3 { font-size: 0.95rem; font-weight: 700; }
.chat-list { flex: 1; overflow-y: auto; padding: 8px; }
.chat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-fast);
}
.chat-item:hover { background: var(--bg-hover); }
.chat-item.active { background: var(--bg-active); }
.chat-item-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  background: var(--bg-hover);
  flex-shrink: 0;
}
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-size: 0.82rem; font-weight: 600; }
.chat-item-preview { font-size: 0.72rem; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-main { flex: 1; display: flex; flex-direction: column; }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; }
.chat-msg {
  display: flex; gap: 10px;
  margin-bottom: 16px;
}
.chat-msg.own { flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
  flex-shrink: 0;
}
.chat-msg-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}
.chat-msg:not(.own) .chat-msg-bubble { background: var(--bg-tertiary); }
.chat-msg.own .chat-msg-bubble { background: rgba(0, 212, 255, 0.12); }
.chat-msg-meta { font-size: 0.65rem; color: var(--text-tertiary); margin-top: 4px; }
.chat-input-area {
  display: flex; gap: 8px; padding: 16px 20px;
  border-top: 1px solid var(--border-primary);
  align-items: center;
}
.chat-input-area input { flex: 1; border-radius: var(--radius-xl); }
.chat-input-area button {
  padding: 10px 18px; border-radius: var(--radius-xl);
  background: var(--gradient-primary); color: white; font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   TEAM MEMBERS
   ═══════════════════════════════════════════════════════════════ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.team-card {
  text-align: center;
  padding: 24px 16px;
}
.team-card .team-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700;
  position: relative;
}
.team-card .team-status {
  position: absolute; bottom: 2px; right: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
}
.team-card .team-name { font-size: 0.95rem; font-weight: 700; }
.team-card .team-role { font-size: 0.78rem; color: var(--text-secondary); margin-top: 2px; }
.team-card .team-stats {
  display: flex; justify-content: center; gap: 20px;
  margin-top: 14px;
}
.team-card .team-stat { text-align: center; }
.team-card .team-stat-val { font-size: 1.1rem; font-weight: 700; }
.team-card .team-stat-label { font-size: 0.65rem; color: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════════════════
   3D VIEWER
   ═══════════════════════════════════════════════════════════════ */
.viewer-container {
  height: calc(100vh - var(--topbar-height) - 80px);
  display: flex; gap: 20px;
}
.viewer-canvas {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.viewer-3d-scene {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  perspective: 800px;
}
.viewer-model {
  width: 200px; height: 200px;
  position: relative;
  transform-style: preserve-3d;
  animation: rotate3d 20s linear infinite;
}
@keyframes rotate3d {
  from { transform: rotateY(0deg) rotateX(15deg); }
  to { transform: rotateY(360deg) rotateX(15deg); }
}
.viewer-model .face {
  position: absolute;
  width: 200px; height: 200px;
  border: 1px solid var(--accent-primary);
  background: rgba(0, 212, 255, 0.05);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; color: var(--accent-primary);
  backdrop-filter: blur(2px);
}
.face.front  { transform: translateZ(100px); }
.face.back   { transform: rotateY(180deg) translateZ(100px); }
.face.left   { transform: rotateY(-90deg) translateZ(100px); }
.face.right  { transform: rotateY(90deg) translateZ(100px); }
.face.top    { transform: rotateX(90deg) translateZ(100px); }
.face.bottom { transform: rotateX(-90deg) translateZ(100px); }
.viewer-toolbar {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 4px;
  padding: 6px;
  background: var(--bg-glass);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(12px);
}
.viewer-toolbar button {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.82rem;
  transition: var(--transition-fast);
}
.viewer-toolbar button:hover { background: var(--bg-hover); color: var(--text-primary); }
.viewer-sidebar {
  width: 280px;
  display: flex; flex-direction: column; gap: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   ACTIVITY FEED
   ═══════════════════════════════════════════════════════════════ */
.activity-list { max-width: 700px; }
.activity-item {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-primary);
}
.activity-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.8rem;
}
.activity-content { flex: 1; }
.activity-text { font-size: 0.85rem; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 0.7rem; color: var(--text-tertiary); margin-top: 2px; }
.activity-attachment {
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  display: flex; align-items: center; gap: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════════════════ */
.settings-container { max-width: 700px; }
.settings-section { margin-bottom: 32px; }
.settings-section h3 {
  font-size: 1rem; font-weight: 700;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.settings-section h3 i { color: var(--accent-primary); }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-primary);
}
.settings-label { font-size: 0.88rem; font-weight: 500; }
.settings-desc { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; }

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px; height: 24px;
  cursor: pointer;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-hover);
  border-radius: 12px;
  border: 1px solid var(--border-primary);
  transition: var(--transition-fast);
}
.toggle-slider::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--text-tertiary);
  transition: var(--transition-fast);
}
.toggle input:checked + .toggle-slider { background: var(--accent-primary); border-color: var(--accent-primary); }
.toggle input:checked + .toggle-slider::after { transform: translateX(20px); background: white; }

/* Background selector */
.bg-options { display: flex; gap: 10px; flex-wrap: wrap; }
.bg-option {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-primary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.bg-option:hover { border-color: var(--border-secondary); }
.bg-option.active { border-color: var(--accent-primary); box-shadow: var(--glow-primary); }

/* ═══════════════════════════════════════════════════════════════
   PLUGIN SYSTEM
   ═══════════════════════════════════════════════════════════════ */
.plugin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.plugin-card { padding: 20px; }
.plugin-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  margin-bottom: 14px;
}
.plugin-name { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.plugin-desc { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 14px; }
.plugin-footer { display: flex; align-items: center; justify-content: space-between; }
.plugin-status {
  font-size: 0.72rem; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.plugin-status.installed { color: var(--accent-success); }
.plugin-status.available { color: var(--text-tertiary); }

/* ═══════════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed; bottom: 20px; right: 20px;
  z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  min-width: 280px;
  max-width: 420px;
}
.toast.removing { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
.toast-icon { font-size: 1.1rem; }
.toast.success .toast-icon { color: var(--accent-success); }
.toast.error .toast-icon { color: var(--accent-danger); }
.toast.info .toast-icon { color: var(--accent-info); }
.toast.warning .toast-icon { color: var(--accent-warning); }
.toast-text { flex: 1; font-size: 0.85rem; }
.toast-close {
  padding: 4px; color: var(--text-tertiary); font-size: 0.75rem;
  transition: var(--transition-fast);
}
.toast-close:hover { color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   PAGE-SPECIFIC LAYOUTS
   ═══════════════════════════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 1.4rem;
  font-weight: 800;
}
.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.page-actions { display: flex; gap: 8px; }

/* Filter bar */
.filter-bar {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-chip {
  padding: 6px 14px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  font-size: 0.78rem; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.filter-chip:hover { border-color: var(--border-secondary); color: var(--text-primary); }
.filter-chip.active {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: 20px;
  gap: 4px;
}
.tab {
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-tertiary);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-secondary); }
.empty-state p { font-size: 0.85rem; margin-top: 8px; max-width: 400px; margin-inline: auto; }

/* File cards */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.file-card {
  padding: 16px;
  text-align: center;
  cursor: pointer;
}
.file-card .file-icon { font-size: 2rem; margin-bottom: 8px; }
.file-card .file-name { font-size: 0.82rem; font-weight: 600; word-break: break-all; }
.file-card .file-size { font-size: 0.7rem; color: var(--text-tertiary); margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   STREAMING / VOICE
   ═══════════════════════════════════════════════════════════════ */
.stream-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.stream-card { padding: 0; overflow: hidden; }
.stream-preview {
  height: 180px;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-primary));
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.stream-live-badge {
  position: absolute; top: 12px; left: 12px;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  background: var(--accent-danger);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 0.7rem; font-weight: 700;
}
.stream-live-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: white;
  animation: pulse 1.5s infinite;
}
.stream-info { padding: 14px 16px; }
.stream-title { font-size: 0.9rem; font-weight: 700; }
.stream-meta { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 4px; }

.voice-room {
  padding: 20px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.voice-participants {
  display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: center;
  margin: 20px 0;
}
.voice-participant {
  text-align: center;
}
.voice-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
  margin: 0 auto 8px;
  border: 2px solid var(--border-primary);
  transition: var(--transition-fast);
}
.voice-avatar.speaking {
  border-color: var(--accent-success);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.2);
}
.voice-name { font-size: 0.75rem; font-weight: 500; }
.voice-controls {
  display: flex; justify-content: center; gap: 12px;
  margin-top: 16px;
}
.voice-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-hover);
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  font-size: 1rem;
  transition: var(--transition-fast);
}
.voice-btn:hover { background: var(--bg-active); color: var(--text-primary); }
.voice-btn.danger { background: var(--accent-danger); color: white; border-color: var(--accent-danger); }

/* ═══════════════════════════════════════════════════════════════
   WIDGETS / DRAGGABLE
   ═══════════════════════════════════════════════════════════════ */
.widget-mode .card {
  cursor: grab;
  border-style: dashed;
}
.widget-mode .card:active { cursor: grabbing; }
.widget-mode .card::after {
  content: '\f58e';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--accent-primary);
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .topbar-search { min-width: 200px; }
  .dashboard-grid .wide { grid-column: span 1; }
  .right-panel { position: fixed; right: 0; top: 0; bottom: 0; z-index: 200; }
  .right-panel.hidden { transform: translateX(100%); width: var(--right-panel-width); }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .mobile-menu-btn { display: block; }
  .topbar-center { display: none; }
  .topbar-search { display: none; }
  .page-container { padding: 16px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .chat-container { flex-direction: column; }
  .chat-sidebar { width: 100%; height: auto; max-height: 200px; border-right: none; border-bottom: 1px solid var(--border-primary); }
  .viewer-container { flex-direction: column; }
  .viewer-sidebar { width: 100%; }
  .kanban-board { flex-direction: column; }
  .kanban-column { min-width: 100%; max-width: 100%; }
  .form-row { flex-direction: column; gap: 0; }
  .notif-panel { right: 10px; width: calc(100vw - 20px); }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: 1fr; }
  .file-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-right { gap: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   UTILITY ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */
.fade-in {
  animation: fadeIn 0.4s ease;
}
.slide-in-up {
  animation: slideUp 0.4s ease;
}
.slide-in-left {
  animation: slideInLeft 0.3s ease;
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
.glow-text {
  text-shadow: 0 0 10px var(--accent-primary), 0 0 20px rgba(0, 212, 255, 0.3);
}
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-tertiary) 50%, var(--bg-hover) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Code block */
.code-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
  position: relative;
}
.code-block .code-lang {
  position: absolute; top: 8px; right: 12px;
  font-size: 0.65rem; color: var(--text-tertiary);
  text-transform: uppercase;
}
.code-block .line-num { color: var(--text-tertiary); user-select: none; margin-right: 16px; }
.code-keyword { color: #c792ea; }
.code-string { color: #c3e88d; }
.code-comment { color: #546e7a; }
.code-func { color: #82aaff; }
.code-type { color: #ffcb6b; }
.code-number { color: #f78c6c; }

/* Section dividers */
.section-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0 16px;
  font-size: 0.8rem; font-weight: 600; color: var(--text-tertiary);
}
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-primary);
}

/* Inline editor */
.inline-editor {
  background: var(--bg-input);
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}

/* Version history */
.version-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-primary);
}
.version-hash {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-primary);
  background: rgba(0, 212, 255, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
}
.version-msg { flex: 1; font-size: 0.82rem; }
.version-author { font-size: 0.72rem; color: var(--text-tertiary); }
.version-date { font-size: 0.72rem; color: var(--text-tertiary); }

/* Doc editor */
.doc-editor {
  max-width: 800px;
  margin: 0 auto;
}
.doc-editor h1 { font-size: 1.8rem; margin-bottom: 8px; }
.doc-editor h2 { font-size: 1.3rem; margin: 24px 0 8px; }
.doc-editor p { margin-bottom: 12px; line-height: 1.7; color: var(--text-secondary); }

/* Progress Circle */
.progress-circle {
  width: 80px; height: 80px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
}
.progress-circle svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.progress-circle .track { fill: none; stroke: var(--bg-hover); stroke-width: 6; }
.progress-circle .fill-ring { fill: none; stroke: url(#grad); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.progress-circle .pct { font-size: 0.85rem; font-weight: 700; }

/* ═══════════════════════════════════════════════════
   ADMIN PANEL STYLES
   ═══════════════════════════════════════════════════ */

.admin-table {
  width: 100%;
  overflow-x: auto;
}
.admin-table-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-hover);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  gap: 12px;
}
.admin-table-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-primary);
  gap: 12px;
  transition: background 0.15s;
}
.admin-table-row:hover {
  background: var(--bg-hover);
}
.admin-table-row:last-child {
  border-bottom: none;
}

.admin-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}
.admin-status-badge.online {
  background: rgba(6, 214, 160, 0.12);
  color: var(--accent-success);
}
.admin-status-badge.away {
  background: rgba(255, 183, 77, 0.12);
  color: var(--accent-warning);
}
.admin-status-badge.offline {
  background: rgba(239, 68, 68, 0.12);
  color: var(--accent-danger);
}
.admin-status-badge.active {
  background: rgba(0, 212, 255, 0.12);
  color: var(--accent-primary);
}

.admin-action-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
}

/* Button variants for admin */
.btn-danger {
  background: var(--accent-danger);
  color: white;
  border: none;
  cursor: pointer;
}
.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}
.btn-warning {
  background: var(--accent-warning);
  color: #1a1a2e;
  border: none;
  cursor: pointer;
}
.btn-warning:hover {
  background: #f59e0b;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════
   SPRINT CARD STYLES
   ═══════════════════════════════════════════════════ */

.sprint-card {
  position: relative;
  overflow: hidden;
}
.sprint-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 4px 0 0 4px;
}

/* ═══════════════════════════════════════════════════
   WIKI / KNOWLEDGE BASE STYLES
   ═══════════════════════════════════════════════════ */

.wiki-card {
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.wiki-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ═══════════════════════════════════════════════════
   TEMPLATE CARD STYLES
   ═══════════════════════════════════════════════════ */

.template-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ═══════════════════════════════════════════════════
   DB STATUS INDICATOR
   ═══════════════════════════════════════════════════ */

.db-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
}
.db-status-indicator.connected {
  background: rgba(6, 214, 160, 0.1);
  color: var(--accent-success);
}
.db-status-indicator.disconnected {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-danger);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE ADMIN TABLE
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .admin-table-header { display: none; }
  .admin-table-row {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
  }
  .admin-table-row > span {
    flex: none !important;
    font-size: 0.75rem;
  }
}

