/* ============================================================
   Kanbang — Digital Obsidian Design System
   Based on Stitch Design System
   ============================================================ */

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

:root {
  /* Stitch Design System — Digital Obsidian */
  /* Surface Hierarchy */
  --background: #131313;
  --surface: #131313;
  --surface-container-lowest: #0e0e0e;
  --surface-container-low: #1c1b1b;
  --surface-container: #201f1f;
  --surface-container-high: #2a2a2a;
  --surface-container-highest: #353534;
  --surface-bright: #3a3939;
  --surface-variant: #353534;
  --inverse-surface: #e5e2e1;

  /* Legacy aliases (mapped to new Stitch tokens) */
  --surface-0: #131313;
  --surface-1: #1c1b1b;
  --surface-2: #201f1f;
  --surface-3: #2a2a2a;
  --surface-4: #353534;
  --surface-lowest: #0e0e0e;

  /* Text */
  --on-surface: #e5e2e1;
  --on-surface-variant: #c2c6d6;
  --text-muted: #8c909f;
  --text-dim: #5c5c66;
  --outline: #8c909f;
  --outline-variant: #424754;

  /* Primary (Blue) */
  --primary: #adc6ff;
  --primary-container: #4d8eff;
  --primary-fixed-dim: #adc6ff;
  --on-primary: #002e6a;
  --on-primary-container: #00285d;

  /* Secondary */
  --secondary: #b1c6f9;
  --secondary-container: #304671;

  /* Tertiary (Orange) */
  --tertiary: #ffb786;
  --tertiary-container: #df7412;

  /* Error */
  --error: #ffb4ab;
  --error-container: #93000a;

  /* Status Chips */
  --status-backlog: #8c909f;
  --status-backlog-bg: rgba(140, 144, 159, 0.12);
  --status-spec: #df7412;
  --status-spec-bg: rgba(223, 116, 18, 0.12);
  --status-progress: #304671;
  --status-progress-bg: rgba(48, 70, 113, 0.2);
  --status-testing: #ffb786;
  --status-testing-bg: rgba(255, 183, 134, 0.12);
  --status-deployed: #4ADE80;
  --status-deployed-bg: rgba(74, 222, 128, 0.12);

  /* Functional colors */
  --color-green: #4ADE80;
  --color-amber: #FBBF24;
  --color-red: #F87171;
  --color-blue: #60A5FA;
  --color-purple: #A78BFA;
  --color-slate: #64748B;

  /* Spacing (4px grid) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* Border radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  /* Ghost border — no-border philosophy: use sparingly */
  --ghost-border: rgba(66, 71, 84, 0.12);
  --ghost-border-hover: rgba(66, 71, 84, 0.25);

  /* Shadows — ambient style */
  --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.45);
  --shadow-ambient: 0 20px 40px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 8px 20px rgba(0, 0, 0, 0.3);

  /* Focus */
  --focus-ring: 0 0 0 2px var(--background), 0 0 0 4px var(--primary-container);

  /* Transitions */
  --transition-fast: 150ms;
  --transition-normal: 200ms;
  --transition-slow: 300ms;

  /* Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Sidebar width */
  --sidebar-w: 52px;
  --sidebar-expanded-w: 240px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: var(--on-surface);
  background: var(--background);
  overflow: hidden;
  height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

button, a, .card, .filter-btn, .sidebar-link {
  transition-timing-function: var(--ease-out);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

button:active,
.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.97);
}


/* === 2. Custom Scrollbar === */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-container-highest);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--surface-bright);
}


/* === 3. Sidebar === */
#sidebar {
  height: 100vh;
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 40;
  transition: width 250ms var(--ease-out);
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

/* Expanded state */
#sidebar:not(.collapsed) {
  width: var(--sidebar-expanded-w);
  align-items: stretch;
  padding: 28px 20px;
}

/* Collapsed state */
#sidebar.collapsed {
  width: var(--sidebar-w);
  align-items: center;
  padding: 28px 0;
}

.sidebar-top {
  margin-bottom: 48px;
}

/* Brand logo area */
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--primary);
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  padding: 0 4px;
}
.sidebar-logo:hover {
  opacity: 0.85;
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  background: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.sidebar-logo-icon svg,
.sidebar-logo-icon i {
  width: 22px;
  height: 22px;
}

/* Collapsed: only icon */
#sidebar.collapsed .sidebar-logo {
  padding: 0;
  justify-content: center;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

/* Nav links */
.sidebar-link {
  display: flex;
  flex-direction: row;
  gap: 14px;
  height: 44px;
  padding: 0 12px;
  align-items: center;
  color: #9ca3af;
  text-decoration: none;
  border-radius: var(--radius-lg);
  transition: all 200ms ease;
  border-left: 4px solid transparent;
  position: relative;
  cursor: pointer;
}
.sidebar-link i,
.sidebar-link svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.sidebar-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.sidebar-link:hover i,
.sidebar-link:hover svg {
  color: #3b82f6;
}
.sidebar-link:active {
  transform: scale(0.97);
}
.sidebar-link.active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.08);
  border-left-color: #3b82f6;
  font-weight: 600;
}
.sidebar-link.active i,
.sidebar-link.active svg {
  color: #60a5fa;
}

/* Collapsed sidebar link */
#sidebar.collapsed .sidebar-link {
  width: 40px;
  height: 40px;
  padding: 0;
  justify-content: center;
  border-left: none;
  border-radius: 10px;
}
#sidebar.collapsed .sidebar-link.active {
  border-left: none;
}

/* Sidebar label */
.sidebar-label {
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity var(--transition-normal), width var(--transition-normal);
}

#sidebar.collapsed .sidebar-label {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

#sidebar:not(.collapsed) .sidebar-label {
  opacity: 1;
  width: auto;
}

/* Sidebar project switcher */
.sidebar-project-switcher {
  padding: 0 4px;
  margin-bottom: 20px;
  position: relative;
}

#sidebar.collapsed .sidebar-project-switcher {
  display: none;
}

.sidebar-project-current {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.sidebar-project-current:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
  flex-shrink: 0;
}

