:root {
  color-scheme: dark;
  --bg: #06090b;
  --bg-soft: #0a1013;
  --surface: rgba(12, 18, 22, .88);
  --surface-2: rgba(18, 27, 32, .92);
  --surface-3: #17232a;
  --line: rgba(113, 232, 255, .13);
  --line-strong: rgba(113, 232, 255, .28);
  --text: #eef7fa;
  --muted: #8ea6ad;
  --dim: #5e737b;
  --orange: #fd8043;
  --blue: #37d5ff;
  --cream: #fffadb;
  --success: #35e29a;
  --warning: #f6bd43;
  --danger: #ff5f57;
  --magenta: #d96cff;
  --glow-blue: 0 0 0 1px rgba(55, 213, 255, .14), 0 18px 56px rgba(0, 0, 0, .38);
  --glow-orange: 0 0 0 1px rgba(253, 128, 67, .18), 0 18px 48px rgba(0, 0, 0, .34);
  --radius: 8px;
  --shadow: 0 18px 54px rgba(0, 0, 0, .38);
  --sidebar: 272px;
  font-family: "Aptos", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(55, 213, 255, .06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(55, 213, 255, .035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(253, 128, 67, .055), transparent 32%),
    linear-gradient(180deg, #061014 0%, #06090b 42%, #040607 100%),
    var(--bg);
  background-size: 48px 48px, 48px 48px, auto, auto;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 0, rgba(55, 213, 255, .08) 50%, transparent 100%);
  opacity: .05;
  mask-image: repeating-linear-gradient(180deg, #000 0 1px, transparent 1px 7px);
}

button,
input,
select {
  font: inherit;
}

button {
  touch-action: manipulation;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shell-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  padding: 18px;
  background: rgba(5, 10, 13, .86);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 10;
  box-shadow: 18px 0 44px rgba(0, 0, 0, .22);
  overflow-y: auto;
}

.brand-block {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  position: relative;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(145deg, var(--blue), var(--orange));
  color: #031014;
  font-weight: 900;
  box-shadow: 0 0 28px rgba(55, 213, 255, .25);
}

.brand-block strong {
  display: block;
  font-size: 14px;
  letter-spacing: .02em;
}

.brand-block span,
.side-label,
.eyebrow,
.section-note,
.confidence-panel span,
.meta-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.role-switcher {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(55, 213, 255, .035);
}

.role-pill {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.role-pill:hover,
.role-pill.is-active {
  color: var(--text);
  background: rgba(55, 213, 255, .12);
  border-color: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(55, 213, 255, .12);
}

.side-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.side-label {
  padding: 6px 8px;
}

.side-link {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.side-link:hover,
.side-link.is-active {
  background: linear-gradient(90deg, rgba(55, 213, 255, .13), rgba(55, 213, 255, .025));
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--blue);
}

.confidence-panel {
  margin-top: auto;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(53, 226, 154, .08), rgba(12, 18, 22, .9));
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: inset 0 0 0 1px rgba(53, 226, 154, .05);
}

.confidence-panel strong {
  display: block;
  color: var(--success);
  font-size: 30px;
  margin: 8px 0 2px;
}

.confidence-panel p {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
  font-size: 12px;
}

.app-shell {
  margin-left: var(--sidebar);
  padding: 24px 28px 56px;
  min-width: 0;
  max-width: 1680px;
}

.page-view {
  display: none;
}

.page-view.is-active {
  display: block;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: rgba(6, 12, 15, .62);
  backdrop-filter: blur(14px);
  box-shadow: var(--glow-blue);
}

.topbar h1,
.executive-brief h2,
.panel h2,
.section-heading h2,
.dialog-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 25px;
  font-weight: 850;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.source-badge,
.impact-chip,
.risk-chip,
.autonomy-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid var(--line);
  white-space: nowrap;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.status-badge.ok {
  color: var(--success);
  background: rgba(53, 226, 154, .1);
  border-color: rgba(53, 226, 154, .28);
}

.status-badge.warn {
  color: var(--warning);
  background: rgba(246, 189, 67, .1);
  border-color: rgba(246, 189, 67, .28);
}

.status-badge.risk {
  color: var(--danger);
  background: rgba(255, 95, 87, .1);
  border-color: rgba(255, 95, 87, .28);
}

.status-badge.neutral {
  color: var(--muted);
  background: rgba(142, 166, 173, .08);
  border-color: rgba(142, 166, 173, .2);
}

.source-real {
  color: var(--success);
  background: rgba(53, 208, 127, .1);
  border-color: rgba(53, 208, 127, .25);
}

.source-ai {
  color: var(--blue);
  background: rgba(55, 184, 247, .1);
  border-color: rgba(55, 184, 247, .25);
}

.source-estimate {
  color: var(--warning);
  background: rgba(246, 189, 67, .1);
  border-color: rgba(246, 189, 67, .25);
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(12, 18, 22, .92);
  color: var(--text);
  border-radius: 7px;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: rgba(55, 213, 255, .12);
  color: var(--blue);
}

.executive-brief {
  display: grid;
  grid-template-columns: minmax(300px, 1.35fr) minmax(360px, 1fr);
  gap: 18px;
  padding: 24px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(135deg, rgba(55, 213, 255, .12), transparent 30%),
    linear-gradient(225deg, rgba(253, 128, 67, .1), transparent 38%),
    rgba(9, 16, 20, .9);
  border-radius: var(--radius);
  box-shadow: var(--glow-blue);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.executive-brief::after,
.analytics-title-card::after,
.data-panel::after,
.panel::after,
.decision-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), transparent 28%);
  opacity: .42;
}

