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

html, body {
  height: 100%;
  height: 100dvh;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow: hidden;
}
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg-page:    #0a0a0a;
  --bg-sidebar: #050505;
  --bg-topbar:  #050505;
  --bg-card:    #111111;
  --bg-card-hover: #161616;
  --bg-input:   #111111;

  --accent:     #F97316;
  --accent-dim: rgba(249,115,22,0.12);
  --accent-glow: rgba(249,115,22,0.25);

  --text-primary:   #F5F5F5;
  --text-secondary: #888888;
  --text-muted:     #444444;

  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.12);
  --border-accent: rgba(249,115,22,0.30);

  --positive: #6EE7B7;
  --negative: #F87171;
  --warning:  #FCD34D;
  --outlier:  #C084FC;

  --radius-card:  13px;
  --radius-inner: 8px;
  --radius-pill:  100px;

  --sidebar-w: 220px;
  --transition: 0.15s ease;

  --font-mono: 'Fira Code', monospace;
  --font-sans: 'Inter', sans-serif;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 16px;
  border-bottom: 1px solid var(--border);
}

.logo-mark {
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: #0a0a0a;
  font-weight: 700;
  font-size: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

.logo-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 10px 6px 4px;
  margin-top: 4px;
}

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

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border-accent);
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.sync-dot.live { background: var(--positive); }

/* ── Main ──────────────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100vh;
  height: 100dvh;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.main::-webkit-scrollbar { width: 4px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.tab-content {
  padding: 28px 28px;
  max-width: 1300px;
}

/* ── Page header ───────────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px;
  transition: border-color var(--transition), background var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.card.clickable {
  cursor: pointer;
}

.card.clickable:hover {
  border-color: var(--border-accent);
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

/* ── Stat cards ────────────────────────────────────────────────────────────── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  transition: all var(--transition);
  cursor: pointer;
}

.stat-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-delta {
  font-size: 12px;
  font-weight: 500;
  margin-top: 4px;
  font-family: var(--font-mono);
}

.stat-delta.pos { color: var(--positive); }
.stat-delta.neg { color: var(--negative); }

/* ── Section headers ───────────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Grid layouts ──────────────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 20px; }

/* Platform main layout: charts (flexible) + sidebar (fixed 300px) */
.platform-main-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  margin-bottom: 0;
}
@media (max-width: 900px) {
  .platform-main-grid { grid-template-columns: 1fr; }
}

/* Collapsible audience section */
details.card > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 0;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after {
  content: '›';
  font-size: 18px;
  color: var(--text-muted);
  transition: transform var(--transition);
  margin-left: 8px;
}
details.card[open] > summary::after {
  transform: rotate(90deg);
}

/* ── Tables ────────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead tr {
  background: var(--bg-sidebar);
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

thead th:hover { color: var(--text-secondary); }
thead th.sorted { color: var(--accent); }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  cursor: pointer;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }

tbody td {
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 13px;
}

.td-mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-outlier {
  background: rgba(192,132,252,0.15);
  color: var(--outlier);
  border: 1px solid rgba(192,132,252,0.3);
}

.badge-tiktok {
  background: rgba(0,242,234,0.1);
  color: #00F2EA;
  border: 1px solid rgba(0,242,234,0.2);
}

.badge-instagram {
  background: rgba(225,48,108,0.1);
  color: #E1306C;
  border: 1px solid rgba(225,48,108,0.25);
}

.badge-queued {
  background: rgba(129,140,248,0.15);
  color: var(--accent);
}

.badge-remixed {
  background: rgba(110,231,183,0.1);
  color: var(--positive);
}

.badge-filmed {
  background: rgba(252,211,77,0.1);
  color: var(--warning);
}

.badge-published {
  background: rgba(110,231,183,0.15);
  color: var(--positive);
}

/* ── Progress bars ─────────────────────────────────────────────────────────── */
.progress-bar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-pill);
  height: 6px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent);
  transition: width 0.4s ease;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-inner);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0a;
}
.btn-primary:hover { opacity: 0.9; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-danger {
  background: rgba(248,113,113,0.15);
  color: var(--negative);
  border: 1px solid rgba(248,113,113,0.25);
}
.btn-danger:hover { background: rgba(248,113,113,0.25); }

/* ── Period toggle ─────────────────────────────────────────────────────────── */
.period-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 3px;
}

