/* =========================================================
   Mínimas RFEA - rediseño institucional con color
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
    /* Acentos RFEA - los tres colores */
    --c-rfea: #d62828;
    --c-rfea-dark: #a31f1f;
    --c-rfea-soft: #fef2f2;
    --c-rfea-border: #fecaca;
    --c-rfea-naranja: #f4801f;
    --c-rfea-naranja-soft: #fff7ed;
    --c-rfea-amarillo: #fdb913;

    /* Acentos EA */
    --c-ea: #1e40af;
    --c-ea-dark: #1e3a8a;
    --c-ea-soft: #eff6ff;
    --c-ea-border: #bfdbfe;

    /* Hombres / Mujeres - tintes diferenciados */
    --c-hombres-soft: #eff6ff;
    --c-hombres-text: #1e40af;
    --c-hombres-border: #dbeafe;
    --c-mujeres-soft: #fdf2f8;
    --c-mujeres-text: #be185d;
    --c-mujeres-border: #fbcfe8;

    /* Neutros - más cálidos */
    --c-bg: #faf9f6;
    --c-surface: #ffffff;
    --c-surface-2: #f5f4f0;
    --c-border: #e7e5e0;
    --c-border-strong: #d6d3cc;

    /* Texto */
    --c-text: #1c1917;
    --c-text-soft: #57534e;
    --c-text-muted: #a8a29e;

    /* Estados */
    --c-success: #16a34a;
    --c-error: #dc2626;
    --c-warning: #ea580c;

    /* Sombras */
    --shadow-xs: 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-sm: 0 1px 3px rgba(28, 25, 23, 0.08), 0 1px 2px rgba(28, 25, 23, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(28, 25, 23, 0.06), 0 2px 4px -2px rgba(28, 25, 23, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(28, 25, 23, 0.08), 0 4px 6px -4px rgba(28, 25, 23, 0.05);
    --shadow-color-rfea: 0 4px 14px -4px rgba(214, 40, 40, 0.25);
    --shadow-color-ea: 0 4px 14px -4px rgba(30, 64, 175, 0.25);

    /* Radios */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 14px;
    --r-full: 999px;

    --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Gradiente RFEA */
    --gradient-rfea: linear-gradient(90deg, var(--c-rfea) 0%, var(--c-rfea-naranja) 50%, var(--c-rfea-amarillo) 100%);
    --gradient-ea: linear-gradient(90deg, var(--c-ea-dark) 0%, var(--c-ea) 50%, #3b82f6 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'cv11', 'ss01';
}

::selection { background: var(--c-rfea-soft); color: var(--c-rfea-dark); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--c-border-strong); border-radius: var(--r-full); border: 3px solid var(--c-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--c-text-muted); }

/* =================== HEADER =================== */
header.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--c-border);
    padding: 0.875rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 100;
    position: relative;
}

/* Línea decorativa con gradiente RFEA debajo del header */
header.header::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-rfea);
    opacity: 0.85;
}

header.header.tema-ea::after {
    background: var(--gradient-ea);
}

header .header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

header .brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: var(--c-text);
}

header .brand-logo {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-rfea);
    border-radius: var(--r-md);
    color: white;
    flex-shrink: 0;
    box-shadow: var(--shadow-color-rfea);
}

header.tema-ea .brand-logo {
    background: var(--gradient-ea);
    box-shadow: var(--shadow-color-ea);
}

header h1 {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--c-text);
}

header h1 a { color: inherit; text-decoration: none; }

header nav {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    background: var(--c-surface-2);
    padding: 4px;
    border-radius: var(--r-full);
    border: 1px solid var(--c-border);
}

header nav a {
    color: var(--c-text-soft);
    text-decoration: none;
    padding: 0.4rem 0.95rem;
    border-radius: var(--r-full);
    font-size: 0.825rem;
    font-weight: 500;
    transition: all var(--t-fast);
    letter-spacing: -0.01em;
}

header nav a:hover { color: var(--c-text); }

header nav a.activo {
    background: var(--c-surface);
    color: var(--c-rfea);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}

header.tema-ea nav a.activo { color: var(--c-ea); }

/* =================== MAIN =================== */
main {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    flex: 1;
}

/* =================== HOME =================== */
.hero {
    text-align: center;
    padding: 3rem 1rem 2rem;
    position: relative;
}

.hero h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--c-text);
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

/* Línea decorativa de los 3 colores debajo del título */
.hero h2::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    margin: 1rem auto 0;
    background: var(--gradient-rfea);
    border-radius: var(--r-full);
}

