/*
 * Estilos del panel de administracion. Copiados de la maqueta aprobada (ui-guide/ui_panel-de-administracion.html): tokens claros y
 * oscuros, piezas, graficos y tablas. Lo que la maqueta resolvia con atributos `style` va aqui como clases, porque la CSP del panel
 * no permite estilos en linea. Al final: el tema oscuro segun el sistema, las clases de ayuda y el diseño del telefono (cuadro 8).
 */
:root {
  color-scheme: light;
  --ground: #f3f2ef;
  --sheet: #ffffff;
  --content: #faf9f6;
  --card: #ffffff;
  --divider: #e2e0da;
  --divider-soft: #f0eee9;
  --border-inner: #eeece7;
  --border-control: #dcdad3;
  --text: #1a1a19;
  --text-2: #5f5e5a;
  --text-3: #6b6a65;
  --nav: #3d3c39;
  --violet: #5b3fd1;
  --violet-text: #4b2fb0;
  --violet-bg: #ece9fb;
  --violet-line: #d8d2f6;
  --wait-bg: #fdf3dc;
  --wait-text: #8a3b07;
  --wait-dot: #c2410c;
  --done: #116b34;
  --done-bg: #e3f3e8;
  --fail: #b42318;
  --fail-bg: #fdecea;
  --neutral-bg: #f0eee9;
  --action: #1a1a19;
  --on-action: #ffffff;
  --action-hover: #3d3c39;
  --action-off: #a9a7a1;
  --sec-bg: #f3f2ef;
  --sec-hover: #eae8e3;
  --shadow-sheet: 0 1px 3px rgba(26, 26, 25, 0.05);
  --shadow-card: 0 1px 2px rgba(26, 26, 25, 0.04);
  --pop: 0 12px 32px rgba(26, 26, 25, 0.16);
  --page: #dedbd3;
  /* Gráficos: paleta categórica validada (3 primeras ranuras, todos los pares) */
  --s1: #257de0;
  --s2: #f47230;
  --s3: #00b894;
  --grid: #ebe9e3;
  --axis: #c9c6bd;
  --track: #e3eefc;
  --q1: #cce3fd;
  --q2: #9dc8f7;
  --q3: #6aabf1;
  --q4: #338ced;
  --q5: #1b64be;
  --on-q-claro: #0b0b0b;
  --mark-ok: #0aac23;
  --mark-mal: #dc3c3d;
  --mark-aviso: #fbb315;
  --mono: 'Cascadia Mono', 'SF Mono', 'Roboto Mono', Consolas, monospace;
  --e1: 0.25rem;
  --e2: 0.5rem;
  --e3: 0.75rem;
  --e4: 1rem;
  --e5: 1.5rem;
  --e6: 2.25rem;
}

