@font-face {
    font-family: "Nunito";
    src: url("fonts/Nunito-Variable.ttf") format("truetype");
    font-weight: 200 1000;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Lilita One";
    src: url("fonts/LilitaOne-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --azul: #0096d7;
    --azul-profundo: #075a86;
    --azul-tinta: #14344a;
    --azul-suave: #e7f5fc;
    --crema: #ffe4ba;
    --crema-suave: #fff6e8;
    --rojo: #d0123a;
    --paper: #f6f3ec;
    --card: #ffffff;
    --line: #e4edf3;
    --muted: #5c7383;
    --shadow: 0 12px 30px rgba(20, 52, 74, 0.06);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--azul-tinta);
    background: var(--paper);
    font-family: "Nunito", "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

h1, h2, .campana-titulo, .marca-texto strong, .total-vivo, .podio .puntos, .barra-tablero strong {
    font-family: "Lilita One", "Segoe UI", sans-serif;
    font-weight: 400;
    letter-spacing: 0.01em;
    color: var(--azul);
}

h1 { font-size: 2.15rem; margin: 0 0 0.35rem; line-height: 1.1; }
h2 { font-size: 1.45rem; margin: 0 0 0.45rem; }

a { color: var(--azul-profundo); }
a:hover { color: #043e5e; }

::selection { background: var(--crema); }

.nav-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.marco {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 22px 16px 16px;
    background: white;
    border-right: 1px solid var(--line);
    box-shadow: inset 0 6px 0 var(--azul);
}

.logo-link img {
    display: block;
    width: 100%;
    height: auto;
}

.marca-texto { margin: 12px 6px 8px; }
.marca-texto strong { display: block; font-size: 1.45rem; line-height: 1.05; }
.marca-texto span { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 800; }

.nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 12px;
    overflow: auto;
}

.nav a {
    display: block;
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--azul-tinta);
    font-weight: 800;
    text-decoration: none;
}

.nav a:hover { background: var(--azul-suave); color: var(--azul-profundo); }
.nav a.activo { background: var(--azul-profundo); color: white; }

.sesion {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.sesion strong { display: block; font-size: 15px; }
.sesion small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }

.sesion form { margin-top: 10px; }
.sesion button { width: 100%; }

.contenido { min-width: 0; }

.barra-movil, .barra-tablero, .nav-velo { display: none; }

body.app main {
    width: min(1080px, calc(100% - 48px));
    margin: 28px auto 56px;
}

.intro { color: var(--muted); margin-top: 0; max-width: 68ch; font-weight: 650; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
    margin-top: 16px;
}