.hero p {
    color: var(--c-text-soft);
    font-size: 1.0625rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.55;
}

.cards-home {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    margin-top: 2.5rem;
}

@media (min-width: 720px) {
    .cards-home { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
}

.card-home {
    text-decoration: none;
    color: var(--c-text);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    padding: 1.75rem;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
    position: relative;
    overflow: hidden;
}

.card-home::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
}

.card-home.nacional::before { background: var(--gradient-rfea); }
.card-home.europea::before { background: var(--gradient-ea); }

.card-home:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--c-border-strong);
}

.card-home.nacional:hover { box-shadow: var(--shadow-md), var(--shadow-color-rfea); }
.card-home.europea:hover { box-shadow: var(--shadow-md), var(--shadow-color-ea); }

.card-home .card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-md);
    margin-bottom: 1rem;
}

.card-home.nacional .card-icon {
    background: var(--c-rfea-soft);
    color: var(--c-rfea);
}

.card-home.europea .card-icon {
    background: var(--c-ea-soft);
    color: var(--c-ea);
}

.card-home h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.card-home p {
    color: var(--c-text-soft);
    font-size: 0.925rem;
    line-height: 1.5;
}

.card-home .card-arrow {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.875rem;
    font-weight: 600;
    transition: gap var(--t-fast);
}

.card-home.nacional .card-arrow { color: var(--c-rfea); }
.card-home.europea .card-arrow { color: var(--c-ea); }
.card-home:hover .card-arrow { gap: 0.6rem; }

/* =================== FILTROS =================== */
.filtros {
    background: var(--c-surface);
    padding: 1.25rem;
    border-radius: var(--r-lg);
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}

.filtro-grupo { margin-bottom: 1rem; }
.filtro-grupo:last-child { margin-bottom: 0; }

.filtro-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-text-muted);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    background: var(--c-surface-2);
    padding: 4px;
    border-radius: var(--r-md);
    border: 1px solid var(--c-border);
    width: fit-content;
    max-width: 100%;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.95rem;
    border-radius: calc(var(--r-md) - 4px);
    background: transparent;
    color: var(--c-text-soft);
    text-decoration: none;
    font-size: 0.825rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all var(--t-fast);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.chip:hover { color: var(--c-text); background: rgba(255,255,255,0.6); }

.chip.activo {
    background: var(--c-rfea);
    color: white;
    box-shadow: var(--shadow-color-rfea);
    font-weight: 600;
    border-color: var(--c-rfea-dark);
}

.tema-ea .chip.activo {
    background: var(--c-ea);
    box-shadow: var(--shadow-color-ea);
    border-color: var(--c-ea-dark);
}

.search-box {
    width: 100%;
    padding: 0.65rem 0.875rem;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--c-surface);
    color: var(--c-text);
    transition: all var(--t-fast);
}

.search-box::placeholder { color: var(--c-text-muted); }
.search-box:focus {
    outline: none;
    border-color: var(--c-rfea);
    box-shadow: 0 0 0 3px var(--c-rfea-soft);
}

.tema-ea .search-box:focus {
    border-color: var(--c-ea);
    box-shadow: 0 0 0 3px var(--c-ea-soft);
}

/* =================== TABLA =================== */
.tabla-wrapper {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.tabla-header {
    padding: 1.125rem 1.25rem;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: linear-gradient(180deg, var(--c-surface) 0%, var(--c-rfea-naranja-soft) 100%);
}

.tema-ea .tabla-header {
    background: linear-gradient(180deg, var(--c-surface) 0%, var(--c-ea-soft) 100%);
}

.tabla-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--c-text);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    letter-spacing: -0.01em;
}

.tabla-header h2 .count {
    color: var(--c-text-soft);
    font-weight: 500;
    font-size: 0.78rem;
    background: var(--c-surface);
    padding: 0.15rem 0.55rem;
    border-radius: var(--r-full);
    border: 1px solid var(--c-border);
}

.toggle-repesca {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.825rem;
    color: var(--c-text-soft);
    user-select: none;
    font-weight: 500;
    background: var(--c-surface);
    padding: 0.4rem 0.75rem;
    border-radius: var(--r-md);
    border: 1px solid var(--c-border);
    transition: all var(--t-fast);
}

.toggle-repesca:hover { border-color: var(--c-border-strong); }

.toggle-repesca input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--c-rfea);
    cursor: pointer;
}

.tema-ea .toggle-repesca input[type="checkbox"] { accent-color: var(--c-ea); }

