/* Lumina · base, shell y componentes compartidos. Los colores salen solo de tokens.css; cada sección tiene su hoja en
   css/vistas/. App técnica: barra lateral y barra superior pegadas a los bordes, esquinas cortas, fondo liso (negro en
   oscuro). SF y la curva «llegada» de las one-pages; el movimiento responde a algo (movimiento.js). */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  font-family: var(--opt-font); font-size: var(--opt-text-md); line-height: var(--opt-line-body); letter-spacing: -0.008em;
  background: var(--opt-background); color: var(--opt-text); -webkit-font-smoothing: antialiased; overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled, .btn[aria-disabled=true] { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--opt-focus); outline-offset: 2px; }
::selection { background: var(--lumina-claro); color: #0B131B; }
.ic { width: 20px; height: 20px; flex: none; }
.ic.sm { width: 17px; height: 17px; }
.ic.xs { width: 14px; height: 14px; }
code, kbd, pre { font-family: var(--opt-font-mono); }
kbd { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--opt-surface-inset); color: var(--opt-text-secondary); line-height: 1.6; box-shadow: inset 0 -1px 0 var(--opt-border-strong); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
* { scrollbar-width: thin; scrollbar-color: var(--opt-border-strong) transparent; }

/* ============ arranque: la lente de Lumina enfoca mientras carga el panel ============ */
.arranque { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: var(--opt-background); transition: opacity .7s var(--llegada), visibility .7s, filter .7s var(--llegada); }
.arranque.fuera { opacity: 0; visibility: hidden; filter: blur(12px); }
.arranque > div { display: grid; justify-items: center; gap: 22px; }
.arranque small { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--opt-text-secondary); }
.lente { width: 76px; height: 76px; overflow: visible; }
.lente .disco { fill: var(--lumina); transform-origin: 50% 50%; animation: lente-disco 1.6s var(--llegada) both; }
.lente .anillo { fill: var(--lumina); transform-box: fill-box; transform-origin: center; animation: lente-anillo 2.4s var(--llegada) .3s infinite; }
@keyframes lente-disco { from { transform: scale(.6); opacity: 0; filter: blur(8px); } }
@keyframes lente-anillo { 0% { transform: scale(.55); opacity: 0; } 35% { transform: scale(1.06); opacity: 1; } 55%, 100% { transform: scale(1); opacity: 1; } }
.cargando-lente { display: grid; justify-items: center; gap: 14px; padding: 56px 20px; color: var(--opt-text-secondary); font-size: var(--opt-text-sm); }
.cargando-lente .lente { width: 44px; height: 44px; }

/* ============ shell: isla lateral y barra superior de vidrio ============ */
/* Franja de desconexión (nucleo.js, pintarFranja): arriba de todo y por encima de los diálogos; la app se achica lo que
   ocupa (--franja). El sello va en la barra superior, junto a la ruta. */
.franja { position: relative; z-index: 45; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; min-height: 40px; padding: 6px 16px; background: var(--opt-error); color: #fff; font-size: var(--opt-text-sm); text-align: center; }
.franja[hidden] { display: none; }
.franja .ic { flex: none; }
.franja .btn { min-height: 28px; background: #fff; color: #0B131B; box-shadow: none; }
:root[data-theme=oscuro] .franja { color: #0B131B; }
.sello { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--opt-radius-pill); background: var(--opt-warning-soft); color: var(--opt-warning); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.sello[hidden] { display: none; }
.app { position: relative; display: grid; grid-template-columns: var(--opt-nav-width) minmax(0, 1fr); height: calc(100vh - var(--franja, 0px)); transition: grid-template-columns .5s var(--llegada); }
.app.compacta { grid-template-columns: var(--opt-nav-collapsed-width) minmax(0, 1fr); }

.side { margin: 0; border-radius: 0; background: var(--opt-nav-background); border-right: 1px solid var(--opt-border); color: var(--opt-nav-text); display: flex; flex-direction: column; min-height: 0; overflow: hidden auto; padding: 18px 12px 12px; gap: 16px; }
.side-top { display: flex; align-items: center; gap: 8px; padding: 0 2px 0 8px; min-height: 44px; }
.marca { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; color: var(--opt-nav-text); border-radius: var(--opt-radius-control); }
.marca svg, .marca img { flex: none; display: block; }
.marca > img { width: 32px; height: 32px; transition: transform .8s var(--resorte); }
.marca:hover > img { transform: rotate(-12deg) scale(1.06); }
/* Marca Lumina: isotipo naranjo y la palabra LUMINA en tinta (clara en el tema oscuro) */
.marca-txt { display: grid; gap: 5px; min-width: 0; line-height: 1; }
.marca-txt > span { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--opt-nav-text); }
.marca-palabra { display: block; height: 15px; width: auto; }
:root[data-theme=oscuro] .marca-palabra { content: url("../assets/lumina-palabra-clara.svg"); }
.marca-txt small { font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--opt-nav-text-secondary); white-space: nowrap; }
.side .ib { color: var(--opt-nav-text-secondary); }
.side .ib:hover { background: var(--opt-nav-hover); color: var(--opt-nav-text); }
.planta { display: flex; align-items: center; gap: 10px; margin: 0 2px; padding: 0 12px; border-radius: var(--opt-radius-pill); background: var(--opt-surface-inset); font-size: var(--opt-text-sm); font-weight: 600; color: var(--opt-nav-text); min-height: 40px; }
.planta .ic { color: var(--lumina); }
.planta span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 12px; border-radius: var(--opt-radius-pill); color: var(--opt-nav-text); font-weight: 500; font-size: var(--opt-text-md); position: relative; isolation: isolate; text-align: left; width: 100%;
  transition: background var(--opt-duration-fast) var(--opt-ease), color var(--opt-duration-fast), transform .25s var(--llegada); }
.nav-item:hover { background: var(--opt-nav-hover); }
.nav-item:active { transform: scale(.98); }
/* la píldora de la sección activa se desliza desde la anterior (--desde lo pone movimiento.js) */
.nav-item[aria-current=page] { background: none; color: var(--opt-nav-selection-text); font-weight: 600; }
.nav-item[aria-current=page]::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--opt-nav-selection); box-shadow: 0 1px 2px rgba(11, 19, 27, .06), 0 6px 16px -8px rgba(11, 19, 27, .22), inset 0 0 0 .5px rgba(11, 19, 27, .04); animation: nav-desliza .5s var(--llegada); }
@keyframes nav-desliza { from { transform: translateY(var(--desde, 0px)); } }
.nav-item .t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .cnt { min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--opt-radius-pill); background: var(--lumina); color: #0B131B; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.nav-sep { border: 0; border-top: 1px solid var(--opt-nav-border); margin: 10px 8px; }
.nav-grupo { color: var(--opt-nav-text); }
.nav-grupo .chev { transition: transform var(--opt-duration-normal) var(--opt-ease); }
.nav-grupo[aria-expanded=false] .chev { transform: rotate(-90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 1px; }
.nav-sub .nav-item { padding-left: 22px; min-height: 36px; color: var(--opt-nav-text-secondary); }
.nav-sub .nav-item[aria-current=page] { color: var(--opt-nav-selection-text); }
.nav-seccion { display: flex; flex-direction: column; gap: 1px; }
.nav-seccion + .nav-seccion { margin-top: 16px; }
.nav-titulo { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--opt-nav-text-secondary); padding: 4px 12px 6px; }
.nav-item .ic { color: var(--opt-nav-text-secondary); transition: color var(--opt-duration-fast), transform .4s var(--resorte); }
.nav-item:hover .ic { color: var(--opt-nav-text); }
.nav-item[aria-current=page] .ic { color: var(--lumina); transform: scale(1.06); }
.side-pie { margin-top: auto; display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--opt-nav-border); }
.conexion:has(.dot.ok) { display: none; }
.conexion { display: flex; align-items: center; gap: 10px; padding: 0 10px; font-size: var(--opt-text-xs); color: var(--opt-nav-text-secondary); min-height: 22px; }
.identidad { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.identidad .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--opt-surface-inset); color: var(--opt-nav-text); display: grid; place-items: center; flex: none; }
.identidad span:last-child { display: grid; min-width: 0; line-height: 1.3; }
.identidad b { font-size: var(--opt-text-sm); font-weight: 600; }
.identidad small { font-size: 12px; color: var(--opt-nav-text-secondary); }
.identidad .avatar.ini { font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; background: linear-gradient(140deg, var(--lumina-claro), var(--lumina)); color: #0B131B; }
.app.compacta .marca-txt, .app.compacta .nav-titulo span, .app.compacta .planta span, .app.compacta .nav-item .t, .app.compacta .nav-grupo .chev,
.app.compacta .conexion span, .app.compacta .identidad span:last-child { display: none; }
.app.compacta .side { padding: 18px 8px 12px; }
.app.compacta .side-top { flex-direction: column; padding: 0; gap: 10px; }
.app.compacta .marca { justify-content: center; flex: none; }
.app.compacta .planta { justify-content: center; padding: 0; margin: 0; }
.app.compacta .nav-item { justify-content: center; padding: 0; }
.app.compacta .nav-sub .nav-item { padding: 0; }
.app.compacta .nav-titulo { padding: 0; margin: 4px 10px; border-top: 1px solid var(--opt-nav-border); }
.app.compacta .nav-item .cnt { position: absolute; top: 1px; right: 6px; min-width: 17px; height: 17px; font-size: 10.5px; padding: 0 5px; }
.app.compacta .conexion, .app.compacta .identidad { justify-content: center; padding: 0; }
.app.compacta #colapsar .ic { transform: rotate(180deg); }

/* el contenido pasa por debajo de la barra superior de vidrio */
.principal { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { position: absolute; z-index: 10; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 16px 0 20px; border-radius: 0;
  background: var(--vidrio-fuerte); -webkit-backdrop-filter: var(--vidrio-blur); backdrop-filter: var(--vidrio-blur); border-bottom: 1px solid var(--opt-border); }
.crumbs { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--opt-text-sm); color: var(--opt-text-secondary); }
.crumbs a { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--opt-heading); transition: background var(--opt-duration-fast); }
.crumbs a:hover { background: var(--opt-surface-inset); }
.crumbs .sep { color: var(--opt-text-muted); opacity: .6; }
.crumbs b { color: var(--opt-heading); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: entra-x .5s var(--llegada); }
@keyframes entra-x { from { opacity: 0; transform: translateX(-6px); filter: blur(4px); } }
.demo { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--opt-radius-pill); background: var(--opt-surface-inset); color: var(--opt-text-secondary); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.search { display: flex; align-items: center; gap: 8px; width: min(320px, 28vw); height: 38px; padding: 0 8px 0 14px; border-radius: var(--opt-radius-pill); background: var(--opt-surface-inset); color: var(--opt-text-secondary); transition: background .25s, box-shadow .35s var(--llegada), width .5s var(--llegada); }
.search:focus-within { background: var(--opt-surface-raised); box-shadow: 0 0 0 4px var(--opt-accent-soft), 0 0 0 1px var(--opt-accent-border); width: min(380px, 32vw); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--opt-text); }
.search input::placeholder { color: var(--opt-text-muted); }
.bell { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--opt-heading); transition: background var(--opt-duration-fast), transform .3s var(--llegada); }
.bell:hover { background: var(--opt-surface-inset); }
.bell:active { transform: scale(.92); }
.bell .badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--opt-radius-pill); background: var(--lumina); color: #0B131B; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--opt-surface-raised); }
@keyframes latido-badge { 0%, 70%, 100% { box-shadow: 0 0 0 2px var(--opt-surface-raised), 0 0 0 2px rgba(236, 109, 39, 0); } 20% { box-shadow: 0 0 0 2px var(--opt-surface-raised), 0 0 0 7px rgba(236, 109, 39, .22); } }
.view { position: relative; flex: 1; min-height: 0; overflow: auto; padding: calc(var(--alto-top, 56px) + 28px) var(--opt-content-padding) 32px; outline: 0; scrollbar-gutter: stable; }
.view > * + * { margin-top: 22px; }

