:root {
  --bg: #04070c;
  --bg-elevated: #0a1018;
  --panel: rgba(11, 16, 24, 0.9);
  --panel-strong: #0d141d;
  --panel-soft: rgba(14, 21, 31, 0.8);
  --text: #f4f7fb;
  --text-soft: #98a4b8;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --accent: #62f2c1;
  --accent-2: #59d0ff;
  --accent-3: #ff8a5b;
  --green: #3ddc84;
  --amber: #ffb84d;
  --red: #ff6b6b;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --content-max: 1620px;
  --sidebar-width: 272px;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(89, 208, 255, 0.13), transparent 22%),
    radial-gradient(circle at 85% 10%, rgba(98, 242, 193, 0.11), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(255, 138, 91, 0.08), transparent 28%),
    linear-gradient(180deg, #030507 0%, #09111b 100%);
}

h1, h2, h3, h4, .brand, .card-title, .media-head strong, .client-card h2 {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  background: linear-gradient(180deg, rgba(4, 7, 12, 0.97), rgba(8, 12, 18, 0.99));
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-block.compact { margin-bottom: 16px; }

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, rgba(98, 242, 193, 0.24), rgba(89, 208, 255, 0.2));
  border: 1px solid rgba(98, 242, 193, 0.22);
  color: #fff;
}

.brand {
  display: inline-block;
  font-weight: 700;
  font-size: 1.02rem;
}

.subtitle, .muted {
  color: var(--text-soft);
}

.subtitle {
  margin: 4px 0 0;
  font-size: 0.92rem;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  overflow-y: auto;
}

.sidebar-link {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--text-soft);
  background: transparent;
  border: 1px solid transparent;
  transition: 180ms ease;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: var(--text);
  background: rgba(22, 31, 43, 0.88);
  border-color: var(--line);
}

.sidebar-link small {
  color: var(--text-soft);
  font-size: 0.75rem;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.main-shell {
  display: grid;
  grid-template-rows: auto auto 1fr;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 28px 36px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 8, 13, 0.78);
  backdrop-filter: blur(16px);
}

