/**
 * Tema visual único para TODO el sitio (tienda pública + paneles de
 * administración: login, organizador, superadmin, mis-boletos),
 * inspirado en el lenguaje visual de las grandes boleteras: fondo
 * oscuro, tarjetas con borde sutil, acento azul. Las páginas de
 * estación (movil.php / fijo.php) usan su propio estilo inline a
 * pantalla completa y no dependen de este archivo.
 *
 * Las clases .th-* son específicas de la tienda pública (hero, grid de
 * eventos, panel de compra). Las clases genéricas de abajo (.tarjeta,
 * .contenedor, .boton, etc.) son las que usan los paneles de admin —
 * se mantienen con los mismos nombres que tenía estilo.css para no
 * tener que reescribir el HTML de esas páginas, solo se les cambió el
 * <link> para apuntar aquí.
 */

:root {
    --th-bg: #0b0e17;
    --th-bg-alt: #111526;
    --th-card: #161b2e;
    --th-card-hover: #1d2338;
    --th-borde: #262c42;
    --th-texto: #f4f6fb;
    --th-texto-mute: #9aa3bd;
    --th-acento: #2f6bff;
    --th-acento-hover: #4d80ff;
    --th-rojo: #ff3b5c;
    --th-radio: 14px;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--th-bg);
    color: var(--th-texto);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { color: var(--th-texto); }

/* ============================================================
   Clases genéricas compartidas por los paneles de administración
   (login, organizador/*, superadmin/*, mis-boletos, checkout/retorno)
   ============================================================ */
.contenedor { max-width: 900px; margin: 0 auto; padding: 24px; }
.tarjeta {
    background: var(--th-card);
    border: 1px solid var(--th-borde);
    border-radius: var(--th-radio);
    padding: 20px;
    margin-bottom: 16px;
}
.pantalla-centrada { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

/* Grupo de boletos de un mismo evento, en /mis-boletos: encabezado con
   la portada/nombre del evento y debajo un renglón por cada boleto
   individual (código + estado + descarga), en vez de una tarjeta suelta
   por boleto. */
.boleto-grupo { max-width: 640px; padding: 0; overflow: hidden; }
.boleto-grupo-header {
    display: flex; gap: 16px; align-items: center;
    padding: 18px 20px; border-bottom: 1px solid var(--th-borde);
}
.boleto-grupo-header h2 { margin: 0; font-size: 18px; }
.boleto-grupo-header .ayuda { margin: 4px 0 0; }
.boleto-img {
    flex: 0 0 72px; width: 72px; height: 72px; border-radius: 10px;
    background-size: cover; background-position: center; background-color: var(--th-bg-alt);
}
.boleto-img-vacia {
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800; color: var(--th-texto-mute);
}
.boleto-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 20px; border-bottom: 1px solid var(--th-borde);
}
.boleto-item:last-child { border-bottom: none; }
.boleto-item-codigo { font-weight: 700; }
.boleto-item-estado { font-size: 13px; color: var(--th-texto-mute); margin-top: 2px; }
.boleto-item-acciones { display: flex; align-items: center; gap: 8px; }
.boleto-item-acciones .boton-secundario { padding: 12px 16px; line-height: 1; font-size: 17px; }

label { display: block; margin-bottom: 12px; font-size: 14px; color: var(--th-texto-mute); font-weight: 600; }
input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    margin-top: 4px;
    border: 1px solid var(--th-borde);
    border-radius: 8px;
    font-size: 15px;
    background: var(--th-bg-alt);
    color: var(--th-texto);
    font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--th-acento); }
input::placeholder, textarea::placeholder { color: var(--th-texto-mute); }

button, .boton {
    display: inline-block;
    background: var(--th-acento);
    color: #fff;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background .15s ease;
}
button:hover, .boton:hover { background: var(--th-acento-hover); }

.error { color: var(--th-rojo); }
.ayuda { color: var(--th-texto-mute); font-size: 14px; }

