/* Identidad Luz del Sur — misma que Ayuda_David (app/streamlit_app.py y .streamlit/config.toml).
   Antes era web/estilos.css con las imágenes incrustadas en base64; en la web van como archivos de assets/. */
:root {
  --navy: #132B6C;
  --navy-dark: #0B1B47;
  --orange: #F0791A;
  --gold: #FFC24B;
  --ink: #152047;
  --muted: #6B7280;
  --surface: #FFFFFF;
  --fondo: #FBF8F3;
  --azul-suave: #EDF1FA;
  --grid: rgba(19,43,108,.08);
  --line: rgba(19,43,108,.12);
  --ok: #1E7D3A;
  --crit: #D03B3B;
  --warn: #B7791F;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fondo); color: var(--ink);
  font: 15px/1.5 Inter, "Segoe UI", system-ui, sans-serif;
}
main { max-width: 1280px; margin: 0 auto; padding: 24px 16px 32px; }
input, select, button { font: inherit; color: inherit; }

/* --- Logo: franja central del logo cuadrado ("chapita") --- */
.logo-strip {
  background: url('../assets/luzdelsur_logo.jpg') center 49% / 228px auto no-repeat, linear-gradient(90deg, #FDE36A, #F0791A);
  width: 196px; height: 52px; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.22); flex-shrink: 0;
}
.logo-strip.sm { width: 108px; height: 28px; background-size: 138px auto, cover; border-radius: 6px; box-shadow: none; }

/* --- Encabezado --- */
.hero {
  position: relative; border-radius: 24px; overflow: hidden; margin-bottom: 8px;
  background: var(--navy) url('../assets/fondo_luz_delsur.png') center 60% / cover;
  box-shadow: 0 10px 30px rgba(11,27,71,.18);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(115deg, rgba(11,27,71,.95) 0%, rgba(19,43,108,.82) 45%, rgba(240,121,26,.55) 100%);
}
.hero-inner {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  gap: 20px 40px; padding: 26px 34px; flex-wrap: wrap;
}
.hero-left { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero h1 {
  font-family: Rajdhani, sans-serif; letter-spacing: .02em; color: #fff; font-size: 2.05rem;
  margin: 0; line-height: 1.1; text-transform: uppercase;
}
.hero-sub { color: var(--gold); font-weight: 500; font-size: .92rem; margin-top: 5px; }
.hero-prog { color: #fff; min-width: 200px; }
.hero-prog .num { font-family: Rajdhani, sans-serif; font-size: 2.6rem; font-weight: 700; line-height: 1; }
.hero-prog .num small { font-size: 1.05rem; font-weight: 500; opacity: .85; margin-left: 6px; }
.hero-prog .meta { font-size: .82rem; opacity: .85; margin-top: 6px; }

/* --- Secciones y tarjetas --- */
.sec { display: flex; align-items: center; gap: 10px; margin: 24px 0 11px; }
.sec::before { content: ""; width: 5px; height: 1.35rem; border-radius: 3px; background: var(--orange); }
.sec span {
  font-family: Rajdhani, sans-serif; font-weight: 700; font-size: 1.35rem; letter-spacing: .02em;
  display: flex; align-items: center; gap: 8px;
}
.sec small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.sec .num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy); color: #fff; font-style: normal; font-size: 1rem;
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--orange);
  border-radius: 18px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(19,43,108,.05);
}
.card-t {
  display: block; font-family: Rajdhani, sans-serif; font-weight: 700; font-size: 1.15rem;
  letter-spacing: .02em; margin: 0;
}
.card-s { font-size: .8rem; color: var(--muted); margin: 2px 0 10px; }
.grp {
  font-family: Rajdhani, sans-serif; font-weight: 700; font-size: .85rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); padding-bottom: 5px; margin: 16px 0 9px;
  border-bottom: 2px solid var(--grid);
}
.grp:first-child { margin-top: 0; }