/* ============ encabezado de sección (como el de las one-pages) ============ */
.encabezado { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 6px 2px 4px; }
.encabezado > div:first-child { min-width: 0; }
.titulo-fila { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.eti { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--opt-text-secondary); }
.eti::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--lumina); }
h1 { font-family: var(--opt-font-display); font-size: var(--opt-text-title); line-height: var(--opt-line-heading); letter-spacing: -0.035em; color: var(--opt-heading); font-weight: 600; text-wrap: balance; }
.sub { font-size: var(--opt-text-lead); color: var(--opt-text-secondary); margin-top: 6px; line-height: 1.4; letter-spacing: -0.012em; }
.encabezado-acciones { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
h2 { font-family: var(--opt-font-display); font-size: var(--opt-text-section); line-height: 1.2; color: var(--opt-heading); font-weight: 600; letter-spacing: -0.02em; }
h3 { font-size: var(--opt-text-md); color: var(--opt-heading); font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }

/* ============ botones: píldoras; primario en tinta como las one-pages ============ */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--opt-control-height); padding: 0 18px; border-radius: var(--opt-radius-pill);
  font-weight: 600; font-size: var(--opt-text-md); letter-spacing: -0.01em; background: var(--opt-surface-raised); border: 0; box-shadow: inset 0 0 0 1px var(--opt-border-strong), 0 1px 2px rgba(11, 19, 27, .04); color: var(--opt-heading); white-space: nowrap;
  transition: background .25s, box-shadow .4s var(--llegada), color .2s, transform .35s var(--llegada); }
.btn:hover { box-shadow: inset 0 0 0 1px var(--opt-border-strong), 0 10px 22px -14px rgba(11, 19, 27, .45); transform: translateY(-1px); }
.btn:active { transform: scale(.97); transition-duration: .1s; }
.btn .ic { transition: transform .45s var(--llegada); }
.btn:hover .ic[aria-hidden] { transform: translateX(0); }
.btn.p { background: var(--opt-heading); color: var(--opt-background); box-shadow: 0 1px 2px rgba(11, 19, 27, .2); }
.btn.p:hover { box-shadow: 0 14px 28px -14px rgba(11, 19, 27, .6); }
:root[data-theme=oscuro] .btn.p { background: #F5F5F7; color: #0B0B0C; }
.btn.t { background: none; box-shadow: none; color: var(--opt-accent-text); padding: 0 10px; }
.btn.t:hover { background: var(--opt-accent-soft); transform: none; }
.btn.peligro { color: var(--opt-error); box-shadow: inset 0 0 0 1px var(--opt-error-soft); }
.btn.peligro:hover { background: var(--opt-error-soft); }
.btn.chico { min-height: 32px; padding: 0 14px; font-size: var(--opt-text-sm); }
.btn.ancho, .btn.c { width: 100%; }
.btn.c { background: var(--opt-accent-soft); box-shadow: inset 0 0 0 1px var(--opt-accent-border); color: var(--opt-accent-text); }
.btn:disabled, .btn[aria-disabled=true] { opacity: 0.45; transform: none; box-shadow: inset 0 0 0 1px var(--opt-border); }
.btn.p:disabled { background: var(--opt-surface-inset); color: var(--opt-text-muted); opacity: 1; }
.btn[aria-busy=true] { cursor: progress; }
.btn[aria-busy=true]::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: giro .8s linear infinite; }
@keyframes giro { to { transform: rotate(360deg); } }
.ib { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--opt-heading); flex: none; transition: background var(--opt-duration-fast), transform .3s var(--llegada), color .2s; }
.ib:hover { background: var(--opt-surface-inset); }
.ib:active { transform: scale(.92); }
.ib.borde { background: var(--opt-surface-raised); box-shadow: inset 0 0 0 1px var(--opt-border-strong); }
.ib.on, .ib[aria-pressed=true] { color: var(--opt-accent-text); background: var(--opt-accent-soft); box-shadow: inset 0 0 0 1px var(--opt-accent-border); }
.ib:disabled { opacity: .45; }
.mas { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: var(--opt-text-secondary); transition: background .2s, color .2s; }
.mas:hover { background: var(--opt-surface-inset); color: var(--opt-heading); }
.grupo-botones { display: inline-flex; gap: 6px; }

