/* =========================================
   Estadística Descarga
   Aesthetic: Industrial Minimal — Dark Navy
   ========================================= */

:root {
    --bg:        #f0f2f7;
    --surface:   #ffffff;
    --navy:      #0d1f6b;
    --navy-dim:  #1a308a;
    --cobalt:    #2952e3;
    --line:      #dde1ee;
    --text:      #1a1d2e;
    --muted:     #8b90a8;
    --mono:      'IBM Plex Mono', monospace;
    --sans:      'IBM Plex Sans', sans-serif;
    --r:         8px;
    --ease:      cubic-bezier(.4,0,.2,1);
}

/* ── Reset ───────────────────────────────── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { font-size:16px; }
img  { max-width:100%; height:auto; display:block; }
ul   { list-style:none; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Typography ──────────────────────────── */
h1,h2,h3,h4,h5,h6 {
    font-family: var(--sans);
    color: var(--text);
    line-height: 1.2;
}
p { margin-bottom: .9em; }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--navy-dim); }

/* =========================================
   HEADER
   ========================================= */
header {
    background: var(--navy);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

header nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 52px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header nav > a {
    font-size: .88rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: .08em;
    text-transform: uppercase;
}

header nav > a:hover { color: rgba(255,255,255,.7); }

header nav ul {
    display: flex;
    align-items: center;
    gap: .25rem;
}

header nav ul a {
    color: rgba(255,255,255,.55);
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: .35rem .8rem;
    border-radius: var(--r);
    transition: color .15s var(--ease), background .15s var(--ease);
}

header nav ul a:hover,
header nav ul a.active {
    color: #fff;
    background: rgba(255,255,255,.1);
}

/* =========================================
   MAIN
   ========================================= */
main { animation: fadeIn .3s var(--ease) both; }

@keyframes fadeIn {
    from { opacity:0; transform:translateY(6px); }
    to   { opacity:1; transform:translateY(0); }
}

section { padding: 2.5rem 2rem; }
section > div { max-width: 1100px; margin: 0 auto; }

section:nth-child(even) {
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

/* ── Section title ───────────────────────── */
.section-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--navy);
    letter-spacing: .1em;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
}

.section-title::before,
.section-title::after {
    content: '';
    flex: 1;
    max-width: 80px;
    height: 1px;
    background: var(--line);
}

/* =========================================
   KPI CARDS
   ========================================= */
.kpi-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.kpi {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 1.1rem 1.4rem;
    width: 200px;
    position: relative;
    overflow: hidden;
    transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}

.kpi::before {
    content: '';
    position: absolute;
    top: -1px; left: -1px; right: -1px;
    height: 2px;
    background: var(--navy);
    border-radius: var(--r) var(--r) 0 0;
    opacity: 0;
    transition: opacity .2s;
}

.kpi:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(13,31,107,.1); border-color: var(--navy); }
.kpi:hover::before { opacity: 1; }

.kpi-label {
    font-size: .68rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: .07em;
    text-transform: uppercase;
    margin-bottom: .5rem;
}

.kpi-value {
    font-family: var(--mono);
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--navy);
    letter-spacing: -.04em;
    line-height: 1;
    margin-bottom: .3rem;
}

.kpi-sub {
    font-size: .72rem;
    color: var(--muted);
    font-family: var(--mono);
}

/* =========================================
   FILTER ROW
   ========================================= */
.filter-row {
    display: flex;
    gap: .5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-btn {
    font-family: var(--sans);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: .4rem 1rem;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: all .15s var(--ease);
}

.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }

/* =========================================
   CHART CARDS
   ========================================= */
.chart-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.25rem;
}

.chart-card-title {
    font-size: .8rem;
    font-weight: 600;
    color: var(--navy);
    letter-spacing: .07em;
    text-transform: uppercase;
}

.chart-card-sub {
    font-size: .72rem;
    color: var(--muted);
    font-family: var(--mono);
}

.chart-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
}

/* =========================================
   TABLE
   ========================================= */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--r);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    font-size: .83rem;
}

th, td {
    padding: .6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    background: var(--navy);
    color: rgba(255,255,255,.85);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}

tbody tr { transition: background .1s var(--ease); }
tbody tr:hover { background: #f5f6fb; }
tbody tr:last-child td { border-bottom: none; }

td { color: var(--text); }

td.num {
    font-family: var(--mono);
    font-size: .8rem;
    color: var(--navy);
}

/* ── Badges ──────────────────────────────── */
.badge {
    display: inline-block;
    padding: .15em .55em;
    border-radius: 4px;
    font-size: .68rem;
    font-weight: 600;
    font-family: var(--mono);
}

.badge-ok   { background: #e0f2e9; color: #1a6b40; }
.badge-warn { background: #fff3e0; color: #8a4800; }
.badge-bad  { background: #fde8ef; color: #9b1244; }

/* =========================================
   PAGINATION
   ========================================= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.page-btn {
    font-family: var(--mono);
    font-size: .75rem;
    font-weight: 600;
    padding: .4rem .75rem;
    border-radius: var(--r);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: all .15s var(--ease);
    text-decoration: none;
    display: inline-block;
}

.page-btn:hover { border-color: var(--navy); color: var(--navy); background: var(--surface); }
.page-btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.page-btn:disabled,
.page-btn.disabled { opacity: .35; cursor: default; pointer-events: none; }

.page-info {
    font-family: var(--mono);
    font-size: .72rem;
    color: var(--muted);
    padding: 0 .5rem;
}

/* =========================================
   TECNOLOGÍA
   ========================================= */
.tecnologia-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-items: center;
}

.tecnologia {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.tecnologia hr { margin-top: 10px; }

main ul li {
    font-size: .88rem;
    padding-left: 1.2rem;
    margin-bottom: .4rem;
    position: relative;
    color: var(--text);
}

main ul li::before {
    content: '—';
    position: absolute;
    left: 0;
    color: var(--muted);
    font-size: .75rem;
}

/* =========================================
   UTILS
   ========================================= */
.muted { color: var(--muted); }

.skeleton {
    background: linear-gradient(90deg, var(--line) 25%, #eceef7 50%, var(--line) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.2s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    header nav { padding: 0 1rem; }
    section { padding: 2rem 1rem; }
    .chart-row { grid-template-columns: 1fr; }
    .kpi { width: 46%; }
}

@media (max-width: 480px) {
    .kpi { width: 100%; }
}
