/* FINAL ALPHA FORCE THEME — loaded last */

:root {
  --alpha-bg: #010711;
  --alpha-panel: #07111c;
  --alpha-panel2: #0b1624;
  --alpha-line: #1d3347;
  --alpha-text: #d8dee9;
  --alpha-muted: #8fa3b8;
  --alpha-amber: #ffbf00;
  --alpha-orange: #ff8c00;
  --alpha-green: #00d26a;
  --alpha-red: #ff4d4d;
  --alpha-blue: #28a5ff;
}

html,
body,
body * {
  font-family: Arial, Helvetica, sans-serif !important;
}

html,
body {
  background: var(--alpha-bg) !important;
  color: var(--alpha-text) !important;
}

body {
  margin: 0 !important;
  padding: 10px !important;
  font-size: 15px !important;
}

div,
section,
main,
article,
aside {
  color: var(--alpha-text) !important;
}

.top,
.header,
.nav,
.card,
.mini,
.panel,
.section,
.box,
.module,
.metric-card,
.container,
.content,
.grid > div,
.cards > div {
  background: linear-gradient(180deg, var(--alpha-panel), #030912) !important;
  border-color: var(--alpha-line) !important;
  color: var(--alpha-text) !important;
  box-shadow: none !important;
}

.card,
.mini,
.panel,
.section,
.box,
.module,
.metric-card {
  border: 1px solid var(--alpha-line) !important;
  border-radius: 4px !important;
  padding: 10px !important;
  margin-bottom: 8px !important;
}

.top,
.header,
.nav {
  background: rgba(1, 7, 17, 0.97) !important;
  border: 1px solid var(--alpha-line) !important;
  border-radius: 4px !important;
  padding: 10px !important;
  margin-bottom: 8px !important;
}

h1,
h2,
h3,
h4 {
  font-family: Arial, Helvetica, sans-serif !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
}

h1 {
  color: var(--alpha-amber) !important;
  font-size: 28px !important;
}

h2 {
  color: var(--alpha-amber) !important;
  font-size: 17px !important;
  border-bottom: 1px solid var(--alpha-line) !important;
  padding-bottom: 6px !important;
}

h3,
h4 {
  color: var(--alpha-orange) !important;
}

p,
li,
span,
td,
th,
label {
  color: var(--alpha-text) !important;
}

.note,
.muted,
.label,
small {
  color: var(--alpha-muted) !important;
}

b,
strong,
.value {
  color: var(--alpha-text) !important;
}

.status,
.confirm,
.good {
  color: var(--alpha-green) !important;
}

.pending,
.warn {
  color: var(--alpha-orange) !important;
}

.warning,
.bad,
.error {
  color: var(--alpha-red) !important;
}

table {
  background: #050b13 !important;
  color: var(--alpha-text) !important;
  border-collapse: collapse !important;
}

td,
th {
  border: 1px solid var(--alpha-line) !important;
  color: var(--alpha-text) !important;
  background: transparent !important;
}

th {
  background: #111d2b !important;
  color: var(--alpha-amber) !important;
}

tr:nth-child(even) td {
  background: #07111c !important;
}

a,
button,
select,
input,
textarea,
input[type="submit"] {
  color: var(--alpha-amber) !important;
  background: #08111c !important;
  border: 1px solid #40566b !important;
  border-radius: 3px !important;
  font-family: Arial, Helvetica, sans-serif !important;
}

a:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--alpha-amber) !important;
  color: #000 !important;
}

pre,
code {
  background: #050b13 !important;
  color: var(--alpha-text) !important;
  border: 1px solid var(--alpha-line) !important;
}

svg,
canvas,
.plotly,
.plotly-graph-div,
.js-plotly-plot,
#map,
#chart {
  background: #050b13 !important;
}

/* Plotly-specific background fixes */
.main-svg,
.bg,
.draglayer,
.cartesianlayer,
.plot-container,
.user-select-none {
  background: #050b13 !important;
}

/* Try to force Plotly text closer to Alpha theme */
.gtitle,
.xtitle,
.ytitle,
.legendtext,
.xtick text,
.ytick text {
  fill: var(--alpha-text) !important;
  color: var(--alpha-text) !important;
}