/* ============ etiquetas de estado ============ */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 10px; border-radius: var(--opt-radius-pill); font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1; background: var(--opt-neutral-soft); color: var(--opt-neutral); letter-spacing: -0.005em; }
.chip .pt { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.ok, .chip.baja.rev, .chip.rev, .chip.vivo { background: var(--opt-success-soft); color: var(--opt-success); }
@keyframes pulso-pt { 50% { opacity: .35; } }
.chip.aviso, .chip.media, .chip.pend { background: var(--opt-warning-soft); color: var(--opt-warning); }
.chip.error, .chip.alta, .chip.muerto { background: var(--opt-error-soft); color: var(--opt-error); }
.chip.info, .chip.baja { background: var(--opt-info-soft); color: var(--opt-info); }
.chip.acento { background: var(--opt-accent-soft); color: var(--opt-accent-text); }
.chip.neutro, .chip.gris { background: var(--opt-neutral-soft); color: var(--opt-neutral); }
.chip.borde { background: var(--opt-surface-raised); box-shadow: inset 0 0 0 1px var(--opt-border-strong); color: var(--opt-heading); }
.chip.grande { min-height: 32px; padding: 0 14px; font-size: var(--opt-text-sm); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--opt-text-muted); flex: none; }
.dot.ok { background: var(--atendida); }
.dot.alta, .dot.error { background: var(--critica); }
.dot.media, .dot.aviso { background: var(--revision); }
.dot.off, .dot.neutro { background: var(--opt-text-muted); }
.side .dot.ok { background: var(--atendida); }
.side .dot.alta { background: var(--critica); }
.contador { min-width: 24px; height: 22px; padding: 0 8px; border-radius: var(--opt-radius-pill); background: var(--lumina); color: #0B131B; font-size: 12px; font-weight: 700; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }

/* ============ tarjetas de vidrio ============ */
.card { position: relative; background: var(--opt-surface); border: 1px solid transparent; border-radius: var(--opt-radius-card);
  box-shadow: var(--vidrio-filo), var(--opt-shadow-sm); padding: 22px; min-width: 0; transition: box-shadow .5s var(--llegada), transform .5s var(--llegada), border-color .3s, background .3s; }
a.card:hover, .card.click:hover { transform: translateY(-2px); box-shadow: var(--vidrio-filo), var(--opt-shadow-md); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h2 { font-size: 17px; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.card-head .meta-der { color: var(--opt-text-secondary); font-size: var(--opt-text-sm); display: flex; align-items: center; gap: 6px; }
.grid { display: grid; gap: 22px; }
.fila-dos { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* indicadores */
.kpis { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kpi { display: flex; align-items: center; gap: 16px; padding: 20px 22px; min-height: 108px; position: relative; color: inherit; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--vidrio-filo), var(--opt-shadow-md); }
.kpi .ico { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--opt-surface-inset); color: var(--opt-heading); }
.kpi .ico .ic { width: 22px; height: 22px; }
.kpi > div { flex: 1; min-width: 0; }
.kpi small { display: block; font-size: var(--opt-text-sm); color: var(--opt-text-secondary); font-weight: 500; }
.kpi strong { display: inline-block; font-family: var(--opt-font-display); font-size: var(--opt-text-metric); line-height: 1.05; color: var(--opt-heading); font-weight: 600; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi em { font-style: normal; font-size: var(--opt-text-sm); color: var(--opt-text-secondary); margin-left: 8px; }
.kpi .ir { color: var(--opt-text-secondary); }
.kpi.error { background: linear-gradient(150deg, var(--opt-error-soft), var(--opt-surface) 65%); }
.kpi.error .ico { background: var(--opt-error-soft); color: var(--opt-error); }
.kpi.error em { color: var(--opt-error); font-weight: 600; }
.kpi.aviso .ico { color: var(--opt-warning); background: var(--opt-warning-soft); }

/* mensajes contextuales: vidrio teñido, el icono en su círculo (nunca barra de color al canto) */
.banda { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--opt-radius-card); background: var(--opt-surface); box-shadow: var(--vidrio-filo), var(--opt-shadow-sm); }
.banda > .ic { flex: none; width: 34px; height: 34px; padding: 8px; border-radius: 6px; background: var(--opt-surface-inset); }
.banda > div { flex: 1; min-width: 0; }
.banda b { display: block; color: var(--opt-heading); font-weight: 600; }
.banda small, .banda p { color: var(--opt-text-secondary); font-size: var(--opt-text-sm); }
.banda.info > .ic { color: var(--opt-info); background: var(--opt-info-soft); }
.banda.aviso > .ic { color: var(--opt-warning); background: var(--opt-warning-soft); }
.banda.error > .ic { color: var(--opt-error); background: var(--opt-error-soft); }
.banda.ok > .ic { color: var(--opt-success); background: var(--opt-success-soft); }
.banda.acento { background: linear-gradient(120deg, var(--opt-accent-soft), var(--opt-surface) 60%); } .banda.acento > .ic { color: var(--opt-accent-text); background: var(--opt-accent-soft); }
.banda.error { background: linear-gradient(120deg, var(--opt-error-soft), var(--opt-surface) 60%); }
.banda.aviso { background: linear-gradient(120deg, var(--opt-warning-soft), var(--opt-surface) 60%); }
.banda.oscura { background: #0B131B; color: #F5F5F7; box-shadow: var(--opt-shadow-md); }
.banda.oscura b { color: #fff; } .banda.oscura small, .banda.oscura p { color: #A1A9AD; }
.banda.oscura > .ic { background: rgba(255, 255, 255, .1); color: var(--lumina-claro); }

/* estados vacíos y carga: la carga es un barrido de luz */
.vacio { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 40px 20px; color: var(--opt-text-secondary); }
.vacio > .ic { width: 52px; height: 52px; padding: 14px; border-radius: 6px; color: var(--opt-text-secondary); background: var(--opt-surface-inset); margin-bottom: 4px; }
.vacio b { color: var(--opt-heading); font-size: var(--opt-text-body); font-weight: 600; }
.vacio p { max-width: 460px; font-size: var(--opt-text-sm); }
.vacio .btn { margin-top: 8px; }
.esqueleto { display: grid; gap: 12px; }
.esqueleto i { display: block; height: var(--alto, 64px); border-radius: var(--opt-radius-card); background: var(--opt-surface-inset); position: relative; overflow: hidden; }
.esqueleto i::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .55) 45%, rgba(245, 160, 106, .18) 52%, transparent 75%); animation: barrido 1.6s var(--llegada) infinite; }
:root[data-theme=oscuro] .esqueleto i::after { background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .07) 45%, rgba(236, 109, 39, .12) 52%, transparent 75%); }
.esqueleto i:nth-child(2)::after { animation-delay: .12s; } .esqueleto i:nth-child(3)::after { animation-delay: .24s; } .esqueleto i:nth-child(4)::after { animation-delay: .36s; }
@keyframes barrido { to { transform: translateX(100%); } }

/* ============ controles ============ */
.barra-filtros { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.control { display: inline-flex; align-items: center; gap: 8px; height: var(--opt-control-height); padding: 0 14px; border-radius: var(--opt-radius-pill); background: var(--opt-surface-raised); box-shadow: inset 0 0 0 1px var(--opt-border-strong); color: var(--opt-heading); min-width: 0; transition: box-shadow .3s var(--llegada), background .2s; }
.control:hover { box-shadow: inset 0 0 0 1px var(--opt-border-strong), 0 8px 18px -14px rgba(11, 19, 27, .4); }
.control:focus-within { box-shadow: inset 0 0 0 1px var(--opt-accent-border), 0 0 0 4px var(--opt-accent-soft); }
.control > .ic { color: var(--opt-text-secondary); }
.control select, .control input { border: 0; outline: 0; background: none; color: var(--opt-text); min-width: 0; height: 100%; font-weight: 500; }
.control select { appearance: none; -webkit-appearance: none; padding-right: 22px; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%235E6A71' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right center / 15px no-repeat; }
:root[data-theme=oscuro] .control select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%23A1A1A6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.control select option { color: #0B131B; background: #fff; }
.control input::placeholder { color: var(--opt-text-muted); }
.control.buscar { flex: 1 1 220px; }
.control.buscar input { flex: 1; }
/* pestañas como control segmentado de macOS */
.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--opt-radius-pill); background: var(--opt-surface-inset); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tabs [role=tab], .tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 16px; border-radius: var(--opt-radius-pill); font-weight: 600; font-size: var(--opt-text-sm); color: var(--opt-text-secondary); white-space: nowrap; transition: color .2s, background .3s var(--llegada), box-shadow .3s var(--llegada); }
.tabs [role=tab]:hover { color: var(--opt-heading); }
.tabs [aria-selected=true], .tabs button.on { color: var(--opt-heading); background: var(--opt-surface-raised); box-shadow: 0 1px 2px rgba(11, 19, 27, .08), 0 4px 12px -6px rgba(11, 19, 27, .2); }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--opt-radius-pill); background: var(--opt-surface-inset); }
.seg button { min-height: 30px; padding: 0 12px; border-radius: var(--opt-radius-pill); font-size: var(--opt-text-sm); font-weight: 600; color: var(--opt-text-secondary); display: inline-flex; align-items: center; gap: 6px; transition: color .2s, background .3s var(--llegada), box-shadow .3s var(--llegada); }
.seg button:hover { color: var(--opt-heading); }
.seg button.on, .seg button[aria-pressed=true], .seg button[aria-checked=true] { background: var(--opt-surface-raised); color: var(--opt-heading); box-shadow: 0 1px 2px rgba(11, 19, 27, .08), 0 4px 12px -6px rgba(11, 19, 27, .2); }
/* interruptor como el de iOS, con resorte */
.sw { width: 46px; height: 28px; border-radius: var(--opt-radius-full); background: rgba(120, 120, 128, .24); position: relative; transition: background .3s var(--llegada); flex: none; display: inline-block; cursor: pointer; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .45s var(--resorte), width .2s; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); }
.sw:active::after { width: 28px; }
.sw.on, .sw[aria-checked=true] { background: var(--atendida); }
.sw.on::after, .sw[aria-checked=true]::after { transform: translateX(18px); }
.sw.on:active::after, .sw[aria-checked=true]:active::after { transform: translateX(14px); }
.sw[aria-disabled=true] { opacity: .5; cursor: not-allowed; }

