/* ================================================================
   FEIA - Universidades Ecuador  |  Main Stylesheet
   ================================================================ */

:root {
  /* Brand */
  --feia-blue:      #0047AB;
  --feia-blue-dark: #003080;
  --feia-gold:      #F5A623;
  --feia-green:     #1B8A4C;

  /* Neutrals */
  --bg:          #F0F4F8;
  --surface:     #FFFFFF;
  --surface2:    #F8FAFC;
  --border:      #E2E8F0;
  --text:        #1E293B;
  --text-muted:  #64748B;
  --text-light:  #94A3B8;

  /* Semantic */
  --success:  #16A34A;
  --warning:  #D97706;
  --error:    #DC2626;
  --info:     #0891B2;

  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:    0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);

  /* Transitions */
  --t: 220ms ease;
}

/* Dark mode */
[data-theme="dark"] {
  --bg:         #0F172A;
  --surface:    #1E293B;
  --surface2:   #172032;
  --border:     #334155;
  --text:       #F1F5F9;
  --text-muted: #94A3B8;
  --text-light: #64748B;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--t), color var(--t);
}
img { max-width: 100%; display: block; }
a  { color: var(--feia-blue); text-decoration: none; }

/* ── Typography ─────────────────────────────────────────────── */
h1 { font-size: clamp(1.5rem, 3vw, 2rem);   font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1rem;  font-weight: 600; }
h4 { font-size: .9rem; font-weight: 600; }
small { font-size: .8rem; }

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Topbar ─────────────────────────────────────────────────── */
#topbar {
  background: linear-gradient(135deg, var(--feia-blue-dark), var(--feia-blue));
  color: #fff;
  position: sticky; top: 0; z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,80,.25);
}
#topbar .inner {
  display: flex; align-items: center; gap: 1rem;
  padding: .6rem 1.5rem; max-width: 1400px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--feia-gold); display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.1rem; color: var(--feia-blue-dark);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 1rem; font-weight: 800; color: #fff; }
.brand-sub  { font-size: .65rem; color: rgba(255,255,255,.75); letter-spacing: .05em; }

.topbar-nav { display: flex; gap: .25rem; margin-left: 1rem; }
.topbar-nav a {
  color: rgba(255,255,255,.8); font-size: .85rem; padding: .35rem .75rem;
  border-radius: 6px; transition: background var(--t), color var(--t);
}
.topbar-nav a:hover, .topbar-nav a.active {
  background: rgba(255,255,255,.15); color: #fff;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
#global-search-wrap { position: relative; }
#global-search {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  color: #fff; border-radius: 30px; padding: .35rem 1rem .35rem 2.2rem;
  font-size: .85rem; width: 220px; outline: none; transition: var(--t);
}
#global-search::placeholder { color: rgba(255,255,255,.6); }
#global-search:focus { background: rgba(255,255,255,.22); width: 260px; }
.search-icon {
  position: absolute; left: .7rem; top: 50%; transform: translateY(-50%);
  color: rgba(255,255,255,.7); pointer-events: none;
}
#search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 320px; overflow-y: auto; z-index: 2000; display: none;
}
#search-results .sr-item {
  padding: .6rem 1rem; cursor: pointer; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .6rem; font-size: .85rem;
  transition: background var(--t);
}
#search-results .sr-item:last-child { border-bottom: none; }
#search-results .sr-item:hover { background: var(--bg); }
.sr-badge {
  font-size: .7rem; padding: .15rem .45rem; border-radius: 20px; font-weight: 600;
  white-space: nowrap;
}
.sr-badge.universidad { background: #DBEAFE; color: #1D4ED8; }
.sr-badge.carrera     { background: #D1FAE5; color: #065F46; }

#btn-theme {
  background: rgba(255,255,255,.15); border: none; color: #fff;
  border-radius: 8px; padding: .4rem .6rem; cursor: pointer; font-size: .9rem;
  transition: background var(--t);
}
#btn-theme:hover { background: rgba(255,255,255,.25); }

/* ── Hero Banner ─────────────────────────────────────────────── */
#hero {
  background: linear-gradient(160deg, var(--feia-blue) 0%, #0d6efd 50%, var(--feia-green) 100%);
  color: #fff; padding: 2.5rem 1.5rem 1.5rem;
  position: relative; overflow: hidden;
}
#hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
#hero .container { position: relative; }
#hero h1 { font-size: clamp(1.4rem, 3vw, 2.2rem); margin-bottom: .4rem; }
#hero p  { font-size: .95rem; opacity: .85; max-width: 560px; }
.hero-meta {
  display: flex; gap: 1.5rem; margin-top: .9rem; flex-wrap: wrap;
}
.hero-meta span { font-size: .8rem; opacity: .8; display: flex; align-items: center; gap: .3rem; }

/* ── Stat Cards ─────────────────────────────────────────────── */
#stats-row {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin: 1.5rem 0;
}
.stat-card {
  background: var(--surface); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm);
  border-left: 4px solid transparent; transition: var(--t);
  position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-clickable { cursor: pointer; }