.sidebar-project-name {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-project-chevron {
  width: 14px;
  color: #6b7280;
  flex-shrink: 0;
}

.sidebar-project-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface-container-highest);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 30;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 4px;
}

.sidebar-project-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: #9ca3af;
  transition: all var(--transition-fast);
}
.sidebar-project-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

/* Sidebar bottom */
.sidebar-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
}

/* Sidebar toggle */
.sidebar-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  border-radius: 10px;
  transition: all var(--transition-fast);
}
.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Collapsed toggle icon rotates */
#sidebar.collapsed .sidebar-toggle {
  transform: rotate(180deg);
}


/* === 4. Main Wrapper === */
#main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}


/* === 5. Toolbar === */
#toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 52px;
  background: rgba(19, 19, 19, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
  border-bottom: 1px solid var(--ghost-border);
  position: relative;
  z-index: 15;
}

.toolbar-left h1 {
  font-size: 14px;
  font-weight: 600;
  color: var(--on-surface);
  white-space: nowrap;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
}

.toolbar-brand {
  color: var(--on-surface);
  text-decoration: none;
  cursor: default;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 14px;
  font-weight: 500;
}

.breadcrumb-segment {
  color: var(--on-surface-variant);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.breadcrumb-segment:hover {
  color: var(--on-surface);
}
.breadcrumb-segment:last-child {
  color: #fff;
}

.breadcrumb-sep {
  color: var(--text-dim);
  margin: 0 8px;
  user-select: none;
}

/* Legacy breadcrumb support */
.breadcrumb {
  font-weight: 500;
  color: var(--on-surface-variant);
}
.breadcrumb::before {
  content: '/';
  margin: 0 8px;
  color: var(--text-muted);
}

.toolbar-center {
  flex: 1;
  max-width: 320px;
  margin: 0 16px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  pointer-events: none;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

#search {
  width: 100%;
  padding: 7px 40px 7px 34px;
  background: var(--surface-container-lowest);
  border: none;
  border-radius: var(--radius-full);
  color: var(--on-surface);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: box-shadow var(--transition-fast);
  box-shadow: 0 0 0 1px rgba(66, 71, 84, 0.2);
}
#search::placeholder { color: var(--text-muted); }
#search:focus {
  box-shadow: 0 0 0 1px rgba(173, 198, 255, 0.4);
}

.search-kbd {
  position: absolute;
  right: 8px;
  font-size: 10px;
  color: var(--text-dim);
  background: var(--surface-container-high);
  padding: 2px 5px;
  border-radius: 3px;
  font-family: inherit;
  pointer-events: none;
}

.toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toolbar-sep {
  width: 1px;
  height: 20px;
  background: var(--outline-variant);
  opacity: 0.2;
}

.view-switcher,
.density-switcher {
  display: inline-flex;
  background: var(--surface-container-lowest);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.view-switch,
.density-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.view-switch:hover,
.density-btn:hover {
  color: var(--on-surface);
}
.view-switch.active,
.density-btn.active {
  color: var(--primary);
  background: var(--surface-container-high);
}

.toolbar-icon-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.toolbar-icon-btn:hover {
  color: var(--on-surface);
  background: var(--surface-bright);
}

.toolbar-avatar {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-container);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  margin-left: var(--sp-1);
}


/* === 6. Filter System === */
.filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  background: rgba(19, 19, 19, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--ghost-border);
  min-height: 0;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 8px 0 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  background: rgba(173, 198, 255, 0.1);
  color: var(--primary);
  border: 1px solid rgba(66, 71, 84, 0.1);
}

.chip-remove {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}
.chip-remove:hover { opacity: 1; }

.filter-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.filter-clear:hover { color: var(--primary); }

.filter-popover {
  position: absolute;
  top: 52px;
  right: 20px;
  z-index: 50;
  background: var(--surface-container-highest);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-ambient);
  padding: 16px;
  width: 360px;
  border: 1px solid var(--ghost-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.filter-popover-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.filter-popover-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
}

.filter-popover-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color var(--transition-fast);
}
.filter-popover-clear:hover { color: var(--primary); }

/* Legacy filter-bar support */
#filter-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  padding: var(--sp-2) var(--sp-5);
  background: var(--surface-container-low);
  min-height: 36px;
}

.filter-group {
  margin-bottom: 12px;
}
.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--outline);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
  display: block;
}

.filter-buttons {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-lg);
  border: none;
  background: transparent;
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.filter-btn:hover {
  background: var(--surface-bright);
  color: var(--on-surface);
}
.filter-btn.active {
  background: rgba(77, 142, 255, 0.12);
  color: var(--primary);
}

.priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-high { background: var(--color-red); }
.dot-medium { background: var(--color-blue); }
.dot-low { background: var(--color-amber); }


/* === 7. Buttons === */
.btn-primary {
  height: 32px;
  padding: 0 16px;
  background: linear-gradient(135deg, #adc6ff, #4d8eff);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition-fast), box-shadow var(--transition-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 4px 16px rgba(77, 142, 255, 0.25);
}
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  height: 32px;
  padding: 0 16px;
  background: var(--surface-container-highest);
  color: var(--on-surface);
  border: none;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition-fast);
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--surface-bright); }
.btn-secondary:active { transform: scale(0.97); }

.btn-danger {
  height: 32px;
  padding: 0 16px;
  background: rgba(248, 113, 113, 0.12);
  color: var(--color-red);
  border: none;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }
.btn-danger:active { transform: scale(0.97); }

.btn-ghost {
  height: 32px;
  padding: 0 12px;
  background: none;
  color: var(--on-surface-variant);
  border: none;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost:hover {
  color: var(--on-surface);
  background: var(--surface-bright);
}


/* === 8. Board === */
#board {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  height: calc(100vh - 52px);
  overflow-x: auto;
}

/* Card density variants */
.board-compact .card {
  padding: 8px 12px;
}
.board-spacious .card {
  padding: 16px 20px;
}

.column {
  flex: 1;
  min-width: 280px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
}