/* tabla: limpia, sin rejilla, la fila se ilumina */
.tabla { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { font-weight: 600; color: var(--opt-text-secondary); font-size: 12px; letter-spacing: .02em; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--opt-border); white-space: nowrap; }
td { padding: 13px 14px; border-bottom: 1px solid var(--opt-border); font-size: var(--opt-text-md); vertical-align: middle; transition: background .2s; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--opt-surface-inset); }
tbody tr.click:hover td:first-child { border-radius: 6px 0 0 12px; } tbody tr.click:hover td:last-child { border-radius: 0 12px 12px 0; }
tbody tr[aria-selected=true] td { background: var(--opt-accent-soft); }
td.fin { width: 40px; text-align: right; color: var(--opt-text-secondary); }
td .ev { display: flex; align-items: center; gap: 10px; min-width: 0; }
td .ev .ic { width: 20px; height: 20px; color: var(--opt-accent-text); }
td .ev .ic.alta { color: var(--opt-error); }
.hora { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--opt-border); }
.pager small { color: var(--opt-text-secondary); }
.pager div { display: flex; gap: 8px; }

/* gráficos: entran creciendo (movimiento.js marca .entra) */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--opt-text-secondary); font-size: 11.5px; font-family: var(--opt-font); }
.chart text.v { fill: var(--opt-heading); font-weight: 600; }
.chart line { stroke: var(--opt-border); }
.chart rect.b { fill: var(--opt-chart-1); rx: 4px; transform-box: fill-box; transform-origin: bottom; animation: crece .9s var(--llegada) both; }
.chart rect.b.n2 { fill: var(--opt-chart-2); }
.chart rect.b.hoy { fill: var(--lumina-hondo); }
@keyframes crece { from { transform: scaleY(0); } }
.datos-tabla { margin-top: 10px; font-size: var(--opt-text-sm); }
.datos-tabla summary { cursor: pointer; color: var(--opt-accent-text); font-weight: 600; width: max-content; }
.datos-tabla table { margin-top: 8px; }
.datos-tabla td, .datos-tabla th { padding: 6px 10px; font-size: var(--opt-text-sm); }
.barras-h { display: grid; gap: 8px; }
.barra-h { display: grid; grid-template-columns: minmax(90px, 1.1fr) minmax(60px, 2fr) 44px; gap: 12px; align-items: center; padding: 3px 0; font-size: var(--opt-text-sm); }
.barra-h .riel { background: var(--opt-surface-inset); border-radius: 8px; height: 10px; overflow: hidden; }
.barra-h .riel i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--lumina-claro), var(--lumina)); transform-origin: left; animation: crece-x 1s var(--llegada) both; }
@keyframes crece-x { from { transform: scaleX(0); } }
.barra-h b { text-align: right; color: var(--opt-heading); font-variant-numeric: tabular-nums; }

/* visor de cámara: la relación de aspecto la fija el video; controles de vidrio oscuro encima */
.visor { position: relative; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 9; background: var(--opt-video); box-shadow: 0 0 0 1px rgba(11, 19, 27, .06), 0 18px 40px -24px rgba(11, 19, 27, .55); }
.visor canvas { width: 100%; height: 100%; display: block; }
.visor:fullscreen { aspect-ratio: auto; border-radius: 0; }
.visor .esquina { position: absolute; top: 12px; right: 12px; }
.visor .ampliar { position: absolute; right: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 6px; background: rgba(20, 20, 22, .5); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: #fff; display: grid; place-items: center; transition: background .2s, transform .3s var(--llegada); }
.visor .ampliar:hover { background: rgba(20, 20, 22, .72); transform: scale(1.06); }
.visor-pie { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: var(--opt-text-sm); color: var(--opt-text); flex-wrap: wrap; }
.visor-pie .grow { flex: 1; }

.mini-ev { width: 120px; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; background: var(--opt-surface-inset); flex: none; display: grid; place-items: center; color: var(--opt-text-muted); position: relative; }
.mini-ev img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s var(--llegada); }
.mini-ev:hover img { transform: scale(1.05); }
.mini-ev small { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-size: 10.5px; }

/* menús «···»: popover de vidrio que nace desde su botón */
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 15; min-width: 200px; background: var(--vidrio-fuerte); -webkit-backdrop-filter: var(--vidrio-blur); backdrop-filter: var(--vidrio-blur); border-radius: 8px; box-shadow: var(--vidrio-filo), var(--opt-shadow-lg); padding: 6px; display: grid; transform-origin: top right; animation: popover .35s var(--llegada); }
@keyframes popover { from { opacity: 0; transform: scale(.94) translateY(-4px); filter: blur(4px); } }
.menu button { text-align: left; padding: 9px 12px; border-radius: 6px; font-size: var(--opt-text-sm); font-weight: 500; color: var(--opt-heading); transition: background .15s; }
.menu button:hover, .menu button:focus-visible { background: var(--opt-surface-inset); }
.menu button.peligro { color: var(--opt-error); }

/* barra de guardado: isla flotante de vidrio */
.barra-guardar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 20px; border-radius: 8px; background: var(--vidrio-fuerte); -webkit-backdrop-filter: var(--vidrio-blur); backdrop-filter: var(--vidrio-blur); box-shadow: var(--vidrio-filo), var(--opt-shadow-lg); animation: sube .6s var(--llegada); }
@keyframes sube { from { opacity: 0; transform: translateY(16px); } }
.barra-guardar .estado-guardado { flex: 1; display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: var(--opt-text-sm); }
.estado-guardado.ok { color: var(--opt-success); } .estado-guardado.pend { color: var(--opt-warning); } .estado-guardado.error { color: var(--opt-error); }