@media (prefers-color-scheme: dark) {
  :root:not(.claro) {
    color-scheme: dark;
    --ground: #1f1e1d;
    --sheet: #262624;
    --content: #232220;
    --card: #2b2a28;
    --divider: #3a3936;
    --divider-soft: #33322f;
    --border-inner: #353430;
    --border-control: #4a4844;
    --text: #ecebe8;
    --text-2: #bab8b2;
    --text-3: #b0aea8;
    --nav: #d6d4cf;
    --violet: #b3a5f5;
    --violet-text: #b3a5f5;
    --violet-bg: rgba(179, 165, 245, 0.16);
    --violet-line: rgba(179, 165, 245, 0.35);
    --wait-bg: #3a2d12;
    --wait-text: #f2c27a;
    --wait-dot: #fb923c;
    --done: #4ade80;
    --done-bg: rgba(74, 222, 128, 0.14);
    --fail: #ff8a80;
    --fail-bg: rgba(255, 138, 128, 0.14);
    --neutral-bg: #32312e;
    --action: #ecebe8;
    --on-action: #1f1e1d;
    --action-hover: #d6d4cf;
    --action-off: #5a5853;
    --sec-bg: #32312e;
    --sec-hover: #3a3936;
    --shadow-sheet: 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
    --pop: 0 12px 32px rgba(0, 0, 0, 0.5);
    --page: #141413;
    --s1: #338ced;
    --s2: #e76624;
    --s3: #00a888;
    --grid: #363532;
    --axis: #4f4d48;
    --track: #1f3350;
    --q1: #0e3d7e;
    --q2: #0f4a96;
    --q3: #1b64be;
    --q4: #257de0;
    --q5: #519ced;
    --mark-ok: #0aac23;
    --mark-mal: #dc3c3d;
    --mark-aviso: #fbb315;
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0;
  background: var(--ground);
  font:
    400 13px/1.45 Inter,
    'Inter Variable',
    system-ui,
    'Segoe UI',
    'Noto Sans',
    sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
::selection {
  background: var(--violet-bg);
  color: var(--text);
}
button {
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
}
ul,
ol {
  list-style: none;
}
:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
}
svg.ico {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg.ico.sm {
  width: 0.875rem;
  height: 0.875rem;
}
b,
strong {
  font-weight: 600;
}
code,
.mono {
  font: 500 0.75rem/1.2 var(--mono);
}
code {
  background: var(--neutral-bg);
  border-radius: 4px;
  padding: 2px 4px;
}
.num-t {
  font-variant-numeric: tabular-nums;
}

/* ---------- Ventana del panel ---------- */
.ventana {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 14.75rem minmax(0, 1fr);
  background: var(--ground);
  color: var(--text);
}
.lateral {
  display: flex;
  flex-direction: column;
  padding: 0.875rem 0.75rem 0.75rem;
  min-height: 0;
}
.marca {
  display: flex;
  align-items: center;
  gap: var(--e2);
  padding: 0.25rem 0.5rem 0.25rem;
  font-weight: 700;
  font-size: 0.875rem;
}
.marca-ico {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
}
.marca-sub {
  padding: 0 0.5rem 0.875rem 2.125rem;
  font-size: 0.75rem;
  color: var(--text-2);
}
.nav a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  height: 2rem;
  padding: 0 0.625rem;
  border-radius: 8px;
  font-weight: 500;
  color: var(--nav);
}
.nav a span:nth-child(2) {
  flex: 1;
}
.nav a[aria-current='page'] {
  background: var(--sheet);
  color: var(--text);
  font-weight: 600;
  box-shadow:
    0 0 0 1px var(--divider),
    0 1px 2px rgba(26, 26, 25, 0.06);
}
.cnt {
  min-width: 1.25rem;
  height: 1.125rem;
  padding: 0 0.375rem;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  background: var(--neutral-bg);
  color: var(--text);
}
.sesion {
  margin-top: auto;
  padding: 0.75rem;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--sheet);
  font-size: 0.75rem;
  color: var(--text-2);
}
.sesion strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 2px;
}
.sesion .b {
  width: 100%;
  justify-content: center;
  margin-top: 0.625rem;
}

.hoja {
  margin: 8px 8px 8px 0;
  background: var(--sheet);
  border: 1px solid var(--divider);
  border-radius: 14px;
  box-shadow: var(--shadow-sheet);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.hoja-cab {
  height: 3.5rem;
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--e3);
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--divider-soft);
}
.hoja-cab h1 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.hoja-cab .fecha {
  color: var(--text-2);
}
.cab-der {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--e3);
  color: var(--text-2);
}
.cuerpo {
  flex: 1;
  padding: 1.25rem 1.5rem 1.75rem;
  background: var(--content);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- Piezas ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 1.25rem;
  padding: 0 0.4375rem;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--neutral-bg);
  color: var(--text);
  white-space: nowrap;
}
.chip svg.ico {
  width: 0.75rem;
  height: 0.75rem;
}
.chip.ok {
  background: var(--done-bg);
  color: var(--done);
}
.chip.mal {
  background: var(--fail-bg);
  color: var(--fail);
}
.chip.aviso {
  background: var(--wait-bg);
  color: var(--wait-text);
}
.chip.vio {
  background: var(--violet-bg);
  color: var(--violet-text);
}
.b {
  height: 2rem;
  padding: 0 0.75rem;
  border-radius: 8px;
  font-weight: 600;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.b-pri {
  background: var(--action);
  color: var(--on-action);
}
.b-pri:hover {
  background: var(--action-hover);
}
.b-pri:disabled {
  background: var(--action-off);
  cursor: not-allowed;
}
.b-sec {
  background: var(--sec-bg);
  border-color: var(--border-control);
}
.b-sec:hover {
  background: var(--sec-hover);
}
.b-ter {
  background: none;
  color: var(--text-2);
}
.b-ter:hover {
  background: var(--sec-hover);
}
.b-peq {
  height: 1.75rem;
  padding: 0 0.625rem;
  font-size: 0.75rem;
}
.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: var(--content);
}
.seg button {
  border: 0;
  background: none;
  height: 1.5rem;
  padding: 0 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
}
.seg button[aria-pressed='true'] {
  background: var(--card);
  color: var(--text);
  box-shadow:
    0 0 0 1px var(--divider),
    0 1px 2px rgba(26, 26, 25, 0.08);
}
.enlace {
  color: var(--violet-text);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.enlace:hover {
  text-decoration: underline;
}
.fuente {
  font-size: 0.6875rem;
  color: var(--text-3);
}
.s {
  color: var(--text-2);
}

.tarjeta {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 1rem 1.125rem;
  min-width: 0;
}
.tarjeta-cab {
  display: flex;
  align-items: center;
  gap: var(--e3);
  margin-bottom: 0.875rem;
}
.tarjeta-cab h3 {
  font-size: 0.875rem;
  font-weight: 650;
}
.tarjeta-cab .der {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--e3);
}
.tarjeta-pie {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e3);
}
.r2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.r3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.r-53 {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 3fr);
  gap: 1rem;
}
.r-35 {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 5fr);
  gap: 1rem;
}

