/* =====================================================================
   LUZTECH 2026 - Estilos (sin dependencias externas)
   Paleta: azul índigo oscuro, cian eléctrico, dorado para podios.
   ===================================================================== */
:root {
  --azul: #0b1437;
  --azul2: #131f52;
  --indigo: #4f46e5;
  --cian: #22d3ee;
  --cian2: #0891b2;
  --oro: #facc15;
  --plata: #cbd5e1;
  --bronce: #d97706;
  --fondo: #f1f5fb;
  --tarjeta: #ffffff;
  --texto: #0f172a;
  --suave: #64748b;
  --borde: #dbe3ef;
  --ok: #16a34a;
  --error: #dc2626;
  --aviso: #f59e0b;
  --radio: 14px;
  --sombra: 0 4px 18px rgba(11, 20, 55, .08);
  --fuente: "Poppins", "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--fuente); color: var(--texto); background: var(--fondo); line-height: 1.45; font-size: 16px; }
a { color: var(--indigo); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; }
small { color: var(--suave); }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--borde); margin: 1rem 0; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 44px; padding: .55em 1.1em; border-radius: 10px; border: 1px solid transparent; background: var(--indigo); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: filter .15s, transform .05s; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn-cian { background: var(--cian2); }
.btn-ok { background: var(--ok); }
.btn-peligro { background: var(--error); }
.btn-sec { background: #fff; color: var(--texto); border-color: var(--borde); }
.btn-oro { background: var(--oro); color: #1f2937; }
.btn-sm { min-height: 36px; padding: .3em .75em; font-size: .9em; }
.btn-lg { min-height: 56px; font-size: 1.15em; padding: .6em 1.6em; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.acciones { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- Formularios ---------- */
label { font-weight: 600; font-size: .92em; display: block; margin-bottom: .25em; }
input[type=text], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: .5em .75em; border: 1px solid var(--borde); border-radius: 10px; font: inherit; background: #fff; color: var(--texto);
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(34, 211, 238, .35); border-color: var(--cian2); }
input[readonly] { background: #eef2f8; }
.campo { margin-bottom: .9rem; }
.fila { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.check { display: flex; align-items: center; gap: .5em; font-weight: 500; min-height: 40px; cursor: pointer; }
.check input { width: 22px; height: 22px; }
.ayuda { color: var(--suave); font-size: .85em; margin-top: .2em; }
fieldset { border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .4em; }

/* ---------- Tarjetas, avisos ---------- */
.card { background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1.2rem; margin-bottom: 1.2rem; }
.card h2 { font-size: 1.2em; }
.alerta { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; border-left: 5px solid; }
.alerta-error { background: #fef2f2; border-color: var(--error); color: #7f1d1d; }
.alerta-ok { background: #f0fdf4; border-color: var(--ok); color: #14532d; }
.alerta-aviso { background: #fffbeb; border-color: var(--aviso); color: #78350f; }
.alerta-info { background: #ecfeff; border-color: var(--cian2); color: #164e63; }
.alerta ul { margin: .3em 0 0; padding-left: 1.2em; }
.badge { display: inline-block; padding: .15em .55em; border-radius: 999px; font-size: .78em; font-weight: 700; background: #e2e8f0; color: #334155; white-space: nowrap; }
.badge-ok { background: #dcfce7; color: #166534; }
.badge-no { background: #fee2e2; color: #991b1b; }
.badge-pend { background: #fef3c7; color: #92400e; }
.badge-dq { background: #1f2937; color: #fff; }
.badge-cian { background: #cffafe; color: #155e75; }
.vacio { color: var(--suave); font-style: italic; }
.leyenda { color: var(--suave); font-size: .8em; margin: .3em 0 1em; }
.grid-stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1.2rem; }
.stat { background: #fff; border-radius: var(--radio); padding: 1rem; box-shadow: var(--sombra); border-top: 4px solid var(--cian); }
.stat .num { font-size: 2em; font-weight: 800; color: var(--azul); }
.stat .lbl { color: var(--suave); font-size: .9em; }
.stat.oro { border-color: var(--oro); }
.stat.rojo { border-color: var(--error); }

/* ---------- Tablas ---------- */
.tabla-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; border: 1px solid var(--borde); background: #fff; }
.tabla { width: 100%; border-collapse: collapse; font-size: .95em; }
.tabla th, .tabla td { padding: .6em .7em; border-bottom: 1px solid var(--borde); text-align: left; vertical-align: middle; }
.tabla th { background: var(--azul); color: #fff; font-weight: 600; font-size: .88em; position: sticky; top: 0; white-space: nowrap; }
.tabla tbody tr:nth-child(even) { background: #f8fafd; }
.tabla tbody tr:hover { background: #eefbfe; }
.tabla .c { text-align: center; }
.tabla .r { text-align: right; }
.tabla .res { font-weight: 800; white-space: nowrap; }
.tabla tr.resaltado { background: #fef9c3 !important; outline: 3px solid var(--oro); outline-offset: -3px; }
.tabla tr.fila-dq { opacity: .55; }
.eq-nom { font-weight: 700; }
.eq-robot { font-size: .85em; color: var(--suave); }
.int { display: block; font-size: .9em; }
.ronda { display: inline-block; font-size: .82em; margin-right: .6em; }
.puesto { display: inline-grid; place-items: center; width: 2em; height: 2em; border-radius: 50%; background: #e2e8f0; color: var(--azul); font-weight: 800; }
body.tv .puesto { background: #334155; color: #fff; }
body.tv .puesto.p1, body.tv .puesto.p2 { color: var(--azul); }
.puesto.p1 { background: var(--oro); }
.puesto.p2 { background: var(--plata); }
.puesto.p3 { background: #f59e0b; color: #fff; }

/* ---------- Pestañas ---------- */
.tabs { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem; margin-bottom: 1rem; scrollbar-width: thin; }
.tabs a, .tabs button { flex: 0 0 auto; padding: .6em 1em; border-radius: 999px; background: #fff; border: 1px solid var(--borde); color: var(--texto); text-decoration: none; font-weight: 600; font: inherit; cursor: pointer; white-space: nowrap; }
.tabs a.activo, .tabs button.activo { background: var(--azul); color: #fff; border-color: var(--azul); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 1rem; bottom: 1rem; z-index: 9999; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 2rem); }
.toast { background: var(--azul); color: #fff; padding: .85rem 1.1rem; border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); border-left: 6px solid var(--cian); animation: entra .25s ease-out; max-width: 420px; }
.toast.ok { border-color: #4ade80; }
.toast.error { border-color: #f87171; }
.toast.aviso { border-color: var(--oro); }
@keyframes entra { from { transform: translateY(20px); opacity: 0; } }

/* =====================================================================
   PÁGINAS PÚBLICAS
   ===================================================================== */
.pub-header { background: var(--azul); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; flex-wrap: wrap; }
.marca { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-size: 1.3em; letter-spacing: .04em; }
.marca b { color: var(--cian); }
.marca small { color: var(--oro); font-weight: 700; }
.pub-nav { display: flex; gap: .4rem; }
.pub-nav a { color: #fff; text-decoration: none; padding: .5em .9em; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); font-weight: 600; }
.pub-nav a:hover { background: rgba(34, 211, 238, .2); }
.pub-main { max-width: 1100px; margin: 0 auto; padding: 1rem; min-height: 70vh; }
.pub-footer { text-align: center; padding: 1.5rem 1rem; color: var(--suave); font-size: .9em; }
.pub-footer .lema { font-weight: 800; color: var(--indigo); letter-spacing: .08em; margin-bottom: .2em; }

.hero { background: radial-gradient(circle at 20% 0%, #1e3a8a 0, var(--azul) 60%); color: #fff; border-radius: 22px; padding: 2.2rem 1.4rem; text-align: center; margin-bottom: 1.2rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(34, 211, 238, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(34, 211, 238, .08) 1px, transparent 1px); background-size: 28px 28px; pointer-events: none; }
.hero h1 { font-size: clamp(2.2rem, 8vw, 4rem); margin: .2em 0 .1em; letter-spacing: .04em; }
.hero h1 b { color: var(--cian); }
.hero h1 span { color: var(--oro); }
.hero .lema { color: var(--cian); font-weight: 700; letter-spacing: .12em; font-size: clamp(.75rem, 2.6vw, 1rem); }
.hero p { color: #cbd5e1; margin: .4em 0; }
.hero .acciones { justify-content: center; margin-top: 1.2rem; position: relative; z-index: 1; }
.cats-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cat-card { background: #fff; border-radius: var(--radio); padding: 1rem; box-shadow: var(--sombra); text-decoration: none; color: var(--texto); border-top: 4px solid var(--cian); }
.cat-card .ico { font-size: 2em; }
.cat-card h3 { margin: .3em 0 .2em; font-size: 1.05em; }

.buscador { max-width: 520px; margin: 0 auto 1.2rem; text-align: center; }
.buscador input { font-size: 1.8em; text-align: center; letter-spacing: .15em; text-transform: uppercase; font-weight: 800; min-height: 64px; }
.ficha-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.ficha-head .ico { font-size: 2.6em; }
.ficha-head h2 { margin: 0; font-size: 1.5em; }
.codigo { font-family: ui-monospace, Consolas, monospace; font-weight: 800; letter-spacing: .08em; background: var(--azul); color: var(--cian); padding: .15em .5em; border-radius: 8px; }
.mi-puesto { text-align: center; background: linear-gradient(135deg, var(--azul), #312e81); color: #fff; border-radius: var(--radio); padding: 1.2rem; margin-bottom: 1rem; }
.mi-puesto .grande { font-size: 3em; font-weight: 800; color: var(--oro); line-height: 1; }
.datos-lista { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.datos-lista dt { color: var(--suave); font-weight: 600; }
.datos-lista dd { margin: 0; }
.criterios { width: 100%; }
.barra { height: 10px; border-radius: 99px; background: #e2e8f0; overflow: hidden; margin-top: .25em; }
.barra i { display: block; height: 100%; background: linear-gradient(90deg, var(--cian), var(--indigo)); }

/* ---------- Podio ---------- */
.podio { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; align-items: end; margin: 1rem 0; }
.pod { text-align: center; }
.pod-med { font-size: 2.2em; }
.pod-eq { font-weight: 800; }
.pod-eq.vacio { color: var(--suave); font-weight: 500; font-style: italic; }
.pod-rob { font-size: .85em; color: var(--suave); }
.pod-int .int { font-size: .8em; }
.pod-base { margin-top: .4rem; border-radius: 10px 10px 0 0; color: var(--azul); font-weight: 900; font-size: 1.6em; display: grid; place-items: center; }
.pod1 .pod-base { background: var(--oro); height: 110px; }
.pod2 .pod-base { background: var(--plata); height: 80px; }
.pod3 .pod-base { background: #f59e0b; height: 60px; }
.pod-manual { text-align: center; color: var(--indigo); font-weight: 600; font-size: .9em; }
.premios { padding-left: 1.2em; font-size: .92em; }
.premios li { margin-bottom: .35em; }
.nota-premio { color: var(--indigo); }

/* ---------- Bracket y partidos ---------- */
.bracket { display: flex; gap: 1rem; overflow-x: auto; padding: .5rem 0 1rem; }
.br-col { flex: 0 0 210px; display: flex; flex-direction: column; justify-content: space-around; gap: .8rem; }
.br-col h4 { text-align: center; color: var(--indigo); margin: 0; }
.partido { background: #fff; border: 1px solid var(--borde); border-radius: 10px; overflow: hidden; box-shadow: var(--sombra); }
.partido.prog { border-style: dashed; }
.pt-eq { display: flex; justify-content: space-between; gap: .5rem; padding: .45em .7em; border-bottom: 1px solid var(--borde); }
.pt-eq:last-of-type { border-bottom: 0; }
.pt-eq.gana { background: #ecfeff; font-weight: 800; }
.pt-eq.yo { outline: 3px solid var(--oro); outline-offset: -3px; }
.pt-eq b { min-width: 1.5em; text-align: right; }
.pt-nota { font-size: .75em; color: var(--suave); text-align: center; padding: .15em; background: #f8fafc; }
.lista-partidos { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* =====================================================================
   PANEL ADMIN
   ===================================================================== */
.adm-top { position: fixed; top: 0; left: 0; right: 0; height: 58px; background: var(--azul); color: #fff; display: flex; align-items: center; gap: .8rem; padding: 0 1rem; z-index: 50; }
.adm-top .marca { font-size: 1.1em; }
.btn-menu { display: none; background: transparent; border: 1px solid rgba(255, 255, 255, .3); color: #fff; font-size: 1.4em; width: 44px; height: 44px; border-radius: 10px; cursor: pointer; }
.adm-user { margin-left: auto; font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rol { text-transform: uppercase; font-size: .72em; font-weight: 800; padding: .15em .5em; border-radius: 6px; background: var(--cian); color: var(--azul); }
.rol-admin { background: var(--oro); }
.adm-side { position: fixed; top: 58px; left: 0; bottom: 0; width: 240px; background: var(--azul2); overflow-y: auto; z-index: 40; transition: transform .2s; }
.adm-side nav { padding: .6rem; display: flex; flex-direction: column; gap: 2px; }
.adm-side a { color: #cbd5e1; text-decoration: none; padding: .7em .8em; border-radius: 10px; display: flex; gap: .6em; align-items: center; font-weight: 500; }
.adm-side a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.adm-side a.activo { background: var(--cian); color: var(--azul); font-weight: 700; }
.adm-side .ico { width: 1.5em; text-align: center; }
.adm-side hr { border-color: rgba(255, 255, 255, .15); }
.adm-main { margin-left: 240px; padding: 78px 1.2rem 2rem; max-width: 1400px; }
.adm-titulo { font-size: 1.5em; color: var(--azul); }
.adm-velo { display: none; }
.filtros { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1rem; align-items: end; }
.integrante { background: #f8fafd; border: 1px dashed var(--borde); border-radius: 12px; padding: .8rem; margin-bottom: .6rem; }
.integrante h4 { margin: 0 0 .5rem; color: var(--indigo); }
.rapido { background: linear-gradient(135deg, var(--azul), #312e81); color: #fff; }
.rapido label { color: #e0f2fe; }
.rapido input, .rapido select { font-size: 1.2em; }
.rapido .tiempo-input { font-size: 2em; font-weight: 800; text-align: center; min-height: 64px; }
.rubrica-crit { display: grid; grid-template-columns: 1fr 120px; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--borde); }
.rubrica-crit input { text-align: center; font-size: 1.2em; font-weight: 700; }
.total-rubrica { font-size: 1.6em; font-weight: 800; color: var(--indigo); text-align: right; }
.login-caja { max-width: 400px; margin: 8vh auto; }
.mini { font-size: .85em; }
.nowrap { white-space: nowrap; }
.oculto { display: none !important; }

@media (max-width: 900px) {
  .btn-menu { display: inline-block; }
  .adm-side { transform: translateX(-100%); width: 260px; }
  body.menu-abierto .adm-side { transform: none; }
  body.menu-abierto .adm-velo { display: block; position: fixed; inset: 58px 0 0 0; background: rgba(0, 0, 0, .4); z-index: 30; }
  .adm-main { margin-left: 0; padding: 72px .8rem 2rem; }
  .adm-top .marca span { display: none; }
}
@media (max-width: 640px) {
  .col-det { display: none; }
  .tabla th, .tabla td { padding: .5em .45em; }
  .pub-header { justify-content: center; }
  .rubrica-crit { grid-template-columns: 1fr 90px; }
  .podio { gap: .3rem; }
  .pod-med { font-size: 1.6em; }
}

/* =====================================================================
   MODO PROYECTOR (resultados.php?modo=tv)
   ===================================================================== */
body.tv { background: #050a24; color: #e2e8f0; font-size: clamp(16px, 1.6vw, 30px); overflow: hidden; }
body.tv .pub-main { max-width: none; padding: 1rem 2rem; }
.tv-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.tv-top h1 { margin: 0; font-size: 2em; color: #fff; }
.tv-top h1 b { color: var(--cian); }
.tv-top .lema { color: var(--oro); letter-spacing: .12em; font-weight: 700; font-size: .8em; }
.tv-slide { display: none; animation: entra .5s; }
.tv-slide.activo { display: block; }
.tv-slide h2 { font-size: 1.8em; color: var(--oro); }
body.tv .tabla-wrap { background: transparent; border-color: #1e293b; }
body.tv .tabla { font-size: 1em; }
body.tv .tabla th { background: #1e1b4b; }
body.tv .tabla td { border-color: #1e293b; color: #e2e8f0; }
body.tv .tabla tbody tr:nth-child(even) { background: rgba(255, 255, 255, .03); }
body.tv .tabla tbody tr:hover { background: transparent; }
body.tv .eq-robot, body.tv small, body.tv .leyenda { color: #94a3b8; }
body.tv .partido { background: #0f172a; border-color: #334155; }
body.tv .pt-eq { border-color: #334155; }
body.tv .pt-eq.gana { background: #083344; }
body.tv .pt-nota { background: #0b1220; }
body.tv .pod-eq { color: #fff; }
.tv-barra { position: fixed; left: 0; bottom: 0; height: 6px; background: var(--cian); width: 0; }

/* =====================================================================
   FICHAS QR E IMPRESIÓN
   ===================================================================== */
.fichas { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.ficha { border: 1px dashed #94a3b8; height: 12.6cm; padding: .6cm; display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; background: #fff; page-break-inside: avoid; break-inside: avoid; }
.ficha .f-top { display: flex; align-items: center; gap: .4rem; font-weight: 800; color: var(--azul); font-size: 1.2em; }
.ficha .f-top b { color: var(--cian2); }
.ficha .f-cat { font-size: .95em; color: var(--indigo); font-weight: 700; }
.ficha .f-eq { font-size: 1.25em; font-weight: 800; line-height: 1.15; }
.ficha .f-qr svg, .ficha .f-qr img { width: 5.2cm; height: 5.2cm; }
.ficha .f-cod { font-family: ui-monospace, Consolas, monospace; font-size: 1.9em; font-weight: 900; letter-spacing: .1em; }
.ficha .f-ley { font-size: .9em; color: #334155; }
.ficha .f-url { font-size: .65em; color: var(--suave); word-break: break-all; }
.qr-grande { text-align: center; padding: 1.5cm 1cm; page-break-after: always; break-after: page; }
.qr-grande h2 { font-size: 2.2em; color: var(--azul); }
.qr-grande .qr svg { width: 13cm; height: 13cm; max-width: 90vw; max-height: 90vw; }
.solo-print { display: none; }

@media print {
  @page { size: letter; margin: 1cm; }
  body { background: #fff !important; font-size: 11pt; }
  body.admin .adm-main { margin: 0; padding: 0; max-width: none; }
  .no-print, .adm-top, .adm-side, .adm-velo, .pub-header, .pub-footer, #toasts, .tabs, .filtros, .btn { display: none !important; }
  .solo-print { display: block; }
  .card { box-shadow: none; border: 0; padding: 0; margin-bottom: .6cm; }
  .tabla-wrap { border: 0; overflow: visible; }
  .tabla th { background: #e2e8f0 !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tabla td, .tabla th { padding: 4px 6px; border: 1px solid #999; }
  .col-det { display: table-cell !important; }
  .salto { page-break-before: always; break-before: page; }
  .fichas-hoja .ficha { border-color: #bbb; }
  .pod-base, .puesto { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: #000; text-decoration: none; }
  .adm-titulo { font-size: 16pt; }
}
