:root {
  color-scheme: light;
  --ink: #162033;
  --muted: #687386;
  --line: #d6deea;
  --panel: #ffffff;
  --page: #f4f8fd;
  --navy: #20436f;
  --deep-blue: #071a33;
  --royal-blue: #123f73;
  --cyan: #00a7c7;
  --teal: #0f766e;
  --gold: #b7791f;
  --orange: #f97316;
  --red: #b42318;
  --green: #327a46;
  --violet: #6f4ca5;
  --shadow: 0 18px 42px rgba(15, 23, 42, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(7, 26, 51, 0.22), transparent 34%),
    linear-gradient(to right, #002E5D, #002E5D, #2774ae),
    var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.dashboard-loading {
  min-height: 100vh;
  overflow: hidden;
}

body.dashboard-loading::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5000;
  background:
    radial-gradient(circle at 10% 0%, rgba(7, 26, 51, 0.22), transparent 34%),
    linear-gradient(to right, #002E5D, #002E5D, #2774ae);
}

body.dashboard-loading::after {
  content: "Loading dashboard data...";
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 5001;
  transform: translate(-50%, -50%);
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  box-shadow: 0 18px 42px rgba(7, 26, 51, 0.24);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

body.dashboard-loading .app-header,
body.dashboard-loading .controls,
body.dashboard-loading .section-nav,
body.dashboard-loading main {
  visibility: hidden;
}

.app-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: stretch;
  padding: 36px 32px 28px;
  background: #2774ae;
  background: -webkit-linear-gradient(to right, #002E5D, #002E5D, #2774ae);
  background: linear-gradient(to right, #002E5D, #002E5D, #2774ae);
  border-bottom: 0;
  color: #ffffff;
}

.app-header > div:first-child {
  max-width: 65%;
}

.app-header p {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
}

.eyebrow {
  margin: 0 0 6px;
  color: #b8d6ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1;
  font-weight: 900;
  letter-spacing: -1px;
}

.subtitle {
  max-width: 760px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 15px;
}

.build-pill {
  display: inline-flex;
  margin-top: 16px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 20px;
}

.nca-logo {
  width: min(653px, 46.6vw);
  max-width: 653px;
  height: auto;
  object-fit: contain;
  transform: translateX(28px);
}

@media (min-width: 1051px) {
  .app-header {
    gap: 44px;
    padding: 30px 44px 28px;
    min-height: 410px;
  }

  .app-header > div:first-child {
    max-width: 72%;
  }

  .app-header .eyebrow {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.2;
  }

  .app-header h1 {
    line-height: 1.08;
    letter-spacing: 0;
  }

  .app-header .subtitle {
    max-width: 1080px;
    margin-top: 22px;
    font-size: 17px;
    line-height: 1.55;
  }

  .app-header .build-pill {
    margin-top: 24px;
  }

  .header-right {
    position: absolute;
    top: 24px;
    bottom: 24px;
    right: 32px;
    align-items: flex-end;
    justify-content: center;
    transform: none;
  }

  .nca-logo {
    width: auto;
    height: 100%;
    max-width: none;
    max-height: 362px;
    transform: translateX(150px);
  }
}

.controls {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  padding: 14px 32px;
  background: rgba(247, 250, 253, 0.9);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

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

select,
button {
  width: 100%;
  height: 40px;
  margin-top: 6px;
  border: 1px solid #c7d3e4;
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  color: var(--ink);
  font: inherit;
  transition: transform 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease,
    color 0.18s ease;
}

select:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.quarter-mode .controls label:nth-child(2) {
  opacity: 0.56;
}

.quarter-mode .trend-card {
  background: #002E5D;
  background: -webkit-linear-gradient(to right, #002E5D, #003b73, #2774ae);
  background: linear-gradient(to right, #002E5D, #003b73, #2774ae);
}

button {
  align-self: end;
  cursor: pointer;
  font-weight: 800;
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.18);
  border-color: #2b6aa7;
}

button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.18);
}

button:focus-visible {
  outline: 2px solid #2b6aa7;
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

#toggleTables {
  background: linear-gradient(135deg, #071a33, #1f5f9f);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(249, 115, 22, 0.22);
}

#toggleTables:hover:not(:disabled) {
  background: linear-gradient(135deg, #0a2547, #2774ae);
  box-shadow: 0 14px 26px rgba(7, 26, 51, 0.28);
}

.section-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 16px 32px 0;
}

.section-nav button {
  width: auto;
  min-width: max-content;
  padding: 0 14px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.72);
}

.section-nav button:hover:not(.active) {
  background: rgba(255, 255, 255, 0.95);
  border-color: #2b6aa7;
}

.section-nav button.active {
  border-color: transparent;
  background: linear-gradient(135deg, #071a33, #2b6aa7);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(32, 67, 111, 0.22);
}

.section-nav button.active:hover {
  background: linear-gradient(135deg, #0a2547, #337dc2);
  box-shadow: 0 14px 26px rgba(32, 67, 111, 0.32);
}

main {
  padding: 20px 32px 40px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

body.mobile-dashboard .kpi-grid,
body.compact-kpis .kpi-grid,
body.bwa-dashboard .kpi-grid {
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 15px;
  margin-bottom: 14px;
}

.executive-insights {
  margin-bottom: 22px;
}

.summary-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: #051d3b;
  background: radial-gradient(circle at center, #0f4185 0%, #010d1e 100%);
  color: #ffffff;
  box-shadow: var(--shadow);
}

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

.summary-head span {
  color: #b8d6ff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.summary-head h2 {
  margin: 8px 0 0;
  color: #ffffff;
  font-size: clamp(24px, 3vw, 36px);
}

.summary-toggle-btn {
  width: auto;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 13px;
  backdrop-filter: blur(4px);
  transition: all 0.2s;
}

.summary-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px 24px;
  margin-top: 22px;
}

.summary-point {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
}

.summary-point strong {
  display: block;
  color: #ffffff;
  font-size: 16px;
}

.summary-point p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  line-height: 1.45;
}

.summary-insight-title {
  display: block;
  margin-top: 12px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.kpi {
  min-height: 106px;
  padding: 18px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #e7f1fc);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

body.mobile-dashboard .kpi,
body.compact-kpis .kpi,
body.bwa-dashboard .kpi {
  min-height: 70px;
  padding: 10px 14px 9px;
}

.kpi:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, #071a33, #2b6aa7, #ffffff);
  transition: height 0.3s ease;
}

.kpi:hover::before {
  height: 8px;
}

.kpi-2::before,
.kpi-3::before,
.kpi-4::before,
.kpi-5::before { background: linear-gradient(90deg, #071a33, #2b6aa7, #ffffff); }

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

body.mobile-dashboard .kpi span,
body.compact-kpis .kpi span,
body.bwa-dashboard .kpi span {
  font-size: 11px;
  letter-spacing: 0;
}

.kpi strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  white-space: nowrap;
  scrollbar-width: thin;
}

body.mobile-dashboard .kpi strong,
body.compact-kpis .kpi strong,
body.bwa-dashboard .kpi strong {
  margin-top: 4px;
  font-size: clamp(24px, 1.7vw, 32px);
  line-height: 1.02;
}

.kpi strong::-webkit-scrollbar {
  height: 6px;
}

.kpi strong::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(32, 67, 111, 0.35);
}

.kpi small {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
}

body.mobile-dashboard .kpi small,
body.compact-kpis .kpi small,
body.bwa-dashboard .kpi small {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 700;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: 5px 8px 0 0;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.kpi-delta-up {
  color: #15803d;
  background: #dcfce7;
}

.kpi-delta-down {
  color: #b91c1c;
  background: #fee2e2;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 22px;
}

.chart-card {
  min-width: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(7, 26, 51, 0.82), rgba(43, 106, 167, 0.55), rgba(255, 255, 255, 0.7)) border-box;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.chart-card:nth-child(3n + 1) .chart-head {
  border-top: 5px solid #071a33;
}

.chart-card:nth-child(3n + 2) .chart-head {
  border-top: 5px solid #1f5f9f;
}

.chart-card:nth-child(3n + 3) .chart-head {
  border-top: 5px solid #d9e9fb;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 8px;
  background: linear-gradient(180deg, #fbfdff, #ffffff);
  border-bottom: 1px solid rgba(214, 222, 234, 0.72);
}

.chart-head h2 {
  margin: 0;
  color: #162033;
  font-size: 20px;
  letter-spacing: 0;
}

.chart-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.sheet-name {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.view-toggle {
  display: flex;
  gap: 4px;
  align-items: center;
  align-self: flex-start;
}

.view-toggle button {
  width: auto;
  height: 30px;
  margin: 0;
  padding: 0 10px;
  align-self: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.view-toggle button:hover:not(.active):not(:disabled) {
  color: var(--ink);
  border-color: #2b6aa7;
  background: linear-gradient(180deg, #ffffff, #eef4fb);
}

.view-toggle button.active {
  background: linear-gradient(135deg, #071a33, #2b6aa7);
  color: #ffffff;
  border-color: transparent;
}

.view-toggle button.active:hover {
  background: linear-gradient(135deg, #0a2547, #337dc2);
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  width: auto;
  height: 30px;
  margin: 0;
  padding: 0 10px;
  background: linear-gradient(135deg, #071a33, #2b6aa7);
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 2px 4px rgba(7, 26, 51, 0.2);
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(7, 26, 51, 0.4);
  background: linear-gradient(135deg, #092447, #337dc2);
}

.download-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(7, 26, 51, 0.3);
}

.download-btn svg {
  width: 14px !important;
  height: 14px !important;
  display: inline-block;
  margin-right: 6px;
}

.note {
  margin: 0;
  padding: 0 18px 8px;
  color: var(--muted);
  font-size: 12px;
}

.chart-wrap {
  position: relative;
  min-height: 320px;
  padding: 10px 12px 0;
  background: linear-gradient(180deg, rgba(239, 248, 251, 0.55), rgba(255, 255, 255, 0));
}

svg {
  display: block;
  width: 100%;
  height: 340px;
  overflow: visible;
}

.axis text {
  fill: var(--muted);
  font-size: 11px;
}

.axis-tick {
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.96);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.data-label {
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 4px;
  stroke-linejoin: round;
  font-size: 12px;
  font-weight: 900;
}

[data-tip] {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s, stroke-width 0.2s, opacity 0.2s;
  cursor: crosshair;
}

circle[data-tip] {
  transform-box: fill-box;
  transform-origin: center;
}

circle[data-tip]:hover {
  transform: scale(2);
  stroke: #ffffff;
  stroke-width: 2px;
  filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.5));
}

rect[data-tip] {
  transform-box: fill-box;
  transform-origin: bottom center;
}

rect[data-tip]:hover {
  transform: scaleY(1.02);
  filter: brightness(1.3) contrast(1.1) drop-shadow(0 -4px 8px rgba(0, 0, 0, 0.3));
  opacity: 1 !important;
}

rect[data-tip].active-click {
  animation: barIgnite 1.25s ease-in-out infinite;
  filter: brightness(1.45) saturate(1.35) drop-shadow(0 -6px 12px rgba(0, 167, 199, 0.55));
}

circle[data-tip].active-click {
  animation: pointIgnite 1.15s ease-in-out infinite;
  stroke: #ffffff;
  stroke-width: 2.4px;
  filter: brightness(1.35) saturate(1.45) drop-shadow(0 0 10px rgba(255, 255, 255, 0.78)) drop-shadow(0 0 14px rgba(0, 167, 199, 0.55));
}

.click-halo {
  fill: none;
  pointer-events: none;
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.62)) drop-shadow(0 0 16px rgba(0, 167, 199, 0.44));
}

.point-halo {
  animation: haloPulse 1.15s ease-out infinite;
}

.bar-halo {
  animation: barHaloPulse 1.3s ease-out infinite;
}

path[data-tip]:hover {
  filter: brightness(1.3) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  stroke-width: 4px;
}

@keyframes pointIgnite {
  0%, 100% {
    transform: scale(1.55);
  }
  50% {
    transform: scale(2.25);
  }
}

@keyframes barIgnite {
  0%, 100% {
    transform: scaleY(1.02);
  }
  50% {
    transform: scaleY(1.08);
  }
}

@keyframes haloPulse {
  0% {
    opacity: 0.9;
    transform: scale(0.7);
  }
  100% {
    opacity: 0;
    transform: scale(2.4);
  }
}

@keyframes barHaloPulse {
  0% {
    opacity: 0.85;
    transform: scale(0.98);
  }
  100% {
    opacity: 0;
    transform: scale(1.14);
  }
}

.bar-label {
  font-size: 11px;
}

.chart-axis-label {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.axis-line {
  stroke: #b8c0ce;
  stroke-width: 1;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0 18px 14px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #39465c;
  font-size: 12px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.trend-card {
  margin: 0 18px 16px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #002E5D;
  background: -webkit-linear-gradient(to right, #002E5D, #003b73, #2774ae);
  background: linear-gradient(to right, #002E5D, #003b73, #2774ae);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.14);
}

.trend-card p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.trend-card p + p {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
}

.table-scroll {
  display: none;
  margin: 0 18px 18px;
  width: calc(100% - 36px);
  max-width: calc(100% - 36px);
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: max-content;
  min-width: max(100%, 1360px);
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.show-tables .table-scroll {
  display: block;
}

.table-scroll::-webkit-scrollbar {
  height: 14px;
}

.table-scroll::-webkit-scrollbar-track {
  background: #e6eef8;
  border-radius: 999px;
}

.table-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #071a33, #2b6aa7);
  border: 3px solid #e6eef8;
  border-radius: 999px;
}

.table-scroll {
  scrollbar-color: #2b6aa7 #e6eef8;
  scrollbar-width: auto;
}

.show-tables .chart-card {
  border-color: rgba(0, 167, 199, 0.42);
}

.show-tables .chart-card::after {
  content: "Table view enabled - scroll horizontally to view more quarters";
  display: block;
  margin: 0 18px 10px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table th,
.data-table td {
  min-width: 140px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #102a43;
  color: #ffffff;
}

.data-table tbody tr:nth-child(even) {
  background: #f4f9fc;
}

.data-table th:first-child,
.data-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 160px;
  max-width: 180px;
  background: #ffffff;
  text-align: left;
  white-space: normal;
}

.data-table th:first-child {
  z-index: 3;
  background: #102a43;
}

.tooltip {
  position: fixed;
  display: none;
  pointer-events: none;
  max-width: 260px;
  padding: 10px 12px;
  border: 1px solid #cfd6e2;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
}

.forecast-panel {
  margin-top: 26px;
  padding: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.forecast-panel h2 {
  margin: 0;
  font-size: 28px;
}

.forecast-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 160px;
  gap: 12px;
  margin-top: 14px;
}

.forecast-metric-card {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #e7f1fc);
}

.forecast-metric-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.forecast-metric-card strong {
  display: block;
  margin-top: 7px;
  color: #002E5D;
  font-size: 17px;
}

#runForecast {
  align-self: end;
  background: linear-gradient(to right, #002E5D, #002E5D, #2774ae);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(7, 26, 51, 0.22);
}

#runForecast:hover:not(:disabled) {
  background: linear-gradient(to right, #0a2547, #0a2547, #337dc2);
  box-shadow: 0 14px 26px rgba(7, 26, 51, 0.32);
}

.forecast-output {
  margin-top: 18px;
  overflow-x: auto;
}

.forecast-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 13px;
}

.forecast-table th,
.forecast-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.forecast-table th:first-child,
.forecast-table td:first-child {
  text-align: left;
}

.forecast-table th {
  background: #102a43;
  color: #ffffff;
}

.forecast-note {
  color: var(--muted);
  font-size: 12px;
}

.donut-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

@media (max-width: 1050px) {
  .app-header {
    align-items: stretch;
    flex-direction: column;
  }

  .app-header > div:first-child {
    max-width: 100%;
  }

  .header-right {
    align-items: center;
    width: 100%;
  }

  .nca-logo {
    display: block;
    width: min(653px, 78vw);
    margin: 12px auto 0;
    transform: none;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .kpi-grid,
  .chart-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .forecast-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-header,
  .controls,
  .section-nav,
  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .controls {
    position: static;
    grid-template-columns: 1fr;
  }

  .summary-card {
    padding: 22px 20px;
  }

  .summary-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .summary-head h2 {
    font-size: clamp(34px, 12vw, 48px);
    line-height: 1.16;
  }

  .summary-toggle-btn {
    width: 100%;
    min-height: 54px;
    margin: 0;
    padding: 10px 16px;
    font-size: 22px;
    line-height: 1.15;
  }

  .chart-head {
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 14px 8px;
  }

  .chart-head > div:first-child {
    flex: 1 1 15rem;
    min-width: 0;
  }

  .chart-head h2 {
    font-size: 18px;
    line-height: 1.12;
  }

  .sheet-name {
    font-size: 11px;
    line-height: 1.15;
  }

  .chart-actions {
    gap: 5px;
    flex: 0 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
  }

  .view-toggle {
    gap: 3px;
  }

  .view-toggle button {
    height: 26px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 10px;
  }

  .download-btn {
    width: 28px;
    flex: 0 0 28px;
    height: 26px;
    margin-left: auto;
    padding: 0;
    border-radius: 6px;
  }

  .download-btn svg {
    width: 12px !important;
    height: 12px !important;
  }

  body.mobile-dashboard .kpi-grid,
  body.compact-kpis .kpi-grid,
  body.bwa-dashboard .kpi-grid {
    display: grid;
    grid-auto-columns: minmax(220px, 72vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: 10px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    padding-bottom: 8px;
    padding-right: 16px;
    scroll-padding-left: 0;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
  }

  body.mobile-dashboard .kpi,
  body.compact-kpis .kpi,
  body.bwa-dashboard .kpi {
    min-height: 84px;
    padding: 12px 14px;
    scroll-snap-align: start;
  }

  body.mobile-dashboard .kpi span,
  body.compact-kpis .kpi span,
  body.bwa-dashboard .kpi span {
    font-size: 11px;
  }

  body.mobile-dashboard .kpi strong,
  body.compact-kpis .kpi strong,
  body.bwa-dashboard .kpi strong {
    font-size: clamp(24px, 7vw, 32px);
  }

  body.mobile-dashboard .kpi small,
  body.compact-kpis .kpi small,
  body.bwa-dashboard .kpi small {
    font-size: 11px;
  }

  .kpi-delta {
    font-size: 12px;
  }
}