.tabla-minimas {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

.tabla-minimas thead th {
    text-align: center;
    padding: 0.75rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--c-text-soft);
    border-bottom: 1px solid var(--c-border);
}

.tabla-minimas thead th.prueba-col {
    text-align: left;
    padding-left: 1.25rem;
    color: var(--c-text);
    background: var(--c-surface-2);
}

/* Cabecera principal: hombres en azul, mujeres en rosa */
.tabla-minimas thead .grupo th {
    color: var(--c-text);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: -0.005em;
    text-transform: none;
    padding: 0.875rem 0.5rem;
    border-bottom: 2px solid var(--c-border);
    position: relative;
}

/* Hombres: azul muy suave */
.tabla-minimas thead .grupo th:nth-child(2),
.tabla-completa thead .grupo th:nth-child(2) {
    background: var(--c-hombres-soft);
    color: var(--c-hombres-text);
    border-bottom-color: var(--c-hombres-border);
}

/* Mujeres: rosa muy suave */
.tabla-minimas thead .grupo th:nth-child(3),
.tabla-completa thead .grupo th:nth-child(3) {
    background: var(--c-mujeres-soft);
    color: var(--c-mujeres-text);
    border-bottom-color: var(--c-mujeres-border);
}

/* Subhead: tono más neutro pero conservando el lateral coloreado */
.tabla-minimas thead .subhead th {
    background: var(--c-surface-2);
    color: var(--c-text-muted);
    font-weight: 600;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--c-border);
}

/* Subhead hombres tinte azulado */
.tabla-completa thead .subhead th:nth-child(1),
.tabla-completa thead .subhead th:nth-child(2) {
    background: linear-gradient(180deg, var(--c-hombres-soft) 0%, var(--c-surface-2) 100%);
}

/* Subhead mujeres tinte rosado */
.tabla-completa thead .subhead th:nth-child(3),
.tabla-completa thead .subhead th:nth-child(4) {
    background: linear-gradient(180deg, var(--c-mujeres-soft) 0%, var(--c-surface-2) 100%);
}

.tabla-minimas tbody tr {
    border-bottom: 1px solid var(--c-border);
    transition: background var(--t-fast);
}

.tabla-minimas tbody tr:last-child { border-bottom: none; }

.tabla-minimas tbody tr:nth-child(even) {
    background: rgba(245, 244, 240, 0.5);
}

.tabla-minimas tbody tr:hover {
    background: var(--c-rfea-naranja-soft);
}

.tema-ea .tabla-minimas tbody tr:hover { background: var(--c-ea-soft); }

.tabla-minimas td {
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--c-text);
}

.tabla-minimas td.prueba-celda {
    text-align: left;
    padding-left: 1.25rem;
    font-weight: 500;
    color: var(--c-text);
    letter-spacing: -0.005em;
}

.tabla-minimas td.marca {
    font-weight: 600;
    color: var(--c-text);
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 0.875rem;
}

.tabla-minimas td.repesca {
    color: var(--c-text-muted);
    font-weight: 500;
    font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 0.825rem;
}

/* Celdas de hombres con tinte azul muy sutil */
.tabla-simple tbody td:nth-child(2),
.tabla-completa tbody td:nth-child(2),
.tabla-completa tbody td:nth-child(3) {
    background: rgba(239, 246, 255, 0.35);
}

/* Celdas de mujeres con tinte rosa muy sutil */
.tabla-simple tbody td:nth-child(3),
.tabla-completa tbody td:nth-child(4),
.tabla-completa tbody td:nth-child(5) {
    background: rgba(253, 242, 248, 0.4);
}

/* Hover refuerza el color */
.tabla-minimas tbody tr:hover td:nth-child(2),
.tabla-minimas tbody tr:hover td:nth-child(3),
.tabla-minimas tbody tr:hover td:nth-child(4),
.tabla-minimas tbody tr:hover td:nth-child(5) {
    background: transparent;
}

/* Divisores entre Hombres y Mujeres */
.tabla-completa thead .grupo th:nth-child(2) { border-right: 1px solid var(--c-border); }
.tabla-completa tbody td:nth-child(3) { border-right: 1px solid var(--c-border); }
.tabla-completa thead .subhead th:nth-child(2) { border-right: 1px solid var(--c-border); }
.tabla-simple thead .grupo th:nth-child(2) { border-right: 1px solid var(--c-border); }
.tabla-simple tbody td:nth-child(2) { border-right: 1px solid var(--c-border); }

