/* style.css — Design tokens + component styles for HC Housing Dashboard */

/* ===== TYPE SCALE ===== */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1rem    + 1.5vw,  2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Font */
  --font-body: 'Inter', system-ui, sans-serif;
  --font-display: 'Inter', system-ui, sans-serif;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Chart colors */
  --chart-navy: #1a2744;
  --chart-blue: #4a8bc2;
  --chart-coral: #e86c5a;
  --chart-green: #3a8a5c;
  --chart-gold: #d4a843;
  --chart-light-blue: #8bb8e0;
}

/* ===== LIGHT MODE ===== */
:root, [data-theme="light"] {
  --color-bg:               #fafaf8;
  --color-surface:          #ffffff;
  --color-surface-2:        #f5f5f3;
  --color-surface-offset:   #eeeee9;
  --color-surface-offset-2: #e5e5e0;
  --color-surface-dynamic:  #ddddd8;
  --color-divider:          #d4d4cf;
  --color-border:           #c8c8c2;

  --color-text:           #1a2744;
  --color-text-muted:     #5a6478;
  --color-text-faint:     #9aa0ad;
  --color-text-inverse:   #fafaf8;

  --color-primary:          #1a2744;
  --color-primary-hover:    #263756;
  --color-primary-active:   #0f1a2e;
  --color-primary-highlight: #dde3ed;

  --color-secondary:        #4a8bc2;
  --color-secondary-hover:  #3a7ab0;

  --color-warning:          #e86c5a;
  --color-warning-hover:    #d45a48;
  --color-warning-active:   #c04a38;
  --color-warning-highlight: #fce8e5;

  --color-success:          #3a8a5c;
  --color-success-hover:    #2d7049;
  --color-success-highlight: #dff0e6;

  --color-error:            #c23d3d;
  --color-error-hover:      #a83232;

  --shadow-sm: 0 1px 2px rgba(26, 39, 68, 0.06);
  --shadow-md: 0 4px 12px rgba(26, 39, 68, 0.08);
  --shadow-lg: 0 12px 32px rgba(26, 39, 68, 0.12);
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --color-bg:               #0e1525;
  --color-surface:          #141d30;
  --color-surface-2:        #1a2540;
  --color-surface-offset:   #1e2a48;
  --color-surface-offset-2: #243152;
  --color-surface-dynamic:  #2a385c;
  --color-divider:          #2e3d62;
  --color-border:           #384870;

  --color-text:           #e0e4eb;
  --color-text-muted:     #8d96a8;
  --color-text-faint:     #5a6478;
  --color-text-inverse:   #0e1525;

  --color-primary:          #6b9fd4;
  --color-primary-hover:    #85b2de;
  --color-primary-active:   #5589c0;
  --color-primary-highlight: #1e2a48;

  --color-secondary:        #6baad6;
  --color-secondary-hover:  #85bce0;

  --color-warning:          #f08878;
  --color-warning-hover:    #e67060;
  --color-warning-active:   #d45848;
  --color-warning-highlight: #2e1f1c;

  --color-success:          #5aae7a;
  --color-success-hover:    #4a9a6a;
  --color-success-highlight: #162e20;

  --color-error:            #e06060;
  --color-error-hover:      #cc4c4c;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);

  --chart-navy: #6b9fd4;
  --chart-blue: #6baad6;
  --chart-coral: #f08878;
  --chart-green: #5aae7a;
  --chart-gold: #e8c06a;
  --chart-light-blue: #9cc5e8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:               #0e1525;
    --color-surface:          #141d30;
    --color-surface-2:        #1a2540;
    --color-surface-offset:   #1e2a48;
    --color-surface-offset-2: #243152;
    --color-surface-dynamic:  #2a385c;
    --color-divider:          #2e3d62;
    --color-border:           #384870;
    --color-text:           #e0e4eb;
    --color-text-muted:     #8d96a8;
    --color-text-faint:     #5a6478;
    --color-text-inverse:   #0e1525;
    --color-primary:          #6b9fd4;
    --color-primary-hover:    #85b2de;
    --color-primary-active:   #5589c0;
    --color-primary-highlight: #1e2a48;
    --color-secondary:        #6baad6;
    --color-secondary-hover:  #85bce0;
    --color-warning:          #f08878;
    --color-warning-hover:    #e67060;
    --color-warning-active:   #d45848;
    --color-warning-highlight: #2e1f1c;
    --color-success:          #5aae7a;
    --color-success-hover:    #4a9a6a;
    --color-success-highlight: #162e20;
    --color-error:            #e06060;
    --color-error-hover:      #cc4c4c;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    --chart-navy: #6b9fd4;
    --chart-blue: #6baad6;
    --chart-coral: #f08878;
    --chart-green: #5aae7a;
    --chart-gold: #e8c06a;
    --chart-light-blue: #9cc5e8;
  }
}