/* Indicadores */
.kpis {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.75rem;
}
.kpi {
  background: var(--card);
  border: 1px solid var(--divider);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 0.875rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.kpi.ancho {
  grid-column: span 2;
}
.kpi .et {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi .val {
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-top: 0.375rem;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.kpi .val small {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0;
}
.kpi .sub {
  font-size: 0.75rem;
  color: var(--text-2);
  margin-top: 2px;
}
.kpi .fuente {
  margin-top: auto;
  padding-top: 0.625rem;
}
.tres {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  column-gap: 1.5rem;
  margin-top: 0.375rem;
}
.tres div {
  display: flex;
  flex-direction: column;
}
.tres b {
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.tres span {
  font-size: 0.75rem;
  color: var(--text-2);
}
.medio-ok {
  display: inline-flex;
  color: var(--done);
}
.delta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--done);
}
.delta.mal {
  color: var(--fail);
}
.chispa {
  display: block;
  margin-top: 0.5rem;
  height: 26px;
  width: 100%;
}

/* Gráficos */
.graf {
  position: relative;
  width: 100%;
}
.graf svg {
  display: block;
  overflow: visible;
}
.graf .grid {
  stroke: var(--grid);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.graf .base {
  stroke: var(--axis);
  stroke-width: 1;
  shape-rendering: crispEdges;
}
.graf .tick {
  fill: var(--text-2);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.graf .ln {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.graf .area {
  stroke: none;
  opacity: 0.1;
}
.graf .pt {
  stroke: var(--card);
  stroke-width: 2;
}
.graf .fin {
  fill: var(--text);
  font-size: 12px;
  font-weight: 600;
}
.graf .fin tspan.n {
  fill: var(--text-2);
  font-weight: 400;
}
.graf .cruz {
  stroke: var(--axis);
  stroke-width: 1;
}
.c1 {
  stroke: var(--s1);
  fill: var(--s1);
}
.c2 {
  stroke: var(--s2);
  fill: var(--s2);
}
.c3 {
  stroke: var(--s3);
  fill: var(--s3);
}
.graf .ln.c1,
.graf .ln.c2,
.graf .ln.c3 {
  fill: none;
}
.barra-v.c1 {
  fill: var(--s1);
  stroke: none;
}
.barra-v.c2 {
  fill: var(--s2);
  stroke: none;
}
.leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1rem;
  font-size: 0.75rem;
  color: var(--text-2);
}
.leyenda span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.clave-l {
  width: 14px;
  height: 2px;
  border-radius: 2px;
  flex: none;
}
.clave-c {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}
.k1 {
  background: var(--s1);
}
.k2 {
  background: var(--s2);
}
.k3 {
  background: var(--s3);
}
.tip {
  position: fixed;
  z-index: 20;
  pointer-events: none;
  min-width: 9rem;
  padding: 0.5rem 0.625rem;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--divider);
  box-shadow: var(--pop);
  font-size: 0.75rem;
  color: var(--text);
  display: none;
}
.tip b {
  display: block;
  margin-bottom: 4px;
}
.tip .fila-t {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
}
.tip .fila-t span:last-child {
  margin-left: auto;
  padding-left: 1rem;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Barras horizontales */
.barras {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.barras li {
  display: grid;
  grid-template-columns: 9.5rem minmax(0, 1fr) 4.5rem;
  align-items: center;
  gap: 0.75rem;
}
.barras .nom {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
}
.barras .pista {
  height: 14px;
  position: relative;
}
.barras .relleno {
  height: 100%;
  background: var(--s1);
  border-radius: 0 4px 4px 0;
  min-width: 2px;
}
.barras .valor {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.barras .valor small {
  font-weight: 400;
  color: var(--text-2);
  margin-left: 4px;
}

/* Barra segmentada alta */
.segmentada {
  display: flex;
  gap: 2px;
  height: 28px;
}
.segmentada div {
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0b0b0b;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
}
.segmentada.fina {
  height: 8px;
}
.segmentada.fina div {
  border-radius: 999px;
  padding: 0;
}

/* Tablas */
.tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}
.tabla th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-2);
  padding: 0 0.625rem 0.5rem;
  white-space: nowrap;
}
.tabla td {
  white-space: nowrap;
  padding: 0.5625rem 0.625rem;
  border-top: 1px solid var(--divider-soft);
  vertical-align: middle;
}
.tabla th:first-child,
.tabla td:first-child {
  padding-left: 0;
}
.tabla th:last-child,
.tabla td:last-child {
  padding-right: 0;
}
.tabla .d {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tabla td.ajusta {
  white-space: normal;
}
.barras.total .pista {
  background: var(--track);
  border-radius: 0 4px 4px 0;
}
.medidor.red .v {
  grid-column: 2 / 4;
}
.tabla tr.atenuada td {
  color: var(--text-2);
}
.msg {
  max-width: 26rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 0.75rem;
}

/* Mapa de calor */
.calor {
  border-collapse: separate;
  border-spacing: 2px;
  width: 100%;
}
.calor th {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-2);
  padding: 0 0.5rem 0.25rem;
  text-align: center;
  white-space: nowrap;
}
.calor th.f {
  text-align: left;
  padding-left: 0;
  font-size: 0.75rem;
  color: var(--text);
  font-weight: 500;
}
.calor td {
  height: 34px;
  border-radius: 4px;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--neutral-bg);
  color: var(--text-2);
}
.calor td.v1 {
  background: var(--q1);
  color: var(--text);
}
.calor td.v2 {
  background: var(--q2);
  color: #0b0b0b;
}
.calor td.v3 {
  background: var(--q3);
  color: #0b0b0b;
}
.calor td.v4 {
  background: var(--q4);
  color: #0b0b0b;
}
.calor td.v5 {
  background: var(--q5);
  color: #fff;
}
@media (prefers-color-scheme: dark) {
  :root:not(.claro) .calor td.v1,
  :root:not(.claro) .calor td.v2,
  :root:not(.claro) .calor td.v3 {
    color: #fff;
  }
  :root:not(.claro) .calor td.v5 {
    color: #0b0b0b;
  }
}
.escala {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  color: var(--text-2);
}
.escala i {
  width: 18px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

/* Medidores */
.medidor {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) 7.5rem;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.75rem;
}
.medidor + .medidor {
  margin-top: 0.5rem;
}
.medidor .et-m {
  color: var(--text-2);
}
.medidor .pista {
  height: 8px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}
.medidor .relleno {
  height: 100%;
  border-radius: 999px;
  background: var(--s1);
}
.medidor .v {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.medidor .v small {
  font-weight: 400;
  color: var(--text-2);
}

/* Franja de disponibilidad */
.franja {
  display: grid;
  grid-template-columns: repeat(30, minmax(0, 1fr));
  gap: 2px;
  height: 22px;
}
.franja i {
  border-radius: 2px;
  background: var(--mark-ok);
  opacity: 0.4;
}
.franja i.m {
  background: var(--mark-mal);
  opacity: 1;
}
.servicio-cab {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-bottom: 0.875rem;
}
.servicio-cab h3 {
  font-size: 0.875rem;
  font-weight: 650;
}
.servicio-cab p {
  font-size: 0.75rem;
  color: var(--text-2);
}
.servicio-cab .chip {
  margin-left: auto;
}
.datos-s {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.875rem;
}
.datos-s div {
  background: var(--content);
  border: 1px solid var(--border-inner);
  border-radius: 8px;
  padding: 0.4375rem 0.625rem;
}
.datos-s span {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-2);
}
.datos-s b {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}
.separa {
  border-top: 1px solid var(--divider-soft);
  margin: 0.875rem 0;
}

/* Árbol de invitaciones */
.arbol {
  font-size: 0.8125rem;
}
.arbol ul {
  margin-left: 0.875rem;
  padding-left: 1rem;
  border-left: 1px solid var(--divider);
}
.arbol li {
  position: relative;
  padding: 0.1875rem 0;
}
.arbol ul > li::before {
  content: '';
  position: absolute;
  left: -1rem;
  top: 1.0625rem;
  width: 0.75rem;
  border-top: 1px solid var(--divider);
}
.arbol ul > li:last-child::after {
  content: '';
  position: absolute;
  left: -1.0625rem;
  top: 1.125rem;
  bottom: 0;
  width: 3px;
  background: var(--card);
}
.nodo-a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  border-radius: 7px;
  border: 1px solid var(--border-inner);
  background: var(--content);
}
.nodo-a.raiz {
  background: var(--violet-bg);
  border-color: var(--violet-line);
  color: var(--violet-text);
  font-weight: 600;
}
.nodo-a .s {
  font-size: 0.75rem;
}
.avatar {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 999px;
  background: var(--neutral-bg);
  border: 1px solid var(--divider);
  display: inline-grid;
  place-items: center;
  font-size: 0.5625rem;
  font-weight: 700;
  color: var(--text-2);
  flex: none;
}
.mas-ramas {
  color: var(--text-2);
  font-size: 0.75rem;
  padding-left: 0.25rem;
}

/* Bandas y estados */
.banda {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border-radius: 10px;
  font-size: 0.8125rem;
}
.banda svg.ico {
  margin-top: 1px;
}
.banda.mal {
  background: var(--fail-bg);
  color: var(--text);
}
.banda.mal > svg.ico {
  color: var(--fail);
}
.banda.aviso {
  background: var(--wait-bg);
  color: var(--text);
}
.banda.aviso > svg.ico {
  color: var(--wait-dot);
}
.banda.info {
  background: var(--violet-bg);
  color: var(--text);
}
.banda.info > svg.ico {
  color: var(--violet);
}
.banda .b {
  margin-left: auto;
  flex: none;
}
.nota {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  background: var(--content);
  border: 1px solid var(--border-inner);
  font-size: 0.75rem;
  color: var(--text-2);
}
.nota svg.ico {
  color: var(--text-3);
  margin-top: 1px;
}
.vacio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.375rem;
  padding: 1.5rem 1rem;
  border: 1px dashed var(--divider);
  border-radius: 10px;
  color: var(--text-2);
  font-size: 0.8125rem;
}
.vacio strong {
  color: var(--text);
}
.vacio svg.ico {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-3);
}
.viejo {
  color: var(--text-3);
}

