:root {
  /* Dark theme (Modo Terminal) - default */
  --bg-primary: #0F172A;
  --bg-secondary: #1a2332;
  --bg-tertiary: #1E293B;
  --bg-card: #1E293B;
  --bg-card-hover: #273549;
  --bg-surface: #1E293B;
  --bg-input: #1a2332;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --accent: #2563EB;
  --accent-dim: rgba(37, 99, 235, 0.12);
  --accent-hover: #1d4ed8;
  --accent-amber: #F59E0B;
  --accent-amber-dim: rgba(245, 158, 11, 0.12);
  --accent-green: #10B981;
  --accent-green-dim: rgba(16, 185, 129, 0.12);
  --accent-red: #EF4444;
  --accent-red-dim: rgba(239, 68, 68, 0.12);
  --accent-purple: #8B5CF6;
  --accent-purple-dim: rgba(139, 92, 246, 0.12);
  --border-default: #334155;
  --border-light: #475569;
  --shadow-card: none;
  --shadow-card-hover: none;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --font-heading: 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --theme-transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

[data-theme="light"] {
  --bg-primary: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --bg-tertiary: #E2E8F0;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-input: #FFFFFF;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --accent: #2563EB;
  --accent-dim: rgba(37, 99, 235, 0.08);
  --accent-hover: #1d4ed8;
  --accent-amber: #D97706;
  --accent-amber-dim: rgba(217, 119, 6, 0.08);
  --accent-green: #059669;
  --accent-green-dim: rgba(5, 150, 105, 0.08);
  --accent-red: #DC2626;
  --accent-red-dim: rgba(220, 38, 38, 0.08);
  --accent-purple: #7C3AED;
  --accent-purple-dim: rgba(124, 58, 237, 0.08);
  --border-default: #E2E8F0;
  --border-light: #CBD5E1;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-card-hover: 0 2px 8px rgba(0,0,0,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: var(--theme-transition);
}

body {
  overflow: hidden;
}

#login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  background: var(--bg-primary);
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}

.login-brand .logo-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
}

.login-brand h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.login-brand h1 .ff-bold { font-weight: 800; color: var(--accent); }
.login-brand h1 .ff-light { font-weight: 300; color: var(--text-secondary); }

.login-brand .tagline {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
  font-family: var(--font-mono);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.login-card h2 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.login-card .subtitle {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group textarea { resize: vertical; min-height: 120px; font-family: var(--font-body); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  border-color: var(--accent-red-dim);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon { padding: 6px 10px; font-size: 16px; }

.login-btn { margin-top: 4px; }

.role-select {
  margin-bottom: 18px;
}

.demo-hint {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 16px;
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-default);
  flex-shrink: 0;
  z-index: 100;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-brand {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}
.topbar-brand .ff-bold { font-weight: 800; color: var(--accent); }
.topbar-brand .ff-light { font-weight: 300; }

.menu-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s;
}
.menu-toggle:hover { border-color: var(--accent); color: var(--accent); }

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

.theme-toggle-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 15px;
  transition: all 0.15s;
}
.theme-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }

.lang-toggle {
  display: flex;
  gap: 1px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.lang-btn {
  padding: 3px 8px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
}
.lang-btn.active { background: var(--accent); color: #fff; }
.lang-btn:hover:not(.active) { color: var(--text-primary); }

.user-menu {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 8px 3px 3px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: default;
  font-size: 12px;
}

.user-menu .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-heading);
}

.user-menu .user-role-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
}

.logout-btn {
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.logout-btn:hover { border-color: var(--accent-red); color: var(--accent-red); }

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-default);
  padding: 12px 0;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 16px;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  padding: 0 4px;
  font-family: var(--font-mono);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.1s;
  margin-bottom: 1px;
  font-weight: 500;
}

.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }

.nav-item .nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.nav-project {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.1s;
  margin-bottom: 1px;
}

.nav-project:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-project.active { background: var(--bg-tertiary); color: var(--accent); font-weight: 600; }

.nav-project .project-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}
.nav-project .project-dot::after {
  content: attr(title);
  position: absolute;
  left: 16px;
  top: -3px;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 600;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}