/* ============ formularios ============ */
.form { display: grid; gap: 16px; max-width: 680px; }
.form label { display: grid; gap: 7px; font-weight: 600; font-size: var(--opt-text-sm); color: var(--opt-text); }
.form input, .form select, .form textarea, .campo { min-height: var(--opt-control-height); padding: 8px 14px; border-radius: var(--opt-radius-control); border: 0; box-shadow: inset 0 0 0 1px var(--opt-border-strong); background: var(--opt-surface-raised); color: var(--opt-text); outline: 0; min-width: 0; font-weight: 400; transition: box-shadow .3s var(--llegada); }
.form textarea, textarea.campo { min-height: 80px; resize: vertical; }
.form input:hover, .form select:hover, .form textarea:hover, .campo:hover { box-shadow: inset 0 0 0 1px rgba(11, 19, 27, .24); }
.form input:focus, .form select:focus, .form textarea:focus, .campo:focus { box-shadow: inset 0 0 0 1px var(--opt-accent-border), 0 0 0 4px var(--opt-accent-soft); }
.form input[aria-invalid=true], .campo[aria-invalid=true] { box-shadow: inset 0 0 0 1px var(--opt-error), 0 0 0 4px var(--opt-error-soft); animation: sacude .4s var(--llegada); }
@keyframes sacude { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.error-campo { color: var(--opt-error); font-size: var(--opt-text-xs); font-weight: 500; animation: entra-y .4s var(--llegada); }
@keyframes entra-y { from { opacity: 0; transform: translateY(-4px); } }
.form .dos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form fieldset.conexion, fieldset.conexion { border: 0; border-radius: 8px; padding: 18px; display: grid; gap: 12px; min-width: 0; background: var(--opt-surface-inset); color: var(--opt-text); }
fieldset.conexion legend { float: left; width: 100%; padding: 0 0 4px; font-weight: 600; color: var(--opt-heading); }
.ayuda { color: var(--opt-text-secondary); line-height: 1.5; font-size: var(--opt-text-xs); font-weight: 400; }
.ayuda.caja { display: block; background: var(--opt-accent-soft); border-radius: 8px; padding: 12px 14px; color: var(--opt-text); font-size: var(--opt-text-sm); }
label.check { display: flex !important; gap: 10px; align-items: center; font-weight: 500; font-size: var(--opt-text-sm); }
label.check input, input[type=checkbox], input[type=radio] { accent-color: var(--lumina); width: 17px; height: 17px; flex: none; }
.botones { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; justify-content: flex-end; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 14px; border-radius: var(--opt-radius-pill); background: var(--opt-surface-raised); box-shadow: inset 0 0 0 1px var(--opt-border-strong); font-weight: 500; font-size: var(--opt-text-sm); color: var(--opt-heading); white-space: nowrap; transition: box-shadow .3s var(--llegada), background .2s, transform .3s var(--llegada); }
.pill:hover { box-shadow: inset 0 0 0 1px rgba(11, 19, 27, .24), 0 8px 18px -14px rgba(11, 19, 27, .4); }
.pill:active { transform: scale(.97); }
.pill.on { background: var(--opt-heading); color: var(--opt-background); box-shadow: none; }
.pill .n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--opt-radius-pill); background: var(--opt-surface-inset); font-size: 11.5px; font-weight: 700; }
.pill.on .n { background: rgba(255, 255, 255, .18); }
input.pill { border-radius: var(--opt-radius-control); outline: 0; border: 0; }
.tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.tools .grow { flex: 1; }
.aviso:not(.chip), .no-disp, .no-disp-r { background: var(--opt-warning-soft); color: var(--opt-warning); border-radius: 6px; padding: 9px 12px; font-size: var(--opt-text-xs); line-height: 1.45; }
.aviso:not(.chip) { font-size: var(--opt-text-sm); padding: 11px 14px; }
.no-disp { display: grid; gap: 4px; } .no-disp small { display: flex; gap: 4px; align-items: flex-start; font-size: var(--opt-text-xs); } .no-disp b { font-weight: 600; }
.no-disp-r { display: flex; gap: 6px; align-items: flex-start; }
.no-disp .ic, .no-disp-r .ic, .pi-estado .ic { vertical-align: -2px; margin-right: 2px; }
.prueba { border-radius: 8px; padding: 12px 14px; display: grid; gap: 10px; font-size: var(--opt-text-sm); animation: entra-y .45s var(--llegada); }
.prueba.ok { background: var(--opt-success-soft); } .prueba.mal { background: var(--opt-error-soft); }
.pasos { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pasos li { display: grid; gap: 2px; } .pasos li small { color: var(--opt-text-secondary); overflow-wrap: anywhere; }
.pasos li.ok b { color: var(--opt-success); } .pasos li.mal b { color: var(--opt-error); }
.hallazgos { display: grid; gap: 4px; }
.hallazgo { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--opt-border); }
.hallazgo:last-child { border-bottom: 0; } .hallazgo small { color: var(--opt-text-secondary); }
pre.codigo { background: var(--opt-surface-inset); padding: 14px; border-radius: 8px; overflow: auto; font-size: 12.5px; margin-top: 10px; }
.secreto { display: flex; gap: 8px; align-items: center; }
.secreto code { flex: 1; min-width: 0; background: var(--opt-surface-inset); padding: 10px 14px; border-radius: 6px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rango { display: flex; align-items: center; gap: 14px; }
.rango input[type=range] { flex: 1; accent-color: var(--lumina); }
.rango output { font-weight: 700; color: var(--opt-heading); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

/* estado de la Pi en tarjetas de cámara y en el asistente */
.pi-estado { display: grid; gap: 5px; font-size: var(--opt-text-xs); color: var(--opt-text-secondary); line-height: 1.45; }
.pi-estado > div { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; }
.pi-estado .chip { min-height: 22px; font-size: 11.5px; }
.pi-estado .anul { color: var(--opt-warning); }
.pi-estado code { font-size: 11px; background: var(--opt-surface-inset); padding: 1px 5px; border-radius: 5px; }
.pi-estado .mal, .as-vivo .mal, .as-resumen .mal { color: var(--opt-error); font-weight: 600; }

/* ============ diálogos: el fondo se desenfoca y el diálogo llega con resorte ============ */
.modal, .modal-fantasma { position: fixed; inset: 0; background: var(--opt-overlay); -webkit-backdrop-filter: blur(14px) saturate(120%); backdrop-filter: blur(14px) saturate(120%); display: grid; place-items: center; z-index: 30; padding: 24px; animation: velo .45s var(--llegada); }
@keyframes velo { from { background: transparent; -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); } }
.modal > .card, .modal-fantasma > .card { max-width: 560px; width: 100%; background: var(--vidrio-fuerte); -webkit-backdrop-filter: var(--vidrio-blur); backdrop-filter: var(--vidrio-blur); max-height: calc(100vh - 48px); overflow: auto; padding: 28px; border-radius: var(--opt-radius-panel); box-shadow: var(--vidrio-filo), var(--opt-shadow-lg); animation: dialogo .55s var(--resorte); }
:root[data-theme=oscuro] .modal > .card { background: rgba(36, 36, 40, .86); }
@keyframes dialogo { from { opacity: 0; transform: translateY(14px) scale(.96); filter: blur(6px); } 60% { filter: none; } }
.modal-fantasma { pointer-events: none; animation: velo-sale .3s var(--llegada) forwards; }
.modal-fantasma > .card { animation: dialogo-sale .3s var(--llegada) forwards; }
@keyframes velo-sale { to { background: transparent; -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); } }
@keyframes dialogo-sale { to { opacity: 0; transform: translateY(8px) scale(.97); filter: blur(4px); } }
.modal > .card.ancho { max-width: 680px; }
.modal > .card.evento { max-width: 980px; }
.modal > .card.asistente { max-width: 920px; }
.modal > .card > p.aviso { margin-top: 10px; }
.modal h2 { margin-bottom: 4px; font-size: 24px; letter-spacing: -0.03em; }
.modal .sub { font-size: var(--opt-text-md); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-head > div { flex: 1; min-width: 0; }
.modal-head .t { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.modal-head small { color: var(--opt-text-secondary); font-size: var(--opt-text-sm); }
.cerrar-x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--opt-text-secondary); background: var(--opt-surface-inset); flex: none; transition: background .2s, color .2s, transform .35s var(--llegada); }
.cerrar-x:hover { color: var(--opt-heading); transform: rotate(90deg); }
.confirmar p { color: var(--opt-text-secondary); margin-top: 8px; }

/* asistente de puesta en marcha (estructura conservada) */
.stepper { list-style: none; padding: 0; margin: 0 0 20px; display: flex; gap: 6px; }
.stepper li { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--opt-text-secondary); position: relative; }
.stepper .num { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; flex: none; font-weight: 700; font-size: 12px; background: var(--opt-surface-inset); transition: background .4s var(--llegada), color .3s, transform .5s var(--resorte); }
.stepper li.on { color: var(--opt-heading); font-weight: 600; } .stepper li.on .num { background: var(--opt-heading); color: var(--opt-background); transform: scale(1.08); }
.stepper li.hecho .num { background: var(--opt-success-soft); color: var(--opt-success); }
.stepper .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#as-cuerpo { display: grid; gap: 12px; animation: entra-y .45s var(--llegada); }
.as-visor { aspect-ratio: 16 / 9; }
.as-ov { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.as-lista { display: grid; gap: 8px; }
.as-op { display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 8px; background: var(--opt-surface-raised); box-shadow: inset 0 0 0 1px var(--opt-border); text-align: left; width: 100%; cursor: pointer; transition: box-shadow .35s var(--llegada), transform .35s var(--llegada), background .2s; }
.as-op:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 1px var(--opt-border-strong), 0 12px 24px -18px rgba(11, 19, 27, .45); }
.as-op.on { box-shadow: inset 0 0 0 2px var(--lumina), 0 12px 24px -18px rgba(236, 109, 39, .55); background: var(--opt-accent-soft); }
.as-op > span:not(.chip) { display: grid; gap: 2px; flex: 1; min-width: 0; }
.as-op b { color: var(--opt-heading); font-size: var(--opt-text-md); font-weight: 600; }
.as-op small { color: var(--opt-text-secondary); font-size: var(--opt-text-xs); line-height: 1.4; }
.as-casos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.as-casos .as-op { align-items: flex-start; } .as-casos .as-op > svg { color: var(--lumina); margin-top: 1px; }
.as-ajustes { border-radius: 8px; padding: 12px 14px; background: var(--opt-surface-inset); }
.as-ajustes summary { cursor: pointer; font-weight: 600; color: var(--opt-heading); font-size: var(--opt-text-sm); }
.as-herr { margin: 0; }
.as-vivo { display: flex; align-items: center; gap: 8px; font-size: var(--opt-text-sm); flex-wrap: wrap; }
.as-prueba ul { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 6px; font-size: var(--opt-text-sm); }
.as-prueba li.ok { color: var(--opt-success); } .as-prueba li.mal, .as-prueba li.alta { color: var(--opt-error); } .as-prueba li.alta { font-weight: 600; }
.as-resumen { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: var(--opt-text-sm); margin: 0; }
.as-resumen dt { color: var(--opt-text-secondary); } .as-resumen dd { color: var(--opt-heading); font-weight: 600; line-height: 1.5; } .as-resumen small { font-weight: 400; }