/* ===== Supply / Geo / Legacy Page Full Match Pass ===== */

body {
  background: #010711 !important;
  color: #d8dee9 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: 15px !important;
  line-height: 1.28 !important;
  padding: 10px !important;
}

/* Make top bar match command center */
.top {
  background: #07111c !important;
  border: 1px solid #1d3347 !important;
  border-radius: 4px !important;
  padding: 10px !important;
  margin-bottom: 8px !important;
  display: grid !important;
  grid-template-columns: 1fr auto !important;
  gap: 10px !important;
  align-items: center !important;
}

/* Fix giant black gaps by forcing content grids/cards */
.grid,
.cards,
.dashboard-grid,
.content-grid,
body > div:not(.top) {
  gap: 8px !important;
}

/* Make all direct card-like divs use same panel */
.card,
.mini,
.panel,
.section,
.box,
.module,
.metric-card,
.grid > div,
.cards > div,
body > div > div {
  background: #07111c !important;
  border: 1px solid #1d3347 !important;
  border-radius: 4px !important;
  color: #d8dee9 !important;
  padding: 10px !important;
  margin-bottom: 8px !important;
  box-shadow: none !important;
}

/* Grid sizing closer to command center */
.grid,
.cards,
.dashboard-grid,
.content-grid {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
}

.grid > div,
.cards > div,
.dashboard-grid > div,
.content-grid > div,
.card {
  grid-column: span 4 !important;
}

/* Better text match */
h1 {
  font-size: 28px !important;
  color: #ffbf00 !important;
  margin: 0 0 4px 0 !important;
  font-weight: 800 !important;
  letter-spacing: .06em !important;
}

h2 {
  font-size: 17px !important;
  color: #ffbf00 !important;
  margin: 0 0 8px 0 !important;
  padding-bottom: 6px !important;
  border-bottom: 1px solid #1d3347 !important;
  font-weight: 800 !important;
  letter-spacing: .06em !important;
}

h3 {
  font-size: 14px !important;
  color: #ffbf00 !important;
  font-weight: 800 !important;
}

p {
  color: #d8dee9 !important;
  margin-top: 4px !important;
  margin-bottom: 7px !important;
}

/* Metric big number like homepage */
.metric,
.score,
.big,
.value-big {
  color: #d8dee9 !important;
  font-size: 32px !important;
  font-weight: 800 !important;
}

/* Table match */
table {
  background: #050b13 !important;
  color: #d8dee9 !important;
  border-collapse: collapse !important;
  font-size: 14px !important;
}

td,
th {
  border: 1px solid #1d3347 !important;
  padding: 6px 8px !important;
  color: #d8dee9 !important;
}

th {
  background: #101b2a !important;
  color: #ffbf00 !important;
  font-weight: 800 !important;
}

tr:nth-child(even) td {
  background: #0b1624 !important;
}

tr:nth-child(odd) td {
  background: #07111c !important;
}

/* Buttons/nav exact match */
a,
button,
select,
input[type="submit"] {
  color: #ffbf00 !important;
  background: #08111c !important;
  border: 1px solid #40566b !important;
  border-radius: 3px !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  text-transform: uppercase !important;
}

a:hover,
button:hover,
input[type="submit"]:hover {
  background: #ffbf00 !important;
  color: #000 !important;
}

/* Force all secondary text into same palette */
span,
label,
li,
small {
  color: #d8dee9 !important;
}

.note,
.muted,
.label {
  color: #8fa3b8 !important;
}

/* Responsive */
@media (max-width: 1100px) {
  .grid > div,
  .cards > div,
  .dashboard-grid > div,
  .content-grid > div,
  .card {
    grid-column: span 12 !important;
  }

  .top {
    grid-template-columns: 1fr !important;
  }
}

/* ===== Route-specific full match: Supply Pressure ===== */
body.supply-pressure-page {
  background: #010711 !important;
  color: #d8dee9 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  padding: 10px !important;
  font-size: 15px !important;
}

body.supply-pressure-page .top {
  background: #07111c !important;
  border: 1px solid #1d3347 !important;
  border-radius: 4px !important;
  margin-bottom: 8px !important;
  padding: 10px !important;
}