.period-btn {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  transition: all var(--transition);
}

.period-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── Chart container ───────────────────────────────────────────────────────── */
.chart-wrap {
  height: 220px;
  position: relative;
}

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

/* ── Heatmap ───────────────────────────────────────────────────────────────── */
.heatmap-grid {
  display: grid;
  gap: 3px;
  font-size: 10px;
}

.heatmap-cell {
  border-radius: 3px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 9px;
  color: transparent;
  transition: all var(--transition);
  cursor: default;
}

.heatmap-cell:hover {
  color: var(--text-primary);
  transform: scale(1.1);
}

/* ── Video cards ───────────────────────────────────────────────────────────── */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition);
}

.video-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

/* ── Competitor Feed Cards ──────────────────────────────────────────────────── */
.comp-feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition);
}
.comp-feed-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}
.comp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.comp-card-caption {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
}
.comp-card-metrics {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.comp-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.comp-metric-val {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.comp-metric-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.comp-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.comp-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.comp-avatar-lg {
  width: 38px;
  height: 38px;
  font-size: 14px;
}
.comp-creator-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  transition: all var(--transition);
}
.comp-creator-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}
.comp-group-card {
  transition: border-color var(--transition);
}

.video-caption {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.video-metric {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 3px;
}

.video-metric .val {
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2,6,23,0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-card);
  max-width: 700px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: color var(--transition);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  padding-right: 32px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ── Metric grid in modal ──────────────────────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.metric-item {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 12px;
}

.metric-item-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.metric-item-value {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Hypothesis block ──────────────────────────────────────────────────────── */
.hypothesis-block {
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-inner);
  padding: 14px;
  margin-bottom: 16px;
}

.hypothesis-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 6px;
}

.hypothesis-text {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ── Variation cards ───────────────────────────────────────────────────────── */
.variation-card {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 14px;
  margin-bottom: 10px;
}

.variation-number {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}

.variation-hook {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.variation-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.variation-body strong {
  color: var(--text-primary);
}

/* ── Remix bank cards ──────────────────────────────────────────────────────── */
.remix-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition);
}

.remix-card:hover {
  border-color: var(--border-hover);
}

.remix-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.remix-caption {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
}

.remix-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Content Calendar ──────────────────────────────────────────────────────── */
.cal-day:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

.cal-day:hover .cal-add-btn {
  opacity: 1 !important;
}

.platform-pick.active {
  background: rgba(129, 140, 248, 0.2);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Outlier Lab Board ──────────────────────────────────────────────────────── */
.lab-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 20px;
}
@media (max-width: 1100px) {
  .lab-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .lab-board { grid-template-columns: 1fr; }
}