/* avisos: notificaciones de vidrio como las de macOS (entran desde la derecha, salen deslizándose) */
.toasts { position: fixed; right: 20px; top: 68px; z-index: 40; display: grid; gap: 10px; justify-items: end; pointer-events: none; transition: top .2s var(--llegada); } /* top: bajo el encabezado de la vista (nucleo.js, ubicarAvisos) */
.toast { display: flex; align-items: center; gap: 12px; max-width: 440px; padding: 7px 7px 7px 7px; border-radius: var(--opt-radius-pill); background: var(--vidrio-fuerte); -webkit-backdrop-filter: var(--vidrio-blur); backdrop-filter: var(--vidrio-blur); color: var(--opt-heading); font-weight: 500; font-size: var(--opt-text-sm); box-shadow: var(--vidrio-filo), var(--opt-shadow-lg); pointer-events: auto; animation: aviso-entra .6s var(--resorte); }
.toast > .ic { width: 32px; height: 32px; padding: 7px; border-radius: 50%; flex: none; }
.toast.ok > .ic { background: var(--opt-success-soft); color: var(--opt-success); }
.toast.mala > .ic { background: var(--opt-error-soft); color: var(--opt-error); }
.toast.alerta > .ic { background: var(--lumina); color: #0B131B; }
.toast .btn { margin-left: 4px; }
@keyframes aviso-entra { from { opacity: 0; transform: translateX(28px) scale(.96); filter: blur(6px); } }
.toast.fantasma { position: fixed; z-index: 41; margin: 0; pointer-events: none; animation: aviso-sale .35s var(--llegada) forwards; }
@keyframes aviso-sale { to { opacity: 0; transform: translateX(32px) scale(.97); filter: blur(4px); } }
.cap { display: inline-block; }
.cap::first-letter { text-transform: uppercase; }

/* atajos */
.atajos { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: var(--opt-text-sm); margin-top: 12px; }
.atajos dt { white-space: nowrap; } .atajos dd { color: var(--opt-text-secondary); }
.atajos h3 { grid-column: 1 / -1; margin-top: 10px; }

/* ============ entradas escalonadas (movimiento.js pone .entra y --i) ============ */
.entra { animation: entra .8s var(--llegada) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes entra { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } }
.entra-fila { animation: entra-fila .6s var(--llegada) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes entra-fila { from { opacity: 0; transform: translateY(8px); } }

/* ventanas angostas (la ventana mínima del producto es 1024 × 640) */
@media (max-width: 1199px) {
  :root { --opt-content-padding: 22px; }
  .search { width: min(240px, 26vw); }
}
@media (max-width: 1099px) {
  .fila-dos { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; }
  .luz i { animation: none; }
}
@media print {
  body { overflow: visible; background: #fff; }
  .luz, .arranque { display: none !important; }
  .app { display: block; height: auto; } .side, .top, .encabezado-acciones, .toasts, .no-imprimir { display: none !important; }
  .view { overflow: visible; padding: 0; } .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; backdrop-filter: none; background: #fff; }
  .solo-imprimir { display: block !important; }
}
.solo-imprimir { display: none; }

/* ============ indicadores del Centro operativo y barra de filtros persistentes ============ */
.ind { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px 22px; min-height: 140px; overflow: hidden; }
.ind:hover { transform: translateY(-2px); box-shadow: var(--vidrio-filo), var(--opt-shadow-md); }
.ind:has(.ind-ir:focus-visible) { outline: 2px solid var(--opt-focus); outline-offset: 2px; }
.ind-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ind-cab h3 { font-size: var(--opt-text-sm); font-weight: 500; color: var(--opt-text-secondary); line-height: 1.35; }
.ind-ir { color: inherit; }
.ind-ir::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.ind-ir:focus-visible { outline: none; }
.ind-ico { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; flex: none; background: var(--opt-surface-inset); color: var(--opt-text-secondary); transition: transform .5s var(--resorte); }
.ind:hover .ind-ico { transform: scale(1.1) rotate(-6deg); }
.ind-valor { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ind-valor strong { font-family: var(--opt-font-display); font-size: 2.75rem; line-height: 1; font-weight: 600; letter-spacing: -0.05em; color: var(--opt-heading); font-variant-numeric: tabular-nums; }
.ind-u, .ind-de { font-size: var(--opt-text-lead); font-weight: 500; color: var(--opt-text-secondary); letter-spacing: -0.01em; }
.ind-sd { font-size: var(--opt-text-section); font-weight: 600; color: var(--opt-text-muted); letter-spacing: 0; }
.ind-sub { margin-top: auto; font-size: var(--opt-text-xs); color: var(--opt-text-secondary); line-height: 1.45; }
.ind-sec { position: relative; z-index: 1; color: var(--opt-accent-text); text-decoration: underline; text-decoration-color: var(--opt-accent-border); text-underline-offset: 3px; border-radius: 4px; }
.ind-alerta { color: var(--opt-accent-text); font-weight: 600; }
/* el indicador que pide atención se enciende con la luz de Lumina */
.ind.foco .ind-valor strong { color: var(--opt-accent-text); }
.ind.foco .ind-ico { background: var(--lumina); color: #0B131B; }
.ind.foco .ind-alerta { display: inline-flex; padding: 3px 9px; border-radius: var(--opt-radius-pill); background: var(--opt-error-soft); color: var(--opt-error); font-size: 12px; }
.chip.chico-chip { min-height: 20px; padding: 0 8px; font-size: 11px; vertical-align: 1px; }
.co-filtros { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.fg { flex: 1 1 auto; min-width: 0; gap: 8px; }
.fg-tit { font-size: var(--opt-text-sm); color: var(--opt-text-secondary); }
.fg .control { height: 36px; font-size: var(--opt-text-sm); padding: 0 12px; }
.fg .control select { max-width: 136px; text-overflow: ellipsis; }
.fg-planta { font-weight: 500; }
.fg-planta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.fg-fecha { gap: 6px; }
.fg-fecha span { font-size: var(--opt-text-xs); color: var(--opt-text-secondary); }
.fg-fecha input { width: 132px; }
:root[data-theme=oscuro] .fg-fecha input { color-scheme: dark; }
.co-sync { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-size: var(--opt-text-xs); color: var(--opt-text-secondary); white-space: nowrap; }

/* ============ íconos animados (Lucide; cada trazo tiene pathLength=1) ============ */
/* se dibujan al activarse la sección y al pasar sobre ella; algunos tienen su gesto propio */
@keyframes dibuja { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
.nav-item[aria-current=page] .ic, .nav-item:hover .ic, .ruta-btn:hover .ic, .menu button:hover .ic, .vacio > .ic { animation: dibuja .8s var(--llegada) both; }
.ic:has(use[href="#i-ajustes"]), .ic:has(use[href="#i-motor"]), .ic:has(use[href="#i-sync"]), .ic:has(use[href="#i-reiniciar"]), .ic:has(use[href="#i-mas"]), .ic:has(use[href="#i-flecha"]) { transition: transform .6s var(--llegada); }
:is(.nav-item, .btn, .ib, .pill):hover .ic:has(use[href="#i-ajustes"]), :is(.btn, .ib):hover .ic:has(use[href="#i-motor"]) { transform: rotate(90deg); }
:is(.btn, .ib):hover .ic:has(use[href="#i-sync"]) { transform: rotate(180deg); }
:is(.btn, .ib):hover .ic:has(use[href="#i-reiniciar"]) { transform: rotate(-180deg); }
:is(.btn, .ib, a):hover .ic:has(use[href="#i-descargar"]) { animation: baja .6s var(--llegada); }
@keyframes baja { 40% { transform: translateY(3px); } }
:is(.btn, .ib, a):hover .ic:has(use[href="#i-flecha"]) { transform: translateX(3px); }
:is(.btn, .ib):hover .ic:has(use[href="#i-chispa"]) { animation: destello .7s var(--llegada); }
@keyframes destello { 40% { transform: scale(1.18) rotate(12deg); } }
:is(.btn, .ib):hover .ic:has(use[href="#i-mas"]) { transform: rotate(90deg); }
.bell .ic, .nav-item .ic:has(use[href="#i-campana"]) { transform-origin: 50% 15%; }
.bell:hover .ic, .bell.suena .ic, .nav-item:hover .ic:has(use[href="#i-campana"]) { animation: campana .8s var(--llegada); }
@keyframes campana { 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); } }
.bell.on { background: var(--opt-surface-inset); color: var(--opt-heading); }

/* ============ ruta con función: atrás/adelante y menú del grupo ============ */
.crumbs { gap: 6px; }
.ruta-nav { display: flex; gap: 2px; margin-right: 6px; }
.ruta-nav .ib { width: 30px; height: 30px; }
.ruta-nav .ib:disabled { opacity: .3; cursor: default; }
.ruta-btn { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: var(--opt-radius-pill); color: var(--opt-text-secondary); font-weight: 500; transition: background .2s, color .2s; }
.ruta-btn:hover, .ruta-btn[aria-expanded=true] { background: var(--opt-surface-inset); color: var(--opt-heading); }
.ruta-btn .ic { transition: transform .3s var(--llegada); }
.ruta-btn[aria-expanded=true] .ic { transform: rotate(180deg); }
.crumbs b { display: inline-flex; align-items: center; gap: 8px; }
.crumbs b .ic { color: var(--lumina); }
.crumbs .sep { opacity: .45; }
.ruta-tab { text-transform: capitalize; color: var(--opt-text-secondary); }
.ruta-menu { left: 0; right: auto; transform-origin: top left; min-width: 220px; }
.ruta-menu button { display: flex; align-items: center; gap: 10px; }
.ruta-menu button[aria-current=true] { background: var(--opt-surface-inset); font-weight: 600; }
.ruta-menu button[aria-current=true] .ic { color: var(--lumina); }
.ruta-menu .contador { margin-left: auto; }

/* ============ panel de notificaciones ============
   Va por debajo de los diálogos (.modal, z-index 30): la confirmación que se abre desde el panel queda encima de él. */
.notis { position: fixed; z-index: 25; top: 64px; right: 16px; width: 420px; max-height: calc(100vh - 84px); display: flex; flex-direction: column; border-radius: var(--opt-radius-panel); background: var(--vidrio-fuerte); -webkit-backdrop-filter: var(--vidrio-blur); backdrop-filter: var(--vidrio-blur); box-shadow: var(--vidrio-filo), var(--opt-shadow-lg); transform-origin: top right; animation: popover .4s var(--llegada); overflow: hidden; }
:root[data-theme=oscuro] .notis { background: rgba(20, 20, 23, .92); }
.notis.sale { animation: notis-sale .25s var(--llegada) forwards; }
@keyframes notis-sale { to { opacity: 0; transform: scale(.96) translateY(-4px); } }
.notis-cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 16px 12px 18px; border-bottom: 1px solid var(--opt-border); }
.notis-cab h2 { font-size: 16px; }
.notis-lista { flex: 1; min-height: 120px; overflow-y: auto; padding: 6px 8px 8px; }
.notis-lista ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.notis-t { padding: 10px 10px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--opt-text-muted); }
.noti { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--opt-radius-card); text-align: left; transition: background .2s; }
.noti:hover, .noti:focus-visible { background: var(--opt-surface-inset); }
.noti-ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--opt-surface-inset); color: var(--opt-heading); }
.noti.alta .noti-ico { background: var(--lumina); color: #0B131B; }
.noti-ico .ic { width: 17px; height: 17px; }
.noti-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.noti-txt b { font-weight: 600; font-size: var(--opt-text-sm); color: var(--opt-heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.noti-txt small, .noti-der small { font-size: 12px; color: var(--opt-text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.noti-der { flex: none; }
.notis-mas { padding: 10px; text-align: center; font-size: 12.5px; color: var(--opt-text-secondary); }
.notis-pie { display: grid; gap: 12px; padding: 12px 16px 14px 18px; border-top: 1px solid var(--opt-border); }
.notis-silencio { display: flex; align-items: center; gap: 10px; font-size: var(--opt-text-sm); color: var(--opt-text-secondary); cursor: pointer; }
.notis-silencio .sw { transform: scale(.8); transform-origin: left center; margin-right: -8px; }
.notis-acc { display: flex; gap: 8px; justify-content: space-between; }
/* con el panel abierto, los avisos emergentes no lo tapan (igual quedan en la lista) */
body:has(.notis) .toasts { opacity: 0; pointer-events: none; transition: opacity .2s; }
:root[data-theme=oscuro] .menu { background: rgba(22, 22, 25, .97); }

/* ============ navegación por secciones: pestañas en la barra superior ============ */
.ruta-sec { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; color: var(--opt-heading); font-weight: 600; white-space: nowrap; }
.ruta-sec .ic { color: var(--lumina); }
.ruta-tabs { flex: none; }
.ruta-tabs a { display: inline-flex; align-items: center; min-height: 28px; padding: 0 14px; border-radius: var(--opt-radius-pill); font-size: var(--opt-text-sm); font-weight: 600; color: var(--opt-text-secondary); white-space: nowrap; transition: color .2s, background .3s var(--llegada), box-shadow .3s var(--llegada); }
.ruta-tabs a:hover { color: var(--opt-heading); }
.ruta-tabs a.on { background: var(--opt-surface-raised); color: var(--opt-heading); box-shadow: 0 1px 2px rgba(11, 19, 27, .1), 0 4px 12px -6px rgba(11, 19, 27, .25); animation: tab-on .4s var(--llegada); }
@keyframes tab-on { from { transform: scale(.94); opacity: .6; } }
#nav > .nav-sep { margin: 10px 12px; }

/* ============ pantallas más simples: lo secundario aparece al explorar ============ */
/* el nombre de la sección ya está en la barra: el título baja y la bajada queda en una línea */
.view .encabezado h1 { font-size: 26px; letter-spacing: -0.03em; }
.view .encabezado .sub { font-size: var(--opt-text-md); margin-top: 4px; max-width: 70ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-cab h1 { font-size: 30px; }
/* indicadores: se lee el número; la explicación en dos líneas y completa al pasar o enfocar */
.ind-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ind:hover .ind-sub, .ind:focus-within .ind-sub { -webkit-line-clamp: 6; }
/* un indicador sin datos no grita: compacto y atenuado hasta que lo exploras */
/* UI-09: la tarjeta sin datos no se atenúa con opacidad (su texto bajaba a 2,1:1); se distingue por «Sin datos» y por ocultar el detalle */
.ind:has(.ind-sd) { min-height: 0; }
.ind:has(.ind-sd) .ind-sub { display: none; }
.ind:has(.ind-sd):hover .ind-sub, .ind:has(.ind-sd):focus-within .ind-sub { display: -webkit-box; }
.ind-sd { font-size: var(--opt-text-md); }
/* ayudas largas dentro de tarjetas: dos líneas, completas al pasar */
.co-sub, .card > .sub, .card-head + p, .rp-nota span, .ev-ayuda { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
:is(.card, .co-head):hover :is(.co-sub, .card-head + p, .rp-nota span, .ev-ayuda), .card:hover > .sub { -webkit-line-clamp: 8; }
.crumbs .ruta-tabs a { width: auto; height: auto; display: inline-flex; border-radius: var(--opt-radius-pill); color: var(--opt-text-secondary); }
.crumbs .ruta-tabs a.on { color: var(--opt-heading); }

/* ============ controles propios (controles.js): nada se abre con la ventana del sistema ============ */
.sel-oculto { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; overflow: hidden; }
.sel { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; max-width: 100%; text-align: left; color: var(--opt-text); font-weight: 500; cursor: pointer; }
.sel:disabled { opacity: .5; cursor: not-allowed; }
.sel-txt { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sel-flecha { flex: none; color: var(--opt-text-secondary); transition: transform .3s var(--llegada); }
.sel[aria-expanded=true] .sel-flecha { transform: rotate(180deg); }
.control .sel { height: 100%; padding: 0; background: none; border: 0; max-width: 220px; }
.fg .control .sel { max-width: 150px; }
/* fuera de un .control (formularios, tablas, diálogos) se ve como campo */
.sel:not(.control .sel) { min-height: var(--opt-control-height); padding: 0 12px 0 14px; border-radius: var(--opt-radius-control); background: var(--opt-surface-raised); box-shadow: inset 0 0 0 1px var(--opt-border-strong); transition: box-shadow .3s var(--llegada); }
.sel:not(.control .sel):hover { box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .45); }
.sel:not(.control .sel):focus-visible, .sel:not(.control .sel)[aria-expanded=true] { outline: 0; box-shadow: inset 0 0 0 1px var(--opt-accent-border), 0 0 0 4px var(--opt-accent-soft); }
.form label > .sel { width: 100%; }
.control:has(.sel[aria-expanded=true]) { box-shadow: inset 0 0 0 1px var(--opt-accent-border), 0 0 0 4px var(--opt-accent-soft); }

.flota { position: fixed; z-index: 60; overflow: auto; border-radius: var(--opt-radius-panel); background: var(--vidrio-fuerte); -webkit-backdrop-filter: var(--vidrio-blur); backdrop-filter: var(--vidrio-blur); box-shadow: var(--vidrio-filo), var(--opt-shadow-lg); animation: popover .28s var(--llegada); }
:root[data-theme=oscuro] .flota { background: rgba(24, 24, 27, .97); }
.flota.sale { animation: flota-sale .18s var(--llegada) forwards; }
@keyframes flota-sale { to { opacity: 0; transform: scale(.97); } }
.lista [role=listbox] { padding: 5px; outline: 0; display: grid; gap: 1px; }
.op { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px 0 8px; border-radius: var(--opt-radius-control); font-size: var(--opt-text-sm); color: var(--opt-heading); cursor: pointer; white-space: nowrap; }
.op.act { background: var(--opt-surface-inset); }
.op-check { visibility: hidden; color: var(--lumina); }
.op[aria-selected=true] { font-weight: 600; }
.op[aria-selected=true] .op-check { visibility: visible; }
.op[aria-disabled=true] { opacity: .4; cursor: default; }
.op-grupo { padding: 8px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--opt-text-muted); }

input.fecha-app::-webkit-calendar-picker-indicator { display: none; }
input.fecha-app { cursor: pointer; }
.calendario { width: 272px; padding: 12px; }
.cal-cab { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-cab b { font-size: var(--opt-text-md); text-transform: capitalize; color: var(--opt-heading); }
.cal-cab .ib { width: 30px; height: 30px; }
.cal-sem, .cal-dias { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-sem span { font-size: 11px; font-weight: 600; color: var(--opt-text-muted); padding: 4px 0; }
.cal-dias button { height: 32px; border-radius: 50%; font-size: var(--opt-text-sm); color: var(--opt-heading); font-variant-numeric: tabular-nums; transition: background .15s; }
.cal-dias button:hover:not(:disabled) { background: var(--opt-surface-inset); }
.cal-dias button.hoy { color: var(--lumina); font-weight: 700; }
.cal-dias button.on { background: var(--opt-heading); color: var(--opt-background); font-weight: 600; }
.cal-dias button:disabled { opacity: .3; cursor: default; }
.cal-pie { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--opt-border); }

.globo { position: fixed; z-index: 70; max-width: 300px; padding: 7px 11px; border-radius: var(--opt-radius-control); background: #1C1C1F; color: #F5F5F7; font-size: 12.5px; line-height: 1.4; pointer-events: none; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(-3px); transition: opacity .18s, transform .25s var(--llegada); }
:root[data-theme=oscuro] .globo { background: #2C2C30; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 10px 30px -10px rgba(0, 0, 0, .8); }
.globo.on { opacity: 1; transform: none; }

/* ============ pestañas internas más limpias ============ */
/* Avisos: Canales · Escalamiento · Historial ya están en la barra superior */
.al-tabs { display: none !important; }
/* Configuración como Ajustes de macOS: lista lateral de grupos y una sola columna de contenido */
.view:has(> .cf-tabs) { display: grid; grid-template-columns: 220px minmax(0, 1fr); column-gap: 28px; align-content: start; }
.view:has(> .cf-tabs) > * + * { margin-top: 0; }
.view:has(> .cf-tabs) > .encabezado, .view:has(> .cf-tabs) > .barra-guardar { grid-column: 1 / -1; }
.view:has(> .cf-tabs) > .encabezado { margin-bottom: 20px; }
.view:has(> .cf-tabs) > .barra-guardar { margin-top: 22px; }
.cf-tabs { grid-column: 1; align-self: start; position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; padding: 0; background: none; border-radius: 0; overflow: visible; max-width: none; }
.cf-tabs [role=tab] { justify-content: flex-start; width: 100%; min-height: 36px; padding: 0 12px; font-weight: 500; color: var(--opt-text); }
.cf-tabs [role=tab] .ic { color: var(--opt-text-secondary); }
.cf-tabs [role=tab][aria-selected=true] { font-weight: 600; }
.cf-tabs [role=tab][aria-selected=true] .ic { color: var(--lumina); }
.view:has(> .cf-tabs) > .cf-grid { grid-column: 2; grid-template-columns: minmax(0, 1fr); max-width: 860px; }

/* ============ ingreso del panel desde la red (servidor en la Pi; js/sesion.js, Sesion.pantalla) ============
   Tapa toda la app sobre el navy de la navegación: sin sesión, desde otro equipo, el servidor no muestra nada más. */
.ingreso { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; overflow: auto; background: var(--opt-nav-background); }
.ingreso-caja { width: 100%; max-width: 400px; display: grid; gap: 20px; padding: 32px; background: var(--opt-surface); color: var(--opt-text); border: 1px solid var(--opt-border); border-radius: var(--opt-radius-panel); box-shadow: var(--opt-shadow-md); }
.ingreso-marca { display: flex; align-items: center; gap: 12px; }
.ingreso-marca img { flex: none; display: block; }
.ingreso-marca span { display: grid; gap: 4px; line-height: 1; }
.ingreso-marca .marca-palabra { height: 20px; }
.ingreso-marca small { font-size: 9.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--opt-text-muted); }
.ingreso h1 { font-size: var(--opt-text-section); }
.ingreso-sub { margin-top: 6px; color: var(--opt-text-secondary); font-size: var(--opt-text-sm); }
.ingreso .form { gap: 14px; }
.ingreso-pie { display: flex; align-items: flex-start; gap: 8px; padding-top: 16px; border-top: 1px solid var(--opt-border); color: var(--opt-text-muted); font-size: var(--opt-text-xs); line-height: 1.5; }
.ingreso-pie .ic { margin-top: 2px; }
.ingreso-pie b { color: var(--opt-text-secondary); font-weight: 600; overflow-wrap: anywhere; }
/* pestañas «Ingresar | Crear cuenta» y los pasos de Crear cuenta (js/sesion.js: htmlIngreso y montarRegistro; el mismo
   flujo va en un diálogo en este equipo), el enlace del diálogo de ingreso y Mi cuenta. Todo con tokens: claro y oscuro. */
.ing-tabs { display: flex; width: 100%; }
.ing-tabs [role=tab] { flex: 1; justify-content: center; }
.ing-panel, .ing-form, .cc-modal { display: grid; gap: 20px; align-content: start; }
.cc-tit { font-size: var(--opt-text-section); outline: 0; margin-bottom: -14px; }
.modal .cc-tit { font-size: 24px; letter-spacing: -0.03em; padding-right: 40px; }
.cc-form { gap: 14px; }
.cc-campo { display: grid; gap: 6px; min-width: 0; }
.cc-aviso { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--opt-radius-card); background: var(--opt-info-soft); color: var(--opt-text); font-size: var(--opt-text-sm); line-height: 1.5; }
.cc-aviso .ic { flex: none; margin-top: 2px; color: var(--opt-info); }
.cc-aviso[role=alert] { background: var(--opt-error-soft); } .cc-aviso[role=alert] .ic { color: var(--opt-error); }
.cc-pie { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: -6px; color: var(--opt-text-secondary); font-size: var(--opt-text-sm); line-height: 1.5; }
.cc-pie .btn.t { padding: 0 8px; }
.ingreso-sub b { color: var(--opt-heading); overflow-wrap: anywhere; }
#cc-k { font-family: var(--opt-mono, ui-monospace, monospace); letter-spacing: 0.12em; text-transform: uppercase; }
.modal .cc-x { position: absolute; top: 20px; right: 20px; }
.ses-crear { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 14px; color: var(--opt-text-secondary); font-size: var(--opt-text-sm); }
.mc-grupo { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 16px; border: 0; border-radius: var(--opt-radius-card); background: var(--opt-surface-inset); }
.mc-grupo legend { float: left; width: 100%; padding: 0; color: var(--opt-heading); font-weight: 600; font-size: var(--opt-text-body); }
.mc-grupo legend + * { clear: both; }
.mc-et { font-weight: 600; font-size: var(--opt-text-sm); color: var(--opt-text); }
.mc-seg { flex-wrap: wrap; width: max-content; max-width: 100%; }
.mc-nota { margin: 0; }
@media (max-width: 520px) {
  .ingreso { padding: 12px; place-items: start center; }
  .ingreso-caja { padding: 22px 18px; gap: 16px; }
  .modal { padding: 12px; }
  .modal > .card { padding: 22px 18px; max-height: calc(100vh - 24px); }
  .mc-form .dos { grid-template-columns: minmax(0, 1fr); }
  .mc-seg { width: 100%; } .mc-seg button { flex: 1 1 auto; justify-content: center; }
  .ses-chip { flex-wrap: wrap; padding: 4px 4px 4px 12px; }
}
.as-op.as-pronto { opacity: .6; cursor: default; }
.as-op.as-pronto:hover { transform: none; }

/* Auditoría 1.3.1: lo que el rol no puede hacer, a la vista (SEG-01/02/03) y el aviso de datos recuperados (SEG-11). */
.img-negada { display: grid; place-items: center; width: 100%; height: 100%; min-height: 48px; padding: 8px; box-sizing: border-box; text-align: center; font-size: var(--opt-text-sm); color: var(--opt-text-secondary); background: var(--opt-surface-inset); }
.sin-permiso { opacity: .55; cursor: not-allowed; }
/* Bajo la barra superior (que flota sobre la vista): la banda ocupa su sitio y la vista le cede su margen. */
.aviso-datos { flex: none; margin: calc(var(--alto-top, 56px) + 10px) var(--opt-content-padding) 0; border-left: 4px solid var(--opt-warning); }
.aviso-datos + .view { padding-top: 20px; }
/* UI-06: ventana angosta (≤ 900 px, p. ej. 200 % de zoom en 1366×768): la barra superior salta de línea en vez de
   encimarse (la ruta y sus pestañas arriba; búsqueda y campana abajo) y Configuración pasa a una columna. */
@media (max-width: 900px) {
  .top { height: auto; min-height: 56px; flex-wrap: wrap; row-gap: 6px; padding-top: 8px; padding-bottom: 8px; }
  .crumbs { flex: 1 1 100%; flex-wrap: wrap; row-gap: 6px; }
  .crumbs .ruta-tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .top .search, .top .search:focus-within { flex: 1 1 160px; width: auto; min-width: 0; }
  .view:has(> .cf-tabs) { grid-template-columns: minmax(0, 1fr); }
  .view:has(> .cf-tabs) > .cf-tabs { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; }
  .view:has(> .cf-tabs) > .cf-tabs [role=tab] { width: auto; }
  .view:has(> .cf-tabs) > .cf-grid { grid-column: 1; }
}