.stat-clickable:hover .sc-hint { opacity: 1; }
.sc-hint { font-size: .68rem; color: var(--feia-blue); margin-top: .3rem; opacity: 0; transition: opacity .2s; }
.stat-card .sc-icon {
  font-size: 1.6rem; margin-bottom: .4rem;
}
.stat-card .sc-value {
  font-size: 1.7rem; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-card .sc-label { font-size: .78rem; color: var(--text-muted); margin-top: .2rem; }
.stat-card .sc-sub   { font-size: .72rem; color: var(--text-light); margin-top: .4rem; }

/* ── Section Headers ─────────────────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; gap: .5rem; flex-wrap: wrap;
}
.section-title { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.section-title span { font-size: 1.1rem; }

/* ── Filter Bar ─────────────────────────────────────────────── */
#filter-bar {
  background: var(--surface); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: .3rem; flex: 1; min-width: 140px; }
.filter-group label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.filter-group select,
.filter-group input {
  padding: .45rem .7rem; border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
  font-size: .85rem; outline: none; transition: var(--t);
}
.filter-group select:focus,
.filter-group input:focus { border-color: var(--feia-blue); box-shadow: 0 0 0 3px rgba(0,71,171,.1); }
.btn-reset {
  background: none; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: 8px; padding: .45rem 1rem; cursor: pointer; font-size: .83rem;
  transition: var(--t); white-space: nowrap; align-self: flex-end;
}
.btn-reset:hover { border-color: var(--error); color: var(--error); }

/* ── Grid Layouts ─────────────────────────────────────────────── */
.grid-2 { display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; gap: 1.25rem; grid-template-columns: 1fr 1fr 1fr; }
.grid-1-2 { display: grid; gap: 1.25rem; grid-template-columns: 1fr 2fr; }
.grid-2-1 { display: grid; gap: 1.25rem; grid-template-columns: 2fr 1fr; }

/* ── Card ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 1.2rem;
  transition: var(--t);
}
.card:hover { box-shadow: var(--shadow); }
.card-title {
  font-size: .85rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: .9rem;
  display: flex; align-items: center; gap: .4rem;
}

/* ── Charts ─────────────────────────────────────────────────── */
.chart-wrap { position: relative; width: 100%; }
.chart-wrap canvas { display: block; }

/* ── Map ─────────────────────────────────────────────────────── */
#map-ecuador {
  height: 420px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.leaflet-container { font-family: inherit; }