/* ===== LAYOUT ===== */
.dashboard-wrapper {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* ===== HEADER ===== */
.site-header {
  background: #ffffff;
  color: var(--color-text);
  padding: var(--space-6) 0;
  position: relative;
  border-bottom: 1px solid var(--color-divider);
}
[data-theme="dark"] .site-header {
  background: var(--color-surface);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-divider);
}
.header-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.header-logo svg {
  width: 40px;
  height: 40px;
}
.header-logo-img {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.header-logo-img img {
  display: block;
  height: 88px;
  width: auto;
  max-width: 320px;
}
[data-theme="dark"] .header-logo-img {
  background: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.header-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-top: var(--space-1);
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-4);
}
.header-text h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: inherit;
}
.header-text .subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 400;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.badge-updated {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
  background: var(--color-surface-offset, #f3f4f6);
  color: var(--color-text-muted);
  white-space: nowrap;
}
[data-theme="dark"] .badge-updated {
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
}
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: inherit;
  transition: background var(--transition-interactive);
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  background: rgba(255,255,255,0.15);
}
[data-theme="dark"] .theme-toggle-btn:hover {
  background: var(--color-surface-offset);
}

/* ===== STICKY NAV ===== */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sticky-nav::-webkit-scrollbar { display: none; }
.sticky-nav-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  gap: var(--space-1);
}
.sticky-nav a {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--transition-interactive), border-color var(--transition-interactive);
}
.sticky-nav a:hover {
  color: var(--color-text);
  text-decoration: none;
}
.sticky-nav a.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ===== SECTIONS ===== */
.dashboard-section {
  padding: clamp(var(--space-8), 5vw, var(--space-16)) 0;
}
.section-header {
  margin-bottom: var(--space-6);
}
.section-header h2 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.section-header p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.section-divider {
  height: 1px;
  background: var(--color-divider);
}

/* ===== KPI CARDS ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}
.kpi-card { min-width: 0; overflow: hidden; }
.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: box-shadow var(--transition-interactive);
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
}
.kpi-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: var(--space-2);
  line-height: 1.3;
}
.kpi-value {
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-text);
  line-height: 1.1;
}
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 500;
  margin-top: var(--space-2);
  font-variant-numeric: tabular-nums lining-nums;
}
.kpi-delta.positive { color: var(--color-success); }
.kpi-delta.negative { color: var(--color-warning); }
.kpi-delta.neutral { color: var(--color-text-faint); }
.kpi-source {
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: var(--space-2);
}

/* ===== CHART CONTAINERS ===== */
.chart-container {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.chart-wrapper {
  position: relative;
  width: 100%;
}
.chart-source {
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: var(--space-3);
}

/* ===== SIDE-BY-SIDE CHARTS ===== */
.chart-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 768px) {
  .chart-pair {
    grid-template-columns: 1fr;
  }
}
.chart-pair .chart-container {
  display: flex;
  flex-direction: column;
}
.chart-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
  line-height: 1.3;
}
.chart-title-lg {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.005em;
}
.chart-title-bold {
  font-weight: 700;
}
.chart-pair .chart-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}
.chart-callout {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-warning-highlight);
  border-radius: var(--radius-md);
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-warning);
}
[data-theme="dark"] .chart-callout {
  color: var(--color-warning);
}
.chart-callout.info {
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}
.chart-callout.positive {
  background: var(--color-success-highlight);
  color: var(--color-success);
}
[data-theme="dark"] .chart-callout.positive {
  color: var(--color-success);
}

/* ===== TABLE ===== */
.table-container {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.table-wrapper {
  overflow-x: auto;
}
.data-table {
  width: 100%;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums lining-nums;
}
.data-table th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-divider);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  white-space: nowrap;
}
.data-table tbody tr:last-child td {
  border-bottom: none;
}
.data-table tbody tr:hover {
  background: var(--color-surface-2);
}
.data-table tr.row-highlight {
  background: var(--color-warning-highlight);
}
.data-table tr.row-highlight:hover {
  background: var(--color-warning-highlight);
}
.data-table .cell-warn {
  color: var(--color-warning);
  font-weight: 600;
}
.table-footer {
  padding: var(--space-3) var(--space-4);
  font-size: 11px;
  color: var(--color-text-faint);
  border-top: 1px solid var(--color-divider);
}