.tipo-boleto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--th-borde);
}
.tipo-boleto input { width: 70px; margin-top: 0; }

.portada {
    padding: 60px 24px;
    background-color: var(--th-bg-alt);
    background-size: cover;
    background-position: center;
    color: #fff;
    border-radius: var(--th-radio);
}

.fila-copiar { display: flex; gap: 8px; margin-bottom: 18px; }
.fila-copiar input { flex: 1; font-family: monospace; margin-top: 0; }
.fila-copiar button { white-space: nowrap; }

.fila-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    align-items: center;
}

fieldset { border: 1px solid var(--th-borde); border-radius: 10px; padding: 14px; margin: 14px 0; }
legend { padding: 0 8px; font-size: 12px; color: var(--th-texto-mute); font-weight: 600; }

/* ---------- Header ---------- */
.th-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 10px;
    justify-content: space-between;
    padding: 16px 32px;
    background: rgba(11, 14, 23, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--th-borde);
}
.th-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    flex: 0 0 auto;
}
.th-logo span { color: var(--th-acento); }
.th-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 20px;
}
.th-nav a {
    margin-left: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--th-texto-mute);
    white-space: nowrap;
    transition: color .15s ease;
}
.th-nav a:hover { color: var(--th-texto); }
.th-nav a.th-cta {
    background: var(--th-acento);
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
}
.th-nav a.th-cta:hover { background: var(--th-acento-hover); }

/* En pantallas angostas (celulares) el logo y el menú/sesión nunca caben
   en una sola línea. En vez de dejar que se encimen (que es justo lo que
   pasaba antes: "Cerrar sesión" se partía a la mitad y quedaba flotando
   sobre el logo), el menú se va a su propia línea completa debajo del
   logo, con los enlaces alineados a la izquierda. */
@media (max-width: 560px) {
    .th-header { padding: 14px 20px; }
    .th-nav { flex-basis: 100%; }
}

/* ---------- Hero (home) ---------- */
.th-hero {
    padding: 72px 32px 56px;
    text-align: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(47,107,255,.25), transparent 45%),
        radial-gradient(circle at 80% 0%, rgba(255,59,92,.18), transparent 40%),
        var(--th-bg);
}
.th-hero h1 {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0 0 12px;
}
.th-hero p {
    color: var(--th-texto-mute);
    font-size: 17px;
    margin: 0 auto 28px;
    max-width: 520px;
}
.th-buscador {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    background: var(--th-card);
    border: 1px solid var(--th-borde);
    border-radius: 999px;
    padding: 6px 6px 6px 20px;
}
.th-buscador input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: var(--th-texto);
    font-size: 15px;
    outline: none;
}
.th-buscador input::placeholder { color: var(--th-texto-mute); }
.th-buscador .th-buscador-ciudad {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    border-left: 1px solid var(--th-borde);
    color: var(--th-texto);
    font-size: 14px;
    outline: none;
    width: auto;
    max-width: 200px;
    margin: 0;
    padding: 10px 14px;
    border-radius: 0;
    cursor: pointer;
}
.th-buscador button {
    flex: 0 0 auto;
    background: var(--th-acento);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .th-buscador { flex-wrap: wrap; border-radius: 22px; padding: 14px 16px; gap: 10px; }
    .th-buscador input { flex: 1 1 100%; }
    .th-buscador .th-buscador-ciudad { flex: 1 1 auto; border-left: none; border-top: 1px solid var(--th-borde); max-width: none; padding: 10px 0; }
    .th-buscador button { flex: 1 1 auto; }
}

/* ---------- Grid de eventos ---------- */
.th-seccion { padding: 48px 32px 80px; max-width: 1200px; margin: 0 auto; }
.th-seccion h2 { font-size: 24px; font-weight: 800; margin: 0 0 20px; }