/* ── Data Table ─────────────────────────────────────────────── */
.data-table-wrap {
  overflow-x: auto; overflow-y: auto;
  max-height: calc(100vh - 190px);
  border-radius: var(--radius-sm);
}
.data-table {
  width: 100%; min-width: 680px; border-collapse: collapse; font-size: .84rem;
}
.data-table th {
  padding: .6rem .8rem; text-align: left;
  background: var(--bg); color: var(--text-muted);
  font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 2px solid var(--feia-blue); white-space: nowrap;
  cursor: pointer; user-select: none;
  position: sticky; top: 0; z-index: 5;
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
}
.data-table th:hover { color: var(--feia-blue); }
.data-table th .sort-arrow { opacity: .4; margin-left: .2rem; }
.data-table th.sorted .sort-arrow { opacity: 1; color: var(--feia-blue); }
.data-table td {
  padding: .55rem .8rem; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.data-table .rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-size: .7rem; font-weight: 800;
}
.rank-1 { background: #FFD700; color: #78350F; }
.rank-2 { background: #C0C0C0; color: #374151; }
.rank-3 { background: #CD7F32; color: #fff; }
.rank-n { background: var(--bg); color: var(--text-muted); }

/* ── Progress bar ─────────────────────────────────────────────── */
.progress-bar-wrap { background: var(--bg); border-radius: 4px; height: 6px; overflow: hidden; min-width: 60px; }
.progress-bar { height: 100%; border-radius: 4px; transition: width .6s ease; }

/* ── Area Badge ─────────────────────────────────────────────── */
.area-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .55rem; border-radius: 20px; font-size: .72rem; font-weight: 600;
}
.area-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── University Card ─────────────────────────────────────────── */
.uni-cards-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.uni-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1rem;
  cursor: pointer; transition: var(--t);
  position: relative; overflow: hidden;
}
.uni-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--feia-blue); border-radius: 4px 0 0 4px;
}
.uni-card.publico::before { background: var(--feia-green); }
.uni-card.cofinanciado::before { background: var(--feia-gold); }
.uni-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--feia-blue); }
.uni-card-name { font-weight: 700; font-size: .88rem; margin-bottom: .4rem; line-height: 1.3; }
.uni-card-meta { font-size: .77rem; color: var(--text-muted); display: flex; gap: .8rem; flex-wrap: wrap; }
.uni-card-stats {
  display: flex; gap: .6rem; margin-top: .7rem; flex-wrap: wrap;
}
.uni-chip {
  background: var(--bg); border-radius: 6px; padding: .25rem .5rem;
  font-size: .73rem; font-weight: 600; color: var(--text-muted);
  display: flex; align-items: center; gap: .25rem;
}

/* ── Modal ─────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 3000; display: none; align-items: flex-start;
  justify-content: center; padding: 2rem 1rem; overflow-y: auto;
}
#modal-overlay.open { display: flex; }
#modal-box {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 760px; box-shadow: var(--shadow-lg);
  position: relative; animation: slideUp .25s ease;
}
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }
#modal-close {
  position: absolute; right: 1rem; top: 1rem;
  background: var(--bg); border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 1.1rem; cursor: pointer;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  transition: var(--t);
}
#modal-close:hover { background: var(--error); color: #fff; }
#modal-header {
  padding: 1.4rem 1.4rem .8rem;
  border-bottom: 1px solid var(--border);
}
#modal-body { padding: 1.2rem 1.4rem 1.4rem; }
.modal-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; }
.modal-tab {
  padding: .5rem 1rem; border: none; background: none; cursor: pointer;
  font-size: .83rem; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent;
  transition: var(--t);
}
.modal-tab.active { color: var(--feia-blue); border-bottom-color: var(--feia-blue); }

/* ── Tabs (main) ─────────────────────────────────────────────── */
.view-tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.view-tab {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: 8px; padding: .4rem .9rem;
  font-size: .82rem; font-weight: 600; cursor: pointer; transition: var(--t);
}
.view-tab.active {
  background: var(--feia-blue); color: #fff; border-color: var(--feia-blue);
}

/* ── Comparador ─────────────────────────────────────────────── */
#comparador-select {
  display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem;
}
.comp-tag {
  display: flex; align-items: center; gap: .4rem;
  background: #DBEAFE; color: #1D4ED8; border-radius: 20px;
  padding: .25rem .6rem .25rem .8rem; font-size: .8rem; font-weight: 600;
}
.comp-tag button {
  background: none; border: none; cursor: pointer; color: #1D4ED8;
  display: flex; align-items: center; padding: 0;
}

/* ── PND Alignment ─────────────────────────────────────────── */
.pnd-card {
  background: linear-gradient(135deg, #F0FDF4, #DCFCE7);
  border: 1px solid #BBF7D0; border-radius: var(--radius); padding: 1rem;
}
[data-theme="dark"] .pnd-card {
  background: linear-gradient(135deg, #052e16, #14532d);
  border-color: #166534;
}
.pnd-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--feia-green); color: #fff;
  border-radius: 20px; padding: .2rem .6rem; font-size: .73rem; font-weight: 700;
}

/* ── Loader ─────────────────────────────────────────────────── */
.loader {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; padding: 2rem; color: var(--text-muted); font-size: .9rem;
}
.spinner {
  width: 20px; height: 20px; border: 2px solid var(--border);
  border-top-color: var(--feia-blue); border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ─────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  background: var(--text); color: var(--surface);
  border-radius: var(--radius); padding: .7rem 1.2rem;
  font-size: .85rem; box-shadow: var(--shadow-lg);
  transform: translateY(80px); opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  max-width: 320px;
}
#toast.show { transform: none; opacity: 1; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-1-2, .grid-2-1 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar-nav { display: none; }
  #global-search { width: 160px; }
  #global-search:focus { width: 190px; }
  #hero { padding: 1.5rem 1rem 1rem; }
  .section-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  #stats-row { grid-template-columns: 1fr 1fr; }
  .stat-card .sc-value { font-size: 1.4rem; }
}