/* ---------- Acceso ---------- */
.acceso-fondo {
  min-height: 100vh;
  padding: 1rem;
  background: var(--ground);
  display: grid;
  place-items: center;
  position: relative;
  color: var(--text);
}
.acceso {
  width: 24rem;
  background: var(--sheet);
  border: 1px solid var(--divider);
  border-radius: 16px;
  box-shadow: var(--shadow-sheet);
  padding: 1.75rem 1.75rem 1.5rem;
}
.acceso .marca {
  padding: 0;
  margin-bottom: 1.25rem;
}
.acceso h2 {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.acceso > p.s {
  margin-top: 2px;
  margin-bottom: 1.25rem;
}
.campo {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.875rem;
}
.campo label {
  font-size: 0.75rem;
  font-weight: 600;
}
.entrada {
  height: 2.375rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: var(--sheet);
  font-size: 0.875rem;
}
.entrada input {
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  color: inherit;
  flex: 1;
  min-width: 0;
}
.entrada.fija {
  background: var(--content);
  color: var(--text-2);
}
.entrada.foco {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-bg);
}
.entrada.error {
  border-color: var(--fail);
  box-shadow: 0 0 0 3px var(--fail-bg);
}
.entrada.apagada {
  background: var(--content);
  opacity: 0.6;
}
.ayuda {
  font-size: 0.75rem;
  color: var(--text-2);
}
.ayuda.mal {
  color: var(--fail);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.acceso .b-pri {
  width: 100%;
  justify-content: center;
  height: 2.375rem;
  margin-top: 0.25rem;
}
.acceso-pie {
  margin-top: 1rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--divider-soft);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-2);
}
.acceso .banda {
  margin-bottom: 1rem;
}
.ultima {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  color: var(--wait-text);
  font-weight: 600;
}

