/* Estilos de tablero. Usar SOLO los tokens de estilo.css (colores, radios, sombras). */

.tb { position: relative; container-type: inline-size; container-name: tablero; }
.tb-encabezado { align-items: flex-end; }
.tb-vivo { background: var(--ok-suave); padding: var(--e-1) var(--e-3); border-radius: var(--pildora); min-height: 28px; }
.tb-vivo.caido { background: var(--relleno); }

/* ---------- superficie de tarjeta ---------- */
.tb-tarjeta {
  background: var(--superficie); border: 0; border-radius: var(--radio); box-shadow: var(--sombra);
  padding: var(--e-5); min-width: 0;
}
@container tablero (min-width: 700px) { .tb-tarjeta { padding: var(--e-6); } }
.tb-cabeza { display: flex; align-items: center; justify-content: space-between; gap: var(--e-2); min-height: 28px; }
.tb-rotulo { display: block; color: var(--texto-2); font-size: var(--t-s); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-derecha { text-align: right; }
.tb-tenue { color: var(--texto-2); font-weight: 400; }
.tb-tarjeta-cabeza { display: flex; align-items: baseline; justify-content: space-between; gap: var(--e-3); margin-bottom: var(--e-4); }
.tb-tarjeta-cabeza h3 { margin: 0; }

/* ---------- alertas: banda discreta arriba ---------- */
.tb-alertas { display: grid; gap: var(--e-2); margin-bottom: var(--e-4); }
.tb-alerta { align-items: center; padding: var(--e-3) var(--e-3) var(--e-3) var(--e-4); border-radius: var(--radio-s);
  box-shadow: inset 0 0 0 .5px var(--separador); }
.tb-alerta > .ico { margin-top: 0; }
.tb-alerta-texto { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tb-alerta-texto b { font-weight: 600; font-size: var(--t-m); overflow-wrap: anywhere; }
.tb-alerta-meta { font-size: var(--t-s); color: var(--texto-2); font-weight: 400; }
.tb-alerta-btn { flex: none; background: var(--superficie); }

/* ---------- cifras ---------- */
.tb-cifras { display: grid; gap: var(--e-3); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tb-heroe { grid-column: 1 / -1; display: flex; flex-direction: column; }
@container tablero (min-width: 820px) {
  .tb-cifras { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: var(--e-4); }
  .tb-heroe { grid-column: auto; }
}
.tb-heroe-cifra {
  display: block; font-size: var(--t-enorme); font-weight: 700; letter-spacing: -.04em; line-height: 1;
  font-variant-numeric: tabular-nums; margin-top: var(--e-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-heroe-nota { margin-top: auto; padding-top: var(--e-4); color: var(--texto-2); font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.tb-heroe-nota .moneda { font-size: 1em; vertical-align: baseline; margin: 0; color: inherit; font-weight: inherit; }
.tb-delta {
  display: inline-flex; align-items: center; gap: var(--e-1); padding: 2px var(--e-2) 2px var(--e-2); border-radius: var(--pildora);
  font-size: var(--t-xs); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tb-delta.sube { background: var(--ok-suave); color: var(--ok); }
.tb-delta.baja { background: var(--peligro-suave); color: var(--peligro); }
.tb-delta-de { font-weight: 550; opacity: .85; }

.tb-mini { display: flex; flex-direction: column; }
.tb-mini-ico {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--relleno); color: var(--texto-2);
}
.tb-mini-ico .ico { width: 18px; height: 18px; }
.tb-mini-cifra {
  display: block; font-size: var(--t-cifra); font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
  font-variant-numeric: tabular-nums; margin-top: var(--e-3); white-space: nowrap;
}
.tb-mini-nota { display: block; margin-top: auto; padding-top: var(--e-2); font-size: var(--t-s); color: var(--texto-2); font-variant-numeric: tabular-nums; }
.tb-mini-nota .moneda, .tb-pct .moneda { font-size: 1em; vertical-align: baseline; margin: 0; color: inherit; font-weight: inherit; }
.tb-medidor { height: 4px; margin-top: var(--e-3); }
.tb-mini .tb-medidor + .tb-mini-nota { margin-top: 0; padding-top: var(--e-2); }

/* angosto (teléfono): cifras secundarias compactas, tres en una fila */
@container tablero (max-width: 560px) {
  .tb-cifras { gap: var(--e-2); }
  .tb-heroe { padding: var(--e-5); }
  .tb-heroe-cifra { font-size: calc(var(--t-enorme) * .8); margin-top: var(--e-3); }
  .tb-mini { padding: var(--e-3) var(--e-3) var(--e-4); border-radius: var(--radio-s); }
  .tb-mini-ico { display: none; }
  .tb-cabeza { min-height: 0; }
  .tb-rotulo { font-size: var(--t-xs); }
  .tb-mini-cifra { font-size: var(--t-xl); margin-top: var(--e-1); }
  .tb-mini-cifra .cifra-de { font-size: var(--t-s); }
  .tb-mini-nota { font-size: var(--t-xs); line-height: 1.35; }
}

/* ---------- parqueos ---------- */
.tb-seccion > h2 { margin-bottom: var(--e-3); }
.tb-parqueos { display: grid; gap: var(--e-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
@container tablero (min-width: 700px) { .tb-parqueos { gap: var(--e-4); } }
.tb-parqueo {
  display: grid; gap: var(--e-3); text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%;
  transition: transform var(--rapido) var(--curva), box-shadow var(--rapido) var(--curva);
}
.tb-parqueo:hover { box-shadow: var(--sombra), inset 0 0 0 1.5px var(--acento); }
.tb-parqueo:active { transform: scale(.99); }
.tb-parqueo:focus-visible { outline: none; box-shadow: var(--anillo); }
.tb-parqueo-cabeza { display: flex; align-items: center; justify-content: space-between; gap: var(--e-2); }
.tb-parqueo-nombre { display: flex; align-items: center; gap: var(--e-2); min-width: 0; }
.tb-parqueo-nombre b { font-size: var(--t-l); font-weight: 650; letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-estado { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-s); font-weight: 600; white-space: nowrap; }
.tb-estado.ok { color: var(--ok); }
.tb-estado.peligro { color: var(--peligro); }
.tb-parqueo-datos { display: flex; justify-content: space-between; gap: var(--e-4); margin-top: var(--e-1); }
.tb-parqueo-cifra { display: block; font-size: var(--t-xl); font-weight: 700; letter-spacing: -.025em; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.tb-parqueo-cifra .cifra-de { font-size: var(--t-m); }
.tb-parqueo .tb-medidor { margin-top: 0; }
.tb-parqueo-pie {
  display: flex; align-items: center; justify-content: space-between; gap: var(--e-2);
  padding-top: var(--e-3); border-top: .5px solid var(--separador); font-size: var(--t-s); color: var(--texto-2);
}
.tb-parqueo-resumen { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-parqueo-ver { display: inline-flex; align-items: center; gap: 2px; color: var(--acento); font-weight: 600; white-space: nowrap; }

/* ---------- gráficos ---------- */
.tb-graficos { display: grid; gap: var(--e-3); margin-top: var(--e-4); }
@container tablero (min-width: 820px) { .tb-graficos { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--e-4); } }
.tb-grafico-tarjeta { display: flex; flex-direction: column; }
.tb-grafico-cabeza { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--e-3); }
.tb-grafico-cabeza h3 { margin: 0; }
.tb-grafico-sub { display: block; color: var(--texto-2); font-size: var(--t-s); margin-top: 2px; }
.tb-pico { text-align: right; flex: none; }
.tb-pico .tb-rotulo { font-size: var(--t-xs); }
.tb-pico b { display: block; font-size: var(--t-l); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tb-pico .moneda, .tb-grafico-pie .moneda { font-size: .7em; vertical-align: .08em; }
.tb-grafico { margin-top: auto; padding-top: var(--e-5); min-height: 200px; width: 100%; }
.tb-grafico-pie { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--e-4); margin-top: var(--e-4); padding-top: var(--e-4); border-top: .5px solid var(--separador); }
.tb-grafico-pie > div { min-width: 0; }
.tb-grafico-pie b { display: block; font-size: var(--t-xl); font-weight: 700; letter-spacing: -.025em; line-height: 1.2; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.tb-svg { display: block; overflow: visible; }
.tb-barra { fill: var(--acento); fill-opacity: .38; transition: fill-opacity var(--rapido) var(--curva); }
.tb-barra.pico { fill-opacity: 1; }
.tb-barra-cero { fill: var(--relleno-hover); }
.tb-zona { fill: transparent; }
.tb-col { cursor: default; outline: none; }
.tb-col:hover .tb-barra, .tb-col.tb-columna-activa .tb-barra { fill-opacity: .85; }
.tb-col:hover .tb-barra.pico, .tb-col.tb-columna-activa .tb-barra.pico { fill-opacity: 1; }
.tb-col.tb-columna-activa .tb-zona { fill: var(--relleno); }
.tb-rejilla { stroke: var(--separador); stroke-width: .5; }
.tb-base { stroke: var(--separador); stroke-width: 1; }
.tb-eje { fill: var(--texto-2); font-size: var(--t-xs); font-weight: 500; font-family: var(--fuente); font-variant-numeric: tabular-nums; }
.tb-eje.actual { fill: var(--texto); font-weight: 650; }
.tb-eje.fuerte { fill: var(--acento); font-weight: 700; }
.tb-grafico-vacio { position: relative; }
.tb-grafico-vacio > span {
  position: absolute; inset: 0 0 var(--e-6) 0; display: grid; place-items: center; text-align: center;
  color: var(--texto-2); font-size: var(--t-m);
}

/* globo de detalle (valor primero, contexto después) */
.tb-globo {
  display: grid; gap: 2px; text-align: left; border-radius: var(--radio-s); padding: var(--e-2) var(--e-3);
  transition: left var(--rapido) var(--curva), top var(--rapido) var(--curva);
}
.tb-globo b { font-size: var(--t-m); font-weight: 700; letter-spacing: -.01em; }
.tb-globo span { font-size: var(--t-xs); font-weight: 500; opacity: .8; }

/* ---------- abajo: formas de pago + teléfonos | movimientos ---------- */
.tb-abajo { display: grid; gap: var(--e-3); margin-top: var(--e-4); align-items: start; }
.tb-columna { display: grid; gap: var(--e-3); min-width: 0; }
@container tablero (min-width: 700px) { .tb-abajo, .tb-columna { gap: var(--e-4); } }
@container tablero (min-width: 880px) { .tb-abajo { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }

.tb-metodos { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e-4); }
.tb-metodo { display: flex; gap: var(--e-3); align-items: center; }
.tb-metodo-ico {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: var(--acento-suave); color: var(--acento);
}
.tb-metodo-ico .ico { width: 18px; height: 18px; }
.tb-metodo-cuerpo { flex: 1; min-width: 0; display: grid; gap: var(--e-2); }
.tb-metodo-fila { display: flex; justify-content: space-between; align-items: baseline; gap: var(--e-2); font-size: var(--t-m); }
.tb-metodo-fila > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-metodo-fila .tb-tenue { font-size: var(--t-s); }
.tb-metodo-monto { display: inline-flex; align-items: baseline; gap: var(--e-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-pct { display: inline-block; min-width: 4ch; text-align: right; color: var(--texto-2); font-size: var(--t-s); font-weight: 550; }
.tb-metodo .tb-medidor { margin: 0; height: 4px; }
.tb-metodo-monto .moneda, .tb-mov-monto .moneda, .tb-parqueo-cifra .moneda { font-size: .72em; vertical-align: .08em; }

.tb-contador { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-s); font-weight: 600; color: var(--texto-2); white-space: nowrap; }
.tb-contador.ok { color: var(--ok); }
.tb-contador.peligro { color: var(--peligro); }
.tb-grupo { list-style: none; margin: 0; padding: 0; background: var(--superficie-2); border-radius: var(--radio-s); overflow: hidden; }
.tb-tel { display: flex; align-items: center; gap: var(--e-3); padding: var(--e-3) var(--e-4); min-height: 56px; position: relative; }
.tb-tel + .tb-tel::before { content: ""; position: absolute; top: 0; left: calc(var(--e-4) + 8px + var(--e-3)); right: 0; border-top: .5px solid var(--separador); }
.tb-tel-cuerpo { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tb-tel-nombre { display: flex; align-items: center; gap: var(--e-2); min-width: 0; }
.tb-tel-nombre b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-tel-meta { font-size: var(--t-s); color: var(--texto-2); }
.tb-tel-meta .texto-ok, .tb-tel-meta .texto-peligro { font-weight: 600; }
.tb-tel-avisos { display: flex; flex-direction: column; align-items: flex-end; gap: var(--e-1); flex: none; }
.tb-etq-aviso { background: var(--aviso-suave); color: var(--aviso); }
.tb-etq-aviso .ico { width: 12px; height: 12px; }

.tb-vacio-chico { display: flex; align-items: center; gap: var(--e-3); padding: var(--e-4); background: var(--superficie-2); border-radius: var(--radio-s); color: var(--texto-2); font-size: var(--t-m); }
.tb-vacio-chico > .ico { color: var(--texto-3); flex: none; }

/* ---------- últimos movimientos ---------- */
.tb-movs-cabeza { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e-3); margin-bottom: var(--e-2); }
.tb-movs-titulo { display: flex; align-items: center; gap: var(--e-2); }
.tb-movs-titulo h3 { margin: 0; }
.tb-historial { gap: 2px; padding: 0 var(--e-2); }
.tb-segmentos button { min-width: 76px; }
@container tablero (max-width: 560px) {
  .tb-movs-titulo { width: 100%; justify-content: space-between; }
  .tb-segmentos { width: 100%; }
}
.tb-lista-movs { list-style: none; margin: 0; padding: 0; }
.tb-mov { display: flex; align-items: center; gap: var(--e-3); padding: var(--e-3) 0; min-height: 60px; border-bottom: .5px solid var(--separador); }
.tb-mov:last-child { border-bottom: 0; }
.tb-placa {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-width: 104px; justify-content: center;
  padding: 6px var(--e-3); border-radius: var(--radio-xs); background: var(--superficie-2); box-shadow: inset 0 0 0 .5px var(--separador);
  font-family: var(--placa); font-feature-settings: var(--rasgos-placa); font-weight: 700; font-size: var(--t-m); letter-spacing: .04em; color: var(--texto);
}
.tb-placa .ico { color: var(--texto-2); }
.tb-mov-cuerpo { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tb-mov-l1 { display: flex; align-items: center; gap: var(--e-2); min-width: 0; }
.tb-mov-origen { font-size: var(--t-m); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tb-mov-l2 { font-size: var(--t-s); color: var(--texto-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tb-mov-der { display: grid; justify-items: end; gap: 2px; flex: none; text-align: right; }
.tb-mov-monto { font-weight: 700; font-size: var(--t-base); letter-spacing: -.015em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-mov-hora { font-size: var(--t-s); color: var(--texto-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-vacio { padding: var(--e-7) var(--e-4); }
@container tablero (max-width: 560px) {
  .tb-placa { min-width: 0; padding: var(--e-1) var(--e-2); font-size: var(--t-s); }
  .tb-placa .ico { display: none; }
  .tb-mov { gap: var(--e-2); }
  .tb-mov-origen { font-size: var(--t-s); }
  .tb-mov-l2, .tb-mov-hora { font-size: var(--t-xs); }
  .tb-mov-monto { font-size: var(--t-m); }
  .tb-alerta { flex-wrap: wrap; align-items: flex-start; }
  .tb-alerta-texto { flex-basis: calc(100% - 32px); }
  .tb-alerta-btn { margin-left: auto; }
}

/* globo invertido: oscuro en modo claro, claro en modo oscuro (se distingue de la tarjeta) */
.tb .tb-globo { background: var(--texto); color: var(--fondo); box-shadow: var(--sombra-l); }
:root[data-tema="oscuro"] .tb-barra { fill-opacity: .5; }