.alerta { padding: 12px 14px; border-radius: 12px; margin: 0 0 16px; font-weight: 750; }
.alerta-ok { background: #e7f6ee; color: #0d6b45; }
.alerta-error { background: #fdecef; color: var(--rojo); }

.sub, .muted, .ayuda { color: var(--muted); font-size: 13px; font-weight: 700; }
.vacio { padding: 28px 8px; color: var(--muted); }

.acciones { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.fila { display: flex; justify-content: space-between; gap: 12px; align-items: end; flex-wrap: wrap; }

.rejilla, .filtros { display: grid; gap: 12px; }
.filtros { grid-template-columns: 240px 1fr 1fr; }
.alta-producto { grid-template-columns: 200px 1.4fr 1fr 110px auto; }
.rejilla-2 { grid-template-columns: 1fr 1fr; }
.rejilla-3 { grid-template-columns: repeat(3, 1fr); }

label { display: block; font-size: 13px; font-weight: 800; margin-bottom: 6px; }

.btn, button.btn, a.btn, .sesion button, .nav-abrir {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}

.btn-primario, .sesion button { background: var(--azul-profundo); color: white; }
.btn-primario:hover, .sesion button:hover { background: #05486c; }
.btn-claro { background: white; color: var(--azul-profundo); border-color: #c5dcea; }
.btn-peligro { background: var(--rojo); color: white; }
.btn-texto { background: transparent; color: var(--rojo); height: 34px; }

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    width: 100%;
    border: 1px solid #d5e3ec;
    background: white;
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    color: inherit;
}

textarea { min-height: 140px; resize: vertical; }

input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
    outline: 2px solid var(--azul);
    outline-offset: 1px;
}

input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--azul); }

.podio {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
}

.podio article {
    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px 18px;
    min-height: 140px;
    box-shadow: var(--shadow);
}

.podio .lugar {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.podio h2 { margin: 8px 0 0; }
.podio a { text-decoration: none; }
.podio a:hover { text-decoration: underline; }
.podio .puntos { font-size: 2.1rem; margin: 8px 0 0; line-height: 1; }
.podio-1 {
    background: var(--azul-profundo) !important;
    border-color: var(--azul-profundo) !important;
    color: white;
}
.podio-1 h2, .podio-1 .puntos, .podio-1 a { color: white; }
.podio-1 .lugar, .podio-1 .sub { color: #d7eef8; }
.podio-2 { background: var(--crema-suave); }
.podio-3 { box-shadow: inset 0 -4px 0 #f3c3cc; }

.tabla-wrap { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; }
.tabla th, .tabla td {
    padding: 11px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
.tabla th {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; }
.tabla .total { font-weight: 800; color: var(--azul-profundo); }
.tabla tr.sin-puntos, .tabla tr.anulada { color: var(--muted); }
.tabla tfoot td { font-weight: 800; border-bottom: 0; }

.puesto {
    display: inline-grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 999px;
    background: #eef3f6;
    font-weight: 800;
}
.puesto-1 { background: var(--crema); color: var(--azul-profundo); }
.puesto-2 { background: #d7eef8; color: var(--azul-profundo); }
.puesto-3 { background: #f8d6de; color: #8d1830; }

.resumen {
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.linea td.apagado { opacity: 0.35; }
.centro { text-align: center !important; }

.hoy { margin: 0 0 14px; font-weight: 800; color: var(--azul-profundo); }

.aula-meta { margin: 8px 0 0; }

.fila-agregar {
    display: grid;
    gap: 10px;
    align-items: end;
    margin-top: 14px;
    grid-template-columns: minmax(220px, 1fr) auto auto;
}

.aviso-linea { margin: 8px 0 0; color: var(--rojo); font-weight: 800; }
.vacio-lineas { margin: 14px 0; }
.boleta { margin-top: 16px; }
.boleta .tabla th, .boleta .tabla td { padding: 6px 8px; }
.boleta .sub { display: block; margin-top: 0; }
.boleta .pts { color: var(--azul-profundo); font-size: 1rem; }
.boleta .paso { justify-content: flex-end; }
.boleta .quitar { height: 30px; padding: 0 8px; }

.paso { display: flex; align-items: center; gap: 6px; }
.paso button {
    width: 40px;
    height: 40px;
    border: 1px solid #c5dcea;
    border-radius: 12px;
    background: var(--azul-suave);
    color: var(--azul-profundo);
    font: inherit;
    font-size: 1.3rem;
    font-weight: 800;
    cursor: pointer;
}
.paso input { width: 58px; height: 40px; padding: 0; text-align: center; font-weight: 800; }
.paso-chico button { width: 30px; height: 30px; border-radius: 8px; font-size: 1.05rem; }
.paso-chico input { width: 46px; height: 30px; }

#form-registro .card > label[for="observacion"] { margin-top: 16px; }

.barra-guardar {
    position: fixed;
    z-index: 15;
    left: 268px;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 32px;
    background: var(--paper);
    border-top: 1px solid var(--line);
}

.barra-guardar .btn { margin-left: auto; }

body.app main { padding-bottom: 84px; }

.total-vivo { font-size: 2rem; line-height: 1; }

.login-pagina { background: white; }
.portada {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(280px, 420px) minmax(320px, 1fr);
}
.portada-marca {
    display: grid;
    place-items: center;
    padding: 36px 28px;
    background: var(--crema-suave);
    border-right: 8px solid var(--azul);
}
.portada-marca img { width: min(300px, 100%); height: auto; }
.login-caja {
    display: grid;
    align-content: center;
    justify-self: center;
    width: min(440px, calc(100% - 48px));
    margin: 0;
    padding: 36px 0;
}
.campana-titulo { margin: 0 0 8px; font-size: 2.4rem; line-height: 1; }
.campo { margin-bottom: 12px; }

.instalar-pagina {
    min-height: 100vh;
    padding: 28px 16px 48px;
    background: var(--crema-suave);
}
.instalar-caja {
    width: min(680px, 100%);
    margin: 0 auto;
    padding: 28px;
    background: white;
    border: 1px solid var(--line);
    border-top: 6px solid var(--azul);
    border-radius: 22px;
    box-shadow: var(--shadow);
}
.logo-ancho { display: block; width: min(440px, 100%); height: auto; margin-bottom: 12px; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef3f6;
    font-size: 12px;
    font-weight: 800;
}
.badge-ok { background: #e7f6ee; color: #0d6b45; }
.badge-off { background: #fdecef; color: var(--rojo); }

.grupo-cat { margin-top: 22px; }
.grupo-cat h2 { font-size: 1.25rem; }
.cronograma { margin-top: 18px; }
.cronograma summary { cursor: pointer; font-weight: 800; color: var(--azul-profundo); }
.cronograma li { margin: 4px 0; }

.hoja-puerta { max-width: 920px; margin: 24px auto; padding: 0 16px 32px; }
.marca-impresion {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}
.logo-impresion { width: min(280px, 46vw); height: auto; }

body.tablero { background: var(--crema-suave); }
body.tablero .marco { display: block; }
body.tablero .sidebar, body.tablero .barra-movil { display: none; }
body.tablero .barra-tablero {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 22px;
    background: white;
    border-bottom: 6px solid var(--azul);
}
body.tablero .barra-tablero img { width: 210px; height: auto; }
body.tablero .barra-tablero strong { font-size: 1.7rem; }
body.tablero .barra-tablero a { margin-left: auto; font-weight: 800; }
body.tablero main { width: min(1180px, calc(100% - 36px)); }
body.tablero h1 { font-size: 3rem; }
body.tablero .puntos { font-size: 3rem; }

@media (max-width: 900px) {
    .marco { display: block; }
    .sidebar {
        position: fixed;
        z-index: 40;
        top: 0;
        left: 0;
        width: min(300px, 86vw);
        transform: translateX(-105%);
        transition: transform 0.18s ease;
    }
    .nav-toggle:checked ~ .marco .sidebar { transform: none; }
    .nav-toggle:checked ~ .nav-velo {
        display: block;
        position: fixed;
        z-index: 30;
        inset: 0;
        background: rgba(7, 40, 62, 0.38);
    }
    .barra-movil {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 20;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        background: white;
        border-bottom: 4px solid var(--azul);
    }
    .barra-movil img { height: 38px; width: auto; }
    .nav-abrir { background: var(--azul-profundo); color: white; }
    body.app main { width: min(1080px, calc(100% - 24px)); margin-top: 16px; }
    .filtros, .alta-producto, .podio, .rejilla-2, .rejilla-3, .portada, .fila-agregar { grid-template-columns: 1fr; }
    .barra-guardar { left: 0; padding: 12px 16px; }
    .portada-marca { border-right: 0; border-bottom: 8px solid var(--azul); padding: 20px; }
    .portada-marca img { width: min(220px, 70%); }
    .marca-impresion { flex-wrap: wrap; }
}

@media print {
    .sidebar, .barra-movil, .barra-tablero, .nav-velo, .no-print, .acciones, .alerta { display: none !important; }
    .marco { display: block; }
    body, body.app { background: white; }
    body.app main, .hoja-puerta { width: 100%; margin: 0; }
    .card, .podio article { box-shadow: none; }
    a { color: inherit; text-decoration: none; }
}