.th-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.th-card {
    position: relative;
    background: var(--th-card);
    border: 1px solid var(--th-borde);
    border-radius: var(--th-radio);
    overflow: hidden;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
    display: block;
}
.th-card:hover {
    transform: translateY(-4px);
    background: var(--th-card-hover);
    box-shadow: 0 16px 32px rgba(0,0,0,.35);
}
/* Enlace "estirado" que cubre toda la tarjeta y lleva al evento; el
   nombre del organizador va encima con su propio z-index más alto para
   poder tener su propio destino (la página pública del organizador)
   sin anidar un <a> dentro de otro. */
.th-card-cubre {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.th-card-img {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #2f6bff, #7c3aed);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}
.th-card-img .th-placeholder-letra {
    font-size: 64px;
    font-weight: 800;
    color: rgba(255,255,255,.35);
    margin: auto;
}
.th-badge-fecha {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(11,14,23,.85);
    border-radius: 8px;
    padding: 6px 10px;
    text-align: center;
    line-height: 1.1;
    backdrop-filter: blur(4px);
}
.th-badge-fecha .dia { display: block; font-size: 18px; font-weight: 800; }
.th-badge-fecha .mes { display: block; font-size: 10px; text-transform: uppercase; color: var(--th-texto-mute); letter-spacing: .5px; }

.th-card-body { padding: 16px 18px 20px; }
.th-card-body .th-organizador {
    position: relative;
    z-index: 2;
    display: inline-block;
    font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--th-acento); font-weight: 700; margin-bottom: 4px;
}
.th-card-body .th-organizador:hover { text-decoration: underline; }
.th-card-body h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; line-height: 1.3; }
.th-card-body .th-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--th-texto-mute); }

.th-vacio { color: var(--th-texto-mute); text-align: center; padding: 60px 0; }

/* ---------- Landing de evento ---------- */
.th-evento-hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(135deg, #1d2338, #0b0e17);
    overflow: hidden;
}
/* La imagen de portada se muestra en dos capas para que NUNCA se vea
   recortada, sin importar su proporción (cuadrada, vertical, panorámica):
   una copia de fondo rellena todo el espacio desenfocada (th-evento-hero-fondo,
   con "cover"), y encima la imagen real completa, sin recortar, centrada
   (th-evento-hero-imagen, con "contain"). Si el evento no tiene imagen,
   ninguna de las dos se imprime y solo se ve el degradado de fondo. */
.th-evento-hero-fondo {
    position: absolute;
    inset: -20px; /* un poco más grande que el contenedor para que el blur no deje una orilla transparente visible */
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(.55);
    z-index: 0;
}
.th-evento-hero-imagen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    z-index: 1;
}
.th-evento-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11,14,23,.1) 0%, rgba(11,14,23,.95) 90%);
    z-index: 2;
}
.th-evento-hero-contenido {
    position: relative;
    z-index: 3;
    padding: 48px 32px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
.th-breadcrumb { font-size: 13px; color: var(--th-texto-mute); margin-bottom: 16px; display: inline-block; }
.th-breadcrumb:hover { color: var(--th-texto); }
.th-evento-hero h1 {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800;
    letter-spacing: -1px;
    margin: 0 0 14px;
    max-width: 720px;
}
.th-evento-meta { display: flex; flex-wrap: wrap; gap: 20px; color: var(--th-texto-mute); font-size: 14px; font-weight: 600; }
.th-evento-meta span { display: flex; align-items: center; gap: 6px; }
.th-evento-meta .th-icono { color: var(--th-acento); }

.th-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 32px 100px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
}
@media (max-width: 860px) {
    .th-layout { grid-template-columns: 1fr; }
}

.th-descripcion { color: #d3d8e6; line-height: 1.7; font-size: 15px; }
.th-descripcion h2 { font-size: 20px; font-weight: 800; color: var(--th-texto); margin-bottom: 12px; }

.th-panel-compra {
    position: sticky;
    top: 90px;
    background: var(--th-card);
    border: 1px solid var(--th-borde);
    border-radius: var(--th-radio);
    padding: 22px;
}
.th-panel-compra h2 { font-size: 17px; font-weight: 800; margin: 0 0 16px; }

.th-tipo-boleto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--th-borde);
    gap: 12px;
}
.th-tipo-boleto:last-of-type { border-bottom: none; }
.th-tipo-boleto .th-tb-nombre { font-weight: 700; font-size: 14px; }
.th-tipo-boleto .th-tb-precio { color: var(--th-texto-mute); font-size: 13px; margin-top: 2px; }

