/* Monitor de precios JetSmart — hoja de estilos única (sin dependencias). */

:root {
  --fondo:        #0b0f1a;
  --fondo-2:      #111827;
  --panel:        #141c2e;
  --panel-2:      #1a2439;
  --borde:        #26324b;
  --borde-suave:  #1e2942;
  --texto:        #e7edf7;
  --texto-2:      #a4b1c8;
  --texto-3:      #6b7a94;
  --acento:       #ff6a13;
  --acento-2:     #ff8a44;
  --ok:           #34d399;
  --medio:        #fbbf24;
  --caro:         #f87171;
  --radio:        14px;
  --radio-s:      9px;
  --sombra:       0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);
  --fuente:       ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
                  "Helvetica Neue", Arial, sans-serif;
  --mono:         ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Escala de precio: barato -> caro */
  --t0: #0f766e; --t1: #3f7d3a; --t2: #8a7521; --t3: #9c5620; --t4: #98342f;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 15px;
  line-height: 1.5;
  color: var(--texto);
  background:
    radial-gradient(1100px 520px at 78% -12%, rgba(255,106,19,.10), transparent 62%),
    radial-gradient(900px 480px at 8% 4%, rgba(56,132,255,.09), transparent 60%),
    var(--fondo);
  background-attachment: fixed;
  min-height: 100vh;
}

