/**
 * Mission Control V2 — Main Styles
 * Design: "Dense Terminal" (Variation A) by Jonny
 * Mobile-first CSS with dark theme default
 */

/* ═══════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: var(--line-height-normal);
}

/* Subtle noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

html[data-theme="light"] body::before {
  opacity: 0.1;
}

/* ═══════════════════════════════════════════════════════════════════
   GLASS HEADER
   ═══════════════════════════════════════════════════════════════════ */
.glass-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  z-index: 100;
}

@media (min-width: 640px) {
  .glass-header {
    padding: 0 var(--space-6);
  }
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-logo-icon {
  font-size: 24px;
  line-height: 1;
}

.header-logo-text {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

@media (min-width: 640px) {
  .header-logo-text {
    font-size: var(--font-size-xl);
  }
}

/* Header Navigation */
.header-nav {
  display: none;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-4);
}

@media (min-width: 768px) {
  .header-nav {
    display: flex;
    margin-left: var(--space-6);
  }
}

.header-nav-tab {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  background: var(--tab-bg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--tab-text);
  text-decoration: none;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
}

@media (min-width: 900px) {
  .header-nav-tab {
    padding: var(--space-2) var(--space-4);
  }
}

.header-nav-tab:hover {
  background: var(--tab-bg-active);
  color: var(--text-primary);
}

.header-nav-tab--active {
  background: var(--tab-bg-active);
  color: var(--tab-text-active);
}

.header-nav-tab--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space-2);
  right: var(--space-2);
  height: 2px;
  background: var(--tab-border-active);
  border-radius: 1px;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.header-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  font-size: 18px;
}

.theme-toggle:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  display: none;
}

html:not([data-theme="light"]) .theme-toggle .icon-sun {
  display: block;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--agent-rupert), #FFE066);
  margin-left: var(--space-2);
}

/* ═══════════════════════════════════════════════════════════════════
   MAIN LAYOUT
   ═══════════════════════════════════════════════════════════════════ */
.main-content {
  position: relative;
  z-index: 1;
  padding-top: calc(var(--header-height) + var(--space-6));
  padding-bottom: calc(var(--footer-height) + var(--space-6));
  padding-left: var(--space-5);
  padding-right: var(--space-5);
  max-width: var(--content-max-width);
  margin: 0 auto;
  min-height: calc(100vh - var(--header-height));
}

