/* —设计 system de santri.es: paleta neutra profesional con acento esmeralda — */
:root {
  --c1: #d62728;
  --c2: #1f77b4;
  --c3: #2ca02c;
  --c4: #9467bd;

  --bg: #eef1f5;
  --panel: #ffffff;
  --ink: #14202e;
  --mut: #64748b;
  --line: #d9e0e8;
  --line-soft: #e8edf2;

  --top: #101c2c;
  --top2: #17273c;

  --acc: #0f8a5f;
  --acc-hov: #0c714f;
  --acc-suave: #e6f5ee;
  --azul: #1f4e79;
  --azul-suave: #e9f1f9;
  --amber: #9a6700;
  --amber-suave: #fdf3d7;
  --amber-line: #e3c56b;
  --rojo: #b3261e;
  --rojo-suave: #fdeceb;
  --morado: #6b4fa1;
  --morado-suave: #f0ebfa;

  --sombra: 0 1px 2px rgba(15, 30, 46, .06), 0 4px 16px rgba(15, 30, 46, .07);
  --radio: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  background:
    radial-gradient(1100px 320px at 80% -80px, #dfe9f3 0%, transparent 70%),
    var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}

/* — Barra superior — */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, var(--top) 0%, var(--top2) 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(8, 16, 26, .35);
}
.topwrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  flex-wrap: wrap;
}
.marca {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .18em;
  font-size: 21px;
}
.marca .logo {
  align-self: center;
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: linear-gradient(135deg, #17b978, #0e8a5f);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}
.marca small {
  font-weight: 400;
  color: #8fa3ba;
  letter-spacing: .02em;
  font-size: 12px;
}

nav.menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}
nav.menu > a, .menu-det > summary {
  color: #c3d0de;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 8px;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}
nav.menu > a:hover, .menu-det:hover > summary { background: rgba(255, 255, 255, .09); color: #fff; }
nav.menu > a.activo { background: var(--acc); color: #fff; }
.sep {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, .16);
  margin: 0 6px;
}
.menu-det { position: relative; }
.menu-det summary::-webkit-details-marker { display: none; }
.menu-det summary::after { content: "▾"; margin-left: 6px; font-size: 10px; color: #8fa3ba; }
.menu-det > .menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 190px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--sombra);
  padding: 6px;
  display: grid;
  gap: 2px;
}
.menu-det > .menu-panel a {
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
}
.menu-det > .menu-panel a:hover { background: var(--bg); }
.menu-det > .menu-panel a.activo { color: var(--acc); background: var(--acc-suave); }

.usuario-chip {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.usuario-chip .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #22374f;
  color: #cfe8dd;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.usuario-chip .nom { font-size: 12.5px; font-weight: 600; color: #dbe4ee; }
.btn-salir {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .28);
  color: #dbe4ee;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-salir:hover { background: rgba(255, 255, 255, .12); color: #fff; }

/* — Contenido — */
main { max-width: 1240px; margin: 0 auto; padding: 30px 22px 70px; }

.page-head { margin: 4px 0 22px; }
.page-head .eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
  font-weight: 700;
  color: var(--acc);
  margin-bottom: 6px;
}
h1 { margin: 0; font-size: 27px; letter-spacing: -.01em; }
h2 {
  margin: 30px 0 10px;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
h2::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--acc);
  flex: none;
}
.sub { color: var(--mut); font-size: 13.5px; margin: 6px 0 0; }
code {
  background: #e8edf3;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12.5px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

/* — Tarjetas y KPIs — */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  transition: transform .12s, box-shadow .12s;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(15, 30, 46, .12); }
.card-link { display: block; padding: 16px 18px; text-decoration: none; color: inherit; }
.card-titulo { font-size: 19px; font-weight: 700; }
.card[data-slug="primero-1"] .card-titulo { color: var(--c1); }
.card[data-slug="primero-2"] .card-titulo { color: var(--c2); }
.card[data-slug="atico"] .card-titulo { color: var(--c3); }
.card[data-slug="bajo"] .card-titulo { color: var(--c4); }
.card-sub { color: var(--mut); font-size: 12.5px; margin: 3px 0 10px; }
.card-kpi {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.card-kpi.pendiente { color: var(--mut); font-weight: 400; font-size: 12.5px; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
/* En pantalla amplia: rejilla fija de 4 columnas para que las 8 metricas queden
   en dos filas completas (4+4) y la segunda nunca se parta en varias lineas. */
@media (min-width: 900px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 14px 16px;
  text-align: center;
}
.kpi-v { font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpi-l {
  color: var(--mut);
  font-size: 10.5px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
}

/* dashboard en vivo: potencia instantanea + sparkline */
.hero-live {
  display: none;
}
.hero-live.visible {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, var(--panel) 55%, #f2faf6);
  border: 1px solid var(--line);
  border-left: 4px solid var(--acc);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 18px 22px;
  margin: 4px 0 20px;
}
.hero-live .hero-w { display: flex; flex-direction: column; gap: 3px; }
.hero-live .hero-eyebrow {
  color: var(--mut);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
}
.hero-w-num {
  font-size: 54px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.hero-w-num small { font-size: 20px; font-weight: 600; color: var(--mut); margin-left: 4px; }
.hero-v { color: var(--acc); font-weight: 700; font-size: 14.5px; }
.hero-age { color: var(--mut); font-size: 12.5px; }
.hero-age.atrasado { color: #b45309; }
.hero-live .spark { width: 100%; height: 150px; }
@media (max-width: 700px) {
  .hero-live.visible { grid-template-columns: 1fr; }
}

.live-chip {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--acc-suave);
  border: 1px solid #9ed4bb;
  color: #0c6b4a;
  font-size: 13px;
  font-weight: 600;
  width: fit-content;
}
.live-chip.visible { display: inline-flex; }
.live-chip .pulso {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acc);
  animation: pulso 2.2s infinite;
}
.live-chip.atrasado { background: #f2f4f7; border-color: var(--line); color: var(--mut); }
.live-chip.atrasado .pulso { background: var(--mut); animation: none; }
@keyframes pulso {
  0% { box-shadow: 0 0 0 0 rgba(15, 138, 95, .45); }
  70% { box-shadow: 0 0 0 7px rgba(15, 138, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 138, 95, 0); }
}

.chart {
  width: 100%;
  height: 300px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.chart.tall { height: 420px; }

.fila { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .fila { grid-template-columns: 1fr; } }

/* — Tablas — */
.tabla-envoltura {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  overflow-x: auto;
}
.tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}
.tabla th, .tabla td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.tabla th {
  background: #f4f7fa;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--mut);
}
.tabla tbody tr:hover { background: #f7fafc; }
.tabla tr:last-child td { border-bottom: none; }

/* — Facturas: detalle y escenarios — */
.metodo {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 6px 22px 18px;
  max-width: 760px;
}
.metodo pre {
  background: var(--top);
  color: #9fe8c3;
  padding: 14px 18px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 13px;
}
.estado {
  display: inline-block;
  margin: 8px 0;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--amber-suave);
  border: 1px solid var(--amber-line);
  font-weight: 600;
}

.badge-admin {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #b7791f;
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .12em;
  vertical-align: middle;
}
.badge-est {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--morado);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .14em;
  vertical-align: middle;
}
.excluido {
  display: inline-block;
  background: var(--morado-suave);
  border: 1px solid var(--morado);
  color: #4d3878;
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 500;
}

.mut { color: var(--mut); font-weight: 400; font-size: 13px; }
.error, .error-alta {
  display: block;
  background: var(--rojo-suave);
  border: 1px solid #e4796f;
  color: #8c1d13;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 600;
  margin: 10px 0;
}
.avisos {
  background: var(--amber-suave);
  border: 1px solid var(--amber-line);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-top: 10px;
}
.card.detalle { padding: 0; margin-bottom: 12px; }
.card.detalle > .card-titulo,
.card.detalle > p,
.card.detalle > .grid2,
.card.detalle > .escenarios,
.card.detalle > .avisos { margin-left: 18px; margin-right: 18px; }
.card.detalle > .card-titulo { margin-top: 14px; }
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 10px 0 14px;
}
@media (max-width: 700px) { .grid2 { grid-template-columns: 1fr; } }

/* — Botones — */
.btn, .btn-calc, .btn-aprobar, .btn-aceptar, .btn-bloquear, .btn-rechazar, .btn-borrar, .btn-reabrir, .btn-ghost {
  border-radius: 9px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
}
.btn-calc {
  background: var(--acc);
  color: #fff;
  padding: 11px 24px;
  font-size: 14.5px;
  border: none;
}
.btn-calc:hover { background: var(--acc-hov); }
.btn-aprobar, .btn-aceptar { background: var(--acc); color: #fff; border-color: var(--acc); }
.btn-aprobar:hover, .btn-aceptar:hover { background: var(--acc-hov); }
.btn-bloquear { background: #fff; color: var(--amber); border-color: #d8b25c; }
.btn-bloquear:hover { background: var(--amber-suave); }
.btn-rechazar { background: #fff; color: var(--rojo); border-color: #e4796f; }
.btn-rechazar:hover { background: var(--rojo-suave); }
.btn-borrar { background: #fff; color: #8c1d13; border-color: #c94a40; }
.btn-borrar:hover { background: var(--rojo-suave); }
.btn-reabrir { background: #fff; color: var(--azul); border-color: #7ba3ca; }
.btn-reabrir:hover { background: var(--azul-suave); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }

/* — Formularios — */
.form-factura, .form-alta, .auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
}
.form-factura { padding: 6px 22px 20px; margin-top: 14px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 18px;
  margin: 12px 0;
}
.form-factura label, .form-alta label, .form-auth label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}
.form-factura label .mut, .form-alta label .mut { font-weight: 400; }
.form-factura label[hidden] { display: none; }
.form-factura input, .form-factura select,
.form-alta input, .form-alta select,
.form-auth input, .form-auth select {
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
.form-factura input:focus, .form-factura select:focus,
.form-alta input:focus, .form-alta select:focus,
.form-auth input:focus, .form-auth select:focus {
  outline: 3px solid rgba(15, 138, 95, .18);
  border-color: var(--acc);
}
.form-factura .notas { margin-bottom: 12px; }
#calc-resultado { margin-top: 14px; }

footer {
  border-top: 1px solid var(--line);
  color: var(--mut);
  font-size: 12px;
  padding: 18px 28px;
  text-align: center;
}

/* — Autenticación — */
.auth-main { display: flex; justify-content: center; }
.auth-card {
  padding: 28px 32px;
  max-width: 470px;
  width: 100%;
  margin: 34px 0;
}
.form-auth { display: grid; gap: 13px; }
.info-ok {
  background: var(--acc-suave);
  border: 1px solid var(--acc);
  color: #0c6b4a;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 12px;
}

/* — Panel de usuarios — */
.credenciales {
  background: var(--acc-suave);
  border: 1px solid var(--acc);
  border-radius: var(--radio);
  padding: 14px 18px;
  margin: 14px 0;
  font-size: 14px;
}
.credenciales .par {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px 10px;
  margin: 4px 6px 0 0;
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
}
.form-alta { padding: 16px 20px 20px; margin: 16px 0 20px; }
.form-alta .fila-alta {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) auto;
  gap: 12px 16px;
  align-items: end;
}
@media (max-width: 860px) { .form-alta .fila-alta { grid-template-columns: 1fr; } }
.chip-pend {
  display: inline-block;
  background: var(--rojo);
  color: #fff;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 7px;
  margin-left: 5px;
}
.estado-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}
.estado-chip.pendiente { background: var(--amber-suave); border: 1px solid var(--amber-line); color: var(--amber); }
.estado-chip.activa { background: var(--acc-suave); border: 1px solid var(--acc); color: #0c6b4a; }
.estado-chip.bloqueada { background: var(--rojo-suave); border: 1px solid #e4796f; color: #8c1d13; }
.acciones { white-space: nowrap; }
.acciones.acciones-fila { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.inline { display: inline-block; }

/* — Autogestión de cuenta — */
.cuenta-main { max-width: 780px; margin: 0 auto; }
.cuenta-main .auth-card { max-width: none; margin: 0 0 18px; }
.cuenta-main .auth-card h2 { margin-top: 0; }
.auth-card.peligro { border-color: #e4796f; }
.auth-card.peligro h2 { color: #8c1d13; }

/* — Flujo de aprobación de facturas — */
.chip {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .06em;
  vertical-align: middle;
}
.chip-pendiente { background: var(--amber-suave); border: 1px solid var(--amber-line); color: var(--amber); }
.chip-aceptada { background: var(--acc-suave); border: 1px solid var(--acc); color: #0c6b4a; }
.chip-rechazada { background: var(--rojo-suave); border: 1px solid #e4796f; color: #8c1d13; }
.chip-estimada { background: var(--morado-suave); border: 1px solid var(--morado); color: #4d3878; }

.escenarios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 4px 0 14px;
}
@media (max-width: 700px) { .escenarios { grid-template-columns: 1fr; } }
.esc {
  background: #f7f9fb;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}
.acciones.acciones-tarjeta { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 18px 16px; }

/* — Página de ingesta — */
.dispositivos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.dispo {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 16px 18px;
}
.dispo h3 { margin: 0 0 2px; font-size: 16px; }
.dispo .fila-dato {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line-soft);
  font-variant-numeric: tabular-nums;
}
.dispo .fila-dato:last-child { border-bottom: none; }
.punto-vivo {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
}
.punto-vivo.ok { background: var(--acc); box-shadow: 0 0 0 3px var(--acc-suave); }
.punto-vivo.aviso { background: #d8a524; box-shadow: 0 0 0 3px var(--amber-suave); }
.punto-vivo.malo { background: var(--rojo); box-shadow: 0 0 0 3px var(--rojo-suave); }
.pre-codigo {
  background: var(--top);
  color: #d7e3ee;
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 12.5px;
  overflow-x: auto;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  line-height: 1.5;
}

/* ---- menu lateral del vecino ---- */
.layout {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
/* El rail es fixed (sale del flujo del grid): el contenido se fija a la 2a columna
   para que no colapse en el hueco de 216px ni se cuele bajo el menu. */
.layout > .contenido { grid-column: 2; }
.lateral {
  position: fixed;
  top: 64px;
  left: max(22px, calc((100vw - 1240px) / 2 + 22px));
  width: 216px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 14px 12px;
  z-index: 40;
}
.lateral-titulo {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--mut);
  padding: 2px 10px 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}
.lateral a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--mut);
  text-decoration: none;
}
.lateral a .ico { font-size: 15px; }
.lateral a:hover { color: var(--acc); background: rgba(15, 138, 95, .07); }
.lateral a.activo { color: var(--acc); background: rgba(15, 138, 95, .10); }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 14px; }
  .layout > .contenido { grid-column: auto; }
  .lateral { position: static; width: auto; max-height: none; flex-direction: row; flex-wrap: wrap; }
  .lateral-titulo { width: 100%; border: none; padding-bottom: 0; }
}
.layout.sin-lateral { grid-template-columns: 1fr; }
.contenido .auth-card { max-width: none; margin: 0 0 18px; }

/* ---- chip de datos en tiempo real ---- */
.chip-directo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 5px 14px;
  border-radius: 999px;
  background: #e3f6ec;
  border: 1px solid #a8dcbd;
  color: #0c6b46;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
}
.chip-directo .punto {
  width: 8px; height: 8px; border-radius: 50%;
  background: #16a34a;
  animation: pulso 1.6s ease-in-out infinite;
}
@keyframes pulso { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---- estado de recibos (5 valores) ---- */
.est {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  white-space: nowrap;
}
.est.PAGADO { background: #e3f6ec; color: #0c6b46; border: 1px solid #a8dcbd; }
.est.PENDIENTE_DE_PAGO { background: #fdeaea; color: #a02418; border: 1px solid #eab5b0; }
.est.EN_PREPARACION { background: #fdf3dd; color: #8a6100; border: 1px solid #e7cd8a; }
.est.NO_APLICA { background: #f1f5f9; color: #64748b; border: 1px solid #dbe3ea; }
.est.ANULADO { background: #e9edf2; color: #475569; border: 1px solid #c3ccd6; text-decoration: line-through; }
.est-vacio { color: #b6c1cc; }

/* ---- identificador FRA y balloon de previsualizacion ---- */
.fra-id { font-size: 12px; color: var(--mut); }
.fra-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--acc);
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.fra-link:hover { color: var(--acc-hov, #0c6b46); }
.fra-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 2px 0 10px;
  padding: 9px 14px;
  background: #f2f7fb;
  border: 1px dashed #b9cfe4;
  border-radius: 10px;
}
.fra-bar .fra-tit {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mut);
}
.fra-bar .btn-ghost { font-size: 12.5px; }
.fra-mini { padding: 3px 9px !important; font-size: 11.5px !important; }
.fra-bar .fra-subir {
  background: var(--acc);
  color: #fff;
  border-color: var(--acc);
}
.fra-bar .fra-subir:hover { filter: brightness(.93); background: var(--acc); }

/* ---- switch Directo/24h del hero ---- */
.hero-live.visible { position: relative; }
.hero-switch {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  z-index: 2;
}
.hero-switch button {
  border: none;
  background: transparent;
  padding: 4px 13px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  color: var(--mut);
  cursor: pointer;
}
.hero-switch button.on { background: var(--acc); color: #fff; }
.fra-balloon {
  position: absolute;
  z-index: 120;
  max-width: 460px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 44px rgba(8, 16, 26, .28);
  padding: 10px 12px 8px;
  user-select: none;
}
.fra-balloon .fra-img-caja {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80px;
  max-height: 340px;
  overflow: hidden;
  border-radius: 9px;
  background: #f6f8fa;
}
.fra-balloon img {
  max-width: 430px;
  max-height: 330px;
  object-fit: contain;
  pointer-events: none;
}
.fra-balloon .fra-pie {
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mut);
  padding-top: 6px;
}
.fra-x {
  position: absolute;
  top: 6px; right: 8px;
  border: none;
  background: rgba(255, 255, 255, .85);
  border-radius: 50%;
  width: 24px; height: 24px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  color: #475569;
}
.fra-x:hover { background: #fdeaea; color: #8c1d13; }

/* ---- selector de anio ---- */
.anio-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--mut);
  font-weight: 700;
}
.anio-selector select {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radio);
  background: var(--panel);
  font: inherit;
  color: var(--tinta, #16232f);
}

/* ---- panel admin de agua/pagos ---- */
.panel-piso { margin-top: 26px; }
.tabla-agua th { font-size: 11px; }
.sel-estado {
  margin-top: 4px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 11.5px;
  background: #fbfdff;
  max-width: 150px;
}
.tabla-agua td { vertical-align: middle; }
.inp-num {
  width: 74px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  background: #fbfdff;
}
.inp-nota {
  width: 128px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  background: #fbfdff;
}
.inp-num:focus, .inp-nota:focus { outline: 2px solid rgba(15, 138, 95, .35); border-color: var(--acc); }
.tabla-agua input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--acc); cursor: pointer; }