.executive-brief > *,
.analytics-title-card > *,
.data-panel > *,
.panel > *,
.decision-card > * {
  position: relative;
  z-index: 1;
}

.brief-copy h2 {
  max-width: 920px;
  font-size: clamp(26px, 3.3vw, 48px);
  line-height: 1.02;
  max-width: 980px;
}

.brief-copy p:not(.eyebrow) {
  max-width: 780px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.closing-evidence {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 920px;
  margin-top: 18px;
}

.closing-evidence:empty {
  display: none;
}

.closing-evidence div {
  min-width: 0;
  border: 1px solid rgba(113, 232, 255, .14);
  border-radius: 7px;
  padding: 10px;
  background: rgba(2, 8, 11, .54);
}

.closing-evidence span {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.closing-evidence strong {
  display: block;
  margin-top: 6px;
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.35;
}

.brief-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-card,
.panel,
.decision-card,
.module-card,
.autonomy-card,
.audit-item {
  background: linear-gradient(180deg, rgba(18, 29, 35, .92), rgba(9, 14, 18, .92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .18);
}

.metric-card {
  padding: 14px;
  border-top: 1px solid var(--line-strong);
}

.metric-card-primary {
  border-color: rgba(253, 128, 67, .32);
  background:
    linear-gradient(135deg, rgba(253, 128, 67, .1), transparent 46%),
    linear-gradient(180deg, rgba(18, 29, 35, .96), rgba(9, 14, 18, .94));
}

.metric-value {
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  color: #f6fbff;
}

.metric-detail {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.decision-hint {
  margin-top: 10px;
  border-top: 1px solid rgba(113, 232, 255, .1);
  padding-top: 8px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  line-height: 1.35;
}

.metric-comparisons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.metric-comparisons div {
  min-width: 0;
  border: 1px solid rgba(113, 232, 255, .12);
  border-radius: 6px;
  padding: 7px;
  background: rgba(2, 8, 11, .48);
}

.metric-comparisons span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.metric-comparisons strong {
  display: block;
  margin-top: 3px;
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, .75fr);
  gap: 18px;
  margin-bottom: 24px;
}

.morning-cockpit-section {
  margin-bottom: 18px;
}

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

.cockpit-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(15, 24, 29, .94), rgba(8, 13, 16, .92));
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.cockpit-card.ok {
  border-color: rgba(53, 226, 154, .24);
}

.cockpit-card.warn {
  border-color: rgba(246, 189, 67, .24);
}

.cockpit-card.risk {
  border-color: rgba(255, 95, 87, .24);
}

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

.cockpit-chip {
  flex-shrink: 0;
}

.cockpit-card > strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 24px;
  line-height: 1.15;
}

.cockpit-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.cockpit-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(113, 232, 255, .08);
}

