:root {
    --navy: #0E2A6B;
    --orange: #F26522;
    --gris-claro: #F5F6FA;
    --gris-borde: #DCE0EA;
    --verde: #1E8E5A;
    --rojo: #C4392B;
}

* { box-sizing: border-box; }

body {
    font-family: Calibri, Arial, sans-serif;
    background: var(--gris-claro);
    color: #1B1F2A;
    margin: 0;
}

.pantalla-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--navy), #17398f);
}

.caja-login {
    background: #fff;
    padding: 32px 36px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
    width: 320px;
    text-align: center;
}
.caja-login h1 { margin: 0 0 4px; color: var(--navy); }
.caja-login .subtitulo { color: #667; font-size: 13px; margin-bottom: 18px; }
.caja-login input {
    width: 100%; padding: 10px 12px; margin-bottom: 12px;
    border: 1px solid var(--gris-borde); border-radius: 8px; font-size: 15px;
}
.caja-login button {
    width: 100%; padding: 11px; background: var(--orange); color: #fff;
    border: none; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 15px;
}
.caja-login .error { color: var(--rojo); font-size: 13px; margin: -4px 0 10px; }

header.cabecera {
    background: var(--navy);
    color: #fff;
    padding: 18px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header.cabecera h1 { margin: 0; font-size: 22px; }
header.cabecera .subtitulo { margin: 2px 0 0; font-size: 13px; opacity: .85; }

main { max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }

.cabecera-seccion {
    display: flex; justify-content: space-between; align-items: center;
    margin: 8px 0 14px;
}
.cabecera-seccion h2 { margin: 0; color: var(--navy); font-size: 19px; }

.tarjetas-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}
.tarjeta {
    background: #fff; border: 1px solid var(--gris-borde); border-radius: 10px;
    padding: 14px 16px;
}
.tarjeta .valor { font-size: 24px; font-weight: bold; color: var(--navy); }
.tarjeta .etiqueta { font-size: 12px; color: #667; text-transform: uppercase; letter-spacing: .03em; }
.tarjeta.destaque .valor { color: var(--orange); }

button { font-family: inherit; }
.btn-primario {
    background: var(--orange); color: #fff; border: none; border-radius: 8px;
    padding: 10px 16px; font-weight: bold; cursor: pointer;
}
.btn-secundario {
    background: #fff; color: var(--navy); border: 1px solid var(--gris-borde); border-radius: 8px;
    padding: 10px 16px; font-weight: bold; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-exportar {
    background: var(--navy); color: #fff; border: none; border-radius: 8px;
    padding: 10px 16px; font-weight: bold; cursor: pointer;
}
.btn-icono {
    background: none; border: none; cursor: pointer; font-size: 15px; padding: 4px 6px;
}

table.tabla {
    width: 100%; border-collapse: collapse; background: #fff;
    border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
table.tabla th, table.tabla td {
    padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--gris-borde); font-size: 13.5px;
}
table.tabla th { background: var(--navy); color: #fff; font-weight: 600; }
table.tabla tr:hover td { background: #FAFBFF; }

.pill {
    display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.pill.pendiente { background: #FDECEA; color: var(--rojo); }
.pill.devuelto { background: #FFF3E0; color: #9C5B00; }
.pill.pagado_completo { background: #E7F6EE; color: var(--verde); }
.pill.liquidado { background: #E6ECFB; color: var(--navy); }

.cargando { color: #889; padding: 20px 0; }

.modal-fondo {
    position: fixed; inset: 0; background: rgba(10,20,50,.45);
    display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal-fondo.oculto { display: none; }
.modal-caja {
    background: #fff; border-radius: 14px; padding: 24px 26px; width: 380px; max-width: 92vw;
    max-height: 88vh; overflow-y: auto;
}
.modal-caja h3 { margin: 0 0 16px; color: var(--navy); }
.modal-caja label {
    display: block; font-size: 12.5px; font-weight: 600; color: #445; margin-bottom: 12px;
}
.modal-caja input, .modal-caja select, .modal-caja textarea {
    width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--gris-borde);
    border-radius: 7px; font-size: 14px; font-family: inherit;
}
.fila-doble { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-botones { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.aviso-incompletos {
    background: #fff; border: 1px solid var(--gris-borde); border-radius: 10px; padding: 4px 0;
}

.barra-filtros {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 18px;
}
.barra-filtros input[type="text"] {
    flex: 1; min-width: 220px; padding: 9px 12px; border: 1px solid var(--gris-borde);
    border-radius: 8px; font-size: 14px;
}
.barra-filtros select {
    padding: 9px 12px; border: 1px solid var(--gris-borde); border-radius: 8px; font-size: 14px;
}
.check-solo-sin { font-size: 13px; color: #445; display: flex; align-items: center; gap: 6px; white-space: nowrap; }

.bloque-equipo { margin-bottom: 10px; }
.titulo-equipo {
    width: 100%; text-align: left; background: #fff; border: 1px solid var(--gris-borde);
    border-radius: 9px; color: var(--navy); font-size: 15px; font-weight: 700; font-family: inherit;
    margin: 0; padding: 12px 14px; display: flex; align-items: baseline; gap: 8px; cursor: pointer;
}
.titulo-equipo:hover { background: var(--gris-claro); }
.flecha-plegable {
    display: inline-block; font-size: 11px; color: var(--orange); transition: transform .15s ease;
}
.flecha-plegable.abierta { transform: rotate(90deg); }
.categoria-equipo { font-size: 12px; font-weight: 400; color: #778; }
.contador-equipo { margin-left: auto; font-size: 12px; font-weight: 600; color: #667; }
.bloque-equipo table.tabla { margin-top: 6px; }
.bloque-equipo table.tabla.oculto { display: none; }

.chips-talonario { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.oculto { display: none !important; }
.chip-talonario {
    border: none; border-radius: 20px; padding: 4px 10px; font-size: 12px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
}
.chip-talonario.pendiente { background: #FDECEA; color: var(--rojo); }
.chip-talonario.devuelto { background: #FFF3E0; color: #9C5B00; }
.chip-talonario.pagado_completo { background: #E7F6EE; color: var(--verde); }
.chip-talonario.liquidado { background: #E6ECFB; color: var(--navy); }
.sin-talonario { color: #99A; font-size: 12.5px; font-style: italic; }

.aviso-dato { color: var(--orange); font-size: 11.5px; font-style: italic; font-weight: 600; }

.btn-icono-add {
    background: none; border: 1px solid var(--gris-borde); border-radius: 7px; padding: 5px 10px;
    font-size: 12px; color: var(--navy); cursor: pointer; white-space: nowrap;
}
.btn-icono-add:hover { background: var(--gris-claro); }

.btn-borrar {
    background: #fff; color: var(--rojo); border: 1px solid #F3C6C0; border-radius: 8px;
    padding: 10px 14px; font-weight: bold; cursor: pointer;
}

/* ---------- Hermanos ---------- */
.badge-hermano {
    display: inline-block; margin-top: 4px; background: #EEF1FB; color: var(--navy);
    border: 1px solid #CFD7F0; border-radius: 20px; padding: 2px 9px; font-size: 11.5px;
    font-weight: 600; cursor: pointer; text-align: left;
}
.badge-hermano:hover { background: #E2E8F8; }
.badge-equipo { font-weight: 400; color: #667; }
.cubierto-hermano {
    background: #F0F2F7; color: #556; border: 1px dashed #B9C1D6; border-radius: 20px;
    padding: 3px 10px; font-size: 12px; font-weight: 600;
}
tr.fila-cubierta td { background: #FAFBFD; color: #667; }
.btn-icono-add.apagado { color: #99A; border-style: dashed; }
.col-acciones { white-space: nowrap; }
.col-acciones .btn-icono-add + .btn-icono-add { margin-left: 4px; }

.aviso-hermano {
    background: #EEF1FB; color: var(--navy); border-radius: 8px; padding: 8px 10px;
    font-size: 12.5px; margin: -4px 0 12px; line-height: 1.45;
}
.aviso-hermano.fuerte { background: #FFF3E0; color: #7A4600; border: 1px solid #F5C98A; }
.aviso-hermano.fuerte span { font-style: italic; }
.aviso-hermano.oculto { display: none; }

.familia-ayuda { font-size: 12.5px; color: #556; margin: -6px 0 14px; }
.familia-fila {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 9px 0; border-bottom: 1px solid var(--gris-borde); font-size: 13.5px;
}
.familia-fila:last-child { border-bottom: none; margin-bottom: 10px; }
.familia-motivo { font-size: 12px; color: #778; }
.btn-borrar.mini { padding: 5px 9px; font-size: 12px; white-space: nowrap; }

/* --- Técnicos y altas manuales --- */
.badge-rol {
    display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px;
    border-radius: 10px; margin-right: 4px; vertical-align: 1px;
    background: #E6ECFB; color: var(--navy); text-transform: uppercase; letter-spacing: .02em;
}
.badge-rol.ayudante { background: #EEF0F6; color: #445; }
.badge-rol.delegado { background: #F3EEFA; color: #5B3A8C; }
.badge-rol.manual { background: #FFF3E0; color: #9C5B00; text-transform: none; }
tr.sub-cabecera td {
    background: var(--gris-claro) !important; color: #556; font-size: 11.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .04em; padding-top: 6px; padding-bottom: 6px;
}
.tambien-en { font-size: 11.5px; color: #778; font-style: italic; }
.bloque-colectivo .titulo-equipo { border-left: 4px solid var(--orange); }


/* ---------- Boletos vendidos / totales ---------- */
.panel-boletos {
    background: #fff; border: 1px solid var(--gris-borde); border-radius: 12px;
    padding: 18px 20px; margin-bottom: 14px;
}
.boletos-cabecera { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.boletos-cifra { font-size: 38px; font-weight: bold; color: var(--navy); line-height: 1; }
.boletos-cifra span { font-size: 22px; color: #99A; font-weight: 600; }
.panel-boletos .etiqueta { font-size: 12px; color: #667; text-transform: uppercase; letter-spacing: .03em; margin-top: 6px; }
.boletos-nota { text-transform: none; letter-spacing: 0; color: #99A; }
.barra-boletos {
    display: flex; height: 22px; border-radius: 11px; overflow: hidden;
    background: #ECEEF4; margin: 16px 0 12px;
}
.barra-boletos > div { height: 100%; }
.seg-tal { background: var(--navy); }
.seg-sueltos { background: var(--orange); }
.seg-fuera { background: #9DB0DD; }
.seg-club { background: #ECEEF4; }
.leyenda-boletos { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; color: #445; }
.leyenda-boletos i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.leyenda-boletos i.seg-club { border: 1px solid #C9CEDB; }
.leyenda-boletos b { color: #1B1F2A; }
.leyenda-boletos .por-vender { margin-left: auto; font-weight: 600; color: var(--navy); }
.panel-boletos .aviso-hermano { margin: 12px 0 0; }
.tarjeta .valor small { font-size: 15px; color: #99A; font-weight: 600; }

/* ---------- Venta directa ---------- */
.tabla-ventas td.num, .tabla-ventas th.num { text-align: right; }
.tabla-ventas tfoot td { font-weight: bold; background: var(--gris-claro); border-bottom: none; }
.campo-modal { font-size: 12.5px; font-weight: 600; color: #445; margin-bottom: 12px; }
.contador-boletos { display: flex; gap: 6px; margin-top: 4px; }
.contador-boletos input { text-align: center; font-size: 16px; font-weight: bold; margin-top: 0 !important; }
.contador-boletos .btn-secundario { padding: 6px 14px; font-size: 18px; line-height: 1; }
.importe-venta { font-size: 22px; font-weight: bold; color: var(--orange); padding: 6px 0 0; }
.opcional { font-weight: 400; color: #99A; font-size: 12px; }
@media (max-width: 600px) {
    .leyenda-boletos .por-vender { margin-left: 0; }
    .boletos-cifra { font-size: 30px; }
}