.th-stepper { display: flex; align-items: center; gap: 10px; }
.th-stepper button {
    width: 28px; height: 28px; padding: 0; border-radius: 50%;
    border: 1px solid var(--th-borde); background: var(--th-bg-alt); color: var(--th-texto);
    font-size: 16px; cursor: pointer; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 28px;
}
.th-stepper input {
    width: 28px; flex: 0 0 28px; padding: 0; margin: 0; text-align: center;
    background: transparent; border: none;
    color: var(--th-texto); font-weight: 700; font-size: 15px;
}

.th-campos label {
    display: block; font-size: 12px; color: var(--th-texto-mute); margin: 14px 0 6px; font-weight: 600;
}
.th-campos input {
    width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--th-borde);
    background: var(--th-bg-alt); color: var(--th-texto); font-size: 14px;
}
.th-campos input:focus { outline: none; border-color: var(--th-acento); }

.th-btn-comprar {
    width: 100%;
    margin-top: 20px;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: var(--th-acento);
    color: #fff;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    transition: background .15s ease;
}
.th-btn-comprar:hover { background: var(--th-acento-hover); }
.th-btn-comprar:disabled { background: var(--th-bg-alt); color: var(--th-texto-mute); cursor: not-allowed; }

/* ---------- Contador de reserva (checkout) ---------- */
.th-contador {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(47, 107, 255, .12);
    border: 1px solid rgba(47, 107, 255, .35);
    color: var(--th-texto);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 18px;
}
.th-contador-reloj { font-size: 16px; }
.th-contador strong { font-variant-numeric: tabular-nums; }
.th-contador.th-contador-urgente {
    background: rgba(255, 59, 92, .12);
    border-color: rgba(255, 59, 92, .4);
}
.th-contador.th-contador-vencido {
    background: rgba(255, 59, 92, .18);
    border-color: var(--th-rojo);
    color: var(--th-rojo);
    font-weight: 700;
}
.th-contador.th-contador-vencido a { color: inherit; text-decoration: underline; }

#mapa-asientos {
    background: var(--th-card);
    border: 1px solid var(--th-borde);
    border-radius: var(--th-radio);
    padding: 16px;
    margin-bottom: 16px;
}
.total-seleccion { color: var(--th-texto-mute); font-size: 14px; margin-top: 8px; }

.th-footer {
    border-top: 1px solid var(--th-borde);
    padding: 28px 32px;
    text-align: center;
    color: var(--th-texto-mute);
    font-size: 13px;
}

/* ============================================================
   Panel de administración (organizador / superadmin)
   ============================================================ */
.admin-shell { display: flex; min-height: 100vh; align-items: stretch; }