.page-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.page-subtitle {
  margin: 10px 0 0;
  max-width: 820px;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.5;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-content {
  width: min(calc(100vw - var(--sidebar-width) - 48px), var(--content-max));
  padding: 28px 0 48px;
  margin: 0 auto;
}

.flash-stack {
  width: min(calc(100vw - var(--sidebar-width) - 48px), var(--content-max));
  margin: 18px auto 0;
  display: grid;
  gap: 10px;
}

.flash {
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(16, 30, 48, 0.86);
}

.flash.success { border-color: rgba(34, 197, 94, 0.28); }
.flash.error { border-color: rgba(239, 68, 68, 0.3); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(17, 24, 34, 0.88);
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(98, 242, 193, 0.24);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

.button.primary {
  background: linear-gradient(135deg, rgba(98, 242, 193, 0.96), rgba(89, 208, 255, 0.92));
  border-color: transparent;
  color: #061018;
}

.button.ghost {
  background: rgba(15, 27, 47, 0.7);
}

.button.subtle {
  background: rgba(14, 20, 28, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
}

.button.full { width: 100%; }
.button.micro {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.text-link {
  color: #dbeafe;
  font-weight: 600;
}

.hero-grid,
.stats-grid,
.content-grid,
.client-grid {
  display: grid;
  gap: 18px;
}

.hero-grid { grid-template-columns: 1.35fr 1fr; margin-bottom: 20px; }
.stats-grid { grid-template-columns: repeat(3, minmax(240px, 1fr)); margin-bottom: 20px; }
.content-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 20px; }
.client-grid { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.client-grid-premium { margin-top: 12px; }

.hero-card,
.client-card,
.panel,
.stat-panel,
.kanban-column,
.collector-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card,
.stat-panel,
.panel,
.client-card,
.collector-card {
  padding: 22px;
}

.accent-panel {
  background:
    linear-gradient(180deg, rgba(19, 27, 38, 0.94), rgba(12, 18, 27, 0.96)),
    linear-gradient(135deg, rgba(98, 242, 193, 0.12), rgba(89, 208, 255, 0.08));
  border-color: rgba(98, 242, 193, 0.22);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 700;
  color: #86fff0;
}

.clean-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
  line-height: 1.65;
}

.inline-metrics,
.stat-row,
.metric-strip,
.badge-row,
.action-row,
.meta-line,
.toggle-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-metrics > div,
.stat-row > div,
.metric-box {
  min-width: 112px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(18, 31, 50, 0.78);
  border: 1px solid var(--line);
}

.inline-metrics strong,
.stat-row strong,
.metric-box strong {
  display: block;
  font-size: 1.28rem;
}

.inline-metrics span,
.stat-row span,
.metric-box span {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.82rem;
}

.client-card-head,
.panel-head,
.kanban-head,
.collector-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.client-card h2,
.hero-card h2,
.panel h3,
.stat-panel h3,
.collector-card h4 {
  margin: 0;
}

.pipeline-preview,
.stack-list,
.table-stack,
.kanban-stack {
  display: grid;
  gap: 12px;
}

.status-chip,
.badge,
.score-pill,
.grade-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip,
.badge.source {
  background: rgba(22, 31, 44, 0.88);
  color: #d9f8ff;
}

.score-pill {
  background: rgba(98, 242, 193, 0.14);
  color: #ddfff5;
}

.bucket-safe { background: rgba(34, 197, 94, 0.14); color: #86efac; border-color: rgba(34, 197, 94, 0.3); }
.bucket-swing { background: rgba(245, 158, 11, 0.14); color: #fcd34d; border-color: rgba(245, 158, 11, 0.28); }
.bucket-conversion { background: rgba(110, 168, 254, 0.14); color: #93c5fd; border-color: rgba(110, 168, 254, 0.28); }
.horizon-tactical { background: rgba(34, 211, 238, 0.12); color: #67e8f9; border-color: rgba(34, 211, 238, 0.28); }
.horizon-strategic { background: rgba(139, 92, 246, 0.12); color: #c4b5fd; border-color: rgba(139, 92, 246, 0.28); }

.grade-aplus, .grade-a { background: rgba(34, 197, 94, 0.14); color: #86efac; }
.grade-bplus, .grade-b { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
.grade-cplus, .grade-c { background: rgba(249, 115, 22, 0.16); color: #fdba74; }
.grade-d, .grade-f { background: rgba(239, 68, 68, 0.14); color: #fca5a5; }

.workspace-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab-link {
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-soft);
  background: rgba(14, 20, 28, 0.76);
  font-weight: 600;
}

.tab-link.active {
  color: white;
  border-color: rgba(98, 242, 193, 0.28);
  background: linear-gradient(135deg, rgba(98, 242, 193, 0.16), rgba(89, 208, 255, 0.14));
}

.analytics-toolbar {
  margin-bottom: 20px;
}

.period-toolbar,
.period-pills,
.range-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.period-toolbar {
  justify-content: space-between;
  align-items: center;
}

.period-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(14, 20, 28, 0.76);
  color: var(--text-soft);
  font-weight: 650;
}

.period-pill.active {
  color: white;
  border-color: rgba(98, 242, 193, 0.28);
  background: linear-gradient(135deg, rgba(98, 242, 193, 0.16), rgba(89, 208, 255, 0.14));
}

.range-form label {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.range-form input {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 28, 0.82);
  color: var(--text);
}

.idea-row,
.table-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(14, 20, 29, 0.78);
  border: 1px solid var(--line);
}

.idea-row.compact,
.table-row.compact {
  padding: 14px;
}

.idea-row-main,
.table-title,
.card-title {
  display: block;
}

.card-title,
.table-title,
.idea-row strong {
  font-size: 1rem;
  line-height: 1.4;
}

.note-text {
  margin: 0;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(20, 36, 56, 0.78);
  color: #cbd5e1;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
  overflow-x: auto;
}

.mission-grid {
  align-items: stretch;
}

.command-card {
  position: relative;
  overflow: hidden;
}

.command-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -35% 35%;
  height: 220px;
  background: radial-gradient(circle, rgba(98, 242, 193, 0.18), transparent 65%);
  pointer-events: none;
}

.hero-card-top,
.source-row-head,
.board-lane-head,
.board-card-top,
.board-card-foot,
.media-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.hero-metric {
  margin: 18px 0 16px;
}

.hero-metric strong {
  display: block;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.hero-metric span {
  display: block;
  margin-top: 10px;
  color: var(--text-soft);
}

.metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-grid.wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.signal-strip {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.signal-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.86rem;
  font-weight: 650;
}

.signal-chip.positive {
  background: rgba(61, 220, 132, 0.12);
  color: #aff3cb;
  border-color: rgba(61, 220, 132, 0.24);
}

.signal-chip.negative {
  background: rgba(255, 107, 107, 0.12);
  color: #ffc0c0;
  border-color: rgba(255, 107, 107, 0.24);
}

.signal-chip.neutral {
  background: rgba(89, 208, 255, 0.1);
  color: #d2f7ff;
  border-color: rgba(89, 208, 255, 0.18);
}

.prose-tight {
  margin: 12px 0 18px;
  color: #d9e6ef;
  line-height: 1.7;
}

.source-stack {
  display: grid;
  gap: 14px;
}

.source-row {
  display: grid;
  gap: 10px;
}

.source-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.source-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(98, 242, 193, 0.95), rgba(89, 208, 255, 0.92));
}

.board-panel {
  padding: 18px;
}

.board-shell {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 16px;
  overflow-x: auto;
}

.board-lane {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 13, 20, 0.96), rgba(11, 16, 24, 0.88));
  min-height: 520px;
}

.board-dropzone {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 420px;
}

.board-lane.drag-over {
  border-color: rgba(98, 242, 193, 0.42);
  box-shadow: 0 0 0 1px rgba(98, 242, 193, 0.16), var(--shadow);
}

.board-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(17, 23, 32, 0.96);
  cursor: grab;
}

.board-card.dragging {
  opacity: 0.42;
  transform: rotate(1deg) scale(0.99);
}

.spark-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8px, 1fr));
  gap: 6px;
  align-items: end;
  min-height: 220px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(12, 18, 26, 0.9);
}

.spark-group {
  display: flex;
  align-items: end;
  gap: 2px;
  min-height: 188px;
}

.spark-bar {
  width: 100%;
  border-radius: 999px 999px 4px 4px;
  min-height: 6px;
}

.spark-bar.views {
  background: linear-gradient(180deg, rgba(98, 242, 193, 0.96), rgba(98, 242, 193, 0.45));
}

.spark-bar.watch {
  background: linear-gradient(180deg, rgba(89, 208, 255, 0.92), rgba(89, 208, 255, 0.38));
}

.spark-bar.subs {
  background: linear-gradient(180deg, rgba(255, 184, 77, 0.92), rgba(255, 184, 77, 0.4));
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.media-card,
.media-row {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(14, 20, 29, 0.84);
}

.premium-card {
  background:
    linear-gradient(180deg, rgba(13, 18, 28, 0.94), rgba(8, 13, 20, 0.98)),
    radial-gradient(circle at top right, rgba(98, 242, 193, 0.08), transparent 30%);
}

.client-spotlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.client-spotlight {
  padding: 16px;
  border-radius: 18px;
  background: rgba(10, 17, 25, 0.9);
  border: 1px solid var(--line);
}

.compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-card .media-body {
  gap: 8px;
}

.compact-card strong {
  font-size: 0.96rem;
}

.center-stat {
  text-align: center;
}

.center-stat h3 {
  font-size: clamp(2rem, 4vw, 2.7rem);
  line-height: 1;
}

.analytics-card-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.spark-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 0.86rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 999px;
}

.dot.views { background: #62f2c1; }
.dot.watch { background: #59d0ff; }
.dot.subs { background: #ffb84d; }

.settings-stack {
  display: grid;
  gap: 18px;
}

.settings-block {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(10, 16, 24, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.settings-block summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
}

.settings-block summary::-webkit-details-marker {
  display: none;
}

.settings-block[open] summary {
  border-bottom: 1px solid var(--line);
}

.settings-block > *:not(summary) {
  padding: 0 22px 22px;
}

.detail-hero {
  align-items: stretch;
}

.detail-highlight-grid,
.detail-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-highlight,
.detail-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(10, 18, 28, 0.9);
  border: 1px solid var(--line);
}

.detail-highlight span,
.detail-card span {
  color: var(--text-soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-highlight strong,
.detail-card strong {
  font-size: 0.98rem;
  line-height: 1.5;
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 600;
}

.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus,
.range-form input:focus {
  outline: none;
  border-color: rgba(98, 242, 193, 0.4);
  box-shadow: 0 0 0 4px rgba(98, 242, 193, 0.08);
}

.board-card {
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.board-card:hover {
  transform: translateY(-2px);
  border-color: rgba(98, 242, 193, 0.2);
  background: rgba(19, 27, 38, 0.96);
}

.table-row.compact,
.idea-row.compact,
.media-row.compact {
  align-items: center;
}

.flatpickr-calendar {
  background: #0b121c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
}

.flatpickr-day,
.flatpickr-weekday,
.flatpickr-current-month input.cur-year {
  color: var(--text);
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: #62f2c1;
  border-color: #62f2c1;
  color: #071019;
}

.thumb,
.media-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.media-body {
  display: grid;
  gap: 10px;
}

.top-gap {
  margin-top: 18px;
}

.kanban-column {
  padding: 18px;
  background: rgba(10, 19, 33, 0.75);
}

.kanban-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(16, 28, 46, 0.86);
  border: 1px solid var(--line);
}

.kanban-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label,
.inline-form-grid label {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-weight: 600;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.inline-form-grid input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 28, 0.82);
  color: var(--text);
  font: inherit;
}

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

.collector-grid,
.inline-form-grid {
  display: grid;
  gap: 12px;
}

.collector-grid { grid-template-columns: 1fr; }
.inline-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inline-form-grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--text-soft);
}

.prose {
  white-space: pre-wrap;
  line-height: 1.7;
  color: #d7e1f5;
}

.detail-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.detail-list li {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(16, 30, 48, 0.64);
  border: 1px solid var(--line);
}

.empty-state {
  padding: 18px;
  border-radius: 18px;
  color: var(--text-soft);
  background: rgba(12, 22, 37, 0.72);
  border: 1px dashed var(--line-strong);
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-shell {
  width: min(100%, 480px);
  padding: 28px;
}

.login-card {
  padding: 28px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: rgba(10, 18, 32, 0.92);
  box-shadow: var(--shadow);
}

@media (max-width: 1240px) {
  .stats-grid,
  .content-grid.two-col,
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .kanban-board {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
  .metric-grid.wide,
  .board-shell {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
  }
  .client-spotlight-grid,
  .detail-highlight-grid,
  .detail-card-grid,
  .analytics-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .page-content,
  .flash-stack {
    width: min(calc(100vw - 32px), var(--content-max));
  }
  .topbar {
    padding: 22px 16px 18px;
  }
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .page-content,
  .flash-stack {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (max-width: 720px) {
  .page-content,
  .flash-stack {
    width: calc(100vw - 24px);
  }
  .kanban-board,
  .inline-form-grid,
  .inline-form-grid.three-col,
  .metric-grid,
  .metric-grid.wide,
  .board-shell,
  .media-grid,
  .client-spotlight-grid,
  .detail-highlight-grid,
  .detail-card-grid,
  .analytics-card-grid {
    grid-template-columns: 1fr;
  }
  .topbar,
  .client-card-head,
  .panel-head,
  .collector-head,
  .idea-row,
  .table-row,
  .media-row,
  .media-card,
  .hero-card-top,
  .board-lane-head,
  .board-card-top,
  .board-card-foot,
  .source-row-head {
    flex-direction: column;
  }
  .period-toolbar,
  .range-form {
    flex-direction: column;
    align-items: stretch;
  }
  .period-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .tab-link,
  .period-pill {
    white-space: nowrap;
  }
  .sidebar {
    padding: 20px 14px;
  }
  .page-content {
    padding: 20px 0 36px;
  }
  .hero-metric strong {
    font-size: 2.5rem;
  }
  .board-lane {
    min-height: auto;
  }
  .media-card,
  .media-row {
    grid-template-columns: 1fr;
  }
}