.column-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-2) var(--sp-3);
  position: sticky;
  top: 0;
  z-index: 10;
}

.column-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-backlog { background: var(--status-backlog); }
.dot-spec { background: var(--tertiary-container); }
.dot-in-progress { background: var(--secondary-container); }
.dot-testing { background: var(--tertiary); }
.dot-deployed { background: var(--color-green); }

.column-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--on-surface);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}

.column-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--on-surface-variant);
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--surface-container-high);
}

.column-add-btn {
  margin-left: auto;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  opacity: 0;
}
.column:hover .column-add-btn {
  opacity: 1;
}
.column-add-btn:hover {
  color: var(--on-surface);
  background: var(--surface-bright);
}

.column-inline-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  border: 2px dashed rgba(66, 71, 84, 0.2);
  border-radius: var(--radius-xl);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  margin-top: 4px;
  background: none;
  font-family: inherit;
  opacity: 0;
  transition: opacity var(--transition-normal), border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.column:hover .column-inline-add {
  opacity: 1;
}
.column-inline-add:hover {
  border-color: rgba(77, 142, 255, 0.5);
  color: var(--primary);
  background: rgba(77, 142, 255, 0.04);
}

.column-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--text-dim);
  font-size: 12px;
}

.card-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 2px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-list::-webkit-scrollbar { width: 4px; }
.card-list::-webkit-scrollbar-track { background: transparent; }
.card-list::-webkit-scrollbar-thumb {
  background: var(--surface-container-highest);
  border-radius: 10px;
}


/* === 9. Cards === */
.card {
  background: var(--surface-container-low);
  border-radius: var(--radius-xl);
  padding: 14px 16px;
  cursor: grab;
  transition: all var(--transition-normal) var(--ease-out);
  border: 1px solid rgba(66, 71, 84, 0.1);
  position: relative;
}
.card:hover {
  background: var(--surface-container-high);
  border-color: var(--ghost-border-hover);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

/* Priority indicator — small bar on left edge */
.card::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 0;
  width: 3px;
  height: 16px;
  border-radius: 0 2px 2px 0;
}
.card-needs-spec::before {
  background: var(--color-red);
}
.card-specced::before {
  background: var(--color-amber);
}
.card-ready::before {
  background: var(--color-green);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.card-priority-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.card-id {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.4;
  color: var(--on-surface);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-excerpt {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-bottom: var(--sp-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* Card hover actions */
.card-hover-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.card:hover .card-hover-actions {
  opacity: 1;
}
.card-hover-actions button {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-container-highest);
  border: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.card-hover-actions button:hover {
  color: var(--on-surface);
  background: var(--surface-bright);
}

/* Open questions indicator on card */
.card-open-questions {
  margin-left: auto;
  color: var(--color-amber);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Acceptance criteria indicator on card */
.card-acceptance-criteria {
  color: var(--color-blue);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

/* Spec approval checkmark on card */
.card-approved {
  margin-left: auto;
  color: var(--color-green);
  font-size: 12px;
  font-weight: 700;
}

.card-open-questions + .card-approved,
.card-acceptance-criteria + .card-approved,
.card-open-questions + .card-acceptance-criteria + .card-approved {
  margin-left: 6px;
}

.card-open-questions:first-of-type { margin-left: auto; }
.card-id + .card-acceptance-criteria { margin-left: auto; }
.card-open-questions + .card-acceptance-criteria { margin-left: 6px; }

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  background: rgba(167, 139, 250, 0.1);
  color: var(--color-purple);
}

.card-spacer {
  flex: 1;
}

.card-attachment-count {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
}

.card-completeness {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.comp-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.comp-filled { background: currentColor; }
.comp-empty { border: 1px solid currentColor; background: transparent; }

.comp-label {
  margin-left: 2px;
}

.comp-level-needs-spec { color: var(--color-red); }
.comp-level-specced { color: var(--color-amber); }
.comp-level-ready { color: var(--color-green); }

/* Drag states */
.sortable-ghost {
  opacity: 0.35;
  outline: 1px dashed var(--primary-container);
  background: rgba(77, 142, 255, 0.08);
}
.sortable-chosen {
  box-shadow: var(--shadow-ambient);
  transform: rotate(1.5deg) scale(1.02);
}
.sortable-drag {
  cursor: grabbing;
}

.column.drop-target .card-list {
  background: rgba(77, 142, 255, 0.04);
  border-radius: var(--radius-xl);
}


/* === 10. Skeleton Loading === */
.skeleton {
  background: linear-gradient(90deg, var(--surface-container-high) 0%, var(--surface-bright) 50%, var(--surface-container-high) 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease infinite;
  border-radius: var(--radius-xl);
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 100px;
  margin-bottom: 6px;
}
.skeleton-project {
  height: 180px;
}


/* === 11. Empty States === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state .empty-icon {
  width: 48px;
  height: 48px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.empty-state h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--on-surface-variant);
  margin-bottom: 8px;
}
.empty-state p {
  font-size: 13px;
  max-width: 280px;
  line-height: 1.5;
  margin-bottom: 16px;
}


/* === 12. Modal === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: #1a1a1a;
  border-radius: var(--radius-xl);
  width: 90vw;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-ambient);
  padding: 0;
}

.modal-content::-webkit-scrollbar { width: 4px; }
.modal-content::-webkit-scrollbar-track { background: transparent; }
.modal-content::-webkit-scrollbar-thumb {
  background: var(--surface-container-highest);
  border-radius: 10px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}
.modal-close:hover {
  color: var(--on-surface);
  background: var(--surface-bright);
}

#modal-body {
  padding: var(--sp-6);
}

.modal-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}
.modal-header-bar h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}


/* === 13. Slide-Over Panel === */
.slide-over {
  position: fixed;
  inset: 0;
  z-index: 90;
}
.slide-over.hidden {
  display: none;
}

.slide-over-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.slide-over-content {
  position: absolute;
  top: 0;
  right: 0;
  width: min(680px, 85vw);
  height: 100vh;
  background: var(--surface-container);
  box-shadow: var(--shadow-ambient);
  overflow-y: auto;
  transform: translateX(0);
}

.slide-over-content::-webkit-scrollbar { width: 4px; }
.slide-over-content::-webkit-scrollbar-track { background: transparent; }
.slide-over-content::-webkit-scrollbar-thumb {
  background: var(--surface-container-highest);
  border-radius: 10px;
}

#panel-body {
  padding: var(--sp-6);
}


/* === 14. Command Palette === */
.cmd-palette {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
}
.cmd-palette.hidden {
  display: none;
}

.cmd-palette-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cmd-palette-dialog {
  position: relative;
  width: 560px;
  max-width: 90vw;
  background: rgba(28, 27, 27, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-ambient);
  overflow: hidden;
  border: 1px solid var(--ghost-border);
}

.cmd-palette-input-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ghost-border);
}

.cmd-palette-input-wrapper input {
  flex: 1;
  background: none;
  border: none;
  color: var(--on-surface);
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.cmd-palette-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.cmd-palette-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px;
}

.cmd-palette-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.cmd-result-group {
  margin-bottom: 8px;
}

.cmd-result-group-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px 12px 4px;
}

.cmd-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.cmd-result-item:hover,
.cmd-result-item.active {
  background: var(--surface-container-high);
}

.cmd-result-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.cmd-result-text {
  flex: 1;
  min-width: 0;
}

.cmd-result-title {
  font-size: 13px;
  color: var(--on-surface);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmd-result-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

.cmd-result-kbd {
  font-size: 10px;
  color: var(--text-dim);
  background: var(--surface-container-high);
  padding: 2px 6px;
  border-radius: 3px;
}

.cmd-palette-footer {
  display: flex;
  gap: 16px;
  padding: 10px 20px;
  border-top: 1px solid var(--ghost-border);
  font-size: 11px;
  color: var(--text-muted);
}
.cmd-palette-footer kbd {
  font-size: 10px;
  background: var(--surface-container-high);
  padding: 2px 5px;
  border-radius: 3px;
  margin-right: 4px;
  color: var(--text-dim);
  font-family: inherit;
}


/* === 15. Confirm Dialog === */
.confirm-dialog-content {
  position: relative;
  background: #1a1a1a;
  border-radius: var(--radius-xl);
  padding: 24px;
  max-width: 400px;
  width: 90vw;
  box-shadow: var(--shadow-ambient);
}
.confirm-dialog-content p {
  font-size: 14px;
  color: var(--on-surface);
  margin-bottom: 20px;
  line-height: 1.5;
}
.confirm-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}


/* === 16. Keyboard Shortcuts Help === */
.shortcuts-dialog {
  position: relative;
  background: #1a1a1a;
  border-radius: var(--radius-xl);
  padding: 24px;
  max-width: 500px;
  width: 90vw;
  box-shadow: var(--shadow-ambient);
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--surface-container-high);
  border-radius: var(--radius-md);
}
.shortcut-item kbd {
  min-width: 36px;
  text-align: center;
  font-size: 11px;
  background: var(--surface-container-lowest);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--on-surface-variant);
  font-family: inherit;
}
.shortcut-item span {
  font-size: 13px;
  color: var(--on-surface-variant);
}


/* === 17. Detail View — Two-Column Layout === */
.detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--sp-6);
  min-height: 0;
}