.nav-project .project-dot:hover::after {
  opacity: 1;
}
.status-active { background: #06B6D4; }
.status-planning { background: #F59E0B; }
.status-review { background: #D946EF; }
.status-done { background: #10B981; }
.status-on_hold { background: #6B7280; }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--bg-primary);
}

.page-header {
  margin-bottom: 20px;
}

.page-header h1 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.page-header .page-subtitle {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
}

/* ===== FOOTER ===== */
.app-footer {
  padding: 6px 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border-default);
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.app-footer a { color: var(--accent); font-weight: 500; }

/* ===== METRIC CARDS ===== */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  transition: all 0.15s;
}
.metric-card:hover { box-shadow: var(--shadow-card-hover); }

.metric-card .metric-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.metric-card .metric-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-card .metric-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.metric-warn .metric-value { color: var(--accent-amber); }
.metric-success .metric-value { color: var(--accent-green); }
.metric-danger .metric-value { color: var(--accent-red); }

/* ===== PORTFOLIO / PROJECT CARDS ===== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  column-gap: 12px;
  row-gap: 24px;
}

.portfolio-section {
  margin-bottom: 24px;
}

.portfolio-section h2 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-card);
}

.project-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--accent);
}

.card-cover {
  height: 100px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 14px;
}

.card-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--cover);
  background-size: cover;
  background-position: var(--cover-pos, center);
  transform: scale(1);
}

.card-cover:hover::before {
  animation: ken-burns 8s ease-in-out infinite alternate;
}

@keyframes ken-burns {
  to { transform: scale(1.15); }
}

.project-cover {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 20px;
  margin-bottom: 20px;
}

.project-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--cover);
  background-size: cover;
  background-position: var(--cover-pos, center);
  z-index: 0;
  transition: transform 2.5s;
}

.project-cover {
  cursor: grab;
}

.project-cover.dragging {
  cursor: grabbing;
}

.project-cover:hover::before {
  transform: scale(1.1);
}

.card-cover > *, .project-cover > * {
  position: relative;
  z-index: 1;
}

.card-cover .card-status-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 3px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  color: #fff;
  font-family: var(--font-mono);
}

.card-cover .card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 550;
  letter-spacing: -0.3px;
  color: #fff;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  padding: 1px 10px;
  border-radius: 3px;
}

.card-body {
  padding: 14px;
}

.card-body .card-meta {
  display: flex;
  gap: 14px;
  margin-bottom: 10px;
}

.card-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  color: var(--text-muted);
}

.card-meta-item .meta-value {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-meta-item .meta-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
}

.card-body .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-default);
}

.card-due {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.card-due.overdue { color: var(--accent-red); }

.avatar-stack { display: flex; }
.avatar-stack .avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  margin-left: -6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  font-family: var(--font-heading);
}
.avatar-stack .avatar-sm:first-child { margin-left: 0; }

/* ===== KANBAN BOARD ===== */
.kanban-board {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  height: calc(100vh - 230px);
}

.kanban-column {
  min-width: 270px;
  flex: 1;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
}

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

.kanban-column-title {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-primary);
}

.kanban-column-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 1px 7px;
  border-radius: 8px;
  font-family: var(--font-mono);
}

.kanban-cards {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.kanban-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-card-hover);
}

.kanban-card .card-priority {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
}

.priority-critical { background: var(--accent-red-dim); color: var(--accent-red); }
.priority-high { background: var(--accent-amber-dim); color: var(--accent-amber); }
.priority-medium { background: var(--accent-dim); color: var(--accent); }
.priority-low { background: var(--bg-tertiary); color: var(--text-muted); }

.kanban-card .spec-type-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 6px;
  margin-left: 4px;
  font-family: var(--font-mono);
}

