/* Shared presentation layer. Page structure, data and event handlers stay in
   their original documents. Scope page-specific rules to the body classes. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface2: #edf1f5;
  --border: #dce2e9;
  --text: #17283e;
  --muted: #596779;
  --radius: 14px;
  --radius-sm: 8px;
  --navy-900: #102238;
  --navy-800: #19334e;
  --navy-700: #234564;
  --gray-400: #677589;
  --gray-500: #596779;
  --gold-500: #876a22;
  --gold-400: #e2bf70;
  --gold-300: #f0d69a;
  --line: #dce2e9;
  --ice: #f6f7f9;
}

/* Project-wide type system: IBM Plex has a more human, institutional rhythm
   than the previous display pairing while keeping the same hierarchy. */
body,
body :where(button, input, select, textarea) { font-family: 'IBM Plex Sans', system-ui, sans-serif !important; }
body :where(h1, h2, h3, h4, .hero h1, .dashboard-card-title, .section-header h2,
  .subscribe-panel h2, .cta-banner h2, .footer-logo, .logo-text h1,
  .intro-text, .consenso-intro, .intro-stat-num, .kpi-value, .modal-title,
  .modal-header h3, .donut-section h2, .analysis-card h2, .semaforo-stage-title,
  .semaforo-copy-title, .year-pie-title, .simple-table-title, .card-title,
  .allocation-side h3, .reading-lead h2, .method h3, .program-name) {
  font-family: 'IBM Plex Serif', Georgia, serif !important;
}
.page-dashboard .intro-stat-label,
.page-dashboard .kpi-label,
.page-dashboard .semaforo-copy-quote,
.page-dashboard .semaforo-copy-actions,
.page-dashboard .simple-table,
.page-dashboard .bill-card,
.page-dashboard .proj-card { font-family: 'IBM Plex Sans', system-ui, sans-serif !important; }
html { scroll-padding-top: 32px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: #dce7f2; color: #102238; }
:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 3px solid #4886bc;
  outline-offset: 4px;
}
:where(button, a, input, select) { -webkit-tap-highlight-color: transparent; }
:where(button, input, select) { font: inherit; }
:where(button, a) { transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
:where(button):disabled { cursor: wait; opacity: .65; }
:where(h1, h2, h3) { text-wrap: balance; }
:where(p) { text-wrap: pretty; }
:where(.stat-number, .kpi-value, .intro-stat-num, .bar-value, .hero-total-value) { font-variant-numeric: tabular-nums; }

/* Home: a quiet institutional cover, followed by the existing workspaces. */
.page-home { background: #fafbfc; }
.page-home .hero { background: #102238; min-height: 640px; min-height: min(760px, 88svh); border-top: 5px solid #e2bf70; }
.page-home .hero::before { background: linear-gradient(110deg, transparent 55%, rgba(100,138,171,.09)); }
.page-home .hero-content { width: 100%; max-width: 1240px; padding: 80px 48px 88px; }
.page-home .hero-badge {
  background: none; border: 0; border-radius: 0; padding: 0 0 22px;
  border-bottom: 1px solid #ffffff30; width: 100%; margin-bottom: 38px;
  color: #bdcbd9; font-size: 11px; font-weight: 500; letter-spacing: .11em; text-transform: uppercase;
}
.page-home .hero-badge-dot { background: #e2bf70; flex-shrink: 0; }
.page-home .hero h1 { max-width: 1000px; font-size: clamp(38px, 5.1vw, 70px); font-weight: 400; line-height: 1.09; letter-spacing: -.035em; margin-bottom: 26px; }
.page-home .hero h1 .gold { color: #e8c985; }
.page-home .hero-subtitle { max-width: 655px; color: #bdcbd9; font-size: 16px; line-height: 1.8; margin-bottom: 32px; }
.page-home .hero-actions { gap: 10px; }
.page-home :is(.btn-primary, .btn-secondary) { border-radius: 6px; min-height: 48px; padding: 13px 21px; font-size: 13px; font-weight: 600; }
.page-home .btn-primary { background: #e2bf70; color: #102238; }
.page-home .btn-primary:hover { background: #f0d69a; box-shadow: 0 4px 16px #00000012; }
.page-home .btn-secondary { background: transparent; border-color: #ffffff35; }
.page-home .btn-secondary:hover { background: #ffffff0d; border-color: #ffffff70; }
.page-home .stats-strip { padding: 32px 48px; background: #fff; }
.page-home .stats-inner { max-width: 1144px; gap: 0; }
.page-home .stat-item { text-align: left; padding: 8px 32px; border-left: 1px solid var(--border); }
.page-home .stat-item:first-child { border-left: 0; padding-left: 0; }
.page-home .stat-number { font-size: 40px; font-weight: 600; letter-spacing: -.04em; margin-bottom: 9px; }
.page-home .stat-label { font-size: 12px; }
.page-home .section { max-width: 1240px; padding: 76px 48px; }
.page-home .section-header { text-align: left; margin-bottom: 32px; }
.page-home .section-header h2 { font-size: 36px; font-weight: 600; letter-spacing: -.025em; margin-bottom: 8px; }
.page-home .section-header p { max-width: none; margin: 0; font-size: 15px; }
.page-home .dashboard-cards { gap: 20px; margin-bottom: 0; }
.page-home .dashboard-card {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  padding: 30px 26px; border-radius: 10px; border-color: var(--border); box-shadow: 0 2px 4px #10223803;
}
.page-home .dashboard-card::before { height: 2px; background: #315875; }
.page-home .dashboard-card.ia::before { background: #b99243; }
.page-home .dashboard-card.budget::before { background: #6f859c; }
.page-home .dashboard-card:hover { border-color: #9aafc1; transform: translateY(-4px); box-shadow: 0 12px 28px #1022380b; }
.page-home .dashboard-card-icon { font-size: 28px; margin-bottom: 24px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 9px; background: #f0f4f8; color: #315875; }
.page-home .dashboard-card-title { font-size: 25px; font-weight: 600; letter-spacing: -.025em; line-height: 1.2; min-height: 60px; }
.page-home .dashboard-card-desc { line-height: 1.75; margin-bottom: 24px; flex-grow: 1; }
.page-home .dashboard-card-stat { font-size: clamp(27px, 2.7vw, 38px); color: #19334e; letter-spacing: -.04em; font-weight: 600; }
.page-home .dashboard-card-stat-label { color: #596779; }
.page-home .dashboard-card .dashboard-card-btn { margin-top: 26px; width: 100%; border: 0; border-top: 1px solid var(--border); border-radius: 0; padding: 18px 0 0; background: transparent; color: #244e73; }
.page-home .dashboard-card:hover .dashboard-card-btn { background: transparent; color: #102238; }
.page-home #seguimiento { padding-top: 16px; padding-bottom: 16px; }
.page-home .subscribe-panel { background: #edf2f6; border: 1px solid #dce4ec; border-radius: 10px; padding: 42px; gap: 40px; box-shadow: none; }
.page-home .subscribe-kicker { color: #395d7b; font-size: 10px; letter-spacing: .13em; margin-bottom: 16px; }
.page-home .subscribe-panel h2 { font-size: clamp(25px, 2.6vw, 34px); font-weight: 600; line-height: 1.18; letter-spacing: -.025em; }
.page-home .subscribe-panel p { font-size: 14px; line-height: 1.8; }
.page-home .subscribe-form { background: transparent; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.page-home .subscribe-form input { background: #fff; border-radius: 6px; min-height: 48px; }
.page-home .subscribe-fields { flex-wrap: wrap; }
.page-home .subscribe-form input { flex-basis: 170px; }
.page-home .subscribe-form button { background: #19334e; color: #fff; }
.page-home .subscribe-form button:hover { background: #234564; }
.page-home .subscribe-message { font-size: 12px; line-height: 1.7; margin-top: 14px; }
.page-home .cta-banner { margin: 0; max-width: none; padding: 48px; border-radius: 10px; background: #19334e; }
.page-home .cta-banner h2 { font-size: 34px; font-weight: 400; }
.page-home .footer { background: #102238; text-align: left; padding: 40px 48px; }
.page-home .footer-inner { max-width: 1144px; }
.page-home .footer-logo { font-weight: 400; font-size: 22px; }
.page-home .footer p { color: #a4b7c9; line-height: 1.7; }
.page-home .footer-links { justify-content: flex-start; flex-wrap: wrap; gap: 8px 28px; padding-top: 20px; border-top: 1px solid #ffffff20; margin-top: 24px; }
.page-home .footer-links a { color: #c2d0dc; min-height: 32px; display: inline-flex; align-items: center; }

/* Dashboards: shared surfaces, legible controls and lighter data containers. */
.page-dashboard .app { max-width: 1360px; padding: 0 40px 64px; }
.page-dashboard .header { padding: 30px 0 24px; margin-bottom: 36px; }
.page-dashboard .logo-icon { background: #19334e; color: #e8c985; border-radius: 9px; width: 44px; height: 44px; flex-shrink: 0; }
.page-dashboard .logo-text h1 { font-size: 25px; font-weight: 600; letter-spacing: -.035em; }
.page-dashboard .logo-text p { color: #596779; font-size: 12px; margin-top: 5px; }
.page-dashboard :is(.back-link, .header-actions a) { min-height: 40px; display: inline-flex; align-items: center; background: #fff; }
.page-dashboard .header-badge { border-color: #dce2e9; background: #edf2f6; border-radius: 6px; color: #395d7b; }
.page-dashboard .header-badge .dot { animation: none; background: #395d7b; }
.page-dashboard :is(.intro-text, .consenso-intro) { text-align: left; max-width: none; padding: 0; font-size: clamp(20px, 2.05vw, 28px); line-height: 1.55; letter-spacing: -.02em; }
.page-dashboard .intro-text { font-family: 'Source Serif 4', Georgia, serif; }
.page-dashboard .intro-stats { justify-content: flex-start; gap: 48px; padding: 25px 0 8px; margin-top: 12px; }
.page-dashboard .intro-stat { gap: 10px; }
.page-dashboard .intro-stat-num { font-family: 'Source Serif 4', Georgia, serif; font-size: 38px; font-weight: 600; }
.page-dashboard .intro-stat-label { font-family: 'Inter', sans-serif; font-size: 13px; }
.page-dashboard :is(.donut-section, .analysis-card, .card, .simple-table-wrap, .year-pie-wrap) { background: #fff; border-color: var(--border); box-shadow: 0 2px 5px #10223803; }
.page-dashboard :is(.donut-section, .analysis-card) { padding: 30px; }
.page-dashboard :is(.donut-section h2, .analysis-card h2, .card-title, .year-pie-title) { font-weight: 600; letter-spacing: -.02em; }
.page-dashboard :is(.donut-section, .analysis-card) .subtitle { background: none; border: 0; border-radius: 0; padding: 0; font-size: 12px; line-height: 1.7; }
.page-dashboard .donut-canvas-wrap { width: 480px; height: 480px; }
.page-dashboard .donut-layout { gap: 32px; }
.page-dashboard .legend-item { min-height: 48px; border-radius: 6px; border-bottom: 1px solid #edf1f5; margin: 0; }
.page-dashboard .legend-item:hover { background: #edf2f6; }
.page-dashboard .legend-name { font-weight: 500; }
.page-dashboard :is(.donut-legend, .subdonut-legend) { min-width: 0; }
.page-dashboard .kpi-grid { gap: 16px; }
.page-dashboard .kpi-card { background: #fff; padding: 22px; border-radius: 8px; }
.page-dashboard .kpi-card:hover { background: #fff; border-color: #9aafc1; }
.page-dashboard .kpi-value { color: #19334e; font-size: 38px; font-weight: 600; letter-spacing: -.03em; }
.page-dashboard .kpi-label { font-size: 11px; letter-spacing: .07em; }
.page-dashboard .kpi-tag { background: #edf2f6; color: #395d7b; border-color: #dce4ec; border-radius: 4px; }
.page-dashboard :is(.filter-sel, .btn-reset) { min-height: 42px; border-radius: 6px; }
.page-dashboard .filter-sel { background-color: #fff; }
.page-dashboard :is(.simple-table, table) { font-variant-numeric: tabular-nums; }
.page-dashboard :is(.simple-table th, .simple-table td) { padding: 12px 14px; line-height: 1.55; }
.page-dashboard .simple-table thead th { background: #edf2f6; color: #395d7b; }
.page-dashboard .simple-table tbody tr:hover { background: #f3f6f9; }
.page-dashboard :is(.modal, .modal-content) { background: #fff; box-shadow: 0 28px 100px #10223833; }
.page-dashboard .modal-header { background: #fff; }
.page-dashboard .modal-close { min-width: 44px; min-height: 44px; background: #edf2f6; }
.page-dashboard :is(.proj-card, .bill-card) { background: #f8fafc; border-radius: 8px; }
.page-dashboard .proj-desc { font-size: 14px; line-height: 1.7; }
.page-dashboard .proj-meta { font-size: 12px; line-height: 1.6; }
.page-dashboard :is(.proj-pdf, .pdf-link) { min-height: 36px; align-items: center; }
.page-dashboard footer { padding: 28px 0; margin-top: 16px; }

/* Keep the traffic-light semantics, with readable labels and quiet surfaces. */
.page-ia .semaforo-wrap { padding: 0; background: transparent; border: 0; }
.page-ia .semaforo-stack { gap: 24px; }
.page-ia .semaforo-row { border-radius: 12px; box-shadow: none; border-color: #dce2e9; background: #fff; }
.page-ia .semaforo-row::before { background: none; }
.page-ia .semaforo-row.green { --signal: #286747; --signal-soft: #edf6ef; --signal-line: #b9d3c1; }
.page-ia .semaforo-row.yellow { --signal: #865e18; --signal-soft: #fcf6e9; --signal-line: #e1d1ad; }
.page-ia .semaforo-row.red { --signal: #a33f43; --signal-soft: #fbefef; --signal-line: #e0bfc1; }
.page-ia .semaforo-row .semaforo-stripe { background: var(--signal); height: 3px; }
.page-ia .semaforo-row .semaforo-stage-card { background: var(--signal-soft); border-color: var(--signal-line); border-radius: 10px; }
.page-ia .semaforo-row .semaforo-stage-card.front { border-color: var(--signal-line); box-shadow: 0 6px 18px #1022380a; }
.page-ia .semaforo-row .semaforo-stage-chip { color: var(--signal); background: #ffffffb3; border-color: var(--signal-line); border-radius: 4px; }
.page-ia .modal-title { padding-right: 48px; color: #19334e !important; line-height: 1.35; }
.page-ia .modal-value { color: #17283e !important; font-size: 14px; line-height: 1.75; }
.page-ia .modal-field { padding-bottom: 16px; border-bottom: 1px solid #edf1f5; }
.page-ia .modal-field:last-child { border-bottom: 0; }
.page-ia .modal-label { letter-spacing: .05em; }
.page-ia .semaforo-copy-title { letter-spacing: -.025em; }
.page-ia .semaforo-copy-quote { line-height: 1.75; color: #495a6e; }
.page-ia .semaforo-nav-btn { border-radius: 6px; box-shadow: none; }

/* Budget and confirmation pages belong to the same visual system. */
.page-budget { background: #f6f7f9; }
.page-budget .site-header { background: #102238; border-bottom-color: #ffffff20; }
.page-budget .hero { background: #102238; }
.page-budget .hero::before { opacity: .4; }
.page-budget .brand-mark { border-radius: 6px; }
.page-budget .facts { box-shadow: 0 8px 30px #10223808; border-radius: 8px; }
.page-budget :is(.allocation, .method) { border-radius: 10px; }
.page-budget .mode-switch { border-radius: 7px; }
.page-budget .mode-switch button { border-radius: 5px; min-height: 44px; }
.page-budget .section-heading h2 { letter-spacing: -.035em; }
.page-budget .table-wrap { border-radius: 8px; }
.page-budget .program-number { color: #876a22; }
.page-budget .allocation { overflow: hidden; }
.page-confirmation { background: #f6f7f9; border-top: 5px solid #e2bf70; }
.page-confirmation .card { border-radius: 12px; border-color: #dce2e9; box-shadow: 0 12px 40px #10223808; padding: 44px; }
.page-confirmation h1 { letter-spacing: -.03em; font-weight: 400; }
.page-confirmation .btn { border-radius: 6px; background: #19334e; color: #fff; font-weight: 600; min-height: 44px; }

@media (max-width: 1100px) {
  .page-dashboard .donut-canvas-wrap { width: 400px; height: 400px; }
  .page-home .subscribe-panel { gap: 26px; padding: 30px; }
}
@media (max-width: 900px) {
  .page-home .hero { min-height: auto; }
  .page-home .hero-content { padding: 64px 28px; }
  .page-home .section { padding: 56px 28px; }
  .page-home .dashboard-card { padding: 24px 20px; }
  .page-home .dashboard-card-title { font-size: 22px; }
  .page-home .subscribe-panel { grid-template-columns: 1fr; }
  .page-dashboard .app { padding: 0 24px 40px; }
}
@media (max-width: 768px) {
  .page-home .hero-content { padding: 42px 24px 48px; }
  .page-home .hero-badge { font-size: 10px; letter-spacing: .05em; line-height: 1.7; gap: 10px; margin-bottom: 28px; padding-bottom: 18px; }
  .page-home .hero h1 { font-size: clamp(33px, 7.5vw, 52px); margin-bottom: 24px; }
  .page-home .hero-subtitle { font-size: 14px; line-height: 1.75; margin-bottom: 26px; }
  .page-home .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .page-home :is(.btn-primary, .btn-secondary) { font-size: 12px; padding: 13px 10px; }
  .page-home .stats-strip { padding: 24px; }
  .page-home .stats-inner { gap: 22px 0; }
  .page-home .stat-item { padding: 0 0 0 20px; }
  .page-home .stat-item:nth-child(odd) { border-left: 0; padding-left: 0; }
  .page-home .stat-number { font-size: 32px; }
  .page-home .stat-label { font-size: 11px; }
  .page-home .section { padding: 48px 24px; }
  .page-home .section-header h2 { font-size: 30px; }
  .page-home .section-header p { font-size: 14px; }
  .page-home .dashboard-cards { gap: 16px; }
  .page-home .dashboard-card { padding: 26px; }
  .page-home .dashboard-card-title { min-height: 0; font-size: 27px; margin-bottom: 12px; }
  .page-home .dashboard-card-desc { font-size: 14px; }
  .page-home .dashboard-card-stat { font-size: 34px; }
  .page-home .dashboard-card-icon { margin-bottom: 18px; }
  .page-home .subscribe-panel { padding: 26px 22px; gap: 24px; }
  .page-home .subscribe-fields { flex-direction: column; }
  .page-home .subscribe-form input { flex-basis: auto; font-size: 16px; }
  .page-home .subscribe-panel h2 { font-size: 27px; }
  .page-home .cta-banner { padding: 34px 24px; }
  .page-home .cta-banner h2 { font-size: 28px; }
  .page-home .footer { padding: 34px 24px; }
  .page-dashboard .logo { min-width: 0; }
  .page-dashboard .logo-text h1 { font-size: 21px; }
  .page-dashboard .logo-text p { font-size: 11px; line-height: 1.5; }
  .page-dashboard .intro-stats { gap: 22px; }
  .page-dashboard .intro-stat { flex-direction: column; gap: 5px; }
  .page-dashboard .intro-stat-num { font-size: 32px; }
  .page-dashboard :is(.simple-table th, .simple-table td) { padding: 10px; }
}
@media (max-width: 600px) {
  .page-dashboard .app { padding: 0 16px 28px; }
  .page-dashboard .header { padding: 22px 0; margin-bottom: 24px; }
  .page-dashboard .logo-text h1 { font-size: 19px; }
  .page-dashboard :is(.intro-text, .consenso-intro) { font-size: 20px; line-height: 1.5; }
  .page-dashboard :is(.donut-section, .analysis-card) { padding: 22px 16px; }
  .page-dashboard :is(.donut-section h2, .analysis-card h2) { font-size: 22px; }
  .page-dashboard .donut-layout { gap: 24px; }
  .page-dashboard .legend-item { padding: 12px 8px; gap: 9px; }
  .page-dashboard .legend-name { font-size: 13px; }
  .page-dashboard .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .page-dashboard .kpi-card { padding: 16px; }
  .page-dashboard .kpi-value { font-size: 30px; }
  .page-dashboard .kpi-label { font-size: 10px; line-height: 1.5; }
  .page-dashboard .proj-top { flex-wrap: wrap; }
  .page-ia .modal-content { padding: 24px 20px; }
  .page-ia .modal-title { padding: 0 48px 0 0; font-size: 21px; }
  .page-ia .modal-subtitle { padding: 0; margin-bottom: 24px; }
  .page-dashboard :is(.filter-sel, input[type='search'], input[type='email']) { font-size: 16px; }
  .page-dashboard .modal-header { gap: 12px; }
  .page-dashboard .modal-header h3 { padding-right: 0; }
  .page-dashboard .modal-close { flex-shrink: 0; }
  .page-confirmation .card { margin: 20px; padding: 28px; }
  .page-confirmation h1 { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
