/* Administración: usa los estilos del portal (portal.css, copia de portal-monitoreo-snap/src/styles/global.css). */
@font-face { font-family: 'Open Sans'; font-weight: 400; font-display: swap; src: url('/estatico/open-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Open Sans'; font-weight: 600; font-display: swap; src: url('/estatico/open-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Quicksand'; font-weight: 600; font-display: swap; src: url('/estatico/quicksand-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Quicksand'; font-weight: 700; font-display: swap; src: url('/estatico/quicksand-latin-700-normal.woff2') format('woff2'); }

:root { --rojo: #b91c1c; --rojo-50: #fef2f2; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* Menú flotante (igual al del portal) */
.menu { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 900; width: calc(100% - 1.5rem); max-width: 1100px; }
.menu-barra { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: .55rem .75rem .55rem 1rem;
  border-radius: 1rem; border: 1px solid rgb(231 229 228 / .8); background: rgb(255 255 255 / .85); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 4px 18px rgb(28 25 23 / .12); }
.menu-barra:has(.menu-lista.abierto) { background: rgb(255 255 255 / .97); }
.menu-marca { text-decoration: none; color: var(--piedra-900); font-family: var(--fuente-titulo); font-size: 1.2rem; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.menu-marca span { white-space: nowrap; }
.menu-marca strong { color: var(--verde-600); }
.menu-lista { display: none; list-style: none; margin: 0; padding: .5rem 0; width: 100%; flex-direction: column; gap: .25rem; order: 1; }
.menu-lista.abierto { display: flex; }
.menu-lista a:not(.boton) { display: block; padding: .6rem .75rem; border-radius: .5rem; color: var(--piedra-700); text-decoration: none; font-weight: 600; }
.menu-lista a:not(.boton):hover, .menu-lista a[aria-current='page'] { background: var(--piedra-100); color: var(--verde-700); }
.menu-cta { width: 100%; }
.menu-boton { display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 5px; width: 44px; height: 44px; padding: 0 10px; background: transparent; border: 0; border-radius: .5rem; cursor: pointer; }
.raya { display: block; height: 2px; background: var(--piedra-800); border-radius: 2px; transition: transform .2s, opacity .2s; }
.menu-boton[aria-expanded='true'] .raya:nth-child(2) { transform: translateY(7px) rotate(45deg); }
.menu-boton[aria-expanded='true'] .raya:nth-child(3) { opacity: 0; }
.menu-boton[aria-expanded='true'] .raya:nth-child(4) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 960px) {
  .menu { width: calc(100% - 4rem); }
  .menu-boton { display: none; }
  .menu-lista { display: flex; flex-direction: row; align-items: center; width: auto; padding: 0; order: 0; }
  .menu-cta { width: auto; margin-left: .5rem; }
}

/* Cabecera con la foto del portal */
.cabecera { position: relative; color: #fff; background: var(--piedra-900) url('/estatico/fondos/paisaje-07.webp') center / cover no-repeat; }
.cabecera::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgb(12 10 9 / .6), rgb(12 10 9 / .45) 45%, rgb(12 10 9 / .82)); }
.cabecera > .contenedor { position: relative; padding-top: 8rem; padding-bottom: 4.5rem; }
.cabecera h1 { color: #fff; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); text-shadow: 0 2px 20px rgb(0 0 0 / .35); }
.cabecera .antetitulo { color: var(--verde-100); }
.cabecera p { margin: 0; max-width: 58ch; color: rgb(255 255 255 / .92); }
.cabecera .sesion { margin-top: .75rem; font-size: .9rem; }
@media (max-width: 767px) {
  .cabecera { background-image: url('/estatico/fondos/paisaje-07.webp'); }
  .cabecera > .contenedor { padding-top: 6.5rem; padding-bottom: 3.5rem; }
}
.content { position: relative; margin-top: -2rem; padding-bottom: 4rem; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 1.5rem; }

/* Tarjetas, botones y formularios */
.tarjeta { background: #fff; border: 1px solid var(--piedra-200); border-top: 6px solid var(--verde-600); border-radius: var(--radio); box-shadow: var(--sombra); padding: clamp(1.1rem, .8rem + 1.4vw, 2rem); }
.tarjeta h2 { font-size: clamp(1.4rem, 1.1rem + 1vw, 1.9rem); margin: 0; }
.tarjeta-cabeza { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.suave { color: var(--texto-suave); font-size: .95rem; }
.boton-suave { background: var(--verde-50); color: var(--verde-700); border-color: var(--verde-100); }
.boton-suave:hover { background: var(--verde-100); color: var(--verde-800); }
.boton-chico { min-height: 40px; padding: .35rem .9rem; font-size: .9rem; }
.casilla { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; font-size: .95rem; }
.casilla input { width: 1.15rem; height: 1.15rem; accent-color: var(--verde-600); }
.estrecha { width: 100%; max-width: 480px; margin-inline: auto; }
.formulario { display: grid; gap: 1rem; }
.formulario label { display: grid; gap: .35rem; font-weight: 600; color: var(--piedra-800); }
.formulario input, .selector { width: 100%; min-height: 46px; padding: .6rem .8rem; border: 1px solid var(--piedra-500); border-radius: .75rem; background: #fff; color: var(--texto); font-size: 1rem; }
.mensaje { min-height: 1.6em; margin: 0; font-weight: 600; color: var(--rojo); }
.mensaje.bien { color: var(--verde-700); }

/* Inventario: tabla en computador y tarjetas en pantallas chicas */
.resumen { font-family: var(--fuente-titulo); font-weight: 700; font-size: 1.15rem; margin: 0 0 .25rem; color: var(--verde-700); }
.resumen.con-fallas { color: var(--rojo); }
.estado { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; white-space: nowrap; color: var(--piedra-600); }
.estado::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--piedra-500); flex: none; }
.estado.ok { color: var(--verde-700); }
.estado.ok::before { background: var(--verde-500); }
.estado.mal { color: var(--rojo); }
.estado.mal::before { background: var(--rojo); }
.tabla-caja { overflow-x: auto; border: 1px solid var(--piedra-200); border-radius: .75rem; }
.inventario { width: 100%; border-collapse: collapse; font-size: .88rem; line-height: 1.45; }
.inventario th { text-align: left; padding: .75rem; background: var(--verde-700); color: #fff; font-family: var(--fuente-titulo); line-height: 1.25; }
.inventario td { overflow-wrap: anywhere; padding: .75rem; border-top: 1px solid var(--piedra-200); vertical-align: top; }
.inventario tbody tr:hover { background: var(--verde-50); }
.inventario .nombre { min-width: 11.5rem; }
@media (min-width: 900px) {
  .inventario th, .inventario td { padding-inline: .6rem; }
  .inventario th:nth-child(n+3) { min-width: 5.2rem; }
  .inventario th:nth-child(3) { min-width: 8.6rem; }
  .inventario th:nth-child(4), .inventario th:nth-child(5) { min-width: 8rem; }
}
.inventario .nombre a { font-family: var(--fuente-titulo); font-weight: 700; font-size: 1rem; }
.inventario .nombre .boton { display: flex; width: fit-content; margin-top: .5rem; }
.inventario .falla { color: var(--rojo); font-size: .85rem; overflow-wrap: anywhere; }
@media (max-width: 899px) {
  .tabla-caja { border: 0; overflow: visible; }
  .inventario, .inventario tbody { display: block; }
  .inventario thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .inventario tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
  .inventario tr { display: flex; flex-direction: column; border: 1px solid var(--piedra-200); border-left: 5px solid var(--verde-500); border-radius: .75rem; padding: 1rem; background: #fff; }
  .inventario tr.con-falla { border-left-color: var(--rojo); background: var(--rojo-50); }
  .inventario td { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .5rem; padding: .25rem 0; border: 0; overflow-wrap: anywhere; }
  .inventario td::before { content: attr(data-titulo); color: var(--piedra-600); }
  .inventario td.nombre { display: block; order: -1; min-width: 0; padding-bottom: .6rem; }
  .inventario td.nombre::before { content: none; }
  .inventario .nombre a { font-size: 1.12rem; }
}

/* Alertas */
.alertas { display: grid; gap: .75rem; }
.alerta { border: 1px solid var(--piedra-200); border-left: 5px solid var(--piedra-500); border-radius: .75rem; padding: 1rem; background: var(--piedra-50); }
.alerta.critica, .alerta.alta { border-left-color: var(--rojo); background: var(--rojo-50); }
.alerta.media { border-left-color: #b45309; background: #fffbeb; }
.alerta.info { border-left-color: var(--verde-500); background: var(--verde-50); }
.alerta h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.alerta p { margin: .3rem 0; font-size: .95rem; overflow-wrap: anywhere; }

/* Ventana de logs */
.logs { width: min(1000px, calc(100vw - 1.5rem)); max-height: 92vh; max-height: 92dvh; border: 0; border-top: 6px solid var(--verde-600); border-radius: var(--radio); padding: clamp(1rem, .6rem + 1.4vw, 1.75rem); color: var(--texto); box-shadow: 0 24px 60px rgb(12 10 9 / .4); }
.logs::backdrop { background: rgb(12 10 9 / .65); }
.logs h2 { font-size: 1.35rem; margin: 0; }
.logs-controles { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: .6rem; }
.logs-controles label:not(.casilla) { display: grid; gap: .25rem; font-size: .9rem; font-weight: 600; min-width: min(100%, 16rem); }
.logs pre { margin: 0; max-height: 50vh; max-height: 50dvh; overflow: auto; background: var(--piedra-950); color: var(--piedra-200); border-radius: .75rem; padding: 1rem; font-size: .8rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.logs pre .error { color: #fca5a5; }
.logs .aviso { color: var(--rojo); font-weight: 600; }
.logs .nota { font-size: .85rem; margin: .6rem 0 0; }

/* Pie (igual al del portal) */
.pie { position: relative; color: #fff; background: linear-gradient(180deg, rgb(12 10 9 / .88), rgb(12 10 9 / .96)), var(--piedra-950) url('/estatico/pie.webp') center / cover no-repeat; }
.pie .contenedor { padding-block: 2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; font-size: .9rem; padding-right: max(1rem, 5.5rem); }
.pie p { margin: 0; color: rgb(255 255 255 / .85); }
.pie a { color: #bbf7d0; }
.pie a:hover { color: #fff; }

/* Ayuda y recorrido */
.ayuda { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 800; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.ayuda-boton { width: 52px; height: 52px; border-radius: 50%; border: 2px solid #fff; background: var(--verde-600); color: #fff; font-family: var(--fuente-titulo); font-size: 1.5rem; font-weight: 700; cursor: pointer; box-shadow: var(--sombra); }
.ayuda-boton:hover { background: var(--verde-700); }
.ayuda-menu { background: #fff; border: 1px solid var(--piedra-200); border-radius: .75rem; box-shadow: var(--sombra); padding: .4rem; }
.ayuda-menu button { min-height: 44px; padding: .5rem .8rem; border: 0; border-radius: .5rem; background: none; color: var(--verde-700); font-weight: 600; cursor: pointer; }
.ayuda-menu button:hover { background: var(--verde-50); }
.rc-bloqueo { position: fixed; inset: 0; z-index: 4000; }
.rc-foco { position: fixed; z-index: 4001; border-radius: 12px; box-shadow: 0 0 0 9999px rgb(12 10 9 / .65), 0 0 0 3px var(--verde-300) inset; pointer-events: none; transition: top .25s, left .25s, width .25s, height .25s; }
.rc-caja { position: fixed; z-index: 4002; background: #fff; border-radius: var(--radio); padding: 1rem 1.1rem; box-shadow: 0 20px 50px rgb(12 10 9 / .45); border-top: 6px solid var(--verde-600); transition: top .25s, left .25s; }
.rc-caja .rc-n { font-size: .8rem; font-weight: 600; color: var(--verde-600); }
.rc-caja h3 { margin: .2rem 0 .35rem; font-size: 1.1rem; }
.rc-caja p { margin: 0 0 .8rem; font-size: .95rem; }
.rc-bot { display: flex; gap: .4rem; align-items: center; }
.rc-bot span { flex: 1; }
.rc-bot button { min-height: 40px; font-family: var(--fuente-titulo); font-weight: 700; border-radius: .75rem; padding: .4rem .8rem; cursor: pointer; border: 0; }
.rc-sig { background: var(--verde-600); color: #fff; }
.rc-ant { background: var(--verde-50); color: var(--verde-700); }
.rc-salir { background: none; color: var(--piedra-600); padding-left: 0 !important; }