a { color: var(--acento-2); }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
code { font-family: var(--mono); font-size: .9em; color: var(--texto-2);
       background: var(--panel-2); padding: 1px 5px; border-radius: 5px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 15px; border-radius: 10px; border: 1px solid transparent;
  font: inherit; font-size: 14px; font-weight: 600; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn-principal { background: var(--acento); color: #14090b; }
.btn-principal:hover { background: var(--acento-2); }
.btn-fantasma {
  background: transparent; border-color: var(--borde); color: var(--texto-2);
}
.btn-fantasma:hover { border-color: var(--texto-3); color: var(--texto); }
.btn[disabled], .btn.cargando { opacity: .55; pointer-events: none; }

/* ---------- Login ---------- */

.pantalla-login {
  display: grid; place-items: center; padding: 24px; min-height: 100vh;
}
.login-caja {
  width: 100%; max-width: 400px; background: var(--panel);
  border: 1px solid var(--borde); border-radius: 18px;
  padding: 34px 30px 26px; box-shadow: var(--sombra);
}
.login-marca { text-align: center; margin-bottom: 24px; }
.login-avion {
  font-size: 30px; color: var(--acento); line-height: 1;
  transform: rotate(45deg); margin-bottom: 12px;
}
.login-marca h1 { font-size: 21px; }
.login-ruta { margin: 5px 0 0; color: var(--texto-2); font-size: 14px; }
.login-form { display: flex; flex-direction: column; gap: 6px; }
.login-form label { font-size: 13px; font-weight: 600; color: var(--texto-2); margin-top: 8px; }
.login-form .btn { margin-top: 18px; padding: 11px; }
.login-pie {
  margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--borde-suave);
  font-size: 12px; color: var(--texto-3); text-align: center; line-height: 1.5;
}

input[type=text], input[type=password], input[type=email],
input[type=date], input[type=number], select {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 14px;
  color: var(--texto); background: var(--fondo-2);
  border: 1px solid var(--borde); border-radius: 10px;
}
input:focus, select:focus, .btn:focus-visible, .tab:focus-visible, .dia:focus-visible {
  outline: 2px solid var(--acento); outline-offset: 2px;
}
select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--texto-3) 50%),
  linear-gradient(135deg, var(--texto-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 51%, calc(100% - 12px) 51%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.pista { margin: 4px 0 0; font-size: 12px; color: var(--texto-3); line-height: 1.5; }

/* ---------- Avisos ---------- */

.aviso {
  padding: 12px 15px; border-radius: var(--radio-s); font-size: 14px;
  border: 1px solid var(--borde); background: var(--panel-2); margin-bottom: 16px;
  border-left-width: 3px;
}
.aviso-error { border-left-color: var(--caro); background: rgba(248,113,113,.09); }
.aviso-ok    { border-left-color: var(--ok);   background: rgba(52,211,153,.09); }
.aviso-info  { border-left-color: var(--acento); background: rgba(255,106,19,.08); }

/* ---------- Topbar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(11,15,26,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--borde-suave);
}
.topbar-in {
  max-width: 1220px; margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.marca { display: flex; align-items: center; gap: 12px; min-width: 0; }
.marca .avion {
  font-size: 20px; color: var(--acento); transform: rotate(45deg); flex-shrink: 0;
}
.marca strong { display: block; font-size: 15px; }
.marca small { display: block; color: var(--texto-3); font-size: 12px; }
.marca .flecha { color: var(--acento); }
.acciones { display: flex; gap: 8px; flex-shrink: 0; }

.contenido { max-width: 1220px; margin: 0 auto; padding: 22px; }

/* ---------- Barra de estado ---------- */

.barra-estado {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; color: var(--texto-2); margin-bottom: 20px;
  padding: 10px 14px; background: var(--panel); border: 1px solid var(--borde-suave);
  border-radius: var(--radio-s);
}
.barra-estado strong { color: var(--texto); font-weight: 600; }
.barra-estado .sep { color: var(--texto-3); }
.pulso {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52,211,153,.16); flex-shrink: 0;
}
.pulso.malo { background: var(--caro); box-shadow: 0 0 0 3px rgba(248,113,113,.16); }

/* ---------- Tarjetas ---------- */

.tarjetas {
  display: grid; gap: 14px; margin-bottom: 22px;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
}
.tarjeta {
  background: var(--panel); border: 1px solid var(--borde);
  border-radius: var(--radio); padding: 17px 18px; box-shadow: var(--sombra);
  border-top: 3px solid var(--borde);
}
.tarjeta h3 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--texto-3); font-weight: 700; margin-bottom: 9px;
}
.tarjeta .cifra {
  margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.tarjeta .detalle { margin: 7px 0 0; font-size: 13px; color: var(--texto-2); }
.tarjeta .detalle.tenue, .tenue { color: var(--texto-3); }
.tarjeta .veredicto {
  margin: 11px 0 0; padding-top: 9px; border-top: 1px solid var(--borde-suave);
  font-size: 12px; font-weight: 600; color: var(--texto-2);
}
.tarjeta.destacada { border-top-color: var(--acento); }
.tarjeta.destacada .cifra { color: var(--acento-2); }
.tarjeta.bueno { border-top-color: var(--ok); }
.tarjeta.bueno .veredicto { color: var(--ok); }
.tarjeta.medio { border-top-color: var(--medio); }
.tarjeta.medio .veredicto { color: var(--medio); }
.tarjeta.caro  { border-top-color: var(--caro); }
.tarjeta.caro .veredicto { color: var(--caro); }

/* ---------- Paneles ---------- */

.panel {
  background: var(--panel); border: 1px solid var(--borde);
  border-radius: var(--radio); margin-bottom: 22px; overflow: hidden;
  box-shadow: var(--sombra);
}
.panel-cab {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 15px 19px; border-bottom: 1px solid var(--borde-suave);
  background: linear-gradient(180deg, rgba(255,255,255,.022), transparent);
}
.panel-cab h2 { font-size: 15px; }
.panel-cuerpo { padding: 19px; }

.pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--borde); color: var(--texto-2);
}
.pill.ok { color: var(--ok); border-color: rgba(52,211,153,.35); background: rgba(52,211,153,.1); }

.tabs { display: flex; gap: 4px; background: var(--fondo-2); padding: 3px;
        border-radius: 10px; border: 1px solid var(--borde-suave); }