.detail-main {
  min-width: 0;
  overflow: hidden;
}

.detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding-left: var(--sp-5);
  border-left: 1px solid var(--ghost-border);
}

.detail-sidebar-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.detail-sidebar-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--outline);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.detail-sidebar-value {
  font-size: 13px;
  color: var(--on-surface);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* Detail header */
.detail-top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-4);
}

.detail-top-left {
  flex: 1;
  min-width: 0;
}

.detail-top-id {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}

.detail-top-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.detail-top-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--sp-2);
}

.detail-top-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: var(--sp-4);
  flex-shrink: 0;
}

.detail-top-actions .toolbar-icon-btn {
  width: 28px;
  height: 28px;
}

/* Legacy detail header */
.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-6);
  margin: 0 calc(-1 * var(--sp-6));
  margin-top: calc(-1 * var(--sp-6));
  margin-bottom: var(--sp-4);
  background: var(--surface-container-high);
  position: sticky;
  top: 0;
  z-index: 10;
}

.detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--on-surface);
  flex: 1;
  letter-spacing: -0.02em;
}

.detail-id {
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 6px;
  font-size: 16px;
}

.detail-header-left {
  flex: 1;
  min-width: 0;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: var(--sp-4);
  flex-shrink: 0;
}

.btn-delete-ghost {
  font-size: 16px;
  color: var(--text-muted) !important;
  opacity: 0.5;
  transition: all var(--transition-fast);
}
.btn-delete-ghost:hover {
  color: var(--color-red) !important;
  opacity: 1;
}

.detail-meta {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin-top: var(--sp-2);
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  text-transform: capitalize;
}
.status-backlog { background: var(--status-backlog-bg); color: var(--status-backlog); }
.status-spec { background: var(--status-spec-bg); color: var(--tertiary); }
.status-in-progress { background: var(--status-progress-bg); color: var(--secondary); }
.status-testing { background: var(--status-testing-bg); color: var(--tertiary); }
.status-deployed { background: var(--status-deployed-bg); color: var(--color-green); }

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  text-transform: capitalize;
}
.priority-high { background: rgba(248, 113, 113, 0.1); color: var(--color-red); }
.priority-medium { background: rgba(96, 165, 250, 0.1); color: var(--color-blue); }
.priority-low { background: rgba(251, 191, 36, 0.1); color: var(--color-amber); }

.approved-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  background: rgba(74, 222, 128, 0.12);
  color: var(--color-green);
}

.btn-approve {
  height: 32px;
  padding: 0 14px;
  background: rgba(74, 222, 128, 0.1);
  color: var(--color-green);
  border: none;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition-fast);
  white-space: nowrap;
}
.btn-approve:hover { background: rgba(74, 222, 128, 0.18); }