.lab-col {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  min-height: 200px;
  display: flex;
  flex-direction: column;
}
.lab-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.lab-col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.lab-col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.lab-col-count {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 1px 6px;
}
.lab-add-col-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
}
.lab-add-col-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}
.lab-col-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.lab-empty-col {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 20px 8px;
}
.lab-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color var(--transition), background var(--transition);
}
.lab-card:not(.lab-card-posted):hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}
.lab-card-posted {
  opacity: 0.75;
}
.lab-card-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 1px;
}
.lab-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lab-card-notes {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
.lab-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 3px;
}
.lab-card-date {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Drag-and-drop states */
.lab-card.dragging {
  opacity: 0.4;
  pointer-events: none;
}
.lab-col.drag-over > .lab-col-cards {
  background: var(--accent-dim);
  border-radius: 8px;
  outline: 1px dashed var(--accent);
}

/* Native date/time picker */
input[type="date"].form-input,
input[type="datetime-local"].form-input {
  appearance: auto;
  -webkit-appearance: auto;
}

.lab-col-add-row {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 12px 10px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.lab-col:hover .lab-col-add-row {
  opacity: 1;
}
.lab-col-add-row:hover {
  color: var(--accent);
}

/* Inspiration rail */
.lab-inspiration {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 10px 14px;
  margin-bottom: 16px;
}
.lab-inspiration > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
}
.lab-inspiration > summary::-webkit-details-marker { display: none; }
.lab-inspiration-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.lab-inspo-card {
  flex-shrink: 0;
  width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 10px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.lab-inspo-card:hover {
  border-color: var(--border-accent);
}

/* ── Kanban board ──────────────────────────────────────────────────────────── */
#kanban-board {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.kanban-col .kanban-body {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  transition: background 0.15s;
}

.kanban-body.drag-over {
  background: rgba(129, 140, 248, 0.07) !important;
  border-color: var(--accent) !important;
}

.kanban-card {
  transition: opacity 0.15s, box-shadow 0.15s, transform 0.1s;
}

.kanban-card[draggable="true"]:active {
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
  transform: scale(1.02);
}

.kanban-card.dragging {
  opacity: 0.45;
}

.kanban-add-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.kanban-add-btn:hover {
  color: var(--text-primary);
  background: var(--border);
}

/* ── Goals list ────────────────────────────────────────────────────────────── */
.goal-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.goal-item:last-child { border-bottom: none; }

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.goal-label { font-size: 13px; color: var(--text-primary); }

.goal-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Before/after transformation ──────────────────────────────────────────── */
.transform-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.transform-col {
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 14px;
}

.transform-arrow {
  color: var(--accent);
  font-size: 20px;
  text-align: center;
}

.transform-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.transform-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.transform-metric:last-child { border-bottom: none; }

.transform-metric-label { color: var(--text-secondary); }
.transform-metric-value { font-family: var(--font-mono); color: var(--text-primary); }
.transform-metric-value.highlight { color: var(--accent); }

/* ── Tag pills ─────────────────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  margin: 2px;
}

/* ── Toast ─────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-inner);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: slideIn 0.2s ease;
}

@keyframes slideIn {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── Loading skeleton ──────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

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

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary);
  gap: 8px;
}

.empty-state-icon {
  font-size: 36px;
  margin-bottom: 4px;
}

.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.empty-state-body {
  font-size: 13px;
  max-width: 320px;
  line-height: 1.5;
}

/* ── Form inputs ───────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: border-color var(--transition);
  outline: none;
}

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

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Donut chart label ─────────────────────────────────────────────────────── */
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.donut-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Spinner ───────────────────────────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Score display ─────────────────────────────────────────────────────────── */
.score-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border-accent);
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.text-accent { color: var(--accent); }
.text-positive { color: var(--positive); }
.text-negative { color: var(--negative); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-mono { font-family: var(--font-mono); }

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* ── Month switcher ────────────────────────────────────────────────────────── */
.month-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 4px 10px;
}

.month-nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  transition: color var(--transition);
  font-family: var(--font-sans);
  user-select: none;
}
.month-nav-btn:hover:not(:disabled) { color: var(--text-primary); }
.month-nav-btn:disabled { color: var(--text-muted); cursor: default; }

.month-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 108px;
  text-align: center;
  font-family: var(--font-mono);
}

/* ── Big stat cards (Overview) ─────────────────────────────────────────────── */
.stat-card-big {
  cursor: default;
  padding: 22px 24px;
}

.stat-value-big {
  font-size: 36px;
  margin-bottom: 10px;
}

.stat-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.stat-breakdown-item {
  display: flex;
  gap: 5px;
  align-items: center;
}

.stat-breakdown-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-breakdown-val {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* ── Chart toggle (Overview) ───────────────────────────────────────────────── */
.chart-toggle {
  display: flex;
  gap: 4px;
}

.chart-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  padding: 4px 12px;
  transition: all var(--transition);
}

.chart-toggle-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.chart-toggle-btn.active {
  background: var(--accent-dim);
  border-color: var(--border-accent);
  color: var(--accent);
}

/* ── Clickable table rows ───────────────────────────────────────────────────── */
.clickable-row { cursor: pointer; }
.clickable-row:hover td { background: rgba(255,255,255,0.025); }

/* ── Modal section header ────────────────────────────────────────────────────── */
.modal-section-header {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 16px 0 8px;
}
