:root {
  color-scheme: dark;
  --bg: #101418;
  --surface: #151b20;
  --panel: #1c242a;
  --panel-2: #202b32;
  --ink: #f3f7f4;
  --ink-2: #c9d4ce;
  --muted: #91a09a;
  --line: #314047;
  --line-2: #26343b;
  --brand: #9ee6b4;
  --brand-2: #73b7f2;
  --accent: #f0c15c;
  --coral: #f08a78;
  --violet: #b7a7ff;
  --success: #63d894;
  --warning: #f0c15c;
  --danger: #ef766d;
  --shadow: 0 20px 52px rgba(0, 0, 0, .32);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef3f1;
  --surface: #ffffff;
  --panel: #f9fbfa;
  --panel-2: #eef5f2;
  --ink: #111816;
  --ink-2: #293532;
  --muted: #66746f;
  --line: #cfdbd6;
  --line-2: #dfe8e4;
  --brand: #147a46;
  --brand-2: #256fa8;
  --accent: #916415;
  --coral: #b44736;
  --violet: #6659c9;
  --success: #17894f;
  --warning: #9a6b12;
  --danger: #b8322b;
  --shadow: 0 18px 44px rgba(24, 36, 32, .12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand,
.nav-button,
.rail-status,
.topbar,
.topbar-actions,
.metric-strip,
.job-card-head,
.job-meta,
.timeline-item,
.record-item,
.pitch-step,
.crew-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #07110d;
  font-weight: 900;
}

.brand strong,
.brand small,
.metric span,
.metric small {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.1;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  justify-content: flex-start;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  font-weight: 700;
}

.nav-button:hover,
.nav-button.active {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--ink);
}

.rail-status {
  margin-top: auto;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(99, 216, 148, .12);
}

.workspace {
  min-width: 0;
  overflow-x: hidden;
  padding: 18px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.topbar {
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  font-size: 15px;
  line-height: 1.25;
}

.topbar-actions {
  gap: 8px;
}

.button,
.icon-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
}

.button {
  padding: 0 14px;
}

.button.secondary {
  background: var(--panel-2);
}

.icon-button {
  width: 42px;
  padding: 0;
}

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

.metric,
.detail-panel,
.board-column,
.dispatch-map,
.queue-list,
.proof-card,
.workflow-map,
.record-stack,
.pitch-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 104px;
  padding: 14px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
}

.metric small {
  margin-top: 7px;
  color: var(--ink-2);
  font-size: 13px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}

.board-column {
  min-height: 560px;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
}

.column-head {
  display: grid;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-2);
}

.column-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.job-card {
  width: 100%;
  min-height: 156px;
  padding: 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  display: grid;
  gap: 10px;
}

.job-card:hover,
.job-card.active {
  border-color: var(--brand);
}

.job-card-head {
  justify-content: space-between;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(158, 230, 180, .12);
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
}

.tag.warning {
  background: rgba(240, 193, 92, .14);
  color: var(--accent);
}

.tag.danger {
  background: rgba(239, 118, 109, .14);
  color: var(--danger);
}

.job-card p,
.detail-panel p,
.proof-card p,
.pitch-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.job-meta {
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink-2);
  font-size: 12px;
}

.progress {
  height: 7px;
  border-radius: 999px;
  background: var(--line-2);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.detail-panel {
  min-height: 560px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 16px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--panel);
}

.timeline-mark {
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--brand-2);
  flex: 0 0 auto;
}

.dispatch-grid,
.workflow-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 14px;
}

.dispatch-map,
.queue-list,
.workflow-map,
.record-stack {
  min-height: 520px;
  padding: 16px;
}

.map-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.crew-row {
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--line-2);
}

.load-bar {
  width: 42%;
  min-width: 120px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-2);
  overflow: hidden;
}

.load-bar span {
  display: block;
  height: 100%;
  background: var(--coral);
}

.queue-list,
.record-stack,
.workflow-map {
  display: grid;
  align-content: start;
  gap: 10px;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.proof-card {
  min-height: 280px;
  overflow: hidden;
}

.proof-image {
  height: 150px;
  background:
    linear-gradient(135deg, rgba(158, 230, 180, .22), rgba(115, 183, 242, .16)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .08) 0 10px, transparent 10px 20px);
  border-bottom: 1px solid var(--line);
}

.proof-card-body {
  padding: 14px;
  display: grid;
  gap: 10px;
}

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

.workflow-node,
.record-item,
.pitch-card {
  padding: 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--panel);
}

.workflow-node {
  min-height: 122px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.record-item {
  gap: 10px;
  align-items: flex-start;
}

.record-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: rgba(183, 167, 255, .14);
  color: var(--violet);
  font-size: 12px;
  font-weight: 900;
  flex: 0 0 auto;
}

.pitch-layout {
  display: grid;
  grid-template-columns: repeat(5, minmax(210px, 1fr));
  gap: 10px;
  overflow-x: auto;
}

.pitch-card {
  min-height: 520px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.pitch-step {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.presentation .rail,
.presentation .metric-strip {
  display: none;
}

.presentation .app-shell {
  grid-template-columns: 1fr;
}

.presentation .workspace {
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 2px;
  }

  .nav-button {
    flex: 0 0 132px;
    width: 132px;
  }

  .board-layout,
  .dispatch-grid,
  .workflow-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    min-height: auto;
  }

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

@media (max-width: 720px) {
  .workspace {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .button.secondary {
    flex: 1;
  }

  h1 {
    font-size: 24px;
  }

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

  .kanban {
    grid-template-columns: repeat(4, 82vw);
  }

  .proof-grid,
  .workflow-map {
    grid-template-columns: 1fr;
  }
}