.btn-approved {
  height: 32px;
  padding: 0 14px;
  background: rgba(74, 222, 128, 0.18);
  color: var(--color-green);
  border: none;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition-fast);
  white-space: nowrap;
}
.btn-approved:hover { background: rgba(74, 222, 128, 0.1); }

.detail-dates {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--sp-1);
}

/* Spec Approval Banner */
.spec-approval-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-container-high);
  border-radius: var(--radius-xl);
  margin-top: var(--sp-4);
}

.spec-approval-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  flex-shrink: 0;
}
.spec-approval-icon.approved {
  background: rgba(74, 222, 128, 0.12);
  color: var(--color-green);
}
.spec-approval-icon.pending {
  background: rgba(251, 191, 36, 0.12);
  color: var(--color-amber);
}

.spec-approval-text {
  flex: 1;
}
.spec-approval-text strong {
  font-size: 13px;
  display: block;
  margin-bottom: 2px;
}
.spec-approval-text span {
  font-size: 11px;
  color: var(--text-muted);
}

.spec-approval-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--surface-bright);
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 200ms;
  flex-shrink: 0;
}
.spec-approval-toggle.active {
  background: var(--primary-container);
}
.spec-approval-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 200ms;
}
.spec-approval-toggle.active::after {
  transform: translateX(20px);
}

/* Write / Preview tabs */
.detail-tabs {
  display: flex;
  gap: 0;
  margin-bottom: var(--sp-4);
}

.detail-tab {
  padding: var(--sp-2) var(--sp-4);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.detail-tab:hover {
  color: var(--on-surface);
}
.detail-tab.active {
  color: var(--on-surface);
  border-bottom-color: var(--primary-container);
}

/* Rendered markdown in detail view */
.detail-body {
  line-height: 1.7;
  color: var(--on-surface-variant);
}
.detail-body h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--on-surface);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-1);
  letter-spacing: -0.02em;
}
.detail-body h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-1);
}
.detail-body p {
  margin-bottom: var(--sp-2);
}
.detail-body ul, .detail-body ol {
  margin: var(--sp-2) 0;
  padding-left: var(--sp-5);
}
.detail-body li { margin-bottom: var(--sp-1); }
.detail-body code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 5px;
  border-radius: 3px;
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.detail-body pre {
  background: var(--surface-container-lowest);
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: var(--sp-3) 0;
}
.detail-body pre code {
  background: none;
  padding: 0;
  color: var(--on-surface);
}
.detail-body blockquote {
  border-left: 3px solid var(--primary-container);
  padding-left: var(--sp-3);
  color: var(--on-surface-variant);
  margin: var(--sp-3) 0;
}
.detail-body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--sp-3) 0;
}
.detail-body th, .detail-body td {
  padding: var(--sp-2);
  text-align: left;
  font-size: 12px;
}
.detail-body th {
  background: var(--surface-container-high);
  font-weight: 600;
  color: var(--on-surface);
}
.detail-body td {
  background: var(--surface-container);
}
.detail-body img {
  max-width: 100%;
  border-radius: var(--radius-xl);
}
.detail-body input[type="checkbox"] {
  margin-right: 6px;
  accent-color: var(--primary-container);
  cursor: pointer;
  width: 15px;
  height: 15px;
  vertical-align: middle;
}
.detail-body a {
  color: var(--primary);
  text-decoration: none;
}
.detail-body a:hover { text-decoration: underline; }

/* Mermaid diagrams */
.mermaid-diagram {
  margin: var(--sp-4) 0;
  padding: var(--sp-4);
  background: var(--surface-container-high);
  border-radius: var(--radius-xl);
  overflow-x: auto;
  text-align: center;
}
.mermaid-diagram svg {
  max-width: 100%;
  height: auto;
}
.mermaid-error {
  outline: 1px solid var(--color-red) !important;
  opacity: 0.7;
}


/* === 18. Edit Form === */
.form-group {
  margin-bottom: var(--sp-4);
}
.form-group label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--outline);
  margin-bottom: var(--sp-1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-container-lowest);
  border: none;
  border-radius: var(--radius-md);
  color: var(--on-surface);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: box-shadow var(--transition-fast);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-muted); }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  box-shadow: 0 0 0 1px rgba(173, 198, 255, 0.4);
}
.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c909f' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.form-group select option {
  background: var(--surface-container-highest);
  color: var(--on-surface);
}

/* Tag picker */
.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: var(--sp-2);
  background: var(--surface-container-lowest);
  border-radius: var(--radius-md);
  min-height: 38px;
  align-items: center;
}

.tag-pick {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.tag-pick:hover {
  background: var(--surface-bright);
  color: var(--on-surface);
}
.tag-pick.selected {
  background: rgba(167, 139, 250, 0.12);
  color: var(--color-purple);
}

.tag-add {
  width: 26px;
  padding: 0;
  justify-content: center;
  font-size: 14px;
  color: var(--text-muted);
  background: transparent;
  border: 1px dashed var(--outline-variant);
}
.tag-add:hover {
  border-color: var(--primary-container);
  color: var(--primary);
}

.form-group textarea {
  min-height: 300px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}

.form-row {
  display: flex;
  gap: var(--sp-3);
}
.form-row .form-group { flex: 1; }

.form-actions {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-start;
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
}

/* Size picker in edit form */
.size-picker {
  display: flex;
  gap: var(--sp-1);
}

.size-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-width: 42px;
  padding: 0 10px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.size-pick:hover {
  background: var(--surface-bright);
  color: var(--on-surface);
}
.size-pick.selected {
  background: rgba(77, 142, 255, 0.12);
  color: var(--primary);
}

.form-group-grow { flex: 2 !important; }


/* === 19. Attachments === */
.attachments-section {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
}

.attachments-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--on-surface);
  margin-bottom: var(--sp-3);
}

.attachment-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
}