.cockpit-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.cockpit-list strong {
  color: var(--cream);
  font-size: 12px;
  text-align: right;
}

.panel {
  padding: 18px;
  box-shadow: var(--glow-blue);
}

.panel-header,
.section-heading,
.dialog-head,
.decision-head,
.module-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.text-button:hover {
  color: var(--orange);
}

.diagnostic-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.diagnostic-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(6, 12, 15, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.diagnostic-item strong {
  display: block;
  margin: 8px 0;
}

.diagnostic-item p {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
  font-size: 12px;
}

.purpose-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--text);
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, .035);
}

.purpose-icon svg {
  width: 17px;
  height: 17px;
}

.action-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.impact-chip {
  color: var(--orange);
  background: rgba(253, 128, 67, .1);
  border-color: rgba(253, 128, 67, .25);
}

.risk-chip {
  color: var(--danger);
  background: rgba(255, 95, 87, .1);
  border-color: rgba(255, 95, 87, .25);
}

.approval-bar {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button {
  border-radius: 7px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: .03em;
}

.primary-button {
  background: linear-gradient(135deg, var(--orange), #ffab62);
  color: #190f09;
  border-color: var(--orange);
  box-shadow: 0 0 0 1px rgba(253, 128, 67, .18), 0 10px 24px rgba(253, 128, 67, .12);
}

.secondary-button {
  color: var(--text);
  background: rgba(55, 213, 255, .08);
  border-color: var(--line-strong);
}

.primary-button:hover,
.secondary-button:hover {
  filter: brightness(1.08);
}

.section-block {
  margin-top: 28px;
}

.section-heading {
  align-items: end;
  margin-bottom: 14px;
}

.section-heading h2 {
  font-size: 22px;
}

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

.focus-filter-section {
  margin-top: 18px;
}

.change-section {
  margin-top: 18px;
}

.change-grid,
.focus-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.change-card,
.focus-filter-card {
  border: 1px solid rgba(246, 189, 67, .18);
  border-radius: var(--radius);
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(246, 189, 67, .07), transparent 54%),
    rgba(6, 12, 15, .7);
}

.change-card.ok {
  border-color: rgba(53, 226, 154, .22);
  background:
    linear-gradient(135deg, rgba(53, 226, 154, .07), transparent 54%),
    rgba(6, 12, 15, .7);
}

.change-card.risk {
  border-color: rgba(255, 95, 87, .24);
  background:
    linear-gradient(135deg, rgba(255, 95, 87, .075), transparent 54%),
    rgba(6, 12, 15, .7);
}

.change-card.warn {
  border-color: rgba(246, 189, 67, .24);
}

.change-card strong,
.focus-filter-card strong {
  display: block;
  margin: 8px 0;
}

.change-card p,
.focus-filter-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 12px;
}

.decision-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 318px;
}

.decision-card[data-priority="critical"] {
  border-color: rgba(255, 95, 87, .46);
  box-shadow: 0 0 0 1px rgba(255, 95, 87, .1), 0 14px 42px rgba(0, 0, 0, .28);
}

.decision-card h3,
.module-card h3,
.autonomy-card h3 {
  margin: 0;
  font-size: 16px;
}

.decision-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.queue-reason {
  border: 1px solid rgba(113, 232, 255, .12);
  border-radius: 7px;
  padding: 10px;
  background: rgba(6, 12, 15, .62);
}