.admin-nav {
    width: 240px;
    flex-shrink: 0;
    background: var(--th-bg-alt);
    border-right: 1px solid var(--th-borde);
    padding: 24px 0;
}
.admin-nav .admin-logo { display: block; padding: 0 24px 24px; font-size: 19px; font-weight: 800; color: var(--th-texto); }
.admin-nav .admin-nav-sep {
    padding: 18px 24px 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--th-texto-mute);
    opacity: .7;
}
.admin-nav a {
    display: block;
    padding: 11px 24px;
    color: var(--th-texto-mute);
    font-weight: 600;
    font-size: 14px;
    border-left: 3px solid transparent;
}
.admin-nav a:hover { color: var(--th-texto); background: rgba(255,255,255,.03); }
.admin-nav a.activo { color: #fff; border-left-color: var(--th-acento); background: rgba(47,107,255,.1); }

.admin-main { flex: 1; padding: 32px 40px 60px; max-width: 1100px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 28px; gap: 16px; flex-wrap: wrap; }
.admin-topbar h1 { margin: 0; font-size: 24px; }
.admin-user { font-size: 13px; color: var(--th-texto-mute); white-space: nowrap; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--th-card); border: 1px solid var(--th-borde); border-radius: var(--th-radio); padding: 18px 20px; }
.stat-card .stat-valor { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-card .stat-etiqueta { font-size: 12px; color: var(--th-texto-mute); margin-top: 6px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.badge-borrador   { background: rgba(154,163,189,.15); color: #9aa3bd; }
.badge-publicado  { background: rgba(34,197,94,.15);  color: #4ade80; }
.badge-pausado    { background: rgba(250,204,21,.15); color: #facc15; }
.badge-cancelado  { background: rgba(255,59,92,.15);  color: #ff3b5c; }
.badge-finalizado { background: rgba(154,163,189,.15); color: #9aa3bd; }
.badge-valido     { background: rgba(34,197,94,.15);  color: #4ade80; }
.badge-usado      { background: rgba(154,163,189,.15); color: #9aa3bd; }
.badge-pendiente  { background: rgba(250,204,21,.15); color: #facc15; }
.badge-pagado     { background: rgba(34,197,94,.15);  color: #4ade80; }
.badge-gratis     { background: rgba(47,107,255,.15); color: #7ea1ff; }

.tabla-admin { width: 100%; border-collapse: collapse; }
.tabla-admin th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--th-texto-mute); padding: 10px 12px; border-bottom: 1px solid var(--th-borde); }
.tabla-admin td { padding: 12px; border-bottom: 1px solid var(--th-borde); font-size: 14px; vertical-align: middle; }
.tabla-admin tr:last-child td { border-bottom: none; }
.tabla-admin tr:hover td { background: rgba(255,255,255,.02); }
.tabla-admin a { color: var(--th-acento); font-weight: 600; }
/* Links que en realidad son botones (.boton, .boton-secundario,
   .boton-peligro) dentro de una tabla de admin: sin esto, la regla de
   arriba (.tabla-admin a) les gana al color del botón por especificidad
   y el texto queda del mismo azul que el fondo — casi invisible. */
.tabla-admin a.boton { color: #fff; }
.tabla-admin a.boton-secundario { color: var(--th-texto); }
.tabla-admin a.boton-peligro { color: var(--th-rojo); }

.boton-secundario { background: var(--th-bg-alt); border: 1px solid var(--th-borde); color: var(--th-texto); }
.boton-secundario:hover { background: #1a2036; }
.boton-peligro { background: transparent; color: var(--th-rojo); border: 1px solid rgba(255,59,92,.4); }
.boton-peligro:hover { background: rgba(255,59,92,.1); }
.boton-pequeno { padding: 7px 14px; font-size: 13px; }

.fila-acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.subseccion-titulo { font-size: 15px; font-weight: 800; margin: 28px 0 4px; }
.lista-simple { list-style: none; margin: 0; padding: 0; }
.lista-simple li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--th-borde); gap: 12px; }
.lista-simple li:last-child { border-bottom: none; }
.pill-check { display: inline-flex; align-items: center; gap: 6px; background: var(--th-bg-alt); border: 1px solid var(--th-borde); border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.pill-check input { width: auto; margin: 0; }

.dia-evento-fila {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--th-borde);
    border-radius: 10px;
    margin-bottom: 10px;
    background: var(--th-bg-alt);
}
.dia-evento-fila label { margin-bottom: 0; }
.dia-evento-fila .boton-peligro { padding: 10px 12px; line-height: 1; }
@media (max-width: 640px) {
    .dia-evento-fila { grid-template-columns: 1fr 1fr; }
}

.dias-evento-lista { list-style: none; margin: 0; padding: 0; }
.dias-evento-lista li { padding: 10px 0; border-bottom: 1px solid var(--th-borde); }
.dias-evento-lista li:last-child { border-bottom: none; }