.attachment-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-container-high);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.attachment-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.attachment-name {
  flex: 1;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.attachment-name:hover { text-decoration: underline; }

.attachment-size {
  color: var(--text-muted);
  font-size: 11px;
}

.attachment-delete {
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  font-size: 16px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.attachment-delete:hover {
  color: var(--color-red);
  background: rgba(248, 113, 113, 0.08);
}

.no-attachments {
  color: var(--text-muted);
  font-size: 12px;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed rgba(66, 71, 84, 0.2);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: rgba(77, 142, 255, 0.5);
  background: rgba(77, 142, 255, 0.04);
  color: var(--primary);
}
.upload-zone input[type="file"] { display: none; }


/* === 20. Release Notes === */
.release-notes { line-height: 1.7; color: var(--on-surface-variant); }
.release-notes h2 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: var(--sp-3);
  color: var(--on-surface);
  letter-spacing: -0.02em;
}
.release-notes h3 {
  font-size: 13px;
  font-weight: 600;
  margin-top: var(--sp-4);
  margin-bottom: var(--sp-1);
  color: var(--on-surface);
}


/* === 21. Dashboard === */
.dashboard {
  padding: var(--sp-8) var(--sp-6);
  max-width: 1100px;
  margin: 0 auto;
  overflow-y: auto;
  height: calc(100vh - 52px);
}

.dashboard-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: var(--sp-1);
  letter-spacing: -0.02em;
}

.dashboard-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--sp-6);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
  align-content: start;
}

.dashboard-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--sp-8) 0;
  color: var(--text-muted);
}
.dashboard-empty h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--on-surface-variant);
  margin-bottom: var(--sp-2);
}


/* === 22. Project Cards === */
.project-card {
  background: var(--surface-container-high);
  border-radius: var(--radius-xl);
  padding: var(--sp-6);
  cursor: pointer;
  transition: all var(--transition-normal) var(--ease-out);
  min-height: 220px;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  background: var(--surface-bright);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

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

.project-card-module {
  font-size: 10px;
  font-weight: 600;
  color: var(--outline);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.project-card-updated {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

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

.project-card-settings {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}
.project-card:hover .project-card-settings { opacity: 1; }
.project-card-settings:hover { color: var(--on-surface); background: var(--surface-container); }

.project-card-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--on-surface);
  letter-spacing: -0.01em;
}

.project-card-slug {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-container);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.project-card-desc {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-bottom: var(--sp-3);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-badges {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.project-card-stats {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-3);
}

.project-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.project-stat svg {
  opacity: 0.6;
}
.project-stat-count {
  font-weight: 600;
  color: var(--on-surface);
}

/* Status bar on project cards */
.project-card-bar {
  margin-top: auto;
}

.status-bar {
  display: flex;
  height: 6px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--surface-container-lowest);
}

.status-segment {
  height: 100%;
  transition: width 300ms;
}
.seg-backlog { background: var(--status-backlog); }
.seg-spec { background: var(--tertiary-container); }
.seg-in-progress { background: var(--secondary-container); }
.seg-testing { background: var(--tertiary); }
.seg-deployed { background: var(--color-green); }
.seg-empty { background: transparent; }

/* New Project card */
.project-card-new {
  background: transparent;
  border: 2px dashed rgba(66, 71, 84, 0.2);
  border-radius: var(--radius-xl);
  padding: var(--sp-5);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 220px;
  transition: all var(--transition-fast);
  color: var(--text-muted);
}
.project-card-new:hover {
  border-color: rgba(77, 142, 255, 0.5);
  color: var(--primary);
  background: rgba(77, 142, 255, 0.04);
}
.project-card-new svg {
  opacity: 0.5;
}
.project-card-new:hover svg {
  opacity: 1;
}
.project-card-new span {
  font-size: 13px;
  font-weight: 500;
}


/* === 23. Module Badge, Size Badge === */
.module-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: color-mix(in srgb, var(--module-color, var(--primary-container)) 12%, transparent);
  color: var(--module-color, var(--primary));
}

.module-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 2px;
  flex-shrink: 0;
}

.size-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.size-S {
  color: var(--color-green);
  background: rgba(74, 222, 128, 0.08);
}
.size-M {
  color: var(--color-blue);
  background: rgba(96, 165, 250, 0.08);
}
.size-L {
  color: var(--color-amber);
  background: rgba(251, 191, 36, 0.08);
}
.size-XL {
  color: var(--color-red);
  background: rgba(248, 113, 113, 0.08);
}


/* === 24. Entity Panels (Initiatives, Sprints, Releases) === */
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.entity-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  max-height: 60vh;
  overflow-y: auto;
  padding: var(--sp-2) 0;
}

.entity-group-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--outline);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-2);
}

.entity-card {
  background: var(--surface-container-high);
  border-radius: var(--radius-xl);
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  transition: background var(--transition-fast);
  margin-bottom: var(--sp-1);
}
.entity-card:hover {
  background: var(--surface-bright);
}

.entity-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}