.queue-reason span {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.queue-reason p {
  font-size: 12px;
}

.decision-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.meta-box {
  border: 1px solid var(--line);
  background: rgba(3, 9, 12, .68);
  border-radius: 7px;
  padding: 10px;
}

.meta-box strong {
  display: block;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.autonomy-track {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.autonomy-card {
  padding: 14px;
  min-height: 154px;
}

.autonomy-card.is-current {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(55, 213, 255, .22), 0 0 22px rgba(55, 213, 255, .06);
}

.autonomy-badge {
  margin-bottom: 12px;
  color: var(--blue);
  background: rgba(55, 184, 247, .1);
  border-color: rgba(55, 184, 247, .25);
}

.autonomy-card p {
  color: var(--muted);
  line-height: 1.42;
  margin: 8px 0 0;
  font-size: 12px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.module-card {
  padding: 18px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.module-card:hover,
.decision-card:hover,
.metric-card:hover,
.data-panel:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  box-shadow: var(--glow-blue);
}

.module-card p {
  color: var(--muted);
  line-height: 1.5;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 14px;
}

.module-chip {
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.module-outcome {
  margin-top: auto;
  padding: 12px;
  border: 1px solid rgba(55, 184, 247, .24);
  border-radius: var(--radius);
  color: var(--cream);
  background: rgba(55, 213, 255, .08);
  font-weight: 800;
  line-height: 1.35;
}

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

.audit-item {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
}

.audit-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audit-item strong {
  display: block;
  margin-bottom: 3px;
}

.audit-item p {
  color: var(--muted);
  margin: 0;
}

.analytics-page {
  display: none;
}

.analytics-page.is-active {
  display: block;
}

.analytics-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(310px, .65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.analytics-title-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(55, 213, 255, .12), transparent 38%),
    rgba(9, 16, 20, .9);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--glow-blue);
}

.analytics-title-card h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.04;
}

.analytics-title-card p {
  max-width: 820px;
  color: var(--muted);
  line-height: 1.55;
}

.analytics-action-card {
  border: 1px solid rgba(253, 128, 67, .3);
  background: linear-gradient(180deg, rgba(253, 128, 67, .13), rgba(12, 18, 22, .88));
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--glow-orange);
}

.analytics-action-card h3 {
  margin: 8px 0;
  font-size: 18px;
}

.analytics-action-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.analytics-grid.compact {
  grid-template-columns: repeat(3, 1fr);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.board-analytics .chart-grid {
  margin-bottom: 12px;
}

.board-source-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.board-source-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.chart-panel {
  min-height: 260px;
}

.chart-body {
  margin-top: 16px;
}

.data-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 24, 29, .92), rgba(8, 13, 16, .92));
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

.data-panel h3 {
  margin: 0;
  font-size: 16px;
}

.panel-sub {
  color: var(--muted);
  margin: 4px 0 14px;
  font-size: 12px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 18px;
  margin-bottom: 18px;
}

.drilldown-panel {
  margin-bottom: 18px;
}

.drilldown-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.drilldown-field {
  display: grid;
  gap: 7px;
}

.drilldown-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(5, 12, 15, .92);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.drilldown-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(5, 12, 15, .92);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.drilldown-field select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(55, 213, 255, .14);
}

.drilldown-field input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px rgba(55, 213, 255, .14);
}

.drilldown-custom-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: -4px 0 14px;
}

.drilldown-summary {
  margin-bottom: 14px;
}

.drilldown-table td,
.drilldown-table th {
  white-space: normal;
}

.data-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: min(720px, 100%);
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 10px 9px;
  border-bottom: 1px solid rgba(113, 232, 255, .09);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: normal;
}

.data-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-family: var(--font-mono);
  background: rgba(55, 213, 255, .035);
}

.data-table td {
  color: var(--text);
  font-size: 13px;
}