.tab {
  border: 0; background: transparent; color: var(--texto-3);
  font: inherit; font-size: 13px; font-weight: 600; padding: 6px 13px;
  border-radius: 7px; cursor: pointer; transition: background .15s, color .15s;
}
.tab:hover { color: var(--texto-2); }
.tab.activo { background: var(--panel-2); color: var(--texto); box-shadow: 0 1px 3px rgba(0,0,0,.3); }

.vacio { margin: 0; color: var(--texto-3); font-size: 14px; }

/* ---------- Gráfico ---------- */

.grafico { width: 100%; height: auto; display: block; overflow: visible; }
.grafico .rejilla { stroke: var(--borde-suave); stroke-width: 1; }
.grafico .eje { fill: var(--texto-3); font-size: 10.5px; font-family: var(--fuente); }
.grafico .linea { fill: none; stroke: var(--acento); stroke-width: 2;
                  stroke-linejoin: round; stroke-linecap: round; }
.grafico .objetivo { stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .85; }
.grafico .objetivo-txt { fill: var(--ok); font-size: 10.5px; font-weight: 600; font-family: var(--fuente); }
.grafico .punto { fill: var(--acento); }
.grafico .punto.ultimo { fill: #fff; stroke: var(--acento); stroke-width: 2.5; }
.grafico-vacio {
  padding: 26px; text-align: center; color: var(--texto-3); font-size: 14px;
  border: 1px dashed var(--borde); border-radius: var(--radio-s);
  background: rgba(255,255,255,.014);
}
.grafico-vacio p { margin: 0 0 6px; }
.grafico-vacio strong { color: var(--texto-2); }

/* ---------- Calendario ---------- */

.calendario {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  margin-top: 14px;
}
.mes h4 {
  font-size: 13px; margin-bottom: 9px; color: var(--texto-2);
  padding-bottom: 7px; border-bottom: 1px solid var(--borde-suave);
}
.mes h4 span { color: var(--texto-3); font-weight: 500; }
.mes-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dow {
  text-align: center; font-size: 10px; font-weight: 700; color: var(--texto-3);
  padding-bottom: 3px; text-transform: uppercase;
}
.dia {
  position: relative; aspect-ratio: 1/1; border-radius: 7px;
  border: 1px solid var(--borde-suave); background: var(--fondo-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 2px; font: inherit; color: var(--texto-3);
}
.dia.vacia { border: 0; background: transparent; }
.dia .num { font-size: 9.5px; line-height: 1; opacity: .75; }
.dia .precio { font-size: 11px; font-weight: 700; line-height: 1;
               font-variant-numeric: tabular-nums; }
.dia.sin .precio { opacity: .4; }
.dia.fuera { opacity: .28; }
.dia.con {
  cursor: pointer; color: #fff; border-color: transparent;
  transition: transform .12s, filter .12s;
}
.dia.con:hover { transform: translateY(-2px); filter: brightness(1.22); z-index: 2; }
.dia.con .num { opacity: .8; }
.dia.t0 { background: var(--t0); } .dia.t1 { background: var(--t1); }
.dia.t2 { background: var(--t2); } .dia.t3 { background: var(--t3); }
.dia.t4 { background: var(--t4); }
.dia.es-hoy { box-shadow: 0 0 0 2px var(--texto-2); }
.dia.es-minimo { box-shadow: 0 0 0 2px var(--acento); }
.dia .chispa {
  position: absolute; top: -5px; right: -4px; font-size: 10px; color: var(--acento);
  text-shadow: 0 0 4px rgba(0,0,0,.9);
}

.leyenda {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 18px; font-size: 11.5px; color: var(--texto-3);
}
.leyenda i { width: 26px; height: 10px; border-radius: 3px; display: inline-block; }
.leyenda .t0 { background: var(--t0); } .leyenda .t1 { background: var(--t1); }
.leyenda .t2 { background: var(--t2); } .leyenda .t3 { background: var(--t3); }
.leyenda .t4 { background: var(--t4); }
.leyenda-min { margin-left: 12px; color: var(--acento); }

/* ---------- Tablas ---------- */

.tabla-scroll { overflow-x: auto; margin: 0 -19px; padding: 0 19px; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.tabla th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--texto-3); font-weight: 700; padding: 0 12px 9px; white-space: nowrap;
  border-bottom: 1px solid var(--borde);
}
.tabla td { padding: 10px 12px; border-bottom: 1px solid var(--borde-suave); vertical-align: middle; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: rgba(255,255,255,.022); }
.tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla td strong { display: block; font-weight: 600; }
.tabla td small { display: block; color: var(--texto-3); font-size: 11.5px; }
.tabla .rank { color: var(--texto-3); font-variant-numeric: tabular-nums; width: 30px; }
.tabla .total { font-weight: 700; font-size: 14.5px; }
.tabla .fila-top { background: rgba(255,106,19,.06); }
.tabla .fila-top .total { color: var(--acento-2); }
.tabla .fila-top .rank { color: var(--acento); font-weight: 700; }
.asientos { font-size: 12px; color: var(--texto-3); white-space: nowrap; }
.asientos.pocos { color: var(--medio); font-weight: 600; }

/* ---------- Alertas ---------- */

.lista-alertas { list-style: none; margin: 0; padding: 0; }
.lista-alertas li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--borde-suave); font-size: 13.5px;
}
.lista-alertas li:last-child { border-bottom: 0; }
.baja {
  color: var(--ok); font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(52,211,153,.1); padding: 2px 9px; border-radius: 6px;
}
.ruta { font-family: var(--mono); font-size: 12px; color: var(--texto-2); }