.entity-card-title {
  font-weight: 500;
  font-size: 13px;
  color: var(--on-surface);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-card-desc {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-bottom: var(--sp-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.entity-card-footer {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.entity-card-count {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.entity-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Entity detail sections */
.entity-detail-desc {
  font-size: 13px;
  color: var(--on-surface-variant);
  line-height: 1.5;
  margin: var(--sp-3) 0;
}

.entity-progress-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: var(--sp-4) 0;
  padding: var(--sp-4);
  background: var(--surface-container-low);
  border-radius: var(--radius-2xl);
}

.entity-detail-dates {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: var(--sp-3);
}

/* Panel empty state */
.panel-empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--text-muted);
  font-size: 13px;
}

/* Initiative status badges */
.status-init-planned { background: var(--status-backlog-bg); color: var(--status-backlog); }
.status-init-active { background: var(--status-progress-bg); color: var(--secondary); }
.status-init-completed { background: var(--status-deployed-bg); color: var(--color-green); }
.status-init-cancelled { background: rgba(248, 113, 113, 0.12); color: var(--color-red); }

/* Sprint status badges */
.status-sprint-planned { background: var(--status-backlog-bg); color: var(--status-backlog); }
.status-sprint-active { background: var(--status-progress-bg); color: var(--secondary); }
.status-sprint-completed { background: var(--status-deployed-bg); color: var(--color-green); }

/* Form hint */
.form-hint {
  font-size: 12px;
  color: var(--on-surface-variant);
  margin-bottom: var(--sp-4);
}

/* Release task list */
.release-tasks {
  margin-top: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.release-task-item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-container-high);
  border-radius: var(--radius-md);
}

.release-task-title {
  font-size: 13px;
  color: var(--on-surface);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* === 25. Progress bars === */
.progress-bar {
  flex: 1;
  height: 4px;
  background: var(--surface-container-lowest);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-lg {
  height: 6px;
  border-radius: var(--radius-full);
}
.progress-fill {
  height: 100%;
  background: var(--primary-container);
  border-radius: inherit;
  transition: width 300ms ease;
}


/* === 26. Token Tracking === */
.card-token-count {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--color-purple);
  opacity: 0.8;
}

.token-summary {
  margin-top: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-container-high);
  border-radius: var(--radius-xl);
}

.token-headline {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12px;
  color: var(--on-surface-variant);
}

.token-icon {
  color: var(--color-purple);
  font-size: 14px;
}

.token-headline strong {
  color: var(--on-surface);
}

.token-split {
  opacity: 0.7;
}

.token-cost {
  margin-left: auto;
  color: var(--color-amber);
  font-size: 11px;
}

.token-details {
  margin-top: var(--sp-2);
}

.token-details summary {
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.token-details summary:hover {
  color: var(--on-surface-variant);
}

.token-table {
  width: 100%;
  margin-top: var(--sp-2);
  font-size: 11px;
  border-collapse: collapse;
}

.token-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  padding: var(--sp-1) var(--sp-2);
}

.token-table td {
  padding: var(--sp-1) var(--sp-2);
  color: var(--on-surface-variant);
}


/* === 27. Settings === */
.settings-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.settings-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--on-surface);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.settings-subtitle {
  color: var(--text-muted);
  font-size: 13px;
}

.settings-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--outline-variant);
}

.settings-tab {
  padding: 10px 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
}
.settings-tab:hover {
  color: var(--on-surface-variant);
}
.settings-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary-container);
}

.settings-section {
  background: var(--surface-container);
  padding: 28px;
  border-radius: var(--radius-xl);
  margin-bottom: 24px;
}

.settings-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.settings-section-header h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-surface);
}

.settings-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--outline);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.settings-field input,
.settings-field select {
  width: 100%;
  background: var(--surface-container-lowest);
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  padding: 10px 14px;
  color: var(--on-surface);
  outline: none;
  font-family: inherit;
}

.settings-field-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--outline);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  background: var(--surface-container-low);
  border-radius: var(--radius-md);
}

.settings-toggle-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
}

.settings-toggle-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.toggle-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.toggle-label input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.settings-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  background: var(--surface-container-low);
  border-radius: var(--radius-md);
}
.settings-info-icon {
  flex-shrink: 0;
}
.settings-info-row > div:nth-child(2) {
  flex: 1;
}

.settings-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.badge-active {
  background: rgba(74, 222, 128, 0.12);
  color: var(--color-green);
}

.settings-info-box {
  margin-top: 16px;
  padding: 16px;
  background: rgba(77, 142, 255, 0.06);
  border: 1px solid rgba(173, 198, 255, 0.08);
  border-radius: var(--radius-md);
  display: flex;
  gap: 10px;
}
.settings-info-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
}
.settings-info-text {
  font-size: 11px;
  color: rgba(173, 198, 255, 0.7);
  line-height: 1.6;
}
.settings-info-text code {
  background: var(--surface-container-high);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
}

/* Settings toggle switch */
.settings-toggle {
  width: 36px;
  height: 20px;
  background: var(--surface-container-high);
  border-radius: 10px;
  position: relative;
  transition: background 200ms;
}
.settings-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 200ms, background 200ms;
}
input:checked + .settings-toggle {
  background: var(--primary-container);
}
input:checked + .settings-toggle::after {
  transform: translateX(16px);
  background: var(--on-surface);
}

/* Settings theme cards */
.settings-theme-card {
  cursor: pointer;
  padding: 10px;
  border-radius: var(--radius-xl);
  border: 2px solid transparent;
  transition: border-color 200ms;
}
.settings-theme-card:hover {
  border-color: var(--outline-variant);
}
.settings-theme-card.active {
  border-color: var(--primary-container);
}

/* Settings size buttons */
.settings-size-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.settings-size-btn:hover {
  background: var(--surface-bright) !important;
}
.settings-size-btn.active {
  background: var(--primary-container) !important;
  color: var(--on-surface) !important;
  font-weight: 600;
}

/* Theme preview */
.theme-preview {
  aspect-ratio: 16/10;
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--outline-variant);
}
.theme-preview-bar {
  height: 6px;
  width: 50%;
  border-radius: 3px;
}
.theme-preview-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  flex: 1;
}
.theme-preview-cols div {
  border-radius: 3px;
}
.theme-preview-dark {
  background: #0e0e0e;
}
.theme-preview-dark .theme-preview-bar {
  background: var(--surface-container-high);
}
.theme-preview-dark .theme-preview-cols div:nth-child(1) { background: var(--surface-container-low); }
.theme-preview-dark .theme-preview-cols div:nth-child(2) { background: var(--surface-container-high); }
.theme-preview-dark .theme-preview-cols div:nth-child(3) { background: var(--surface-container-low); }