.data-table tbody tr:hover td {
  background: rgba(55, 213, 255, .045);
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.num {
  font-variant-numeric: tabular-nums;
}

.td-right {
  text-align: right !important;
}

.bar-list {
  display: grid;
  gap: 11px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr 72px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.bar-track {
  height: 8px;
  background: rgba(2, 8, 11, .7);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 18px currentColor;
}

.column-chart {
  height: 180px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
  gap: 10px;
  align-items: end;
}

.column-item {
  min-width: 0;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 6px;
  align-items: end;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
}

.column-track {
  height: 126px;
  display: flex;
  align-items: end;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(2, 8, 11, .7);
  overflow: hidden;
}

.column-fill {
  width: 100%;
  min-height: 3px;
  border-radius: 4px;
  box-shadow: 0 0 18px currentColor;
}

.column-item strong {
  color: var(--text);
  font-size: 12px;
}

.donut-layout {
  display: grid;
  grid-template-columns: 136px 1fr;
  gap: 16px;
  align-items: center;
}

.donut {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 0 34px rgba(55, 213, 255, .1);
}

.donut-center {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background: #071014;
  border: 1px solid var(--line);
}

.donut-center strong {
  font-family: var(--font-mono);
  font-size: 19px;
}

.donut-center span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.donut-legend {
  display: grid;
  gap: 8px;
}

.donut-legend div {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.donut-legend strong {
  color: var(--text);
  font-family: var(--font-mono);
}

.status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--muted);
}

.status-dot.ok {
  background: var(--success);
}

.status-dot.warn {
  background: var(--warning);
}

.status-dot.risk {
  background: var(--danger);
}

.mini-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(6, 12, 15, .68);
  padding: 12px;
}

.mini-card strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}

.n2-plan-panel {
  border-color: rgba(253, 128, 67, .26);
}

.n2-plan-panel.risk {
  border-color: rgba(255, 95, 87, .38);
  box-shadow: 0 0 0 1px rgba(255, 95, 87, .08), var(--shadow);
}

.n2-plan-panel.warn {
  border-color: rgba(246, 189, 67, .35);
}

.n2-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.n2-step {
  position: relative;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(3, 9, 12, .72);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.step-index {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #160f08;
  background: var(--orange);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 900;
}

.n2-step strong {
  font-size: 15px;
  line-height: 1.32;
}

.n2-step p,
.n2-step small,
.guardrail-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.n2-step small {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.step-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.step-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--cream);
  background: rgba(55, 213, 255, .05);
  font-size: 10px;
  font-weight: 800;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.guardrail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.guardrail-card {
  border: 1px solid rgba(113, 232, 255, .12);
  border-radius: 7px;
  padding: 11px;
  background: rgba(55, 213, 255, .035);
}

.goal-command-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.planner-panel {
  border-color: rgba(55, 213, 255, .22);
}

.plan-status-cluster,
.plan-version-strip,
.planner-version-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-status-cluster {
  justify-content: flex-end;
}

.plan-version-strip {
  margin: 14px 0 2px;
}

.plan-version-strip span,
.planner-version-row span,
.plan-state {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(6, 12, 15, .72);
  color: var(--muted);
  padding: 6px 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.planner-version-row {
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.planner-version-row span {
  border-radius: 7px;
}

.plan-state.ok,
.plan-version-strip.ok span:first-child {
  border-color: rgba(53, 226, 154, .36);
  color: var(--success);
  background: rgba(53, 226, 154, .1);
}

.plan-state.warn,
.plan-version-strip.warn span:first-child {
  border-color: rgba(246, 189, 67, .36);
  color: var(--warning);
  background: rgba(246, 189, 67, .1);
}

.plan-state.risk,
.plan-version-strip.risk span:first-child {
  border-color: rgba(255, 95, 87, .4);
  color: var(--danger);
  background: rgba(255, 95, 87, .1);
}

.planner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.planner-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.planner-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(3, 9, 12, .72);
  overflow: hidden;
}

.planner-input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  padding: 10px 11px;
  font-family: var(--font-mono);
  font-weight: 850;
}

.planner-input-wrap em {
  color: var(--dim);
  font-style: normal;
  padding-right: 10px;
}

.planner-input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(55, 213, 255, .18);
}