body.supply-pressure-page h1 {
  color: #ffbf00 !important;
  font-size: 28px !important;
  font-weight: 800 !important;
  letter-spacing: .06em !important;
}

body.supply-pressure-page h2 {
  color: #ffbf00 !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  letter-spacing: .06em !important;
  border-bottom: 1px solid #1d3347 !important;
}

body.supply-pressure-page .card,
body.supply-pressure-page .mini,
body.supply-pressure-page .panel,
body.supply-pressure-page .grid > div {
  background: #07111c !important;
  border: 1px solid #1d3347 !important;
  border-radius: 4px !important;
  color: #d8dee9 !important;
  padding: 10px !important;
}

body.supply-pressure-page table {
  background: #050b13 !important;
  color: #d8dee9 !important;
  border-collapse: collapse !important;
}

body.supply-pressure-page td,
body.supply-pressure-page th {
  border: 1px solid #1d3347 !important;
  color: #d8dee9 !important;
  padding: 6px 8px !important;
}

body.supply-pressure-page th {
  background: #101b2a !important;
  color: #ffbf00 !important;
}

body.supply-pressure-page tr:nth-child(even) td {
  background: #0b1624 !important;
}

body.supply-pressure-page tr:nth-child(odd) td {
  background: #07111c !important;
}

body.supply-pressure-page a,
body.supply-pressure-page button {
  color: #ffbf00 !important;
  background: #08111c !important;
  border: 1px solid #40566b !important;
  border-radius: 3px !important;
  font-weight: 700 !important;
}

body.supply-pressure-page a:hover,
body.supply-pressure-page button:hover {
  background: #ffbf00 !important;
  color: #000 !important;
}

/* ===== Supply Pressure structural match pass ===== */

body.supply-pressure-page .grid {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: 8px !important;
  align-items: start !important;
}

/* Row 1 */
body.supply-pressure-page .grid > .card:nth-child(1) {
  grid-column: span 3 !important;
  min-height: 150px !important;
}

body.supply-pressure-page .grid > .card:nth-child(2) {
  grid-column: span 5 !important;
  min-height: 150px !important;
}

body.supply-pressure-page .grid > .card:nth-child(3) {
  grid-column: span 4 !important;
  min-height: 150px !important;
}

/* Row 2 */
body.supply-pressure-page .grid > .card:nth-child(4) {
  grid-column: span 4 !important;
}

body.supply-pressure-page .grid > .card:nth-child(5) {
  grid-column: span 4 !important;
}

body.supply-pressure-page .grid > .card:nth-child(6) {
  grid-column: span 4 !important;
}

/* Lower data modules */
body.supply-pressure-page .grid > .card:nth-child(n+7) {
  grid-column: span 4 !important;
}

/* Do not let old .wide force full-width cards */
body.supply-pressure-page .wide {
  grid-column: auto !important;
}

/* Make score box match Alpha command center */
body.supply-pressure-page .big {
  color: #d8dee9 !important;
  font-size: 34px !important;
  line-height: 1.05 !important;
  font-weight: 800 !important;
  margin: 6px 0 !important;
}

body.supply-pressure-page .label {
  color: #8fa3b8 !important;
  font-size: 13px !important;
  text-transform: uppercase !important;
  letter-spacing: .03em !important;
}

/* Tighten card text so blocks feel like homepage */
body.supply-pressure-page .card div[style*="font-size:18px"] {
  font-size: 15px !important;
  line-height: 1.35 !important;
}

body.supply-pressure-page .card div[style*="font-size:20px"] {
  font-size: 16px !important;
}

/* Keep tables from dominating the page */
body.supply-pressure-page table {
  font-size: 13px !important;
}

body.supply-pressure-page td,
body.supply-pressure-page th {
  padding: 5px 6px !important;
}

/* Responsive */
@media (max-width: 1200px) {
  body.supply-pressure-page .grid > .card {
    grid-column: span 12 !important;
  }
}

/* ===== Supply Pressure V2 exact command-center layout ===== */

body.supply-pressure-v2-page {
  background: #010711 !important;
  color: #d8dee9 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  padding: 10px !important;
}