/* --- Campos y botones --- */
input, select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 0;
}
input:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240,121,26,.18); }
#ident { width: 100%; max-width: 440px; font-size: 1.1rem; font-weight: 600; }
.fila { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.fila input[type=search] { flex: 1 1 280px; }
button {
  padding: 9px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  font-family: Rajdhani, sans-serif; font-weight: 600; font-size: 1rem; letter-spacing: .02em;
  transition: box-shadow .15s, transform .15s, background .15s;
}
button:hover { box-shadow: 0 4px 14px rgba(19,43,108,.12); }
button.primario { background: var(--orange); border-color: var(--orange); color: #fff; }
button.primario:hover { background: #DB6A10; }
button.peligro { color: var(--crit); }
button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

.info { margin-top: 10px; }
.info .ok { color: var(--ok); font-weight: 600; }
.info .error, .error { color: var(--crit); font-weight: 600; }
.aviso { color: var(--warn); font-weight: 600; }
.mensaje { color: var(--navy); font-weight: 600; margin: 12px 0 0; min-height: 1.2em; }

/* --- Partes (equipos sin equipo superior) --- */
.partes { display: flex; flex-wrap: wrap; gap: 12px; }
.parte {
  text-align: left; padding: 12px 16px; border: 1px solid var(--line); border-top: 3px solid var(--navy);
  border-radius: 16px; min-width: 220px; background: var(--surface); box-shadow: 0 2px 10px rgba(19,43,108,.06);
  font-family: Inter, sans-serif; font-weight: 400; display: flex; flex-direction: column; gap: 2px;
}
.parte:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(19,43,108,.16); }
.parte b { font-family: Rajdhani, sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.parte span { color: var(--muted); font-size: .8rem; }
.parte .otro-ident { color: var(--warn); font-weight: 600; }
.parte.activo { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset, 0 4px 16px rgba(19,43,108,.18); }
/* Equipos de la parte (la parte + sus hijas): más compactos */
.equipos { gap: 8px; }
.equipos .parte { min-width: 180px; padding: 8px 12px; border-top-color: var(--orange); }
.equipos .parte b { font-size: .95rem; }
.equipos .parte:disabled { transform: none; }

/* --- Chips de filtro --- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nota-chips { align-self: center; color: var(--muted); font-size: .78rem; }
.chip {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--azul-suave);
  font-family: Inter, sans-serif; font-weight: 500; font-size: .82rem; letter-spacing: 0;
}
.chip:hover { box-shadow: none; border-color: var(--orange); }
.chip.activo { background: var(--navy); border-color: var(--navy); color: #fff; }
.otros { margin-top: 10px; }
.otros summary { cursor: pointer; color: var(--muted); font-size: .82rem; font-weight: 600; }
.otros .chips { margin-top: 8px; }
.otros .chip { background: #fff; border-style: dashed; }
.otros .chip.activo { background: var(--orange); border-color: var(--orange); border-style: solid; }

/* --- Lista de hojas de ruta --- */
.lista {
  margin-top: 12px; max-height: 440px; overflow-y: auto; border: 1px solid var(--line); border-radius: 14px;
}
.lista::-webkit-scrollbar { width: 9px; }
.lista::-webkit-scrollbar-thumb { background: rgba(19,43,108,.33); border-radius: 9px; }
.ruta { padding: 9px 14px; border-bottom: 1px solid var(--grid); cursor: pointer; }
.ruta:last-child { border-bottom: 0; }
.ruta:hover { background: rgba(240,121,26,.06); }
.ruta.elegida { background: rgba(240,121,26,.12); box-shadow: inset 4px 0 0 var(--orange); }
.ruta.aviso, .ruta.nota { cursor: default; background: none; }
.cod { font-family: Rajdhani, sans-serif; font-weight: 700; font-size: 1.02rem; color: var(--navy); }
.det { color: var(--muted); font-size: .8rem; }
.nota { color: var(--muted); font-size: .85rem; }
.etiqueta {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600;
  background: var(--azul-suave); color: var(--navy); margin-left: 6px; vertical-align: 1px;
}
.etiqueta.instalacion { background: #E3F4E8; color: var(--ok); }
.etiqueta.retiro { background: #FBE9E7; color: var(--crit); }

/* --- Tabla --- */
.tabla-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--grid); vertical-align: top; }
th {
  background: var(--navy); color: #fff; white-space: nowrap;
  font-family: Rajdhani, sans-serif; font-weight: 600; font-size: .95rem; letter-spacing: .03em;
}
tbody tr:nth-child(even) { background: #F7F9FD; }
td input { width: 90px; padding: 5px 8px; border-radius: 8px; }
td .quitar { padding: 3px 10px; color: var(--crit); }
.acciones { margin-top: 16px; }

/* --- Pie --- */
.foot {
  display: flex; align-items: center; gap: 10px; margin-top: 35px; padding-top: 16px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem;
}

@media (max-width: 640px) {
  .hero-inner { padding: 20px; }
  .hero h1 { font-size: 1.6rem; }
  .logo-strip { width: 150px; height: 40px; background-size: 175px auto, cover; }
  .card { padding: 14px; }
}
