:root {
  --nike-black: #111111;
  --nike-orange: #E87722;
  --nike-blue: #0077C8;
  --nike-gray: #756F6F;
  --nike-light: #F5F5F5;
  --nike-white: #FFFFFF;
  --ok: #2E7D32;
  --watch: #F9A825;
  --action: #C62828;
  --font: "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--nike-light);
  color: var(--nike-black);
  min-height: 100vh;
}

header {
  background: var(--nike-black);
  color: var(--nike-white);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

header h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: 0.02em; }
header .subtitle { font-size: 0.85rem; opacity: 0.75; margin-top: 0.25rem; }

.controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.controls label {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  gap: 0.25rem;
}

.controls select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #444;
  border-radius: 4px;
  background: #222;
  color: var(--nike-white);
  font-size: 0.85rem;
}

nav.tabs {
  display: flex;
  background: var(--nike-white);
  border-bottom: 2px solid #ddd;
  padding: 0 2rem;
}

nav.tabs button {
  background: none;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--nike-gray);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

nav.tabs button.active {
  color: var(--nike-black);
  border-bottom-color: var(--nike-orange);
  font-weight: 600;
}

main { padding: 1.5rem 2rem 3rem; max-width: 1400px; margin: 0 auto; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #ddd;
}

.forecast-subtitle-line {
  font-size: 1.1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid #ddd;
}