/* ── Page sections ─────────────────────────────────────────── */
.page-section { display: none; }
.page-section.active { display: block; }

/* ── Stat Detail Modal ───────────────────────────────────────── */
#stat-modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 2000;
  align-items: flex-start; justify-content: center;
  padding: 2rem 1rem; overflow-y: auto;
}
#stat-modal-overlay.open { display: flex; }
#stat-modal-box {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 950px;
  padding: 1.5rem; position: relative;
}
#stat-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.2rem; padding-bottom: .8rem; border-bottom: 1px solid var(--border);
}
#stat-modal-header h2 { margin: 0; font-size: 1.15rem; color: var(--feia-blue); }
#stat-modal-close {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  width: 32px; height: 32px; cursor: pointer; font-size: 1rem;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
}
.btn-print {
  background: var(--feia-blue); color: #fff; border: none; border-radius: 6px;
  padding: .35rem .9rem; font-size: .8rem; cursor: pointer; display: flex;
  align-items: center; gap: .35rem;
}
.btn-print:hover { opacity: .88; }
#stat-modal-body { max-height: 70vh; overflow-y: auto; }
#stat-modal-body table { width: 100%; border-collapse: collapse; font-size: .82rem; }
#stat-modal-body th {
  background: var(--bg); padding: .5rem .7rem; text-align: left;
  font-size: .75rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em; position: sticky; top: 0; z-index: 1;
  border-bottom: 2px solid var(--border);
}
#stat-modal-body td { padding: .45rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
#stat-modal-body tr:hover td { background: var(--bg); }
.stat-summary-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin-bottom: 1.2rem;
}
.stat-summary-item {
  background: var(--bg); border-radius: 8px; padding: .7rem .8rem; text-align: center;
  border: 1px solid var(--border); min-width: 0; overflow: hidden;
}
.stat-summary-item .val { font-size: 1.3rem; font-weight: 800; color: var(--feia-blue); }
.stat-summary-item .lbl { font-size: .71rem; color: var(--text-muted); margin-top: .2rem; }
.stat-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body > *:not(#stat-modal-overlay) { display: none !important; }
  #stat-modal-overlay {
    display: block !important; position: static !important;
    background: none !important; padding: 0 !important; overflow: visible !important;
  }
  #stat-modal-box {
    box-shadow: none !important; padding: 1rem !important; max-width: 100% !important;
    border: none !important;
  }
  #stat-modal-close, .btn-print { display: none !important; }
  #stat-modal-body { max-height: none !important; overflow: visible !important; }
  .stat-table-wrap { overflow: visible !important; }
  #stat-modal-body table { font-size: .75rem !important; }
  #stat-modal-body th {
    background: #EFF6FF !important; color: #1e3a5f !important;
    border-bottom: 2px solid #0047AB !important;
  }
  #stat-modal-body td { border-bottom: 1px solid #e2e8f0 !important; }
  #stat-modal-header {
    border-bottom: 3px solid #0047AB !important; padding-bottom: .6rem !important;
    margin-bottom: .8rem !important;
  }
  #stat-modal-header h2 { color: #0047AB !important; font-size: 1rem !important; }
  .stat-summary-grid { grid-template-columns: repeat(4, 1fr) !important; gap: .5rem !important; }
  .stat-summary-item {
    border: 1px solid #cbd5e1 !important; background: #f8fafc !important;
    padding: .5rem !important;
  }
  .stat-summary-item .val { font-size: 1.1rem !important; color: #0047AB !important; }
  #stat-modal-body::after {
    content: "Fuente: SENESCYT SIAU 2024 · FEIA — www.feiaal.org · Generado: " attr(data-date);
    display: block; margin-top: 1rem; font-size: .68rem; color: #64748b;
    border-top: 1px solid #e2e8f0; padding-top: .4rem;
  }
}

/* ── Animate on appear ─────────────────────────────────────── */
.fade-in {
  animation: fadeIn .4s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 1.5rem; text-align: center; margin-top: 3rem;
  font-size: .8rem; color: var(--text-muted);
}
footer a { color: var(--feia-blue); }
