/* ==========================================================================
   Tema "Club Escolar" — verde cancha, tinta y tarjetas
   Tipografia: Barlow (texto) + Barlow Condensed (marcadores y titulos)
   ========================================================================== */

:root {
    --tinta: #14231c;          /* verde-negro profundo */
    --tinta-suave: #23392e;
    --cesped: #0e7a45;         /* verde cancha */
    --cesped-oscuro: #0a5c34;
    --cesped-claro: #e3f2ea;
    --cal: #f2f5f1;            /* fondo tiza */
    --blanco: #ffffff;
    --amarilla: #f0b429;       /* tarjeta amarilla */
    --roja: #d64541;           /* tarjeta roja */
    --gris-texto: #5c6b62;
    --borde: #e0e7e1;
    --radio: 14px;
    --sombra: 0 1px 3px rgba(20, 35, 28, 0.07), 0 4px 14px rgba(20, 35, 28, 0.05);
}

body {
    background-color: var(--cal);
    font-family: "Barlow", system-ui, sans-serif;
    color: var(--tinta);
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

body > .container { flex: 1 0 auto; }

h1, h2, h3, h4, h5, .navbar-brand {
    font-family: "Barlow Condensed", "Barlow", sans-serif;
    letter-spacing: 0.2px;
}

h4 { font-weight: 700; text-transform: uppercase; }

/* ---------- Navbar ---------- */
.navbar-app {
    background: linear-gradient(135deg, var(--tinta) 0%, var(--tinta-suave) 100%);
    border-bottom: 3px solid var(--cesped);
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
}

.navbar-app .navbar-brand {
    font-size: 1.45rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-icon { color: var(--amarilla); }
.brand-accent { color: #7fd4a8; }

.navbar-app .nav-link {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255, 255, 255, 0.75);
    border-bottom: 2px solid transparent;
    margin-right: 0.35rem;
    transition: color 0.15s, border-color 0.15s;
}

.navbar-app .nav-link:hover { color: #fff; border-bottom-color: var(--amarilla); }

.user-chip {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
}

.btn-salir {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding-inline: 1rem;
}
.btn-salir:hover { background: var(--roja); border-color: var(--roja); color: #fff; }

/* ---------- Tarjetas / cards ---------- */
.card {
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
}

.card-header {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-top-left-radius: var(--radio) !important;
    border-top-right-radius: var(--radio) !important;
}

.card-header.bg-primary { background-color: var(--cesped) !important; }

/* ---------- Botones ---------- */
.btn { border-radius: 10px; font-weight: 500; }

.btn-primary {
    background-color: var(--cesped);
    border: none;
}
.btn-primary:hover, .btn-primary:focus { background-color: var(--cesped-oscuro); }

.btn-outline-primary { color: var(--cesped); border-color: var(--cesped); }
.btn-outline-primary:hover { background-color: var(--cesped); border-color: var(--cesped); }

/* ---------- Tablas ---------- */
.table thead {
    background-color: transparent;
}

.table thead th {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gris-texto);
    background-color: #f7faf7;
    border-bottom: 2px solid var(--borde);
}

.table tbody td { vertical-align: middle; }

.tabla-posiciones tbody tr:first-child td {
    background-color: var(--cesped-claro);
    font-weight: 600;
}

/* ---------- Formularios ---------- */
.form-control, .form-select {
    border-radius: 10px;
    border-color: var(--borde);
    padding: 0.55rem 0.85rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--cesped);
    box-shadow: 0 0 0 0.2rem rgba(14, 122, 69, 0.15);
}

.form-label { font-weight: 600; font-size: 0.9rem; }

/* ---------- Alertas ---------- */
.alert { border-radius: var(--radio); border: none; box-shadow: var(--sombra); }

/* ---------- Encabezados de seccion (linea de cal) ---------- */
.linea-cal {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.8rem 0 1rem;
}

.linea-cal .titulo {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--tinta);
    white-space: nowrap;
}

.linea-cal::after {
    content: "";
    flex: 1;
    border-top: 2px dashed #c8d4ca;
}

/* ---------- Marcador (KPI tiles) ---------- */
.marcador {
    background: var(--blanco);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 1rem 1.15rem;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.marcador::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--color-kpi, var(--cesped));
}

.marcador .cifra {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1;
    color: var(--tinta);
    font-variant-numeric: tabular-nums;
}

.marcador .etiqueta {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gris-texto);
    margin-top: 0.35rem;
}

.marcador .icono-kpi {
    position: absolute;
    right: 0.9rem;
    top: 0.8rem;
    font-size: 1.5rem;
    color: var(--color-kpi, var(--cesped));
    opacity: 0.5;
}

/* mini tarjetas amarilla/roja (como las reales) */
.mini-tarjeta {
    display: inline-block;
    width: 14px;
    height: 19px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: -3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.mini-tarjeta.amarilla { background: var(--amarilla); }
.mini-tarjeta.roja { background: var(--roja); }

/* ---------- Tarjetas de torneo ---------- */
.torneo-card { height: 100%; }

.torneo-card .deporte-badge {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--cesped);
    background: var(--cesped-claro);
    border-radius: 999px;
    padding: 0.15rem 0.75rem;
}

.torneo-card .nombre-torneo {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0.5rem 0 0.25rem;
}

.torneo-card .lider {
    background: #fbf6e8;
    border: 1px solid #f0e3bb;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    margin-top: 0.6rem;
}

.torneo-card .lider .bi-star-fill { color: var(--amarilla); }

.stats-inline {
    display: flex;
    gap: 1.2rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--gris-texto);
}

.stats-inline b {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.15rem;
    color: var(--tinta);
}

/* ---------- Listas de partidos ---------- */
.partido-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px dashed var(--borde);
    font-size: 0.92rem;
}
.partido-item:last-child { border-bottom: none; }

.partido-item .resultado {
    font-family: "Barlow Condensed", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--tinta);
    color: #fff;
    border-radius: 8px;
    padding: 0.1rem 0.6rem;
    white-space: nowrap;
}

.partido-item .vs {
    font-family: "Barlow Condensed", sans-serif;
    font-weight: 600;
    color: var(--gris-texto);
}

.partido-item .fecha-p {
    font-size: 0.78rem;
    color: var(--gris-texto);
    white-space: nowrap;
}

/* ---------- Footer ---------- */
.app-footer {
    background: var(--tinta);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    padding: 0.9rem 0;
    margin-top: 2.5rem;
    text-align: center;
    letter-spacing: 0.5px;
}

/* ---------- Accesibilidad / motion ---------- */
:focus-visible { outline: 3px solid var(--amarilla); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