/* ---------- Modal ---------- */

.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-fondo { position: absolute; inset: 0; background: rgba(3,6,14,.72); backdrop-filter: blur(3px); }
.modal-caja {
  position: relative; width: 100%; max-width: 620px; max-height: 86vh;
  overflow: auto; background: var(--panel); border: 1px solid var(--borde);
  border-radius: var(--radio); box-shadow: 0 24px 70px rgba(0,0,0,.6);
}
.modal-cab {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 19px; border-bottom: 1px solid var(--borde-suave);
  position: sticky; top: 0; background: var(--panel); z-index: 1;
}
.modal-cab h3 { font-size: 15px; }
.btn-cerrar {
  border: 0; background: transparent; color: var(--texto-3); font-size: 24px;
  line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 6px;
}
.btn-cerrar:hover { color: var(--texto); }
.modal-cuerpo { padding: 19px; }
.modal-cuerpo .tabla { min-width: 0; }
.modal-cuerpo .tabla-scroll { margin: 0; padding: 0; }
.cargando-txt { color: var(--texto-3); font-size: 14px; margin: 0; }

/* ---------- Ajustes ---------- */

.form-grid { display: grid; gap: 17px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.campo { display: flex; flex-direction: column; gap: 5px; }
.campo label { font-size: 13px; font-weight: 600; color: var(--texto-2); }
.campo.ancho { grid-column: 1 / -1; }
.form-acciones {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--borde-suave);
}
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--acento); flex-shrink: 0; }

.pie {
  margin: 34px 0 12px; padding-top: 18px; border-top: 1px solid var(--borde-suave);
  font-size: 12.5px; color: var(--texto-3); text-align: center; line-height: 1.6;
}
.pie p { margin: 0; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .topbar-in { padding: 10px 14px; flex-wrap: wrap; }
  .contenido { padding: 15px 14px; }
  .marca small { display: none; }
  .tarjeta .cifra { font-size: 25px; }
  .panel-cab { padding: 13px 15px; }
  .panel-cuerpo { padding: 15px; }
  .tabla-scroll { margin: 0 -15px; padding: 0 15px; }
  .calendario { grid-template-columns: 1fr; }
  .btn { padding: 7px 12px; font-size: 13px; }
}

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

/* Alertas de viaje completo */
.baja.suave { color: var(--medio); background: rgba(251,191,36,.1); }
.sub-titulo {
  margin: 20px 0 4px; padding-top: 16px; border-top: 1px solid var(--borde-suave);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--texto-3); font-weight: 700;
}