/* ===== STAT CARDS GRID (MIHU, Rental Market) ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-4);
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
}
.stat-card .stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.stat-card .stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}
.stat-highlight {
  grid-column: 1 / -1;
  background: var(--color-warning-highlight);
  border-color: transparent;
  padding: var(--space-4) var(--space-5);
  text-align: left;
}
.stat-highlight .stat-value {
  color: var(--color-warning);
  font-size: var(--text-sm);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-divider);
  padding: var(--space-10) 0 var(--space-8);
  margin-top: var(--space-8);
}
.footer-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-5);
}
.footer-sources h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-3);
}
.footer-sources ul {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-6);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-2);
}
.footer-sources li {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.footer-sources li a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}

/* ===== SCROLL ANIMATION ===== */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-on-scroll.visible {
  opacity: 1;
}
/* Fallback: if JS fails, show content */
.no-js .animate-on-scroll {
  opacity: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header-inner {
    gap: var(--space-4);
  }
  .header-logo-img img {
    height: 64px;
    max-width: 240px;
  }
  .header-text h1 {
    font-size: var(--text-lg);
  }
  .header-text .subtitle {
    font-size: var(--text-xs);
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi-value {
    font-size: var(--text-lg);
  }
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-highlight {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .header-actions .badge-updated {
    display: none;
  }
}

/* ===== AFFORDABILITY HEADLINE (What It Takes section) ===== */
.req-income-headline {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-8);
  align-items: center;
  padding: var(--space-4) 0 var(--space-2);
}
.req-income-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.req-down-block {
  padding-bottom: var(--space-5);
  border-bottom: 1px solid var(--color-divider);
}
.req-down-label,
.req-income-label-top {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.req-down-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
}
.req-income-big {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-warning);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-3);
}
.req-income-sublabel {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
  max-width: 420px;
}
.req-income-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.piti-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.piti-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--color-surface-alt, #f5f5f0);
  border-radius: 6px;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--color-text);
}
.piti-list li.total {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  margin-top: 4px;
}
[data-theme="dark"] .piti-list li {
  background: rgba(255, 255, 255, 0.04);
}
[data-theme="dark"] .piti-list li.total {
  background: var(--color-primary);
}
@media (max-width: 900px) {
  .req-income-headline {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
  .req-income-big { font-size: 44px; }
  .req-down-value { font-size: 30px; }
}
.scenario-divider {
  height: 1px;
  background: var(--color-divider);
  margin: var(--space-6) 0 var(--space-2);
}

/* ===== MIHU SECTION — two-track layout ===== */
.mihu-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  align-items: start;
}
.mihu-track {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.mihu-track-header {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
}
.mihu-track-eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-warning);
  margin-bottom: 4px;
}
.mihu-track-title {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
}
.mihu-track-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.4;
}
.mihu-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}
.mihu-track .stat-card {
  background: var(--color-surface-alt, #f5f5f0);
  padding: var(--space-3);
}
[data-theme="dark"] .mihu-track .stat-card {
  background: rgba(255, 255, 255, 0.03);
}
@media (max-width: 900px) {
  .mihu-pair {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

/* ===== DISABILITY SECTION: SUPPLY PIPELINE CARDS ===== */
.disability-supply-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.supply-card {
  text-align: left;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.supply-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.supply-eyebrow.positive { color: var(--color-success); }
.supply-eyebrow.info { color: var(--color-primary); }
.supply-eyebrow.muted { color: var(--color-text-faint); }
[data-theme="dark"] .supply-eyebrow.positive { color: var(--color-success); }
.supply-name {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}
.supply-units {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1;
  margin-top: 2px;
}
.supply-units span {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text-muted);
  margin-left: 4px;
  letter-spacing: 0;
  text-transform: none;
}
.supply-detail {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.45;
  margin-top: var(--space-1);
}

/* ===== HOUSING PRODUCTION VS. TARGETS ===== */
.production-kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.production-kpi {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--color-warning);
}
.production-kpi-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-2);
}
.production-kpi-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-warning);
  font-variant-numeric: tabular-nums lining-nums;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-2);
}
.production-kpi-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.45;
}
.production-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
}
@media (max-width: 880px) {
  .production-kpis { grid-template-columns: 1fr; }
  .production-charts { grid-template-columns: 1fr; gap: var(--space-5); }
  .production-kpi-value { font-size: 1.875rem; }
}

/* 3-column shortage KPI grid */
.production-kpis-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.production-kpi-current { border-left-color: var(--color-warning); }
.production-kpi-add { border-left-color: #d49b1e; }
.production-kpi-total {
  border-left-color: var(--color-warning);
  position: relative;
  box-shadow: 0 0 0 1px var(--color-warning) inset;
}
.production-kpi-total::before {
  content: '=';
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-muted);
}
.production-kpi-add::before {
  content: '+';
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-muted);
}
.production-kpi-add { position: relative; }
.production-kpi-current .production-kpi-value { color: var(--color-warning); }
.production-kpi-add .production-kpi-value { color: #b5811a; }
.production-kpi-total .production-kpi-value { color: var(--color-warning); }
@media (max-width: 880px) {
  .production-kpis-3 { grid-template-columns: 1fr; }
  .production-kpi-add::before,
  .production-kpi-total::before { display: none; }
}