/* ---------- Teléfono ---------- */
.tel-barra {
  height: 3.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  background: var(--sheet);
  border-bottom: 1px solid var(--divider-soft);
  font-weight: 700;
}
.tel-barra .b {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  justify-content: center;
}
.tel-tit {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.tel-tit h1 {
  font-size: 1.25rem;
  font-weight: 650;
}

/* ---------- Panel: lo que la maqueta resolvia con `style` en linea ---------- */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.mt-3 {
  margin-top: 0.75rem;
}
.mt-25 {
  margin-top: 0.625rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-15 {
  margin-bottom: 0.375rem;
}
.columna {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.kpis.cinco {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.pista-seg {
  background: var(--track);
}
.escala i.q0 {
  background: var(--neutral-bg);
}
.escala i.q1 {
  background: var(--q1);
}
.escala i.q2 {
  background: var(--q2);
}
.escala i.q3 {
  background: var(--q3);
}
.escala i.q4 {
  background: var(--q4);
}
.escala i.q5 {
  background: var(--q5);
}
.medio-mal {
  display: inline-flex;
  color: var(--fail);
}
.leyenda-franja {
  margin-top: -0.25rem;
}
.franja-ok {
  background: var(--mark-ok);
  opacity: 0.4;
}
.franja-mal {
  background: var(--mark-mal);
}
svg.ico.ok {
  color: var(--done);
}
svg.ico.mal {
  color: var(--fail);
}
.vacio.bien svg.ico {
  color: var(--done);
}
.tendencia-vacia .vacio {
  min-height: 9.5rem;
}
svg.columnas {
  display: block;
}
.columnas .col {
  fill: var(--text-3);
  opacity: 0.45;
}
.columnas .col-cero {
  fill: var(--text-3);
  opacity: 0.2;
}
.columnas .col-ultima {
  fill: var(--s1);
}
.chispa path {
  fill: none;
  stroke: var(--text-3);
  stroke-width: 1.5;
  stroke-linejoin: round;
  opacity: 0.55;
}
.chispa circle {
  fill: var(--s1);
  stroke: var(--card);
  stroke-width: 1.5;
}
.lateral {
  position: sticky;
  top: 0;
  height: 100vh;
}
.hoja {
  min-height: calc(100vh - 16px);
}
.cuerpo {
  min-width: 0;
}
.seg a {
  display: inline-flex;
  align-items: center;
  height: 1.5rem;
  padding: 0 0.625rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.seg a[aria-pressed='true'] {
  background: var(--card);
  color: var(--text);
  box-shadow:
    0 0 0 1px var(--divider),
    0 1px 2px rgba(26, 26, 25, 0.08);
}
a.b {
  justify-content: center;
}
.sesion form {
  margin: 0;
}
.entrada:focus-within {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-bg);
}
.entrada.error,
.entrada.error:focus-within {
  border-color: var(--fail);
  box-shadow: 0 0 0 3px var(--fail-bg);
}
.entrada.fija:focus-within {
  border-color: var(--border-control);
  box-shadow: none;
}
.ver-tabla summary {
  cursor: pointer;
  list-style: none;
}
.ver-tabla summary::-webkit-details-marker {
  display: none;
}
.tarjeta-pie:has(.ver-tabla[open]) {
  flex-wrap: wrap;
}
.ver-tabla[open] {
  flex-basis: 100%;
}
.ver-tabla[open] summary {
  margin-bottom: 0.5rem;
}

.barras .relleno,
.medidor .relleno {
  display: block;
}

/* Menu del telefono */
.tel-barra,
.tel-tit,
.solo-tel {
  display: none;
}
.menu-tel {
  margin-left: auto;
  position: relative;
}
.menu-tel summary {
  list-style: none;
}
.menu-tel summary::-webkit-details-marker {
  display: none;
}
.menu-tel-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  width: 16rem;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--sheet);
  border: 1px solid var(--divider);
  border-radius: 12px;
  box-shadow: var(--pop);
  font-weight: 400;
  z-index: 10;
}

/* Anchos intermedios: la maqueta esta a 1440; por debajo las filas se reacomodan */
@media (max-width: 1200px) {
  .kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .kpis.cinco {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .r3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .r-53,
  .r-35 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Telefono (cuadro 8): menu arriba, cifras de a dos, tablas en tarjetas ---------- */
@media (max-width: 760px) {
  .ventana {
    display: block;
  }
  .lateral,
  .hoja-cab,
  .solo-escritorio,
  .solo-escritorio-bloque,
  .kpi .chispa {
    display: none;
  }
  .solo-tel {
    display: inline;
  }
  section.solo-tel {
    display: block;
  }
  .tel-barra {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 5;
  }
  .tel-tit {
    display: flex;
    padding: 1rem 1rem 0;
  }
  .hoja {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: var(--content);
    min-height: calc(100vh - 3.25rem);
  }
  .cuerpo {
    padding: 0.75rem 1rem 1.5rem;
    gap: 0.75rem;
  }
  .kpis,
  .kpis.cinco {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
  }
  .kpi.ancho,
  .kpi.ancho-tel {
    grid-column: span 2;
  }
  .kpi.primero-tel {
    order: -1;
  }
  .kpi.servidor-kpi .val {
    font-size: 1.125rem;
  }
  .ver-tabla {
    display: none;
  }
  .r2,
  .r3,
  .r-53,
  .r-35 {
    grid-template-columns: minmax(0, 1fr);
  }
  .tarjeta {
    padding: 0.875rem;
  }
  .tarjeta-cab {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
  .tendencia-cab .leyenda {
    order: 3;
    flex-basis: 100%;
  }
  .barras li {
    grid-template-columns: 7rem minmax(0, 1fr) 4rem;
  }
  .barras .nom {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .tabla.apilable thead {
    display: none;
  }
  .tabla.apilable tr {
    display: block;
    padding: 0.5rem 0;
    border-top: 1px solid var(--divider-soft);
  }
  .tabla.apilable td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.125rem 0;
    border-top: 0;
    white-space: normal;
    text-align: right;
  }
  .tabla.apilable td[data-et]::before {
    content: attr(data-et);
    color: var(--text-2);
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    text-align: left;
  }
  .msg {
    max-width: 14rem;
  }
  .datos-s {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .arbol ul {
    margin-left: 0.5rem;
    padding-left: 0.75rem;
  }
  .nodo-a {
    height: auto;
    min-height: 1.75rem;
    flex-wrap: wrap;
  }
}

.a0{width:0%}
.g0{flex:0 1 0}
.a1{width:1%}
.g1{flex:1 1 0}
.a2{width:2%}
.g2{flex:2 1 0}
.a3{width:3%}
.g3{flex:3 1 0}
.a4{width:4%}
.g4{flex:4 1 0}
.a5{width:5%}
.g5{flex:5 1 0}
.a6{width:6%}
.g6{flex:6 1 0}
.a7{width:7%}
.g7{flex:7 1 0}
.a8{width:8%}
.g8{flex:8 1 0}
.a9{width:9%}
.g9{flex:9 1 0}
.a10{width:10%}
.g10{flex:10 1 0}
.a11{width:11%}
.g11{flex:11 1 0}
.a12{width:12%}
.g12{flex:12 1 0}
.a13{width:13%}
.g13{flex:13 1 0}
.a14{width:14%}
.g14{flex:14 1 0}
.a15{width:15%}
.g15{flex:15 1 0}
.a16{width:16%}
.g16{flex:16 1 0}
.a17{width:17%}
.g17{flex:17 1 0}
.a18{width:18%}
.g18{flex:18 1 0}
.a19{width:19%}
.g19{flex:19 1 0}
.a20{width:20%}
.g20{flex:20 1 0}
.a21{width:21%}
.g21{flex:21 1 0}
.a22{width:22%}
.g22{flex:22 1 0}
.a23{width:23%}
.g23{flex:23 1 0}
.a24{width:24%}
.g24{flex:24 1 0}
.a25{width:25%}
.g25{flex:25 1 0}
.a26{width:26%}
.g26{flex:26 1 0}
.a27{width:27%}
.g27{flex:27 1 0}
.a28{width:28%}
.g28{flex:28 1 0}
.a29{width:29%}
.g29{flex:29 1 0}
.a30{width:30%}
.g30{flex:30 1 0}
.a31{width:31%}
.g31{flex:31 1 0}
.a32{width:32%}
.g32{flex:32 1 0}
.a33{width:33%}
.g33{flex:33 1 0}
.a34{width:34%}
.g34{flex:34 1 0}
.a35{width:35%}
.g35{flex:35 1 0}
.a36{width:36%}
.g36{flex:36 1 0}
.a37{width:37%}
.g37{flex:37 1 0}
.a38{width:38%}
.g38{flex:38 1 0}
.a39{width:39%}
.g39{flex:39 1 0}
.a40{width:40%}
.g40{flex:40 1 0}
.a41{width:41%}
.g41{flex:41 1 0}
.a42{width:42%}
.g42{flex:42 1 0}
.a43{width:43%}
.g43{flex:43 1 0}
.a44{width:44%}
.g44{flex:44 1 0}
.a45{width:45%}
.g45{flex:45 1 0}
.a46{width:46%}
.g46{flex:46 1 0}
.a47{width:47%}
.g47{flex:47 1 0}
.a48{width:48%}
.g48{flex:48 1 0}
.a49{width:49%}
.g49{flex:49 1 0}
.a50{width:50%}
.g50{flex:50 1 0}
.a51{width:51%}
.g51{flex:51 1 0}
.a52{width:52%}
.g52{flex:52 1 0}
.a53{width:53%}
.g53{flex:53 1 0}
.a54{width:54%}
.g54{flex:54 1 0}
.a55{width:55%}
.g55{flex:55 1 0}
.a56{width:56%}
.g56{flex:56 1 0}
.a57{width:57%}
.g57{flex:57 1 0}
.a58{width:58%}
.g58{flex:58 1 0}
.a59{width:59%}
.g59{flex:59 1 0}
.a60{width:60%}
.g60{flex:60 1 0}
.a61{width:61%}
.g61{flex:61 1 0}
.a62{width:62%}
.g62{flex:62 1 0}
.a63{width:63%}
.g63{flex:63 1 0}
.a64{width:64%}
.g64{flex:64 1 0}
.a65{width:65%}
.g65{flex:65 1 0}
.a66{width:66%}
.g66{flex:66 1 0}
.a67{width:67%}
.g67{flex:67 1 0}
.a68{width:68%}
.g68{flex:68 1 0}
.a69{width:69%}
.g69{flex:69 1 0}
.a70{width:70%}
.g70{flex:70 1 0}
.a71{width:71%}
.g71{flex:71 1 0}
.a72{width:72%}
.g72{flex:72 1 0}
.a73{width:73%}
.g73{flex:73 1 0}
.a74{width:74%}
.g74{flex:74 1 0}
.a75{width:75%}
.g75{flex:75 1 0}
.a76{width:76%}
.g76{flex:76 1 0}
.a77{width:77%}
.g77{flex:77 1 0}
.a78{width:78%}
.g78{flex:78 1 0}
.a79{width:79%}
.g79{flex:79 1 0}
.a80{width:80%}
.g80{flex:80 1 0}
.a81{width:81%}
.g81{flex:81 1 0}
.a82{width:82%}
.g82{flex:82 1 0}
.a83{width:83%}
.g83{flex:83 1 0}
.a84{width:84%}
.g84{flex:84 1 0}
.a85{width:85%}
.g85{flex:85 1 0}
.a86{width:86%}
.g86{flex:86 1 0}
.a87{width:87%}
.g87{flex:87 1 0}
.a88{width:88%}
.g88{flex:88 1 0}
.a89{width:89%}
.g89{flex:89 1 0}
.a90{width:90%}
.g90{flex:90 1 0}
.a91{width:91%}
.g91{flex:91 1 0}
.a92{width:92%}
.g92{flex:92 1 0}
.a93{width:93%}
.g93{flex:93 1 0}
.a94{width:94%}
.g94{flex:94 1 0}
.a95{width:95%}
.g95{flex:95 1 0}
.a96{width:96%}
.g96{flex:96 1 0}
.a97{width:97%}
.g97{flex:97 1 0}
.a98{width:98%}
.g98{flex:98 1 0}
.a99{width:99%}
.g99{flex:99 1 0}
.a100{width:100%}
.g100{flex:100 1 0}