.type-feature { background: rgba(56,189,248,0.15); color: #38BDF8; }
.type-bug { background: rgba(239,68,68,0.15); color: #EF4444; }
.type-chore { background: rgba(168,85,247,0.15); color: #A855F7; }
.type-research { background: rgba(34,197,94,0.15); color: #22C55E; }
.type-docs { background: rgba(148,163,184,0.15); color: #94A3B8; }
.type-improvement { background: rgba(251,191,36,0.15); color: #FBBF24; }
.type-epic { background: rgba(249,115,22,0.2); color: #F97316; }

.kanban-card .card-title-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.kanban-card .card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  gap: 6px;
}

.kanban-card .card-points {
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.kanban-card .avatar-img {
  width: 32px;
  height: 32px;
  margin-right: 8px;
  margin-bottom: 8px;
}

.kanban-card .card-type {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--accent);
  font-family: var(--font-mono);
}

.kanban-attachments {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.kanban-attachment {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  padding: 2px 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.badge-blocked {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  color: var(--accent-red);
  background: var(--accent-red-dim);
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.card-id {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.7;
}

.kanban-card-ghost {
  opacity: 0.4;
  background: var(--accent-dim);
}

.kanban-card-drag {
  opacity: 0.8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transform: rotate(2deg);
}

/* --- Locked card (needs review) --- */
.kanban-card-locked {
  opacity: 0.7;
  pointer-events: auto;
  cursor: default;
}
.kanban-card-locked .card-lock-icon {
  color: var(--accent-amber, #FBBF24);
  font-size: 11px;
  margin-left: auto;
}
.btn-approve {
  background: var(--accent-green-dim, rgba(52, 211, 153, 0.15));
  color: var(--accent-green, #34D399);
  border: 1px solid var(--accent-green, #34D399);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-approve:hover {
  background: var(--accent-green, #34D399);
  color: #fff;
}

/* ===== WIP BADGE ===== */
.wip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-sans);
  white-space: nowrap;
  transition: all 0.2s ease;
  vertical-align: middle;
}
.wip-badge-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  opacity: 0.85;
}
.wip-badge-ratio {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
}
.wip-badge-green  { background: rgba(52,211,153,0.15); color: #34D399; }
.wip-badge-amber  { background: rgba(251,191,36,0.15); color: #F59E0B; }
.wip-badge-orange { background: rgba(249,115,22,0.15); color: #F97316; }
.wip-badge-red    { background: rgba(248,113,113,0.15); color: #F87171; }

.wip-banner {
  background: var(--accent-red-dim);
  color: var(--accent-red);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  text-align: center;
  font-family: var(--font-mono);
}

/* ===== PEOPLE FILTERS ===== */
.people-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.filter-select {
  padding: 6px 32px 6px 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-input, var(--bg-card));
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  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 12 12'%3E%3Cpath fill='%236B7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-width: 160px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* ===== PEOPLE ===== */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.person-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 14px;
  box-shadow: var(--shadow-card);
  transition: all 0.15s;
}
.person-card:hover { box-shadow: var(--shadow-card-hover); }

.person-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  font-family: var(--font-heading);
}

.person-details { flex: 1; min-width: 0; }

.person-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.person-role-text {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
}

.person-metrics {
  display: flex;
  gap: 18px;
  margin-bottom: 10px;
}

.person-metric { display: flex; flex-direction: column; }

.person-metric .met-value {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
}

.person-metric .met-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
}

.capacity-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 3px;
}

.capacity-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}
.capacity-fill.low { background: var(--accent-green); }
.capacity-fill.medium { background: var(--accent-amber); }
.capacity-fill.high { background: var(--accent-red); }

.person-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.person-project-tag {
  font-size: 10px;
  padding: 2px 7px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ===== CLIENTS ===== */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: all 0.15s;
}
.client-card:hover { box-shadow: var(--shadow-card-hover); border-color: var(--accent); }

.client-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.client-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--accent-purple);
  font-family: var(--font-heading);
}

.client-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
}

.client-company {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.client-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
}

.client-stat .stat-value {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
}

.client-stat .stat-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
}

.client-projects-list {
  display: flex;
  gap: 6px;
}

.client-project-tag {
  font-size: 10px;
  padding: 3px 8px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.1s;
  font-family: var(--font-mono);
}
.client-project-tag:hover { background: var(--accent-dim); color: var(--accent); }

/* ===== SPEC FORM ===== */
.spec-editor { max-width: 720px; }

.spec-editor .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.file-upload-area {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 14px;
}
.file-upload-area:hover { border-color: var(--accent); background: var(--accent-dim); }

.file-upload-area .upload-icon { font-size: 20px; margin-bottom: 4px; }
.file-upload-area .upload-text { font-size: 12px; color: var(--text-muted); }
.file-upload-area .upload-hint { font-size: 10px; color: var(--text-muted); margin-top: 2px; font-family: var(--font-mono); }

.file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

.file-chip .remove-file {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
}
.file-chip .remove-file:hover { color: var(--accent-red); }

.voice-recorder {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.voice-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.voice-btn:hover { border-color: var(--accent-red); color: var(--accent-red); }
.voice-btn.recording {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: var(--accent-red-dim);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

.voice-status {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.ai-preview {
  margin-top: 14px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.ai-preview-header {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-purple);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.ai-preview-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

.success-message {
  padding: 12px 16px;
  background: var(--accent-green-dim);
  border: 1px solid rgba(16,185,129,0.25);
  border-radius: var(--radius-md);
  color: var(--accent-green);
  font-size: 12px;
  margin-top: 14px;
  font-weight: 500;
}

/* ===== REPORTS ===== */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 12px;
}

.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.report-card.glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .report-card.glass {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(148, 163, 184, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 1px 4px rgba(0, 0, 0, 0.12);
}

.chart-wrap {
  position: relative;
  min-height: 200px;
}

.chart-wrap canvas {
  width: 100% !important;
}

.chart-wrap-donut {
  max-height: 265px;
  margin: 0 auto;
}

.chart-wrap-donut canvas {
  max-height: 265px !important;
}

.report-card h3 {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 100px;
  padding: 0 3px;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.bar-value {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
  font-family: var(--font-mono);
}

.bar {
  width: 100%;
  max-width: 36px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  transition: height 0.3s;
}
.bar.alt { background: var(--accent-amber); }

.bar-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
}

.blockers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.blocker-item {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-red);
  font-size: 12px;
}

.blocker-reason { color: var(--text-primary); flex: 1; }
.blocker-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: var(--font-mono);
}

/* ===== SPEC LIST ===== */
.spec-list { display: flex; flex-direction: column; gap: 6px; }

.spec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  transition: all 0.1s;
}
.spec-item:hover { border-color: var(--border-light); }

.spec-item .spec-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.spec-status-dot.done { background: var(--accent-green); }
.spec-status-dot.in_progress { background: var(--accent-amber); }
.spec-status-dot.review, .spec-status-dot.spec_ready { background: var(--accent); }
.spec-status-dot.backlog { background: var(--text-muted); }

.spec-item .spec-item-title { flex: 1; font-size: 12px; color: var(--text-primary); font-weight: 500; }

.spec-item .spec-item-priority {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
}

.spec-item .spec-item-source {
  font-size: 9px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
}

/* ===== PROFILE ===== */
.user-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}
.user-profile-link:hover {
  text-decoration: none;
  color: var(--accent);
}

.avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.profile-card {
  max-width: 520px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.profile-photo-section {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar .avatar-initials {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-heading);
}

.photo-hint {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.profile-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.profile-fields .form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 4px;
  font-family: var(--font-mono);
}
.profile-fields .form-group input[type="text"],
.profile-fields .form-group input[type="email"],
.profile-fields .form-group input[type="number"],
.profile-fields .form-group input[type="date"],
.profile-fields .form-group select {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  font-family: var(--font-body);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}

.form-group-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-group-inline label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.form-group-inline input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.field-error {
  display: block;
  font-size: 11px;
  color: var(--accent-red);
  margin-top: 2px;
}

.profile-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

/* ===== ACTIVITY LOGS ===== */
.modal-logs {
  max-width: 560px;
  max-height: 70vh;
}
.logs-header {
  margin-bottom: 12px;
}
.logs-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border-default);
  font-size: 11px;
}
.log-entry {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  background: var(--bg-card);
  font-size: 11px;
  border-left: 3px solid transparent;
}
.log-entry.log-moved { border-left-color: var(--accent); }
.log-entry.log-field-position { border-left-color: var(--accent-amber); }
.log-entry.log-field-blocker { border-left-color: var(--accent-red); }
.log-entry.log-updated:not(.log-field-position):not(.log-field-blocker) { border-left-color: var(--accent-green); }
.log-meta {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.log-user {
  font-weight: 600;
  color: var(--text-secondary);
}
.log-action {
  color: var(--text-primary);
  line-height: 1.4;
}
.log-values {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding-left: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
}
.log-arrow {
  color: var(--text-muted);
  font-size: 12px;
}
.log-old {
  color: var(--accent-red);
  text-decoration: line-through;
  opacity: 0.7;
}
.log-new {
  color: var(--accent-green);
}
.logs-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}
.logs-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  border-top: 1px solid var(--border-default);
}
.logs-pg-info {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 32px; margin-bottom: 6px; }

.section-title {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-primary);
  margin-bottom: 10px;
  margin-top: 20px;
}
.section-title:first-child { margin-top: 0; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 14px;
  transition: color 0.1s;
  font-family: var(--font-mono);
}
.back-link:hover { color: var(--accent); }

.role-badge {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 7px;
  border-radius: 3px;
  font-family: var(--font-mono);
}
.role-admin { background: var(--accent-amber-dim); color: var(--accent-amber); }
.role-pe { background: var(--accent-dim); color: var(--accent); }
.role-dev { background: var(--accent-green-dim); color: var(--accent-green); }
.role-client { background: var(--accent-purple-dim); color: var(--accent-purple); }

/* ===== MODAL / POPUP ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  width: 90%;
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: slideUp 0.15s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-default);
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  padding-right: 16px;
}

.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.1s;
}
.modal-close:hover { border-color: var(--accent-red); color: var(--accent-red); }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-body .spec-id {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-body .spec-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.modal-body .spec-meta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.modal-meta-item {
  font-size: 11px;
  color: var(--text-muted);
}
.modal-meta-item strong { color: var(--text-primary); font-weight: 600; }

.ac-list {
  margin-bottom: 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ac-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-default);
  background: var(--bg-tertiary);
}

.ac-list-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

.ac-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 1px 7px;
  border-radius: 8px;
}

.ac-list-scroll {
  padding: 4px 12px;
}

.ac-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-primary);
  padding: 5px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}

.ac-list-item:hover {
  background: var(--bg-card-hover);
}

.ac-list-item .ac-check {
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
  font-size: 12px;
}

.ac-list-item .ac-text {
  flex: 1;
  line-height: 1.4;
}

.ac-list-item.ac-done .ac-check {
  color: var(--accent-green);
}

.ac-list-item.ac-done .ac-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.ac-textarea {
  font-family: var(--font-mono) !important;
  font-size: 12px !important;
  line-height: 1.7 !important;
}

.form-hint {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

.modal-attachments {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-default);
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-default);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Cover image in project view */
.project-cover .project-cover-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
}

.project-cover .project-cover-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.5px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 4px;
  margin: 0;
  align-self: flex-start;
}