/* =================== BOTONES =================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.125rem;
    background: var(--c-rfea);
    color: white;
    text-decoration: none;
    border-radius: var(--r-md);
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--t-fast);
    font-family: inherit;
    letter-spacing: -0.005em;
    white-space: nowrap;
}

.btn:hover {
    background: var(--c-rfea-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-color-rfea);
}
.btn:active { transform: translateY(0); }

.btn.btn-secundario {
    background: var(--c-surface);
    color: var(--c-text);
    border-color: var(--c-border-strong);
    box-shadow: var(--shadow-xs);
}

.btn.btn-secundario:hover {
    background: var(--c-surface-2);
    border-color: var(--c-text-muted);
    box-shadow: var(--shadow-sm);
}

.btn.btn-ea { background: var(--c-ea); }
.btn.btn-ea:hover { background: var(--c-ea-dark); box-shadow: var(--shadow-color-ea); }
.btn.btn-peligro { background: var(--c-error); }
.btn.btn-peligro:hover { background: #b91c1c; }

.btn-pdf {
    margin-top: 1.25rem;
    padding: 0.85rem 1.5rem;
    width: 100%;
    background: var(--c-surface);
    color: var(--c-rfea-dark);
    border: 1px solid var(--c-rfea-border);
    box-shadow: var(--shadow-xs);
    font-weight: 600;
}

.btn-pdf:hover {
    background: var(--c-rfea-soft);
    border-color: var(--c-rfea);
    color: var(--c-rfea-dark);
    box-shadow: var(--shadow-color-rfea);
}

@media (min-width: 600px) { .btn-pdf { width: auto; } }

/* =================== FLASH =================== */
.flash-list { list-style: none; margin-bottom: 1rem; }
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--r-md);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid;
}
.flash.success { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.flash.error   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* =================== LOGIN =================== */
.login-card {
    max-width: 400px;
    margin: 4rem auto;
    background: var(--c-surface);
    padding: 2rem;
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--gradient-rfea);
}

.login-card h2 {
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.form-grupo { margin-bottom: 1rem; }
.form-grupo label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.375rem;
    color: var(--c-text-soft);
    font-weight: 500;
}

.form-grupo input,
.form-grupo select,
.form-grupo textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    font-size: 0.95rem;
    background: var(--c-surface);
    color: var(--c-text);
    font-family: inherit;
    transition: all var(--t-fast);
}

.form-grupo input:focus,
.form-grupo select:focus {
    outline: none;
    border-color: var(--c-rfea);
    box-shadow: 0 0 0 3px var(--c-rfea-soft);
}

/* =================== ADMIN =================== */
.admin-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    margin-bottom: 1.5rem;
}
@media (min-width: 720px) { .admin-grid { grid-template-columns: repeat(4, 1fr); } }

.admin-card {
    background: var(--c-surface);
    padding: 1.25rem;
    border-radius: var(--r-lg);
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: var(--c-text);
    transition: all var(--t-base);
    position: relative;
    overflow: hidden;
}

.admin-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-rfea);
    opacity: 0;
    transition: opacity var(--t-base);
}

.admin-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--c-border-strong);
}

.admin-card:hover::before { opacity: 1; }

.admin-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    color: var(--c-text);
    letter-spacing: -0.01em;
}

.admin-card p {
    color: var(--c-text-soft);
    font-size: 0.825rem;
}

.admin-tabla {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    overflow-x: auto;
}

.admin-tabla table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-tabla th, .admin-tabla td {
    padding: 0.65rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
}

.admin-tabla th {
    background: var(--c-surface-2);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--c-text-soft);
    font-weight: 600;
}

.admin-tabla tbody tr:hover { background: var(--c-rfea-naranja-soft); }

.acciones { display: flex; gap: 0.4rem; }
.acciones .btn { padding: 0.35rem 0.7rem; font-size: 0.78rem; }

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.toolbar h2 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }

/* =================== FOOTER =================== */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--c-text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--c-border);
    margin-top: 3rem;
    background: linear-gradient(180deg, var(--c-bg) 0%, var(--c-rfea-naranja-soft) 100%);
}

footer a {
    color: var(--c-text-soft);
    text-decoration: none;
    font-weight: 500;
}
footer a:hover { color: var(--c-rfea); }