.planner-divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0 14px;
}

.feasibility-card.ok {
  border-color: rgba(53, 226, 154, .34);
  background: linear-gradient(180deg, rgba(53, 226, 154, .12), rgba(12, 18, 22, .88));
}

.feasibility-card.warn {
  border-color: rgba(246, 189, 67, .34);
  background: linear-gradient(180deg, rgba(246, 189, 67, .13), rgba(12, 18, 22, .88));
}

.feasibility-card.risk {
  border-color: rgba(255, 95, 87, .38);
  background: linear-gradient(180deg, rgba(255, 95, 87, .13), rgba(12, 18, 22, .88));
}

.feasibility-meter {
  display: grid;
  gap: 10px;
  margin: 14px 0 16px;
}

.meter-track {
  height: 12px;
  border: 1px solid var(--line);
  background: rgba(2, 8, 11, .8);
  border-radius: 999px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--success);
  box-shadow: 0 0 22px currentColor;
}

.feasibility-meter.warn .meter-fill {
  background: var(--warning);
}

.feasibility-meter.risk .meter-fill {
  background: var(--danger);
}

.state-explainer {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  margin: 0 0 14px;
  background: rgba(6, 12, 15, .64);
}

.state-explainer strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.state-explainer p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.state-explainer.ok {
  border-color: rgba(53, 226, 154, .28);
  background: rgba(53, 226, 154, .065);
}

.state-explainer.ok strong {
  color: var(--success);
}

.state-explainer.warn {
  border-color: rgba(246, 189, 67, .28);
  background: rgba(246, 189, 67, .065);
}

.state-explainer.warn strong {
  color: var(--warning);
}

.state-explainer.risk {
  border-color: rgba(255, 95, 87, .32);
  background: rgba(255, 95, 87, .065);
}

.state-explainer.risk strong {
  color: var(--danger);
}

.rhythm-panel.ahead {
  border-color: rgba(53, 226, 154, .28);
}

.rhythm-panel.recover {
  border-color: rgba(246, 189, 67, .28);
}

.rhythm-panel.risk {
  border-color: rgba(255, 95, 87, .32);
}

.rhythm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.rhythm-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 13px;
  background: rgba(6, 12, 15, .68);
  min-height: 118px;
}

.rhythm-card strong {
  display: block;
  margin: 7px 0;
  font-size: 24px;
  letter-spacing: 0;
}

.rhythm-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 12px;
}

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

.channel-target-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: rgba(55, 213, 255, .035);
}

.channel-target-card strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.channel-target-card p,
.channel-target-card small {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.channel-target-card div:last-child {
  display: grid;
  justify-items: end;
  text-align: right;
}

.channel-target-card div:last-child span {
  border: 1px solid rgba(55, 213, 255, .24);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 850;
}

.empty-history {
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 16px;
  background: rgba(6, 12, 15, .5);
}

.empty-history p {
  margin: 6px 0 0;
  color: var(--muted);
}

.goal-history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.goal-history-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: rgba(6, 12, 15, .66);
}

.goal-history-card strong {
  display: block;
  margin: 5px 0;
  font-size: 20px;
}

.goal-history-card p,
.goal-history-card small {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.goal-history-card div:last-child {
  display: grid;
  gap: 5px;
  justify-items: end;
  text-align: right;
}

.mini-action {
  min-height: 30px;
  padding: 7px 10px;
  font-size: 11px;
}

.kpi-map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.kpi-map-card {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(6, 12, 15, .68);
  padding: 13px;
}

.kpi-map-card strong {
  display: block;
  margin-bottom: 8px;
}

.kpi-map-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
  font-size: 12px;
}

.funnel {
  display: grid;
  gap: 9px;
}