.project-cover .project-cover-subtitle {
  font-size: 12px;
  color: #fff;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  padding: 3px 10px;
  border-radius: 3px;
  align-self: flex-start;
  margin: 0;
}

.project-cover .project-cover-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 3px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  color: #fff;
  font-family: var(--font-mono);
}

.status-select {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  font-family: var(--font-mono);
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  outline: none;
}

.cover-edit-btn {
  position: absolute;
  bottom: 12px;
  right: 14px;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 3px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  font-family: var(--font-heading);
  letter-spacing: 0.3px;
  transition: all 0.15s;
  display: none;
}
.project-cover:hover .cover-edit-btn { display: block; }
.cover-edit-btn:hover { background: var(--accent); border-color: var(--accent); }

/* ===== ATTENTION LOAD WIDGET ===== */
.attention-load-widget {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-width: 160px;
}
.attention-load-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 2px;
}
.attention-load-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
}
.attention-load-bar {
  margin-top: 5px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
}
.attention-load-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.attention-load-focused { background: #10B981; }
.attention-load-busy { background: #F59E0B; }
.attention-load-high_load { background: #F97316; }
.attention-load-overloaded { background: #EF4444; }
.attention-load-state {
  margin-top: 3px;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.attention-load-state-focused { color: #10B981; }
.attention-load-state-busy { color: #F59E0B; }
.attention-load-state-high_load { color: #F97316; }
.attention-load-state-overloaded { color: #EF4444; }

/* ===== COVER MODAL ===== */
.modal-card.modal-cover {
  width: 720px;
  max-width: 92vw;
  max-height: 82vh;
}

.cover-preview {
  margin: 0 20px 10px;
  height: 120px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
}

.cover-preview-img {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: background-image 0.2s;
}

.cover-categories {
  display: flex;
  gap: 6px;
  padding: 0 20px 12px;
  flex-wrap: wrap;
}

.cover-cat {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.1s;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.cover-cat:hover { color: var(--text-primary); background: var(--bg-card-hover); }
.cover-cat.active { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

.cover-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 0 20px 16px;
  overflow-y: auto;
  max-height: 320px;
}

.cover-option {
  aspect-ratio: 2 / 1;
  border-radius: var(--radius-sm);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.12s;
}

.cover-option:hover { border-color: var(--text-muted); opacity: 0.85; }
.cover-option.selected { border-color: var(--accent); }

/* Raw Spec section */
.raw-spec-section {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
  background: var(--bg-tertiary);
}

/* ===== SPEC FORM LAYOUT ===== */
.spec-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}
.spec-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.spec-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.spec-attach-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.spec-attach-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.spec-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.spec-textarea-lg {
  width: 100%;
  min-height: 360px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  resize: vertical;
}
.spec-textarea-lg:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

.char-counter {
  text-align: right;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-top: 4px;
  transition: color 0.2s;
}

.spec-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
}
.spec-convert-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
}
.spec-convert-status {
  font-size: 12px;
  font-weight: 500;
}

.spec-preview {
  background: var(--bg-tertiary);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-bottom: 16px;
  animation: specPreviewIn 0.3s ease;
}
@keyframes specPreviewIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.spec-desc-preview {
  width: 100%;
  min-height: 320px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  resize: vertical;
}

/* --- Story cards (multi-story preview) --- */
.story-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}
.story-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.story-card-number {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.story-card-title {
  width: 100%;
  display: block;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.story-card-desc {
  width: 100%;
  min-height: 100px;
  border: 1px solid var(--border-default);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 8px 10px;
  margin-bottom: 6px;
  resize: vertical;
}
.story-card-ac-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}
.story-card-ac {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  padding: 2px 0;
}
.story-card select {
  font-size: 11px;
  padding: 3px 8px;
}

/* --- Kanban card epic label badge --- */
.card-epic-label {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Inline editable select in card detail --- */
.inline-select {
  width: auto;
  min-width: 80px;
  padding: 2px 24px 2px 6px;
  font-size: 11px;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%236B7280' d='M2 3l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: border-color 0.2s;
}
.inline-select:hover { border-color: var(--accent); }
.inline-select:focus { outline: none; border-color: var(--accent); }
.inline-saved {
  border-color: var(--accent-green, #34D399) !important;
  box-shadow: 0 0 0 1px var(--accent-green-dim, rgba(52,211,153,0.3));
}

/* --- Epic label in card detail --- */
.card-epic-label-detail {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-purple, #A78BFA);
  background: var(--accent-purple-dim, rgba(167,139,250,0.12));
  padding: 2px 9px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.spec-bottom-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-default);
  margin-top: 8px;
}
.spec-submit-btn {
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 700;
}

.raw-spec-section .raw-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-amber);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.raw-spec-section textarea {
  width: 100%;
  min-height: 140px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
}

.raw-spec-section textarea:focus {
  outline: none;
  border-color: var(--accent-amber);
  box-shadow: 0 0 0 3px var(--accent-amber-dim);
}

.convert-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

/* ===== TAB NAVIGATION ===== */
.tab-nav {
  display: flex;
  gap: 4px;
  margin: 20px 0 16px;
  border-bottom: 2px solid var(--border-default);
  padding-bottom: 0;
}
.tab-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.tab-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== PROJECT SELECTOR ===== */
.project-selector {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}
.project-selector .filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.project-selector-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}
.project-selector select {
  padding: 6px 32px 6px 12px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg-input, var(--bg-card));
  color: var(--text-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  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 12 12'%3E%3Cpath fill='%236B7280' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}
.project-selector select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ===== NIKO NIKO WIDGET ===== */
.niko-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  font-family: 'Inter', sans-serif;
}
.niko-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
}
.niko-toggle:hover { transform: scale(1.08); box-shadow: 0 4px 20px rgba(0,0,0,0.25); }
.niko-collapsed .niko-panel { display: none; }
.niko-expanded .niko-toggle { display: none; }
.niko-panel {
  width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  overflow: hidden;
}
.niko-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-default);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.niko-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.niko-close:hover { color: var(--accent-red); }
.niko-picker {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 16px 16px 8px;
}
.niko-mood-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid transparent;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  color: var(--text-secondary);
}
.niko-mood-btn:hover { background: var(--bg-card); border-color: var(--accent); transform: scale(1.12); }
.niko-mood-btn.niko-selected { border-color: var(--accent); background: var(--accent-dim); }
.niko-mood-btn.niko-mood-dim {
  opacity: 0.25;
  transform: scale(0.8);
  transition: all 0.25s ease;
}
.niko-mood-btn.niko-mood-pop {
  animation: nikoPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-color: var(--accent);
  background: var(--accent-dim);
}
@keyframes nikoPop {
  0%   { transform: scale(1); }
  35%  { transform: scale(2.2); }
  65%  { transform: scale(0.85); }
  100% { transform: scale(1); }
}
.niko-note {
  width: 100%;
  box-sizing: border-box;
  margin: 8px 0 0;
  padding: 8px 16px;
  border: none;
  border-top: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-primary);
  font-size: 12px;
  font-family: inherit;
  resize: none;
  outline: none;
}
.niko-note::placeholder { color: var(--text-muted); }
.niko-feedback {
  padding: 6px 16px 0;
  font-size: 12px;
}
.niko-done { color: var(--accent-green); }
.niko-recent { padding: 0 16px 12px; }
.niko-recent-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.niko-avatars { display: flex; gap: 4px; }
.niko-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  color: var(--accent);
  cursor: default;
  overflow: hidden;
}
.niko-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Niko Niko speech bubble */
.niko-bubble {
  position: relative;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px 14px;
  margin: 12px 16px 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  animation: nikoBubbleIn 0.35s ease-out;
}
.niko-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--accent);
}
@keyframes nikoBubbleIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== ATTENTION LOAD REPORT ===== */
.attention-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.attention-card {
  background: var(--bg-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.attention-card:hover {
  border-color: var(--accent-dim);
  box-shadow: var(--shadow-elevated);
}

.attention-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.attention-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.attention-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}
.attention-card-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}
.attention-card-bar {
  margin-top: 6px;
  height: 5px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  overflow: hidden;
}
.attention-card-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.attention-card-fill.attention-card-focused { background: #10B981; }
.attention-card-fill.attention-card-busy { background: #F59E0B; }
.attention-card-fill.attention-card-high_load { background: #F97316; }
.attention-card-fill.attention-card-overloaded { background: #EF4444; }
.attention-card-state {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.attention-card-state-focused { color: #10B981; }
.attention-card-state-busy { color: #F59E0B; }
.attention-card-state-high_load { color: #F97316; }
.attention-card-state-overloaded { color: #EF4444; }

/* ── Visibility: Desktop vs Mobile ── */
.desktop-only { display: block; }
.mobile-only { display: none; }

@media (max-width: 767px) {
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }

  /* ── Safe Area ── */
  #app { padding-bottom: env(safe-area-inset-bottom); }

  /* ── Layout Overrides ── */
  .sidebar { display: none !important; }
  .topbar { padding: 8px 12px; }
  .topbar-right { gap: 6px; }
  .user-name, .role-badge, .lang-toggle { display: none !important; }
  .app-layout { flex-direction: column; }
  .main-content {
    padding: 12px 12px 80px 12px;
    max-width: 100%;
    overflow-y: auto;
    height: calc(100vh - 48px);
    -webkit-overflow-scrolling: touch;
  }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); padding: 0; }
  .metric-card { padding: 10px 12px; }
  .metric-sub { display: none; }

  /* ── Project Cover (mobile compact) ── */
  .project-cover { height: 120px; padding: 20px 16px; }
  .project-cover-title { font-size: 18px; }
  .project-cover-subtitle { font-size: 11px; }
  .cover-edit-btn { display: none; }
  .back-link { padding: 0; margin-bottom: 8px; }

  /* ── Attention Load Widget (mobile compact) ── */
  .project-cover .attention-load-widget { display: none; }
  #mobile-kanban-container .attention-load-widget {
    position: static;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-default);
  }
  .attention-load-label { font-size: 10px; }
  .attention-load-value { font-size: 13px; }

  /* ── Stacked Sections ── */
  .stacked-sections { display: flex; flex-direction: column; gap: 10px; }

  .stacked-section {
    background: var(--bg-card);
    border: 1px solid var(--border-default);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
  }
  .stacked-section-expanded {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  }

  .stacked-section-header {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 10px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    min-height: 44px;
  }
  .stacked-section-header:active {
    background: var(--bg-card-hover);
  }

  .stacked-section-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .stacked-section-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .stacked-section-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 22px;
    text-align: center;
  }
  .stacked-section-chevron {
    color: var(--text-muted);
    font-size: 12px;
    transition: transform 0.2s ease;
    width: 20px;
    text-align: center;
  }
  .stacked-section-expanded .stacked-section-chevron i {
    transform: rotate(180deg);
  }

  .stacked-section-cards {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .stacked-section-expanded .stacked-section-cards {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0 12px 10px;
    -webkit-overflow-scrolling: touch;
  }
  .stacked-section-loading,
  .stacked-section-empty {
    padding: 24px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
  }

  /* ── Mobile Kanban Cards ── */
  .mobile-kanban-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 88px;
    padding: 14px;
    margin-bottom: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-default);
    border-radius: 16px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
  }
  .mobile-kanban-card:active {
    transform: scale(0.985);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  }
  .mobile-kanban-card.kanban-card-locked {
    border-left: 3px solid var(--accent-amber);
  }

  .mobile-card-top {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .mobile-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .mobile-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
  }
  .mobile-avatar-initials {
    font-size: 9px;
    font-weight: 700;
    background: var(--accent);
    color: #fff;
    padding: 3px 6px;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ── Bottom Sheet ── */
  .bottom-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    display: none;
    animation: bs-fade-in 0.2s ease;
  }
  @keyframes bs-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 45%;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
  }
  .bottom-sheet.expanded {
    height: 90%;
  }

  .bottom-sheet-handle {
    width: 100%;
    padding: 8px 0 4px;
    display: flex;
    justify-content: center;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
  }
  .bottom-sheet-handle::before {
    content: '';
    width: 36px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
  }
  .bottom-sheet-handle:active {
    cursor: grabbing;
  }

  .bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 24px;
    -webkit-overflow-scrolling: touch;
  }
  .bottom-sheet-body .spec-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
  }
  .bottom-sheet-body .modal-meta-item {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
  }
  .bottom-sheet-body .meta-label {
    width: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
  }
  .bottom-sheet-body .meta-label i {
    width: 14px;
    text-align: center;
    flex-shrink: 0;
  }
  .bottom-sheet-body .meta-label strong {
    white-space: nowrap;
    font-size: 10px;
  }
  .bottom-sheet-body .modal-meta-item .inline-select,
  .bottom-sheet-body .modal-meta-item .meta-label + :not(.meta-label) {
    flex: 1;
    min-width: 0;
  }
  .bottom-sheet-body .inline-select {
    width: auto;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    font-size: 13px;
    padding: 5px 8px;
    min-height: 38px;
  }
  .bottom-sheet-body .spec-description {
    font-size: 14px;
    line-height: 1.5;
    max-height: 35vh;
    overflow-y: auto;
    margin-bottom: 12px;
  }
  .bottom-sheet-body h3 {
    font-size: 18px;
  }
  .bottom-sheet-body .card-priority {
    font-size: 11px;
    padding: 2px 6px;
  }
  .bottom-sheet-body .ac-list-title {
    font-size: 13px;
  }
  .bottom-sheet-body .ac-list-item {
    font-size: 14px;
    min-height: 44px;
    padding: 10px 6px;
  }
  .bottom-sheet-body .ac-check {
    font-size: 17px;
    min-width: 24px;
  }
  .bottom-sheet-body .btn {
    font-size: 12px;
    padding: 6px 12px;
    min-height: 38px;
  }
  .bottom-sheet-body .ac-list-scroll {
    max-height: 25vh !important;
  }

  .bottom-sheet-body .ac-list {
    margin-top: 16px;
  }

  /* ── Bottom Navigation ── */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--bg-card);
    border-top: 1px solid var(--border-default);
    z-index: 900;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.08);
  }
  .bottom-nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
    height: 100%;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-body);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease;
    min-width: 44px;
  }
  .bottom-nav-tab i {
    font-size: 18px;
    margin-bottom: 1px;
  }
  .bottom-nav-tab.active {
    color: var(--accent);
  }
  .bottom-nav-tab:active {
    opacity: 0.7;
  }

  /* ── FAB ── */
  .fab {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom));
    left: 16px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 950;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.2s ease;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .fab i {
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
  }
  .fab:active {
    transform: scale(0.9);
  }
  .fab-hidden {
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
  }

  /* ── My Work ── */
  .mobile-my-work .stacked-section {
    margin-bottom: 6px;
  }

  /* ── Hide desktop modals on mobile ── */
  .modal-card { max-width: 90vw; }
}

/* Desktop: mobile-only is hidden */
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main-content { padding: 16px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-grid { grid-template-columns: 1fr; }
  .kanban-board { height: calc(100vh - 210px); }
  .kanban-column { min-width: 230px; flex: 1; }
  .spec-editor .form-row { grid-template-columns: 1fr; }
  .reports-grid { grid-template-columns: 1fr; }
}