/* =================== UTILS =================== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; }

.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--c-text-soft);
}

.empty-state p { font-size: 0.95rem; line-height: 1.6; }

/* =================== BADGE =================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    background: var(--c-surface-2);
    color: var(--c-text-soft);
    border-radius: var(--r-sm);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    border: 1px solid var(--c-border);
    font-feature-settings: 'tnum';
    box-shadow: var(--shadow-xs);
}

.badge.al {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    color: #9a3412;
    border-color: #fed7aa;
}

.badge.st {
    background: linear-gradient(135deg, var(--c-rfea-soft) 0%, #fee2e2 100%);
    color: var(--c-rfea-dark);
    border-color: var(--c-rfea-border);
}

.badge.ea {
    background: linear-gradient(135deg, var(--c-ea-soft) 0%, #dbeafe 100%);
    color: var(--c-ea-dark);
    border-color: var(--c-ea-border);
}

/* =================== MOBILE =================== */
@media (max-width: 640px) {
    main { padding: 1rem 0.875rem 2rem; }
    header { padding: 0.75rem 0.875rem; }
    header h1 { font-size: 0.95rem; }
    header .header-inner { gap: 0.5rem; }
    header nav a { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
    .hero { padding: 2rem 0.5rem 1.5rem; }
    .hero h2 { font-size: 1.65rem; }
    .hero p { font-size: 0.95rem; }
    .filtros { padding: 1rem; }
    .tabla-minimas { font-size: 0.825rem; }
    .tabla-minimas td { padding: 0.6rem 0.3rem; }
    .tabla-minimas td.prueba-celda { padding-left: 0.875rem; }
    .tabla-minimas td.marca { font-size: 0.825rem; }
    .tabla-minimas td.repesca { font-size: 0.78rem; }
    .tabla-minimas thead th { padding: 0.55rem 0.25rem; font-size: 0.65rem; }
    .tabla-minimas thead th.prueba-col { padding-left: 0.875rem; }
    .tabla-minimas thead .grupo th { font-size: 0.7rem; padding: 0.65rem 0.3rem; }
    .tabla-header { padding: 0.875rem 1rem; }
    .tabla-header h2 { font-size: 0.85rem; }
    .toggle-repesca { font-size: 0.78rem; padding: 0.3rem 0.6rem; }
}

/* ================================================================ */
/*  FIX MÓVIL — TABLAS DE MÍNIMAS                                   */
/*  Añadido el 29/04/2026 para corregir solapamiento de marcas      */
/*  en .tabla-completa (5 columnas) en pantallas estrechas          */
/* ================================================================ */

@media (max-width: 720px) {

    /* Permitir scroll horizontal cuando la tabla no cabe */
    .tabla-wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    /* La tabla simple (3 columnas) cabe bien, solo afinamos tipografía */
    .tabla-minimas.tabla-simple {
        font-size: 0.875rem;
    }
    .tabla-minimas.tabla-simple td.marca {
        font-size: 0.825rem;
    }

    /* La tabla completa (5 columnas) NO debe ser fixed en móvil:
       las celdas se ajustan al contenido y la tabla puede ser
       más ancha que la pantalla → aparece scroll horizontal natural */
    .tabla-minimas.tabla-completa {
        table-layout: auto;
        min-width: 600px;
        font-size: 0.8rem;
    }

    /* Ignorar los anchos en porcentaje del <colgroup> */
    .tabla-minimas.tabla-completa col {
        width: auto !important;
    }

    /* Mínimo por columna para que tiempos largos como 13:45.00 quepan */
    .tabla-minimas.tabla-completa th,
    .tabla-minimas.tabla-completa td {
        white-space: nowrap;
        padding: 0.55rem 0.5rem;
    }
    .tabla-minimas.tabla-completa td.marca,
    .tabla-minimas.tabla-completa td.repesca {
        font-size: 0.78rem;
        min-width: 70px;
    }
    .tabla-minimas.tabla-completa td.prueba-celda {
        min-width: 130px;
        padding-left: 0.75rem;
        font-size: 0.82rem;
        white-space: normal;       /* el nombre de prueba sí puede romper línea */
    }

    /* Cabecera: que no se aplaste tanto */
    .tabla-minimas.tabla-completa thead th {
        padding: 0.55rem 0.4rem;
        font-size: 0.68rem;
    }
    .tabla-minimas.tabla-completa thead .grupo th {
        font-size: 0.72rem;
        padding: 0.6rem 0.4rem;
    }
    .tabla-minimas.tabla-completa thead .subhead th {
        font-size: 0.6rem;
    }
}

/* Pantallas muy estrechas: cabecera del wrapper que se rompe limpio */
@media (max-width: 460px) {
    .tabla-header {
        padding: 0.875rem 1rem;
        gap: 0.5rem;
    }
    .tabla-header h2 {
        font-size: 0.875rem;
        flex-wrap: wrap;
    }
    .toggle-repesca {
        font-size: 0.75rem;
        padding: 0.35rem 0.6rem;
    }
}