.ai-panel {
  margin-top: 0.25rem;
  margin-bottom: 0.9rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.ai-head { margin-bottom: 0.55rem; }
.ai-title { font-size: 0.96rem; font-weight: 700; color: #1f2937; }
.ai-sub { font-size: 0.74rem; color: #6b7280; margin-top: 0.12rem; }

.ai-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.55rem; }
.ai-chip {
  border: 1px solid #d1d5db;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.73rem;
  cursor: pointer;
}

.ai-input-row { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; align-items: start; }
.ai-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  resize: vertical;
  font-size: 0.82rem;
}
.ai-ask-btn {
  border: 1px solid #111827;
  background: #111827;
  color: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.ai-ask-btn:disabled { opacity: 0.65; cursor: not-allowed; }

.ai-answer {
  margin-top: 0.6rem;
  border-top: 1px dashed #e5e7eb;
  padding-top: 0.55rem;
  font-size: 0.8rem;
  color: #1f2937;
}
.ai-answer.empty { color: #6b7280; font-style: italic; }
.ai-answer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.ai-confidence {
  font-size: 0.7rem;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  border: 1px solid #d1d5db;
  color: #374151;
  background: #f8fafc;
}
.ai-confidence-high { border-color: #86efac; background: #f0fdf4; color: #166534; }
.ai-confidence-medium { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.ai-confidence-low { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.ai-citations { display: flex; flex-wrap: wrap; gap: 0.25rem; justify-content: flex-end; }
.ai-cite-tag {
  font-size: 0.68rem;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  padding: 0.08rem 0.38rem;
}
.ai-answer-main { font-weight: 700; margin-bottom: 0.35rem; }
.ai-answer-list { margin: 0; padding-left: 1rem; color: #374151; }
.ai-answer-list li { margin-bottom: 0.15rem; }
.ai-answer-actions { margin-top: 0.45rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.ai-answer-actions span {
  font-size: 0.72rem;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

/* Tab2 Accessible Forecast placeholder */
.acc-controls { margin-bottom: 0.8rem; }
.acc-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}
.acc-kpi-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  padding: 0.55rem 0.65rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.acc-kpi-card .k { font-size: 0.72rem; color: #64748b; }
.acc-kpi-card .v { margin-top: 0.15rem; font-size: 1rem; font-weight: 800; color: #1f2937; }
.acc-section-wrap { margin-bottom: 0.8rem; }
.acc-waterfall { width: 100%; min-height: 320px; }
.acc-end-badges {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.acc-end-badge {
  font-size: 0.72rem;
  color: #334155;
  background: #f1f5f9;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}
.acc-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.65rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.acc-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.acc-viz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
.acc-viz-row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.5rem 0.55rem;
}
.acc-viz-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.acc-row-name { color: #374151; font-weight: 700; font-size: 0.8rem; }
.acc-fy { font-weight: 800; color: #0f172a; font-size: 0.78rem; }
.acc-season-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}
.acc-season-cell {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 0.32rem 0.38rem;
}
.acc-season-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #475569;
  margin-bottom: 0.2rem;
}
.acc-season-top strong {
  font-size: 0.76rem;
  color: #111827;
  font-variant-numeric: tabular-nums;
}
.acc-season-bar-bg {
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.acc-season-bar {
  height: 100%;
  border-radius: 999px;
}
.acc-bar-pos { background: #22c55e; }
.acc-bar-neg { background: #ef4444; }
.acc-bar-neutral { background: #94a3b8; }
.acc-reconcile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}
.acc-reconcile-grid > div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  background: #f8fafc;
  display: grid;
  gap: 0.15rem;
}
.acc-reconcile-grid span { font-size: 0.7rem; color: #64748b; }
.acc-reconcile-grid strong { font-size: 0.95rem; color: #111827; }
.acc-reconcile-grid em { font-size: 0.72rem; color: #475569; font-style: normal; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--nike-white);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.kpi-card .label { font-size: 0.75rem; color: var(--nike-gray); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-card .value { font-size: 1.6rem; font-weight: 700; margin: 0.25rem 0; }
.kpi-card .delta { font-size: 0.8rem; color: var(--nike-gray); }

.layer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 900px) {
  .layer-grid { grid-template-columns: repeat(2, 1fr); }
}

.layer-card {
  background: var(--nike-white);
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  border-top: 4px solid var(--nike-orange);
}

.layer-card[data-layer="dc"] { border-top-color: var(--nike-black); }
.layer-card[data-layer="dc_store_transfer"] { border-top-color: var(--nike-gray); }
.layer-card[data-layer="store"] { border-top-color: var(--nike-blue); }

.layer-card .layer-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.health-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.health-OK { background: #E8F5E9; color: var(--ok); }
.health-WATCH { background: #FFF8E1; color: #E65100; }
.health-ACTION { background: #FFEBEE; color: var(--action); }
.health-FORECAST_ONLY { background: #E3F2FD; color: var(--nike-blue); }

.layer-card .qty { font-size: 1.5rem; font-weight: 700; }
.layer-card .meta { font-size: 0.8rem; color: var(--nike-gray); margin-top: 0.5rem; line-height: 1.5; }

.chart-box {
  background: var(--nike-white);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}

.segment-section {
  background: var(--nike-white);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}

.segment-section summary {
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  background: #fafafa;
  list-style: none;
}

.segment-section summary::before { content: "▸ "; }
.segment-section[open] summary::before { content: "▾ "; }

.segment-body { padding: 1rem 1.25rem; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table.data-table th,
table.data-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

table.data-table th {
  background: #fafafa;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.positive { color: var(--ok); }
.negative { color: var(--action); }

.panel-caption {
  font-size: 0.85rem;
  color: var(--nike-gray);
  margin-bottom: 1rem;
}

.forecast-range-controls {
  margin-bottom: 0.9rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.forecast-range-block {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
}

.forecast-range-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.4rem;
}

.forecast-range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.forecast-range-row label {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: #64748b;
}

.forecast-range-row select {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  font-size: 0.82rem;
  background: #fff;
}

@media (max-width: 900px) {
  .forecast-range-controls { grid-template-columns: 1fr; }
}

.mpu-capacity-wrap {
  margin-top: 0.6rem;
  overflow-x: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  padding: .5rem;
}

table.mpu-capacity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
  min-width: 760px;
}

table.mpu-capacity-table th,
table.mpu-capacity-table td {
  border: 1px solid #e7ebf0;
  padding: .34rem .48rem;
  vertical-align: middle;
}

table.mpu-capacity-table th {
  background: #f5f7fa;
  color: #475569;
  text-align: center;
  font-weight: 800;
  font-size: .92rem;
}

table.mpu-capacity-table th:first-child { text-align: center; }
table.mpu-capacity-table th:nth-child(2) { text-align: left; width: 260px; }

table.mpu-capacity-table td { text-align: center; color: #1f2937; font-variant-numeric: tabular-nums; }
table.mpu-capacity-table td.mpu-cap-mpu { font-weight: 700; color: #111111; background: #fafbfc; text-align: center; }
table.mpu-capacity-table tr.mpu-cap-group-start td { border-top: 2px solid #cfd8e3; }
table.mpu-capacity-table tr.mpu-cap-group-end td { border-bottom: 2px solid #cfd8e3; }
table.mpu-capacity-table td.mpu-cap-type { text-align: left; width: 260px; }
table.mpu-capacity-table td.mpu-cap-type-main { color: #374151; font-size: .78rem; font-weight: 700; }
table.mpu-capacity-table td.mpu-cap-type-sub { color: #6b7280; font-size: .78rem; font-style: italic; padding-left: 1.35rem; }
table.mpu-capacity-table td.mpu-cap-num-main { font-weight: 700; }
table.mpu-capacity-table td.mpu-cap-num-sub { font-style: italic; font-weight: 500; color: #4b5563; font-size: .74rem; }

/* Tab 2 — quarterly forecast matrix (rows = metrics, cols = Q) */
.forecast-matrix-wrap {
  overflow-x: auto;
  background: var(--nike-white);
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 0.5rem;
}

table.forecast-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  min-width: 720px;
}

table.forecast-matrix th,
table.forecast-matrix td {
  padding: 0.34rem 0.48rem;
  text-align: right;
  border: 1px solid #e7ebf0;
  vertical-align: middle;
}

table.forecast-matrix th.fc-head-stub,
table.forecast-matrix td.fc-group,
table.forecast-matrix td.fc-metric {
  text-align: left;
}

table.forecast-matrix th.fc-head-stub {
  font-weight: 600;
  background: #f8fafc;
  color: #334155;
}

table.forecast-matrix th.fc-q-col {
  text-align: center;
  font-size: 0.92rem;
  font-weight: 800;
  background: #f5f7fa;
  color: #475569;
  min-width: 5.5rem;
}

table.forecast-matrix th.fc-total-col {
  background: #eee;
}

table.forecast-matrix tr.fc-section td {
  background: #f3f4f6;
  font-weight: 800;
  text-align: center;
  color: #334155;
  border-top: 1px solid #d7dde6;
  border-bottom: 1px solid #d7dde6;
}

table.forecast-matrix td.fc-group {
  width: 92px;
  font-weight: 700;
  color: #111111;
  background: transparent;
}
table.forecast-matrix td.fc-metric {
  width: 210px;
  color: #1f2a37;
  font-weight: 600;
  background: #ffffff;
}
table.forecast-matrix td.fc-metric-sub {
  font-style: italic;
  color: #718096;
  font-weight: 500;
}
table.forecast-matrix td.fc-metric-leaf {
  font-size: 0.76rem;
  color: #6b7280;
  font-weight: 500;
}
table.forecast-matrix td.fc-val-sub .fc-main {
  font-style: italic;
  color: #718096;
  font-weight: 400 !important;
  font-size: 0.70rem !important;
}
table.forecast-matrix td.fc-val-sub.fc-delta-pos .fc-main { color: #C62828; }
table.forecast-matrix td.fc-val-sub.fc-delta-neg .fc-main { color: #2E7D32; }

table.forecast-matrix td.fc-val .fc-main {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

table.forecast-matrix td.fc-neg { color: #C62828; }
table.forecast-matrix td.fc-val .fc-ly {
  font-size: 0.68rem;
  color: var(--nike-gray);
  margin-top: 0.15rem;
}

td.fcg-landing { background: #fafafa; }
td.fcg-sales { background: #fafafa; }
td.fcg-supply { background: #fafafa; }
td.fcg-others { background: #fafafa; }

td.fc-row-group.fcg-landing { background: #f1f1f1; color: #555; }
td.fc-row-group.fcg-sales { background: #f1f1f1; color: #555; }
td.fc-row-group.fcg-supply { background: #f1f1f1; color: #555; }
td.fc-row-group.fcg-others { background: #f1f1f1; color: #555; }

table.forecast-matrix td.fc-val .fc-main.fc-neg { color: #C62828; }

table.forecast-matrix td.fc-total {
  font-weight: 700;
  background: #f5f5f5;
}

.forecast-sports-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid #e0e0e0;
}

.forecast-sports-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.forecast-sports-section-caption {
  font-size: 0.82rem;
  color: var(--nike-gray);
  margin-bottom: 1rem;
}

.forecast-sports-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.forecast-sport-card {
  background: var(--nike-white);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 0.65rem 0.5rem 0.5rem;
  overflow: hidden;
}

.forecast-sport-card h4 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0.4rem 0.5rem;
}

.forecast-sport-card .forecast-matrix-wrap {
  box-shadow: none;
  padding: 0;
}

.forecast-sport-card table.forecast-matrix {
  font-size: 0.72rem;
  min-width: 0;
}

.forecast-sport-card table.forecast-matrix th,
.forecast-sport-card table.forecast-matrix td {
  padding: 0.35rem 0.4rem;
}

.forecast-sport-card td.fc-row-group {
  font-size: 0.68rem;
  max-width: 4.5rem;
}

@media (max-width: 1200px) {
  .forecast-sports-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .forecast-sports-grid { grid-template-columns: 1fr; }
}

.slider-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.slider-group label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; }
.slider-group input[type="range"] { width: 100%; accent-color: var(--nike-orange); }
.slider-group .slider-val { font-size: 0.8rem; color: var(--nike-gray); }

.alert-list { list-style: none; }
.alert-list li {
  padding: 0.6rem 1rem;
  background: #FFF8E1;
  border-left: 4px solid var(--watch);
  margin-bottom: 0.5rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.85rem;
}

.success-msg {
  padding: 0.75rem 1rem;
  background: #E8F5E9;
  border-radius: 4px;
  color: var(--ok);
  font-size: 0.85rem;
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
  color: var(--nike-gray);
}

.loading {
  text-align: center;
  padding: 4rem;
  color: var(--nike-gray);
}

.vov-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.vov-controls label {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  gap: 0.25rem;
}

.vov-controls select {
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.radio-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.radio-group label { display: flex; align-items: center; gap: 0.35rem; cursor: pointer; }

/* Tab 1 — Upper half */
.overview-wrap { background: #f3f4f6; padding: 1.25rem 1.5rem; border-radius: 12px; }

.scope-summary-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-bottom: 1.5rem; }
.scope-panel {
  background: #fff; border-radius: 12px; padding: 1.1rem 1.25rem 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); border-top: 4px solid var(--accent);
}
.scope-panel-e2e { --accent: #3D5A80; }
.scope-panel-accessible { --accent: #0891B2; }
.scope-head { display: flex; align-items: center; gap: 0.65rem; margin-bottom: 1rem; flex-wrap: wrap; }
.scope-title { font-size: 1.05rem; font-weight: 800; color: #111; }
.scope-dots { display: flex; gap: 0.35rem; }
.scope-dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px rgba(0,0,0,0.06); }
.scope-kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.scope-kpi .val { font-size: 1.75rem; font-weight: 800; color: #111; line-height: 1.1; }
.scope-kpi .lbl { font-size: 0.62rem; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: 0.07em; margin-top: 0.35rem; }
.scope-kpi .ly { font-size: 0.72rem; color: #666; margin-top: 0.2rem; }

.loc-mosaic { background: #fff; border-radius: 12px; padding: 1.25rem; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

.loc-row { display: flex; align-items: stretch; margin-bottom: 0.5rem; min-height: 36px; }
.loc-name-row { margin-bottom: 0.3rem; min-height: auto; }
.loc-bar-row { margin-bottom: 0.75rem; }
.loc-bar-row .loc-col { align-items: stretch; }
.loc-row-label { width: 88px; flex-shrink: 0; font-size: 0.72rem; font-weight: 700; color: #555; display: flex; align-items: center; padding-right: 0.75rem; }
.loc-row-cols { display: flex; flex: 1; gap: 4px; align-items: stretch; }

.loc-col { display: flex; align-items: center; justify-content: center; min-width: 0; }
.loc-col-stack { align-items: stretch; }
.loc-col-metric { min-height: 36px; }

.loc-seg-name {
  font-size: 0.72rem; font-weight: 700; color: #4a5568; text-align: center;
  width: 100%; line-height: 1.25; letter-spacing: 0.02em;
}
.loc-seg {
  width: 100%; height: 52px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.08);
}
.loc-seg-val { font-size: 1rem; text-shadow: 0 1px 2px rgba(0,0,0,0.12); }

.loc-bench-val { font-size: 0.95rem; font-weight: 800; color: #333; }

.loc-t1-head-row { margin-bottom: 0.25rem; min-height: auto; }
.loc-t1-head-col { display: flex; gap: 3px; width: 100%; }
.loc-t1-head-cell {
  flex: 1; min-width: 0; text-align: center;
  font-size: 0.68rem; font-weight: 700; color: #6b7280;
  letter-spacing: 0.02em; line-height: 1.2;
  padding: 0 2px 0.15rem;
}

.loc-t1-col { display: flex; gap: 3px; width: 100%; min-height: 44px; }
.loc-t1-block {
  flex: 1; border-radius: 4px; min-width: 0; min-height: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 0.62rem; font-weight: 700; color: #fff;
  overflow: hidden; padding: 4px 3px; line-height: 1.25; text-align: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}
.loc-t1-block .t1-num { font-size: 0.85rem; font-weight: 800; display: block; }
.loc-t1-block .t1-name { font-size: 0.52rem; opacity: 0.92; display: block; margin-top: 2px; }
.loc-target-col { display: flex; gap: 3px; width: 100%; }
.loc-target-cell {
  flex: 1; text-align: center; font-size: 0.78rem; font-weight: 800; color: #333;
  min-width: 0; padding: 4px 2px; background: #f0f3f6; border-radius: 3px;
}

/* Sports scorecards (Tab 1 lower half) */
.sports-section { margin-top: 1.75rem; }
.sports-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #444;
  margin-bottom: 0.85rem;
}
.sports-board {
  display: grid;
  grid-template-columns: 4.5rem repeat(9, minmax(0, 1fr));
  gap: 0.65rem;
  align-items: start;
}
.sports-label-col,
.sport-col {
  display: grid;
  grid-template-rows: 3.15rem 3.05rem 3.05rem 3.05rem;
  align-content: start;
  padding-top: 0.65rem;
  padding-bottom: 0.55rem;
}
.sport-col {
  background: #fff;
  border-radius: 10px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border-top: 3px solid #6A9DB5;
  min-width: 0;
}
.sports-label-col {
  border-top: 3px solid transparent;
  box-sizing: border-box;
}
.sport-grid-cell { min-height: 0; }
.sport-header-spacer { /* aligns with sport name row */ }
.sport-metric-lbl,
.sport-kpi {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 0;
}
.sport-metric-lbl {
  justify-content: flex-start;
  font-size: 0.55rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.15;
}
.sport-card-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: #111;
  text-align: center;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin-bottom: 0.15rem;
  letter-spacing: 0.01em;
}
.sport-kpi {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: 100%;
}
.sport-kpi-val { font-size: 1.05rem; font-weight: 800; color: #111; line-height: 1.15; }
.sport-kpi-ly { font-size: 0.62rem; color: #666; margin-top: 0.1rem; line-height: 1.2; }

/* Tab 1 prototype — inventory driver workbench */
.driver-workbench {
  margin-top: 1.7rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.driver-wb-head { margin-bottom: 0.75rem; }
.driver-wb-title { font-size: 1rem; font-weight: 700; color: #1f2937; }
.driver-wb-caption { font-size: 0.75rem; color: #6b7280; margin-top: 0.15rem; }
.driver-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}
.driver-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  background: #f9fbfd;
}
.driver-card-head {
  padding: 0.45rem 0.6rem;
  background: #eef3f8;
  border-bottom: 1px solid #d9e2ec;
}
.driver-stage { font-size: 0.78rem; font-weight: 700; color: #334155; }
.driver-stage-kpi { font-size: 0.72rem; color: #64748b; margin-top: 0.1rem; }
.driver-table { width: 100%; border-collapse: collapse; font-size: 0.74rem; }
.driver-table th, .driver-table td { padding: 0.28rem 0.36rem; border: 1px solid #e5e7eb; text-align: center; }
.driver-table th:first-child, .driver-table td:first-child { text-align: left; }
.driver-table th { background: #f8fafc; color: #475569; font-weight: 700; }
.driver-name { font-weight: 600; color: #374151; }
.driver-gap-hot { color: #b91c1c; font-weight: 700; }
.driver-gap-cold { color: #0f766e; font-weight: 700; }
.driver-gap-ok { color: #475569; }

/* Tab1 prototype B — horizontal lane + anomaly list */
.driver-workbench-b {
  margin-top: 1.75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  box-sizing: border-box;
  width: 100%;
}
.driverb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}
.driverb-lanes { display: grid; gap: 0.6rem; }
.driverb-lane {
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #f9fbfd;
  padding: 0.6rem 0.75rem;
}
.driverb-lane-head { margin-bottom: 0.4rem; }
.driverb-stage { font-size: 0.78rem; font-weight: 700; color: #334155; }
.driverb-stage-kpi { font-size: 0.71rem; color: #64748b; margin-top: 0.1rem; }
.driverb-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
.driverb-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
  padding: 0.35rem 0.4rem;
}
.driverb-item-head { display: flex; justify-content: space-between; gap: 0.3rem; margin-bottom: 0.2rem; }
.driverb-item-name { font-size: 0.72rem; font-weight: 600; color: #374151; }
.driverb-item-gap { font-size: 0.7rem; font-weight: 700; }
.driverb-item-bar-wrap {
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}
.driverb-item-bar { height: 100%; border-radius: 999px; }
.driverb-item-meta { font-size: 0.67rem; color: #6b7280; margin-top: 0.2rem; }

.driverb-bar-sev-red { background-color: #ef4444; }
.driverb-bar-sev-yellow { background-color: #f59e0b; }
.driverb-bar-sev-green { background-color: #22c55e; }

.driverb-text-sev-red { color: #b91c1c; }
.driverb-text-sev-yellow { color: #b45309; }
.driverb-text-sev-green { color: #166534; }

.driverb-anomaly {
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #f8fafc;
  padding: 0.5rem 0.6rem;
}
.driverb-anomaly-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.3rem;
}
.driverb-anomaly ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.28rem; }
.driverb-anomaly li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0;
  border-bottom: 1px dashed #dbe3ef;
}
.driverb-anomaly li:last-child { border-bottom: none; }
.driverb-anom-key { font-size: 0.7rem; color: #334155; }
.driverb-anom-val {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0;
  background: transparent;
}

@media (max-width: 1200px) {
  .sports-board { grid-template-columns: 4.5rem repeat(5, minmax(0, 1fr)); }
  .driver-grid { grid-template-columns: 1fr; }
  .driverb-layout { grid-template-columns: 1fr; }
  .driverb-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acc-kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .acc-viz-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .scope-summary-row { grid-template-columns: 1fr; }
  .scope-kpi-row { grid-template-columns: 1fr; }
  .loc-row-cols { flex-wrap: wrap; }
  .loc-col { flex: 1 1 45% !important; min-width: 45%; }
  .sports-board { grid-template-columns: 4.5rem repeat(3, minmax(0, 1fr)); }
  .driverb-items { grid-template-columns: 1fr; }
  .acc-kpi-row { grid-template-columns: 1fr 1fr; }
  .acc-reconcile-grid { grid-template-columns: 1fr; }
  .acc-season-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .sports-board { grid-template-columns: 4.5rem repeat(2, minmax(0, 1fr)); }
  .acc-kpi-row { grid-template-columns: 1fr; }
}
