/* LG Monitor — hoja de estilo propia.
   Sin framework y sin CDN: el panel tiene que cargar igual desde una conexión
   mala a las tres de la mañana, que es cuando se mira de verdad. */

:root {
  --fondo: #f5f6f8;
  --panel: #ffffff;
  --borde: #dfe3e8;
  --texto: #1f2430;
  --suave: #6b7280;
  --acento: #1f6feb;
  --ok: #1a7f37;
  --aviso: #bf8700;
  --grave: #d1651b;
  --critico: #cf222e;
  --mudo: #6e40c9;
  --radio: 6px;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--fondo); color: var(--texto);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--acento); text-decoration: none; }
a:hover { text-decoration: underline; }

.disposicion { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.lateral {
  background: #171b26; color: #c9d1d9; padding: 16px 0; position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
}
.lateral h1 { font-size: 15px; margin: 0 16px 4px; color: #fff; letter-spacing: .3px; }
.lateral .ver { font-size: 11px; color: #6b7280; margin: 0 16px 16px; }
.lateral h2 {
  font-size: 10px; text-transform: uppercase; letter-spacing: .8px;
  color: #6b7280; margin: 18px 16px 6px; font-weight: 600;
}
.lateral a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 16px; color: #c9d1d9; font-size: 13px;
}
.lateral a:hover { background: #21262d; text-decoration: none; }
.lateral a.activo { background: #21262d; color: #fff; box-shadow: inset 3px 0 0 var(--acento); }
.lateral .cuenta { margin-top: auto; }

.principal { padding: 20px 24px 60px; max-width: 1400px; }
.cabecera { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.cabecera h2 { margin: 0; font-size: 19px; }

.tarjeta { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 16px; margin-bottom: 14px; }
.tarjeta h3 { margin: 0 0 10px; font-size: 14px; }

.rejilla { display: grid; gap: 12px; }
.rejilla.c4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.rejilla.c2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.dato { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 12px 14px; }
.dato .n { font-size: 26px; font-weight: 600; line-height: 1.1; }
.dato .e { font-size: 12px; color: var(--suave); margin-top: 2px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); }
.tabla-scroll { overflow-x: auto; border: 1px solid var(--borde); border-radius: var(--radio); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--borde); font-size: 13px; white-space: nowrap; }
th { background: #fafbfc; font-weight: 600; font-size: 12px; color: var(--suave); }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

.pin { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.pin.ok { background: #dafbe1; color: var(--ok); }
.pin.aviso { background: #fff8c5; color: var(--aviso); }
.pin.grave { background: #ffe7d1; color: var(--grave); }
.pin.critico { background: #ffebe9; color: var(--critico); }
.pin.mudo { background: #efe2ff; color: var(--mudo); }
.pin.silenciado, .pin.inactivo, .pin.sindatos { background: #eef1f4; color: var(--suave); }

.barra { height: 6px; background: #eef1f4; border-radius: 3px; overflow: hidden; min-width: 70px; }
.barra i { display: block; height: 100%; background: var(--ok); }
.barra i.aviso { background: var(--aviso); }
.barra i.critico { background: var(--critico); }

form.linea { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type=text], input[type=password], input[type=number], select, textarea {
  padding: 6px 9px; border: 1px solid var(--borde); border-radius: var(--radio);
  font: inherit; background: #fff; color: var(--texto);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #cfe3ff; border-color: var(--acento); }
button, .boton {
  padding: 6px 12px; border: 1px solid var(--borde); border-radius: var(--radio);
  background: #fff; cursor: pointer; font: inherit; color: var(--texto);
}
button.primario { background: var(--acento); border-color: var(--acento); color: #fff; }
button:hover { background: #f2f4f7; }
button.primario:hover { background: #1a5fd0; }
button.peligro { color: var(--critico); border-color: #ffcecb; }

.aviso-caja { padding: 10px 12px; border-radius: var(--radio); margin-bottom: 14px; font-size: 13px; }
.aviso-caja.info { background: #ddf4ff; border: 1px solid #b6e3ff; }
.aviso-caja.mal { background: #ffebe9; border: 1px solid #ffcecb; }
.aviso-caja.bien { background: #dafbe1; border: 1px solid #aceebb; }

.suave { color: var(--suave); }
.pequeno { font-size: 12px; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
pre { background: #f6f8fa; padding: 10px; border-radius: var(--radio); overflow-x: auto; border: 1px solid var(--borde); }

.grafica { width: 100%; height: 150px; display: block; }
.leyenda { font-size: 11px; color: var(--suave); display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }

/* Pantallas de acceso: sin barra lateral. */
.centrado { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.caja-acceso { background: var(--panel); border: 1px solid var(--borde); border-radius: 8px; padding: 26px; width: 100%; max-width: 380px; }
.caja-acceso h1 { font-size: 18px; margin: 0 0 4px; }
.caja-acceso p.sub { color: var(--suave); font-size: 13px; margin: 0 0 18px; }
.caja-acceso label { display: block; font-size: 12px; color: var(--suave); margin-bottom: 4px; }
.caja-acceso input { width: 100%; margin-bottom: 12px; }
.caja-acceso button { width: 100%; }

@media (max-width: 800px) {
  .disposicion { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; }
}