body.supply-pressure-v2-page .grid {
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
  gap: 8px !important;
  align-items: start !important;
}

/* Top decision row */
body.supply-pressure-v2-page .grid > .card:nth-child(1) {
  grid-column: span 3 !important;
}

body.supply-pressure-v2-page .grid > .card:nth-child(2) {
  grid-column: span 5 !important;
}

body.supply-pressure-v2-page .grid > .card:nth-child(3) {
  grid-column: span 4 !important;
}

/* Second row */
body.supply-pressure-v2-page .grid > .card:nth-child(4),
body.supply-pressure-v2-page .grid > .card:nth-child(5),
body.supply-pressure-v2-page .grid > .card:nth-child(6) {
  grid-column: span 4 !important;
}

/* Everything below */
body.supply-pressure-v2-page .grid > .card:nth-child(n+7) {
  grid-column: span 4 !important;
}

/* Remove old full-width behavior */
body.supply-pressure-v2-page .wide {
  grid-column: span 4 !important;
}

/* Make key longer modules wider but not full page */
body.supply-pressure-v2-page .grid > .card:nth-child(5),
body.supply-pressure-v2-page .grid > .card:nth-child(7),
body.supply-pressure-v2-page .grid > .card:nth-last-child(1) {
  grid-column: span 6 !important;
}

/* Match homepage card density */
body.supply-pressure-v2-page .card {
  background: #07111c !important;
  border: 1px solid #1d3347 !important;
  border-radius: 4px !important;
  padding: 10px !important;
  margin: 0 !important;
  min-height: auto !important;
}

body.supply-pressure-v2-page h1 {
  font-size: 28px !important;
  line-height: 1.05 !important;
  margin: 0 0 4px 0 !important;
}

body.supply-pressure-v2-page h2 {
  font-size: 17px !important;
  margin: 0 0 8px 0 !important;
  padding-bottom: 6px !important;
}

body.supply-pressure-v2-page .big {
  color: #d8dee9 !important;
  font-size: 34px !important;
  line-height: 1.05 !important;
  font-weight: 800 !important;
}

body.supply-pressure-v2-page .label {
  color: #8fa3b8 !important;
  font-size: 12px !important;
  letter-spacing: .03em !important;
}

body.supply-pressure-v2-page .card div[style*="font-size:18px"] {
  font-size: 15px !important;
  line-height: 1.32 !important;
}

body.supply-pressure-v2-page .card div[style*="font-size:20px"] {
  font-size: 16px !important;
}

body.supply-pressure-v2-page table {
  font-size: 13px !important;
}

body.supply-pressure-v2-page td,
body.supply-pressure-v2-page th {
  padding: 5px 6px !important;
}

/* Make Plotly panel match */
body.supply-pressure-v2-page .chart {
  height: 320px !important;
  background: #050b13 !important;
  border: 1px solid #1d3347 !important;
  border-radius: 4px !important;
}

/* Mobile */
@media (max-width: 1200px) {
  body.supply-pressure-v2-page .grid > .card,
  body.supply-pressure-v2-page .wide {
    grid-column: span 12 !important;
  }
}

/* ===== Supply Pressure V2 row-height cleanup ===== */
body.supply-pressure-v2-page .grid > .card:nth-child(1) {
  min-height: 225px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
}

body.supply-pressure-v2-page .grid > .card:nth-child(1) .big {
  font-size: 42px !important;
  margin-top: 12px !important;
  margin-bottom: 8px !important;
}

body.supply-pressure-v2-page .grid > .card:nth-child(4) {
  min-height: 190px !important;
}

body.supply-pressure-v2-page .grid > .card:nth-child(5) {
  min-height: 190px !important;
}

body.supply-pressure-v2-page .grid > .card:nth-child(6) {
  min-height: 190px !important;
}

/* Force Deep Model Modules card links vertical */
.card .links,
.card .deep-links,
.card .deep-module-list {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 7px !important;
  align-items: stretch !important;
  width: 100% !important;
}

.card .links a,
.card .deep-links a,
.card .deep-module-list a {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-align: left !important;
  white-space: nowrap !important;
  padding: 8px 10px !important;
}
