:root {
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3ea;
  --paper: #ffffff;
  --bg: #eef3f6;
  --navy: #10233f;
  --teal: #0f766e;
  --cyan: #0ea5e9;
  --green: #22c55e;
  --amber: #f59e0b;
  --red: #ef4444;
  --slate: #475569;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 16px 20px;
  color: white;
  background: linear-gradient(90deg, #10233f 0%, #13405c 48%, #0f766e 100%);
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}

.mark {
  width: 22px;
  height: 22px;
  background:
    linear-gradient(135deg, #22c55e 0 45%, transparent 46%),
    linear-gradient(315deg, #0ea5e9 0 45%, transparent 46%),
    #14b8a6;
  border-radius: 5px;
  display: inline-block;
}

.brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(20px, 3vw, 31px);
  line-height: 1.1;
}

.source-chip {
  white-space: nowrap;
  color: #dbeafe;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12px;
}

.view-switch {
  display: inline-flex;
  gap: 8px;
  margin: 14px 0 0;
  padding: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.view-switch button {
  min-height: 38px;
  padding: 0 14px;
  color: var(--slate);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
}

.view-switch button.active {
  color: white;
  background: var(--teal);
}

.pov-intro {
  margin: 14px 0;
  padding: 18px;
  color: white;
  background: linear-gradient(90deg, #10233f 0%, #174577 52%, #0f766e 100%);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.pov-intro span {
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.pov-intro h2 {
  margin-top: 8px;
  font-size: clamp(24px, 3vw, 38px);
}

.pov-intro p {
  max-width: 850px;
  margin: 10px 0 0;
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.45;
}

.hero-highlight {
  display: grid;
  grid-template-columns: 0.72fr 1.45fr 0.86fr;
  gap: 12px;
  margin: 14px 0;
}

.hero-copy,
.highlight-card,
.outlook-composition {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.hero-copy {
  min-height: 184px;
  padding: 18px;
  color: white;
  background: linear-gradient(135deg, #10233f 0%, #0f766e 100%);
}

.hero-copy span,
.mini-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-copy span {
  color: #a7f3d0;
}

.hero-copy h2 {
  margin-top: 20px;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 0.95;
}

.hero-copy p {
  max-width: 260px;
  margin: 14px 0 0;
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.45;
}

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

.highlight-card {
  min-height: 184px;
  padding: 16px;
  border-top: 5px solid var(--navy);
}

.highlight-card.success {
  border-top-color: var(--green);
}

.highlight-card.info {
  border-top-color: var(--cyan);
}

.highlight-card.risk {
  border-top-color: var(--red);
}

.highlight-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.highlight-card strong {
  display: block;
  margin-top: 20px;
  font-size: clamp(24px, 2.7vw, 42px);
  line-height: 1;
}

.highlight-card small {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

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

.exec-summary-grid .highlight-card {
  min-height: 150px;
}

.gap-bridge {
  display: grid;
  grid-template-columns: 1fr 44px 1fr 44px 1fr 1fr;
  gap: 10px;
  align-items: stretch;
  margin-top: 12px;
}

.bridge-step {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfe;
}

.bridge-step span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.bridge-step strong {
  display: block;
  margin-top: 9px;
  color: var(--ink);
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1;
}

.bridge-step small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.bridge-step.effort {
  border-top: 4px solid var(--cyan);
}

.bridge-step.projected {
  border-top: 4px solid var(--green);
}

.bridge-step.remaining {
  border-top: 4px solid var(--amber);
}

.bridge-step.start {
  border-top: 4px solid var(--teal);
}

.bridge-plus,
.bridge-eq {
  display: grid;
  place-items: center;
  color: var(--teal);
  font-size: 32px;
  font-weight: 900;
}

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

.percent-strip div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.percent-strip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.percent-strip strong {
  display: block;
  margin-top: 6px;
  color: var(--teal);
  font-size: 24px;
}

.outlook-composition {
  min-width: 0;
  padding: 14px;
  overflow: hidden;
}

.outlook-composition .donut-wrap {
  grid-template-columns: 128px 1fr;
  min-height: 145px;
}

.outlook-composition .donut {
  width: 128px;
  height: 128px;
}

.securing-program {
  margin: 14px 0;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.securing-title {
  display: grid;
  grid-template-columns: 0.72fr 1fr;
  column-gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.securing-title span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.securing-title h2 {
  grid-row: 2;
  color: #174577;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
  text-transform: uppercase;
}

.securing-title p {
  grid-column: 2;
  grid-row: 1 / span 2;
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.growth-drivers {
  min-width: 0;
}

.growth-drivers h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 15px;
  text-transform: uppercase;
}

.driver-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px;
  background: #e6f7f5;
  border-radius: 8px;
}

.driver-summary strong {
  color: var(--teal);
  font-size: 20px;
}

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

.securing-footer {
  display: grid;
  grid-template-columns: 0.9fr 1fr 0.9fr;
  gap: 20px;
  align-items: stretch;
  margin-top: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.monthly-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.monthly-table th,
.monthly-table td {
  padding: 7px 6px;
  border: 1px solid #dbe8eb;
  text-align: right;
  white-space: nowrap;
}

.monthly-table th {
  color: white;
  background: var(--teal);
  font-size: 10px;
  text-transform: uppercase;
}

.monthly-table th:first-child,
.monthly-table td:first-child {
  width: 190px;
  text-align: left;
  font-weight: 900;
}

.monthly-table th:last-child,
.monthly-table td:last-child {
  width: 78px;
  font-weight: 900;
}

.monthly-table td {
  color: var(--ink);
  background: #f8fbfc;
}

.monthly-table tbody tr:nth-child(even) td {
  background: #e8f3f4;
}

.monthly-table .table-band td {
  color: white;
  background: #073763;
  font-weight: 900;
}

.monthly-table .table-band.teal td {
  background: var(--teal);
}

.monthly-table .table-band.amber td {
  color: var(--ink);
  background: #f8d26b;
}

.project-monthly th:first-child,
.project-monthly td:first-child {
  width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-monthly th:nth-child(2),
.project-monthly td:nth-child(2) {
  width: 62px;
  text-align: center;
}

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

.insight-card {
  min-height: 122px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--navy);
  border-radius: 8px;
  background: #fbfdfe;
}

.insight-card.success {
  border-top-color: var(--green);
}

.insight-card.info {
  border-top-color: var(--cyan);
}

.insight-card.warn {
  border-top-color: var(--amber);
}

.insight-card.risk {
  border-top-color: var(--red);
}

.insight-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.insight-card strong {
  display: block;
  margin-top: 13px;
  color: var(--ink);
  font-size: clamp(18px, 1.8vw, 26px);
  line-height: 1.1;
}

.insight-card small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

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

.attribution-grid article {
  min-height: 120px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  border-radius: 8px;
  background: #fbfdfe;
}

.attribution-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.attribution-grid strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 18px;
}

.attribution-grid small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.mapping-table th:first-child,
.mapping-table td:first-child {
  width: 140px;
}

.mapping-table th:nth-child(2),
.mapping-table td:nth-child(2) {
  max-width: 230px;
}

.mapping-table th:nth-child(3),
.mapping-table td:nth-child(3) {
  max-width: 200px;
}

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

.revenue-split div,
.insight-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.revenue-split span,
.revenue-split small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.revenue-split strong {
  display: block;
  margin: 8px 0;
  color: var(--teal);
  font-size: 20px;
}

.insight-box {
  color: white;
  background: #073763;
  border-color: #073763;
}

.insight-box b {
  display: block;
  margin-bottom: 7px;
}

.insight-box p {
  margin: 0;
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.45;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  gap: 8px;
}

.tag-cloud span {
  padding: 8px 10px;
  color: var(--teal);
  border: 1px solid #8dd9d0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.filter-panel {
  margin: 14px 0;
  padding: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filter-head span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.filter-head h2 {
  font-size: 18px;
}

.filter-head button {
  min-height: 36px;
  padding: 0 14px;
  color: white;
  background: var(--navy);
  border: 0;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

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

.filter-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.filter-grid select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  text-transform: none;
}

.filtered-view {
  margin-bottom: 14px;
}

.filtered-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

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

.metric-card,
.panel,
.audit-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.metric-card {
  min-height: 112px;
  padding: 14px;
  border-top: 4px solid var(--navy);
}

.metric-card.success {
  border-top-color: var(--green);
}

.metric-card.risk {
  border-top-color: var(--red);
}

.metric-card.info {
  border-top-color: var(--cyan);
}

.metric-card.warn {
  border-top-color: var(--amber);
}

.metric-card span,
.audit-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(20px, 2vw, 31px);
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-grid.overview {
  grid-template-columns: 1.55fr 0.8fr 0.85fr;
}

.dashboard-grid.middle {
  grid-template-columns: 0.95fr 1.1fr 0.95fr;
}

.dashboard-grid.lower {
  grid-template-columns: 1.35fr 1.2fr 1fr 1fr;
}

.panel {
  min-width: 0;
  padding: 14px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head h2 {
  font-size: 16px;
}

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

.chart-frame {
  position: relative;
  height: 282px;
}

.chart-frame svg {
  width: 100%;
  height: 240px;
  display: block;
  overflow: hidden;
}

.grid-line {
  stroke: #e5edf2;
  stroke-width: 1;
}

.target-area {
  fill: rgba(14, 165, 233, 0.12);
}

.target-line {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 4;
}

.real-line {
  fill: none;
  stroke: var(--teal);
  stroke-width: 4;
}

.real-dot {
  fill: white;
  stroke: var(--teal);
  stroke-width: 3;
}

.axis-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-legend {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i,
.legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.target-swatch {
  background: var(--cyan);
}

.real-swatch {
  background: var(--teal);
}

.donut-wrap {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 240px;
}

.donut {
  width: 150px;
  height: 150px;
  transform: rotate(-90deg);
}

.donut text {
  transform: rotate(90deg);
  transform-origin: 60px 60px;
}

.donut-total {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.donut-caption {
  fill: var(--muted);
  font-size: 9px;
  font-weight: 700;
}

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

.legend div {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.legend span {
  color: var(--slate);
  font-weight: 700;
}

.legend b {
  font-size: 12px;
}

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

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
  font-size: 12px;
}

.bar-label span {
  color: var(--slate);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-label b {
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  background: #e2e8f0;
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--cyan));
  border-radius: 999px;
}

.waterfall {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  align-items: end;
  height: 240px;
}

.waterfall-item {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 6px;
  height: 100%;
  align-items: end;
  text-align: center;
}

.waterfall-bar {
  width: 100%;
  min-height: 10px;
  border-radius: 6px 6px 2px 2px;
  background: var(--navy);
}

.waterfall-item.positive .waterfall-bar {
  background: var(--teal);
}

.waterfall-item.risk .waterfall-bar {
  background: var(--red);
}

.waterfall-item strong {
  font-size: 12px;
}

.waterfall-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 9px 8px;
  border-bottom: 1px solid #e5edf2;
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.data-table td:not(:first-child),
.data-table th:not(:first-child) {
  text-align: right;
}

.am-table td:first-child {
  max-width: 155px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hq-table td:first-child {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.pill.ok {
  background: var(--green);
}

.pill.warn {
  background: var(--amber);
}

.pill.risk {
  background: var(--red);
}

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

.audit-card {
  padding: 12px;
  box-shadow: none;
}

.audit-card strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

@media (max-width: 1280px) {
  .hero-highlight {
    grid-template-columns: 1fr;
  }

  .securing-title,
  .securing-footer {
    grid-template-columns: 1fr;
  }

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

  .gap-bridge {
    grid-template-columns: 1fr;
  }

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

  .bridge-plus,
  .bridge-eq {
    min-height: 24px;
  }

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

  .attribution-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .dashboard-grid.overview,
  .dashboard-grid.middle,
  .dashboard-grid.lower {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 10px;
  }

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

  .source-chip {
    white-space: normal;
  }

  .kpi-grid,
  .highlight-grid,
  .filter-grid,
  .filtered-kpis,
  .filtered-grid,
  .dashboard-grid.overview,
  .dashboard-grid.middle,
  .dashboard-grid.lower {
    grid-template-columns: 1fr;
  }

  .hero-highlight {
    grid-template-columns: 1fr;
  }

  .highlight-card,
  .hero-copy {
    min-height: 142px;
  }

  .securing-program {
    padding: 14px;
  }

  .securing-title {
    display: block;
  }

  .securing-title p {
    margin-top: 10px;
  }

  .securing-footer,
  .revenue-split {
    grid-template-columns: 1fr;
  }

  .exec-summary-grid {
    grid-template-columns: 1fr;
  }

  .percent-strip {
    grid-template-columns: 1fr;
  }

  .insight-card-grid {
    grid-template-columns: 1fr;
  }

  .donut-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .data-table {
    font-size: 10px;
  }

  .data-table th,
  .data-table td {
    padding: 8px 4px;
  }

  .pill {
    min-width: 44px;
    padding: 3px 6px;
    font-size: 10px;
  }
}