@media (min-width: 640px) {
  .main-content {
    padding-top: calc(var(--header-height) + var(--space-8));
    padding-bottom: calc(var(--footer-height) + var(--space-8));
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   VIEW CONTAINERS
   ═══════════════════════════════════════════════════════════════════ */
.view {
  display: none;
}

.view--active {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════
   SECTION COMPONENT (V2 Dense Terminal)
   ═══════════════════════════════════════════════════════════════════ */
.section {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

@media (min-width: 640px) {
  .section {
    margin-bottom: var(--space-6);
  }
}

.section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-soft);
}

.section__title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section__header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.section__action {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.section__action:hover {
  color: var(--accent-blue);
}

.section__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.section__btn:hover {
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.section__btn--text {
  width: auto;
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-size-sm);
}

.section__body {
  padding: 0;
}

.section__body--scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.section__footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-soft);
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD ROW (Tasks + Cron side by side)
   ═══════════════════════════════════════════════════════════════════ */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
  .dashboard-row {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
  }
}

.dashboard-row .section {
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   SQUAD CARDS (V2 — 140x88px Minimal)
   ═══════════════════════════════════════════════════════════════════ */
.squad-container {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  scroll-snap-type: x mandatory;
}

.squad-card {
  flex-shrink: 0;
  width: 140px;
  height: 88px;
  padding: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
  scroll-snap-align: start;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  text-align: left;
  font-family: inherit;
}

.squad-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.squad-card--active {
  border-color: var(--status-active);
}

.squad-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.squad-card__emoji {
  font-size: 16px;
  line-height: 1;
}

.squad-card__name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.squad-card__status {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.squad-card__task {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: var(--space-1);
  flex: 1;
}

.squad-card__task--empty {
  color: var(--text-muted);
}

.squad-card__cron {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════
   STATUS DOT
   ═══════════════════════════════════════════════════════════════════ */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.status-dot--active {
  background: var(--status-active);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.status-dot--busy {
  background: var(--status-busy);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.status-dot--idle {
  background: var(--status-idle);
}

.status-dot--error {
  background: var(--status-error);
  animation: pulse-error 2s ease-in-out infinite;
}

/* Project status dots (filled vs outline) */
.status-dot--project-active {
  background: var(--status-active);
}

.status-dot--project-idle {
  background: transparent;
  border: 1.5px solid var(--text-muted);
}

@keyframes pulse-error {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ═══════════════════════════════════════════════════════════════════
   TASK ROWS (V2 — 36px Dense List)
   ═══════════════════════════════════════════════════════════════════ */
.tasks-list {
  max-height: 240px; /* 6 rows × 40px */
  overflow-y: auto;
}

.task-row {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 var(--space-4);
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.task-row:hover {
  background: var(--bg-elevated);
}

.task-row:last-child {
  border-bottom: none;
}

.task-row__emoji {
  width: 20px;
  font-size: 14px;
  flex-shrink: 0;
  text-align: center;
}

.task-row__id {
  width: 60px;
  font-family: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}

.task-row__title {
  flex: 1;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.task-row__project {
  width: 100px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  display: none;
}

@media (min-width: 640px) {
  .task-row__project {
    display: block;
  }
}

.task-row__progress {
  width: 80px;
  flex-shrink: 0;
  display: none;
}

@media (min-width: 480px) {
  .task-row__progress {
    display: block;
  }
}

.task-row__percent {
  width: 40px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════════════ */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--progress-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.progress-bar--complete .progress-bar__fill,
.progress-bar__fill--complete {
  background: var(--progress-fill-complete);
}

/* Animated shimmer for active tasks */
.progress-bar--active .progress-bar__fill {
  background: linear-gradient(
    90deg,
    var(--progress-fill) 0%,
    var(--accent-blue-soft) 50%,
    var(--progress-fill) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════
   CRON ROWS (V2 — 32px Dense List)
   ═══════════════════════════════════════════════════════════════════ */
.cron-list {
  max-height: 180px; /* 5 rows × 36px */
  overflow-y: auto;
}

.cron-row {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--space-4);
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition-fast);
}

.cron-row:hover {
  background: var(--bg-elevated);
}

.cron-row:last-child {
  border-bottom: none;
}

.cron-row__emoji {
  width: 20px;
  font-size: 14px;
  flex-shrink: 0;
  text-align: center;
}

.cron-row__name {
  flex: 1;
  font-size: var(--font-size-base);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cron-row__schedule {
  width: 120px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  flex-shrink: 0;
  display: none;
}

@media (min-width: 480px) {
  .cron-row__schedule {
    display: block;
  }
}

.cron-row__next {
  width: 70px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
}

.cron-row--imminent .cron-row__next {
  color: var(--status-active);
  font-weight: var(--font-weight-medium);
}

/* ═══════════════════════════════════════════════════════════════════
   PROJECT ROWS (V2 — 36px Table Format)
   ═══════════════════════════════════════════════════════════════════ */
.projects-table-header {
  display: none;
  align-items: center;
  height: 36px;
  padding: 0 var(--space-5);
  gap: var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

@media (min-width: 768px) {
  .projects-table-header {
    display: flex;
  }
}

.projects-col {
  flex-shrink: 0;
}

.projects-col--status {
  width: 48px;
  text-align: center;
}

.projects-col--name {
  flex: 1;
  min-width: 0;
}

.projects-col--language {
  width: 100px;
}

.projects-col--stat {
  width: 48px;
  text-align: center;
}

.projects-col--activity {
  width: 80px;
  text-align: right;
}

.projects-table {
  max-height: 280px; /* 7 rows × 40px */
  overflow-y: auto;
}

.project-row {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 var(--space-5);
  gap: var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.project-row:hover {
  background: var(--bg-elevated);
}

.project-row:last-child {
  border-bottom: none;
}

.project-row__status {
  width: 48px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.project-row__name {
  flex: 1;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.project-row__language {
  width: 100px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  flex-shrink: 0;
  display: none;
}

@media (min-width: 640px) {
  .project-row__language {
    display: flex;
  }
}

.project-row__language-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.project-row__stat {
  width: 48px;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-align: center;
  flex-shrink: 0;
  display: none;
}

@media (min-width: 480px) {
  .project-row__stat {
    display: block;
  }
}

.project-row__activity {
  width: 80px;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  text-align: right;
  flex-shrink: 0;
}

/* Projects legend */
.projects-legend {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.projects-legend .status-dot {
  width: 6px;
  height: 6px;
}

/* Language dots */
.language-dot--typescript { background: var(--lang-typescript); }
.language-dot--javascript { background: var(--lang-javascript); }
.language-dot--solidity { background: var(--lang-solidity); }
.language-dot--python { background: var(--lang-python); }
.language-dot--rust { background: var(--lang-rust); }
.language-dot--go { background: var(--lang-go); }

/* ═══════════════════════════════════════════════════════════════════
   AGENTS VIEW
   ═══════════════════════════════════════════════════════════════════ */
.view-agents.view--active {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: calc(100vh - var(--header-height) - var(--footer-height) - var(--space-12));
}

@media (min-width: 768px) {
  .view-agents.view--active {
    flex-direction: row;
    gap: 0;
  }
}

/* Agents Sidebar */
.agents-sidebar {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 768px) {
  .agents-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    border-radius: 0;
    border-right: 1px solid var(--border-soft);
    border-left: none;
    border-top: none;
    border-bottom: none;
  }
}

.agents-sidebar-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-soft);
}

.agents-sidebar-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agents-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
}

.agents-sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  border-left: 2px solid transparent;
}

.agents-sidebar-item:hover {
  background: var(--bg-elevated);
}

.agents-sidebar-item--selected {
  background: var(--bg-elevated);
  border-left-color: var(--accent-blue);
}

.agents-sidebar-emoji {
  font-size: 24px;
  line-height: 1;
}

.agents-sidebar-info {
  flex: 1;
  min-width: 0;
}

.agents-sidebar-name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.agents-sidebar-meta {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.agents-sidebar-tasks {
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.agents-sidebar-footer {
  padding: var(--space-3);
  border-top: 1px solid var(--border-soft);
}

.agents-sidebar-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.agents-sidebar-add:hover {
  background: var(--bg-surface);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* Agent Detail Panel */
.agent-detail {
  flex: 1;
  background: var(--bg-base);
  overflow-y: auto;
  padding: var(--space-4);
}

@media (min-width: 768px) {
  .agent-detail {
    padding: var(--space-6);
  }
}

.agent-detail-header {
  position: sticky;
  top: 0;
  background: var(--bg-base);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border-soft);
  z-index: 10;
}

.agent-detail-identity {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.agent-detail-emoji {
  font-size: 40px;
  line-height: 1;
}

@media (min-width: 640px) {
  .agent-detail-emoji {
    font-size: 48px;
  }
}

.agent-detail-info {
  flex: 1;
}

.agent-detail-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .agent-detail-name {
    font-size: var(--font-size-2xl);
  }
}

.agent-detail-role {
  font-size: var(--font-size-base);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.agent-detail-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.agent-detail-status--active { color: var(--status-active); }
.agent-detail-status--busy { color: var(--status-busy); }
.agent-detail-status--idle { color: var(--status-idle); }

/* Detail Sections */
.agent-detail-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  overflow: hidden;
}

.agent-detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-soft);
}

.agent-detail-section-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.agent-detail-section-body {
  padding: var(--space-4);
}

/* Edit Button */
.btn-edit {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.btn-edit:hover {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

.btn-edit--active {
  background: var(--edit-highlight);
  border-color: var(--edit-border);
  color: var(--accent-blue);
}

/* Skills */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.skill-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
}

.skill-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-blue);
}

.skill-item--edit {
  border: 1px dashed var(--border-medium);
  background: var(--edit-highlight);
}

/* Soul/Personality */
.soul-content {
  font-family: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  white-space: pre-wrap;
  padding: var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  max-height: 200px;
  overflow-y: auto;
}

.soul-textarea {
  width: 100%;
  min-height: 150px;
  font-family: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: var(--edit-highlight);
  border: 1px solid var(--edit-border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  resize: vertical;
  line-height: var(--line-height-relaxed);
}

.soul-textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
}

/* Tasks List in Agent Detail */
.agent-tasks-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.task-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.task-item:hover {
  background: var(--border-soft);
}

.task-item-status {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.task-item-status--active { background: var(--status-active); }
.task-item-status--waiting { background: var(--status-waiting); }
.task-item-status--done { background: var(--status-active); }

.task-item-id {
  font-family: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  min-width: 70px;
}

.task-item-title {
  flex: 1;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

.task-item-label {
  font-size: var(--font-size-xs);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-medium);
}

.task-item-label--active {
  background: rgba(34, 197, 94, 0.1);
  color: var(--status-active);
}

.task-item-label--waiting {
  background: rgba(156, 163, 175, 0.1);
  color: var(--text-muted);
}

.task-item-label--done {
  background: rgba(34, 197, 94, 0.1);
  color: var(--status-active);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.stat-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
}

.stat-card-value {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.stat-card-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Agent Actions */
.agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent-blue);
  border: 1px solid var(--accent-blue);
  color: white;
}

.btn--primary:hover {
  background: #2563EB;
  border-color: #2563EB;
}

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

.btn--secondary:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

.btn--danger {
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
}

.btn--danger:hover {
  background: var(--error);
  color: white;
}

/* ═══════════════════════════════════════════════════════════════════
   TASKS VIEW — KANBAN
   ═══════════════════════════════════════════════════════════════════ */
.view-tasks.view--active {
  display: block;
}

.kanban-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

@media (min-width: 640px) {
  .kanban-header {
    margin-bottom: var(--space-6);
  }
}

.kanban-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

@media (min-width: 640px) {
  .kanban-title {
    font-size: var(--font-size-xl);
  }
}

.kanban-board {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  min-height: calc(100vh - var(--header-height) - var(--footer-height) - 180px);
  overflow-x: auto;
}

@media (min-width: 640px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .kanban-board {
    grid-template-columns: repeat(4, 1fr);
  }
}

.kanban-column {
  background: var(--kanban-column-bg);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  min-height: 200px;
}

@media (min-width: 1024px) {
  .kanban-column {
    min-height: 400px;
  }
}

.kanban-column-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-column-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kanban-column-count {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kanban-column-body {
  flex: 1;
  padding: var(--space-3);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.kanban-column--dragover .kanban-column-body {
  background: var(--kanban-drop-zone);
  border: 2px dashed var(--kanban-drop-border);
  border-radius: var(--radius-md);
  margin: var(--space-2);
}

/* Task Card */
.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.task-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-medium);
}

.task-card--dragging {
  opacity: 0.8;
  transform: rotate(2deg);
  box-shadow: var(--shadow-lg);
}

.task-card-drag {
  display: flex;
  justify-content: flex-start;
  color: var(--text-muted);
  cursor: grab;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  letter-spacing: 2px;
}

.task-card-drag:active {
  cursor: grabbing;
}

.task-card-id {
  font-family: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.task-card-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-card-assignee {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.task-card-progress {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.task-card-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--progress-bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.task-card-progress-fill {
  height: 100%;
  background: var(--progress-fill);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}

.task-card-progress-fill--complete {
  background: var(--progress-fill-complete);
}

.task-card-progress-text {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}

/* ═══════════════════════════════════════════════════════════════════
   PROJECTS VIEW
   ═══════════════════════════════════════════════════════════════════ */
.view-projects.view--active {
  display: block;
}

.projects-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

@media (min-width: 640px) {
  .projects-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.projects-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.projects-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

@media (min-width: 640px) {
  .projects-title {
    font-size: var(--font-size-xl);
  }
}

.projects-header-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.projects-view-toggle {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.view-toggle-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.view-toggle-btn--active {
  background: var(--bg-elevated);
  color: var(--accent-blue);
}

/* Projects Filters */
.projects-filters {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

@media (min-width: 640px) {
  .projects-filters {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
  }
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.filter-select {
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-2) center;
  transition: border-color var(--transition-fast);
}

.filter-select:hover,
.filter-select:focus {
  border-color: var(--border-medium);
  outline: none;
}

.search-group {
  position: relative;
  width: 100%;
}

@media (min-width: 640px) {
  .search-group {
    max-width: 280px;
  }
}

.search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-8);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

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

.search-input:hover,
.search-input:focus {
  border-color: var(--border-medium);
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-blue);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

/* Project Card (Projects View) */
.project-card {
  background: var(--project-card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-medium);
}

.project-card:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

.project-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.project-card-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.project-status-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.project-status-dot--active {
  background: var(--status-active);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.project-status-dot--idle {
  background: var(--status-idle);
}

.project-card-name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.project-card-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

.project-card:hover .project-card-menu {
  opacity: 1;
}

.project-card-menu:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.project-card-description {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-normal);
  margin-bottom: var(--space-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}

.project-card-language {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.language-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.language-name {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.project-card-stats {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-soft);
}

.project-stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.project-stat-icon {
  font-size: var(--font-size-xs);
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.project-agents {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.project-agent {
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.project-agent:hover {
  transform: scale(1.2);
}

.project-agents-empty {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.project-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 20px;
}

.sparkline-bar {
  width: 4px;
  min-height: 2px;
  background: var(--sparkline-color);
  border-radius: 1px;
  opacity: 0.6;
  transition: height var(--transition-fast), opacity var(--transition-fast);
}

.project-card:hover .sparkline-bar {
  opacity: 1;
}

/* Empty State */
.projects-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  max-width: 360px;
}

@media (min-width: 640px) {
  .empty-state {
    padding: var(--space-8);
  }
}

.empty-state-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.projects-no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-8);
  color: var(--text-muted);
}

.projects-no-results-icon {
  font-size: 32px;
  margin-bottom: var(--space-3);
}

.projects-no-results-text {
  font-size: var(--font-size-sm);
}

/* ═══════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-overlay--active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform var(--transition-base);
}

.modal-overlay--active .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-soft);
}

@media (min-width: 640px) {
  .modal-header {
    padding: var(--space-4) var(--space-6);
  }
}

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-4);
}

@media (min-width: 640px) {
  .modal-body {
    padding: var(--space-6);
  }
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4);
  border-top: 1px solid var(--border-soft);
}

@media (min-width: 640px) {
  .modal-footer {
    padding: var(--space-4) var(--space-6);
  }
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-4);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.form-label--required::after {
  content: '*';
  color: var(--error);
  margin-left: var(--space-1);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  font-family: inherit;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
}

.task-detail-id {
  font-family: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

.task-detail-activity {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-soft);
}

.task-detail-activity-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-3);
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.activity-item {
  display: flex;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

.activity-item-time {
  color: var(--text-muted);
  min-width: 60px;
}

/* ═══════════════════════════════════════════════════════════════════
   GLASS FOOTER
   ═══════════════════════════════════════════════════════════════════ */
.glass-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--footer-height);
  background: var(--bg-glass);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-top: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  z-index: 100;
}

@media (min-width: 640px) {
  .glass-footer {
    padding: 0 var(--space-6);
  }
}

.footer-status {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

@media (min-width: 640px) {
  .footer-status {
    gap: var(--space-4);
  }
}

.footer-status-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  .footer-status-item {
    font-size: var(--font-size-sm);
  }
}

.footer-version {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE NAVIGATION (hamburger menu)
   ═══════════════════════════════════════════════════════════════════ */
.mobile-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

@media (min-width: 768px) {
  .mobile-nav-toggle {
    display: none;
  }
}

.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-bottom: 1px solid var(--border-medium);
  padding: var(--space-4);
  z-index: 99;
}

.mobile-nav--active {
  display: block;
}

@media (min-width: 768px) {
  .mobile-nav {
    display: none !important;
  }
}

.mobile-nav-link {
  display: block;
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-2);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  text-decoration: none;
  transition: background var(--transition-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link--active {
  background: var(--bg-elevated);
}

.mobile-nav-link--active {
  color: var(--accent-blue);
}

/* ═══════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   BACKDROP-FILTER FALLBACK
   ═══════════════════════════════════════════════════════════════════ */
@supports not (backdrop-filter: blur(40px)) {
  .glass-header,
  .glass-footer,
  .mobile-nav {
    background: var(--bg-elevated);
  }
}