.funnel-step {
  display: grid;
  grid-template-columns: 140px 1fr 72px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.heat-cell {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: rgba(6, 12, 15, .68);
}

.heat-cell strong {
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}

.heat-cell span {
  color: var(--muted);
  font-size: 11px;
}

.heat-1 {
  background: rgba(55, 184, 247, .08);
}

.heat-2 {
  background: rgba(53, 208, 127, .11);
}

.heat-3 {
  background: rgba(253, 128, 67, .14);
  border-color: rgba(253, 128, 67, .35);
}

.insight-stack {
  display: grid;
  gap: 10px;
}

.insight {
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  background: rgba(6, 12, 15, .72);
  border-radius: 7px;
  padding: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.insight.risk {
  border-left-color: var(--danger);
}

.insight.ok {
  border-left-color: var(--success);
}

.insight.warn {
  border-left-color: var(--warning);
}

.insight strong {
  display: block;
  color: var(--text);
  margin-bottom: 3px;
}

.rules-grid {
  display: grid;
  gap: 10px;
}

.module-flow {
  margin: 18px 0;
}

.module-flow-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.module-flow-card {
  border: 1px solid rgba(113, 232, 255, .12);
  border-radius: 7px;
  padding: 12px;
  background: rgba(6, 12, 15, .68);
  min-height: 156px;
}

.module-flow-card strong {
  display: block;
  margin: 10px 0 6px;
}

.module-flow-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
  font-size: 12px;
}

.rule-card {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  background: rgba(6, 12, 15, .72);
}

.rule-card strong {
  display: block;
  margin: 6px 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
}

.rule-card small {
  color: var(--muted);
  line-height: 1.45;
}

.evidence-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  background: rgba(9, 16, 20, .98);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0;
}

.evidence-dialog::backdrop {
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(3px);
}

.dialog-head {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

#dialog-body {
  padding: 18px;
}

.evidence-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.evidence-list li {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  color: var(--muted);
  line-height: 1.5;
  background: rgba(55, 213, 255, .035);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  color: #031014;
  background: linear-gradient(135deg, var(--blue), var(--cream));
  border-radius: 7px;
  padding: 12px 14px;
  font-weight: 900;
  box-shadow: var(--shadow);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 20;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .executive-brief,
  .board-grid,
  .analytics-hero,
  .split-grid,
  .goal-command-grid {
    grid-template-columns: 1fr;
  }

  .decision-grid,
  .change-grid,
  .focus-filter-grid,
  .diagnostic-list,
  .closing-evidence {
    grid-template-columns: 1fr;
  }

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

  .autonomy-track {
    grid-template-columns: repeat(3, 1fr);
  }

  .analytics-grid,
  .analytics-grid.compact,
  .chart-grid,
  .board-source-grid,
  .morning-cockpit-grid,
  .drilldown-filter-grid,
  .drilldown-custom-range,
  .kpi-map-grid,
  .rhythm-grid,
  .channel-target-grid,
  .module-flow-grid,
  .n2-plan-grid,
  .guardrail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 840px) {
  :root {
    --sidebar: 0px;
  }

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

  .app-shell {
    margin-left: 0;
    padding: 18px;
  }

  .module-grid,
  .autonomy-track,
  .brief-grid,
  .analytics-grid,
  .analytics-grid.compact,
  .chart-grid,
  .board-source-grid,
  .morning-cockpit-grid,
  .mini-card-grid,
  .drilldown-filter-grid,
  .drilldown-custom-range,
  .planner-grid,
  .kpi-map-grid,
  .rhythm-grid,
  .channel-target-grid,
  .module-flow-grid,
  .goal-history-card,
  .n2-plan-grid,
  .guardrail-grid {
    grid-template-columns: 1fr;
  }

  .audit-item {
    grid-template-columns: 1fr;
  }

  .funnel-step,
  .bar-row {
    grid-template-columns: 1fr;
  }

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

  .donut-layout {
    grid-template-columns: 1fr;
  }

  .metric-comparisons {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