.theme-preview-midnight {
  background: #0a0a1a;
}
.theme-preview-midnight .theme-preview-bar {
  background: #1a1a3a;
}
.theme-preview-midnight .theme-preview-cols div:nth-child(1) { background: #12122a; }
.theme-preview-midnight .theme-preview-cols div:nth-child(2) { background: #1a1a3a; }
.theme-preview-midnight .theme-preview-cols div:nth-child(3) { background: #12122a; }

.theme-preview-light {
  background: #f5f5f5;
}
.theme-preview-light .theme-preview-bar {
  background: #e0e0e0;
}
.theme-preview-light .theme-preview-cols div:nth-child(1) { background: #eee; }
.theme-preview-light .theme-preview-cols div:nth-child(2) { background: #ddd; }
.theme-preview-light .theme-preview-cols div:nth-child(3) { background: #eee; }

.theme-label {
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  margin-top: 8px;
  color: var(--on-surface);
}

.settings-panel { }


/* === 28. Responsive === */
@media (max-width: 768px) {
  #sidebar { display: none; }
  #board {
    flex-direction: column;
    height: calc(100vh - 52px);
  }
  .column { max-width: 100%; min-width: 100%; }
  #toolbar, #filter-bar {
    flex-wrap: wrap;
    height: auto;
    padding: var(--sp-3);
    gap: var(--sp-2);
  }
  .toolbar-center { max-width: 100%; width: 100%; order: 3; margin: 0; }
  #filter-bar { flex-direction: column; align-items: flex-start; }
  .detail-layout { grid-template-columns: 1fr; }
  .detail-sidebar { border-left: none; padding-left: 0; padding-top: var(--sp-4); }
  .dashboard {
    height: calc(100vh - 52px);
  }
}

/* In collapsed sidebar, hide project switcher */
#sidebar.collapsed #sidebar-project-switcher {
  display: none;
}


/* === 29. Hidden utility === */
.hidden { display: none !important; }


/* === 30. Notyf Customization === */
.notyf__toast {
  border-radius: var(--radius-xl) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
}


/* === 31. Lucide icon base === */
.lucide {
  display: inline-block;
  vertical-align: middle;
}


/* === 32. Icon size utilities === */
.icon-sm {
  width: 14px;
  height: 14px;
}
.icon-md {
  width: 18px;
  height: 18px;
}


/* === 33. Settings view layout === */
.settings-view {
  height: calc(100vh - 52px);
  overflow-y: auto;
  padding: 40px;
}

.settings-container {
  max-width: 800px;
  margin: 0 auto;
}

.settings-header {
  margin-bottom: 40px;
}

.settings-section-icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.settings-icon-secondary {
  color: var(--secondary);
}

.settings-icon-muted {
  color: var(--text-muted);
}

.settings-info-box-icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
}

.settings-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.settings-size-group {
  display: flex;
  gap: 8px;
}

.settings-breadcrumb-sep {
  color: var(--text-muted);
  flex-shrink: 0;
}

.settings-breadcrumb-active {
  color: var(--primary);
}

.settings-theme-card.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.theme-label-muted {
  color: var(--text-muted);
}


/* === 34. Sidebar logo text === */
.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-normal), width var(--transition-normal);
}

.sidebar-logo-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
}

.sidebar-logo-subtitle {
  font-size: 9px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-top: 2px;
}

#sidebar.collapsed .sidebar-logo-text {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

#sidebar:not(.collapsed) .sidebar-logo-text {
  opacity: 1;
  width: auto;
}

#sidebar:not(.collapsed) .sidebar-logo {
  width: auto;
}


/* === 35. Deploy info bar === */
.deploy-info-bar {
  position: fixed;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  color: var(--text-dim);
  background: rgba(19, 19, 19, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  z-index: 50;
  pointer-events: none;
  white-space: nowrap;
}


/* === 36. Command palette search icon === */
.cmd-palette-search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}


/* === 37. Task detail full-page view === */
#task-detail {
  height: calc(100vh - 52px);
  overflow-y: auto;
  background: var(--background);
}


/* === 38. Roadmap detail side panel (Stitch Digital Obsidian) === */
.roadmap-detail-panel {
  width: 440px;
  height: 100%;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(20px);
  background: rgba(28, 27, 27, 0.6);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.4);
}

.roadmap-detail-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.roadmap-detail-body {
  flex: 1;
  overflow-y: auto;
}

.roadmap-detail-panel .rd-status-badge {
  font-size: 9px;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.roadmap-detail-panel .rd-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 8px;
}

.roadmap-detail-panel .rd-meta {
  font-size: 10px;
  color: #8c909f;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}

.roadmap-detail-panel .rd-description {
  font-size: 12px;
  color: var(--on-surface-variant);
  line-height: 1.6;
  margin: 16px 0;
}

.roadmap-detail-panel .rd-progress-card {
  padding: 16px;
  background: rgba(19, 19, 19, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.roadmap-detail-panel .rd-progress-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #8c909f;
}

.roadmap-detail-panel .rd-progress-value {
  font-size: 13px;
  font-weight: 900;
  color: #fff;
}

.roadmap-detail-panel .rd-progress-bar {
  height: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 10px;
}

.roadmap-detail-panel .rd-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: #3b82f6;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.roadmap-detail-panel .rd-section-title {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #fff;
  margin-bottom: 16px;
}

.roadmap-detail-panel .rd-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(14, 14, 14, 0.6);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.roadmap-detail-panel .rd-task-item:hover {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(42, 42, 42, 0.6);
  transform: translateX(2px);
}

.roadmap-detail-panel .rd-task-item.done {
  opacity: 0.4;
}

.roadmap-detail-panel .rd-task-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--on-surface-variant);
}

.roadmap-detail-panel .rd-task-item.done .rd-task-title {
  text-decoration: line-through;
}

.roadmap-detail-panel .rd-task-status {
  font-size: 9px;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.roadmap-detail-panel .rd-bar {
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  margin-top: 8px;
}

.roadmap-detail-panel .rd-bar.active {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.roadmap-detail-panel .rd-bar.planned {
  background: var(--surface-container-highest);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--on-surface-variant);
}

.roadmap-detail-panel .rd-bar.completed {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

.roadmap-detail-panel .rd-details-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.roadmap-detail-panel .rd-details-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8c909f;
}

.roadmap-detail-panel .rd-details-value {
  font-size: 12px;
  font-weight: 500;
  color: #e5e2e1;
}

.roadmap-detail-panel .rd-btn-close {
  color: #8c909f;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.roadmap-detail-panel .rd-btn-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.roadmap-detail-panel .rd-btn-edit {
  font-size: 10px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.05);
  color: #e5e2e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.15s ease;
}

.roadmap-detail-panel .rd-btn-edit:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
}
