/* Atalaya ED. Sin dependencias externas: la CSP solo permite recursos propios. */
:root {
  --fondo: #f4f5f7;
  --superficie: #ffffff;
  --texto: #1d2433;
  --texto-suave: #5b6476;
  --borde: #dde1e8;
  --marca: #1f3a68;
  --marca-fuerte: #142849;
  --acento: #2c6bd6;
  --peligro: #b42318;
  --ok: #1a7f4b;
  --bajo: #d8f0e1;    --bajo-t: #11603a;
  --medio: #fdf0c4;   --medio-t: #7a5a00;
  --alto: #fddcc4;    --alto-t: #9a3d0b;
  --critico: #f9c9c4; --critico-t: #8f1a10;
  --radio: 8px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.1rem; }
h3 { font-size: 1rem; margin-top: 1em; }
a { color: var(--acento); }
code { background: #eef1f6; padding: 0 .3em; border-radius: 4px; font-size: .9em; }

.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Cabecera y menú */
.cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .75rem 1.25rem; background: var(--marca); color: #fff;
}
.marca { color: inherit; text-decoration: none; display: flex; align-items: center; gap: .9rem; }
.marca-logo { height: 48px; width: auto; display: block; }
.marca-texto { display: flex; flex-direction: column; padding-left: .9rem; border-left: 1px solid rgba(255,255,255,.35); }
.marca-nombre { font-weight: 700; font-size: 1.15rem; letter-spacing: .01em; }
.marca-linea { font-size: .8rem; opacity: .8; }
.salir { display: flex; align-items: center; gap: .75rem; margin: 0; }
.usuario { font-size: .875rem; opacity: .9; }
.enlace-ayuda { color: #fff; font-size: .875rem; text-decoration: none; padding: .3rem .6rem; border-radius: 6px; }
.enlace-ayuda:hover, .enlace-ayuda[aria-current="page"] { background: rgba(255,255,255,.15); }
.menu {
  display: flex; gap: .25rem; overflow-x: auto; padding: 0 1rem;
  background: var(--marca-fuerte); scrollbar-width: thin;
}
.menu a {
  color: #cfd8ea; text-decoration: none; padding: .6rem .75rem; white-space: nowrap;
  border-bottom: 3px solid transparent; font-size: .9rem;
}
.menu a:hover { color: #fff; }
.menu a[aria-current="page"] { color: #fff; border-bottom-color: #8fb4ff; }

.contenido { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.titulo-pagina { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1rem; margin-bottom: 1rem; }
.titulo-pagina h1 { margin: 0; }
.nota { color: var(--texto-suave); font-size: .875rem; }
.vacio { color: var(--texto-suave); font-style: italic; }

/* Tarjetas y rejillas */
.tarjeta {
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  padding: 1.25rem; margin-bottom: 1rem; min-width: 0; overflow-x: auto;
}
.estrecha { max-width: 560px; }
.rejilla-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 1rem; }

.indicadores { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.indicador {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 1rem 1.25rem;
}
.indicador:hover { border-color: var(--acento); }
.cifra { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rotulo { font-weight: 600; }
.detalle { color: var(--texto-suave); font-size: .85rem; }
.detalle.alerta { color: var(--peligro); font-weight: 600; }

.pendientes { margin: 0; padding-left: 1.1rem; }
.pendientes li { margin: .3rem 0; }

/* Tablas */
/* Tablas anchas: el contenedor no pasa del alto de la pantalla, así la barra horizontal siempre queda a la vista;
   encabezado y primera columna fijos para no perder el contexto, y sombras en los bordes que avisan que hay más
   contenido (técnica de fondos con background-attachment: local, sin JavaScript). */
.tabla-contenedor {
  overflow: auto; overscroll-behavior-x: contain; border: 1px solid var(--borde); border-radius: var(--radio);
  background:
    linear-gradient(to right, var(--superficie) 30%, rgba(255,255,255,0)) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--superficie) 30%, rgba(255,255,255,0)) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(29,36,51,.18), transparent) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(29,36,51,.18), transparent) right center / 14px 100% no-repeat scroll,
    var(--superficie);
}
.tabla-contenedor:focus-visible { outline: 3px solid #8fb4ff; outline-offset: 1px; }
.tabla-contenedor .tabla { border-collapse: separate; border-spacing: 0; }
.tabla-contenedor .tabla thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--borde); }
.tabla-contenedor .tabla tbody > tr > :first-child {
  position: sticky; left: 0; z-index: 1; background: var(--superficie);
  min-width: 12rem; max-width: 22rem; box-shadow: inset -1px 0 0 var(--borde);
}
.tabla-contenedor .tabla thead th:first-child { left: 0; z-index: 3; box-shadow: inset -1px -1px 0 var(--borde); }
.tabla-contenedor .tabla tbody tr:hover > * { background-color: #f6f8fc; }
/* Una línea por celda (filas compactas); solo la primera columna, la que identifica la fila, puede partirse. */
.tabla-contenedor .tabla th, .tabla-contenedor .tabla td { white-space: nowrap; }
.tabla-contenedor .tabla tbody > tr > :first-child { white-space: normal; }
.sin-corte { white-space: nowrap; }
@media (min-width: 641px) {
  .tabla-contenedor { max-height: calc(100vh - 13rem); max-height: calc(100dvh - 13rem); }
}
.tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabla th, .tabla td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-suave); background: #f8f9fb; }
.tabla tbody tr:last-child td, .tabla tbody tr:last-child th { border-bottom: 0; }
.tabla tbody th { font-weight: 500; }
.tabla.compacta th, .tabla.compacta td { padding: .35rem .5rem; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.acciones { white-space: nowrap; text-align: right !important; }
/* Acciones por fila: iconos para lo frecuente; eliminar escondido en "más acciones" (un clic extra a propósito). */
.acciones-fila { display: inline-flex; align-items: center; gap: .15rem; position: relative; }
.accion {
  display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem;
  border-radius: 6px; color: var(--texto-suave); cursor: pointer; list-style: none;
}
.accion:hover { background: #e8edf6; color: var(--marca); }
.accion::-webkit-details-marker { display: none; }
.icono { display: block; }
.mas-acciones { position: relative; }
.mas-acciones[open] > .accion { background: #e8edf6; color: var(--marca); }
.menu-acciones {
  position: absolute; right: calc(100% + .25rem); top: 50%; transform: translateY(-50%); z-index: 4;
  background: var(--superficie); border: 1px solid var(--borde); border-radius: 6px;
  box-shadow: 0 4px 14px rgba(29,36,51,.14); padding: .2rem;
}
.menu-acciones a {
  display: flex; align-items: center; gap: .4rem; padding: .35rem .65rem; border-radius: 4px;
  font-size: .85rem; text-decoration: none; white-space: nowrap;
}
.menu-acciones a.peligro { color: var(--peligro); }
.menu-acciones a.peligro:hover { background: #fdecea; }
/* La columna de acciones queda fija a la derecha: no hay que desplazarse para editar. */
.tabla-contenedor .tabla th.acciones, .tabla-contenedor .tabla td.acciones {
  position: sticky; right: 0; background: var(--superficie); box-shadow: inset 1px 0 0 var(--borde);
}
.tabla-contenedor .tabla td.acciones { z-index: 1; }
.tabla-contenedor .tabla thead th.acciones { z-index: 3; background: #f8f9fb; }
.tabla-contenedor .tabla tbody tr:hover > td.acciones { background-color: #f6f8fc; }
.codigo { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; color: var(--texto-suave); }
.evidencia { max-width: 28ch; }
.antes { color: var(--texto-suave); text-decoration: line-through; }

.barra { white-space: nowrap; }
meter { width: 110px; height: 12px; vertical-align: middle; }

/* Insignias por valor de choices */
.insignia { display: inline-block; padding: .1rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eceff4; color: var(--texto-suave); white-space: nowrap; }
.v-bajo, .v-baja, .v-implementado, .v-vigente, .v-cerrado, .v-resuelto, .v-lagoon, .v-lagoon_operativo { background: var(--bajo); color: var(--bajo-t); }
.v-medio, .v-media, .v-parcial, .v-en_revision, .v-en_curso, .v-en_tratamiento, .v-contenido, .v-borrador, .v-seedcloud_anterior, .v-lagoon_sin_datos { background: var(--medio); color: var(--medio-t); }
.v-alto, .v-alta, .v-abierto, .v-identificado, .v-sin_lagoon, .v-legado { background: var(--alto); color: var(--alto-t); }
.v-critico, .v-critica, .v-no_implementado, .v-obsoleta, .v-lagoon_con_falla { background: var(--critico); color: var(--critico-t); }
/* Inventario: ciclo de vida y clasificación de datos */
.v-activo, .v-publica { background: var(--bajo); color: var(--bajo-t); }
.v-interna, .v-propuesto { background: var(--medio); color: var(--medio-t); }
.v-confidencial { background: var(--alto); color: var(--alto-t); }

/* Mapa de calor */
.mapa { border-collapse: separate; border-spacing: 4px; margin: 0 auto; }
.mapa .celda { width: 52px; height: 44px; text-align: center; font-weight: 700; border-radius: 6px; opacity: .55; }
.mapa .celda.con-datos { opacity: 1; outline: 2px solid rgba(0,0,0,.15); }
.mapa .celda.v-bajo { background: var(--bajo); color: var(--bajo-t); }
.mapa .celda.v-medio { background: var(--medio); color: var(--medio-t); }
.mapa .celda.v-alto { background: var(--alto); color: var(--alto-t); }
.mapa .celda.v-critico { background: var(--critico); color: var(--critico-t); }
.mapa .eje { color: var(--texto-suave); font-size: .8rem; font-weight: 500; text-align: center; }
.mapa .eje-x { color: var(--texto-suave); font-size: .8rem; font-weight: 600; text-align: center; }
.mapa .eje-y { color: var(--texto-suave); font-size: .8rem; font-weight: 600; width: 1.5rem; }
.mapa .eje-y span { display: inline-block; transform: rotate(-90deg); white-space: nowrap; }

/* Formularios */
.filtros { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.campo-busqueda { flex: 1 1 220px; }
input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid #c4cad5; border-radius: 6px;
  font: inherit; font-size: 16px; background: #fff; color: inherit;
}
.filtros select { width: auto; max-width: 100%; }
textarea { min-height: 6rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .boton:focus-visible, a:focus-visible {
  outline: 3px solid #8fb4ff; outline-offset: 1px;
}
.formulario { max-width: 760px; }
.formulario-amplio { max-width: 1200px; }
.formulario-amplio .seccion { max-width: 760px; }
.formulario-amplio .campo ul { list-style: none; margin: 0; padding: 0; columns: 2; }
.tabla-edicion td { vertical-align: top; }
.tabla-edicion input:not([type="checkbox"]), .tabla-edicion select { width: 100%; min-width: 7.5rem; }
.campo { margin-bottom: 1rem; display: flex; flex-direction: column; gap: .25rem; }
.campo label { font-weight: 600; font-size: .9rem; }
.campo input[type="checkbox"] { width: auto; align-self: flex-start; }
.requerido { color: var(--peligro); }
.ayuda { color: var(--texto-suave); }
.error { color: var(--peligro); }
.con-error input, .con-error select, .con-error textarea { border-color: var(--peligro); }
.errores { background: #fdecea; color: var(--peligro); padding: .6rem .8rem; border-radius: 6px; margin-bottom: 1rem; }
.errores p, .errores ul { margin: 0; }
.botones { display: flex; align-items: center; gap: 1rem; }
.seccion { border: 0; border-top: 1px solid var(--borde); margin: 0 0 1.25rem; padding: 1rem 0 0; min-width: 0; }
.seccion:first-of-type { border-top: 0; padding-top: 0; }
.seccion legend { font-weight: 700; font-size: 1rem; color: var(--marca); padding: 0 .4rem 0 0; }
.ayuda-seccion { margin: 0 0 1rem; color: var(--texto-suave); font-size: .88rem; }
.alta h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.alta ol { margin: .5rem 0; padding-left: 1.2rem; }
.alta li { margin-bottom: .35rem; }

.boton {
  display: inline-block; padding: .5rem 1rem; border-radius: 6px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .9rem; text-decoration: none; cursor: pointer; text-align: center;
}
.boton-principal { background: var(--acento); color: #fff; }
.boton-principal:hover { background: #2358b3; }
.boton-secundario { background: #fff; color: var(--marca); border-color: #c4cad5; }
.boton-secundario:hover { border-color: var(--marca); }
.boton-peligro { background: var(--peligro); color: #fff; }
.boton-sutil { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); padding: .3rem .75rem; }
.boton-sutil:hover { border-color: #fff; }
.boton-ancho { display: block; width: 100%; }
.enlace { font-size: .9rem; }

.mensajes { list-style: none; padding: 0; margin: 0 0 1rem; }
.mensaje { padding: .7rem 1rem; border-radius: 6px; margin-bottom: .5rem; background: #e8f0fe; }
.mensaje-success { background: #e3f4ea; color: var(--ok); }
.mensaje-error { background: #fdecea; color: var(--peligro); }
.aviso-critico { background: #fdecea !important; border-color: #f2b8b5 !important; }
.aviso { background: #eef3fc; border: 1px solid #c9d9f5; border-radius: var(--radio); padding: .9rem 1.1rem; margin-bottom: 1rem; font-size: .9rem; }
.senales { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: .6rem 0 0; }
.senales dt { color: var(--texto-suave); }
.senales dd { margin: 0; }
.datos { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
.datos dt { color: var(--texto-suave); }
.datos dd { margin: 0; }

/* Páginas de tablas a ancho completo (con tope para pantallas muy anchas); el resto sigue en 1200 px. */
.ancho-completo .contenido { max-width: 1920px; padding-left: 1.5rem; padding-right: 1.5rem; }

/* Barra sobre la tabla: conteo, filtros activos y exportar */
.barra-tabla { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: 0 0 .75rem; }
.barra-tabla .conteo { margin: 0; }
.barra-tabla .boton-chico { margin-left: auto; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .4rem .2rem .7rem; border-radius: 999px;
  background: #e8edf6; color: var(--marca); font-size: .82rem; font-weight: 600; text-decoration: none;
  border: 1px solid #cfd9ea;
}
.chip span[aria-hidden] { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; font-size: .7rem; }
.chip:hover { border-color: var(--marca); }
.chip:hover span[aria-hidden] { background: var(--marca); color: #fff; }
.boton-chico { padding: .35rem .8rem; font-size: .85rem; }
.barra-acciones { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.barra-tabla .barra-acciones .boton-chico { margin-left: 0; }

/* Paneles "Vistas" y "Columnas" (details/summary; app.js los cierra al hacer clic fuera) */
.herramientas-tabla { display: flex; gap: .5rem; }
.panel-herramienta { position: relative; }
.panel-herramienta > summary { list-style: none; }
.panel-herramienta > summary::-webkit-details-marker { display: none; }
.panel-herramienta > summary::after { content: " ▾"; font-size: .75em; }
.panel-herramienta[open] > summary { border-color: var(--marca); }
.panel-contenido {
  position: absolute; right: 0; top: calc(100% + .35rem); z-index: 6; width: min(20rem, 90vw);
  background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio);
  box-shadow: 0 8px 24px rgba(29,36,51,.16); padding: .9rem 1rem;
}
.panel-contenido fieldset { border: 0; margin: 0 0 .8rem; padding: 0; }
.panel-titulo { font-weight: 700; font-size: .85rem; color: var(--marca); margin: 0 0 .4rem; padding: 0; }
.opcion { display: flex; align-items: center; gap: .45rem; padding: .15rem 0; font-size: .9rem; }
.opcion input { width: auto; }
.lista-vistas { list-style: none; margin: 0 0 .75rem; padding: 0; }
.lista-vistas li { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .1rem 0; }
.lista-vistas form { margin: 0; }
.vista-activa { font-weight: 700; }
.accion-chica { width: 1.6rem; height: 1.6rem; border: 0; background: none; font-size: .8rem; }
.guardar-vista { display: flex; flex-direction: column; gap: .5rem; border-top: 1px solid var(--borde); padding-top: .75rem; }

/* Densidad compacta: más filas por pantalla */
.tabla.densidad-compacta th, .tabla.densidad-compacta td { padding-top: .3rem; padding-bottom: .3rem; font-size: .85rem; }
.tabla.densidad-compacta .insignia { padding: 0 .45rem; }
.tabla.densidad-compacta .accion { width: 1.7rem; height: 1.7rem; }

/* Ficha: estado observado */
.titulo-seccion { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; }
.titulo-seccion h2 { margin-bottom: .4rem; }
.observado h3 { margin: 1.1rem 0 .5rem; }
.rejilla-observado { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: .75rem 1.5rem; align-items: start; }
.variables { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0; }
.variables .codigo { background: #eef1f6; padding: .1rem .4rem; border-radius: 4px; }
.diferencias { background: #fff6e0; border: 1px solid #f0d68a; border-radius: 6px; padding: .6rem .9rem .6rem 1.8rem; margin: 0 0 .5rem; font-size: .9rem; }
.v-deploy-complete { background: var(--bajo); color: var(--bajo-t); }
.v-deploy-failed, .v-deploy-cancelled { background: var(--critico); color: var(--critico-t); }
.v-deploy-running, .v-deploy-pending, .v-deploy-new { background: var(--medio); color: var(--medio-t); }

/* Fila que abre la ficha al hacer clic (app.js); el nombre sigue siendo un enlace para teclado. */
.fila-enlace { cursor: pointer; }

/* Pie de página institucional */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.contenido { flex: 1 0 auto; width: 100%; }
.pie {
  border-top: 1px solid var(--borde); background: var(--superficie); color: var(--texto-suave);
  font-size: .82rem; text-align: center; padding: .9rem 1rem;
}
.pie p { margin: .1rem 0; }
.pie strong { color: var(--marca); }
.pie-separador { margin: 0 .35rem; opacity: .6; }
.pagina-ingreso .pie { background: transparent; border-top-color: rgba(255,255,255,.15); color: #cfd8ea; }
.pagina-ingreso .pie strong { color: #fff; }
.pie .codigo { color: inherit; }

/* Orden por columna y favoritos */
.orden { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: .3rem; }
.orden:hover { color: var(--marca); }
.orden-icono { font-size: .7rem; opacity: .45; }
th[aria-sort] .orden { color: var(--marca); }
th[aria-sort] .orden-icono { opacity: 1; }
.favorito-form { display: inline; margin: 0 .35rem 0 0; }
.favorito {
  border: 0; background: none; cursor: pointer; padding: 0 .1rem; font-size: 1.05rem; line-height: 1;
  color: #b5bdca; vertical-align: -1px;
}
.favorito:hover, .favorito[aria-pressed="true"] { color: #d99a00; }
.favorito:focus-visible { outline: 3px solid #8fb4ff; outline-offset: 1px; border-radius: 4px; }
.filtro-check { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; white-space: nowrap; }

.paginacion { display: flex; gap: 1rem; justify-content: center; align-items: center; margin-top: 1rem; font-size: .9rem; }

.historial { list-style: none; padding: 0; }
.historial .meta { margin: 0 0 .5rem; }

/* Ingreso */
.pagina-ingreso { display: grid; min-height: 100vh; min-height: 100dvh; place-items: center; background: var(--marca); }
.pagina-ingreso .contenido { width: 100%; max-width: 420px; padding: 1rem; }
.ingreso { padding: 2rem; }
.roles-demo { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .5rem; }
.franja-demo { margin: 0; padding: .4rem 1rem; background: #fdf0c4; color: #7a5a00; font-size: .85rem; font-weight: 600; text-align: center; }
.pagina-ingreso .franja-demo { width: 100%; align-self: start; }
.ingreso-logo { display: block; width: 100%; max-width: 297px; height: auto; margin: 0 auto 1.5rem; }
.ingreso .marca-nombre { color: var(--marca); font-size: 1.6rem; margin-bottom: .1rem; }
.ingreso .marca-linea { color: var(--texto-suave); margin: 0 0 1.5rem; display: block; }
.separador { text-align: center; color: var(--texto-suave); font-size: .85rem; margin: 1rem 0; }

/* Ayuda */
.ayuda { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.ayuda-menu { position: sticky; top: 1rem; font-size: .9rem; }
.ayuda-menu ul { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.ayuda-menu a { display: block; padding: .35rem .6rem; border-radius: 6px; color: var(--texto); text-decoration: none; }
.ayuda-menu a:hover { background: #e8edf6; color: var(--marca); }
.ayuda-menu a[aria-current="page"] { background: #e8edf6; color: var(--marca); font-weight: 600; }
.ayuda-menu-titulo { margin: 0 0 .35rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texto-suave); }
.ayuda-indice a { color: var(--texto-suave); font-size: .85rem; }
.documento { padding: 1.5rem 2rem; line-height: 1.6; max-width: 52rem; }
.documento h1 { margin-top: 0; color: var(--marca); }
.documento h2 { margin-top: 2rem; padding-top: .5rem; border-top: 1px solid var(--borde); }
.documento h2, .documento h3 { scroll-margin-top: 1rem; }
.documento img { max-width: 100%; height: auto; border: 1px solid var(--borde); border-radius: var(--radio); }
.documento code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: #f1f3f7; padding: .05rem .3rem; border-radius: 4px; }
.documento pre { background: #f1f3f7; padding: .9rem 1rem; border-radius: var(--radio); overflow-x: auto; }
.documento pre code { background: none; padding: 0; }
.documento .diagrama { margin: 1rem 0; padding: 1rem; border: 1px solid var(--borde); border-radius: var(--radio); overflow-x: auto; text-align: center; }
.documento blockquote { margin: 1rem 0; padding: .5rem 1rem; border-left: 4px solid var(--acento); background: #f4f7fd; }
.tabla-documento { overflow-x: auto; margin: 1rem 0; }
.documento table { border-collapse: collapse; font-size: .9rem; min-width: 100%; }
.documento th, .documento td { padding: .45rem .7rem; border: 1px solid var(--borde); text-align: left; vertical-align: top; }
.documento th { background: #f8f9fb; }
@media (max-width: 900px) {
  .ayuda { grid-template-columns: 1fr; }
  .ayuda-menu { position: static; }
  .ayuda-indice { display: none; }
  .documento { padding: 1.25rem 1rem; }
}

/* Informe */
.informe { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 2rem; }
.informe section { margin-top: 2rem; }
.informe-portada { border-bottom: 2px solid var(--marca); padding-bottom: 1.25rem; }
.informe-portada .marca-nombre { color: var(--marca); margin: 0; }

@media (max-width: 640px) {
  .cabecera { flex-wrap: wrap; }
  .marca-linea { display: none; }
  .marca-logo { height: 36px; }
  .marca { gap: .6rem; }
  .marca-texto { padding-left: .6rem; }
  .usuario { display: none; }
  .informe { padding: 1rem; }
  .mapa .celda { width: 40px; height: 36px; }
  meter { width: 60px; }
  .tabla th, .tabla td { padding: .45rem .5rem; }
  .tabla-contenedor .tabla tbody > tr > :first-child { min-width: 8rem; max-width: 45vw; }
}

@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #fff; font-size: 10.5pt; }
  .cabecera, .menu, .mensajes, .no-imprimir { display: none !important; }
  .contenido { max-width: none; padding: 0; }
  .informe { border: 0; padding: 0; }
  .tarjeta, .tabla-contenedor { border: 0; padding: 0; }
  .tabla-contenedor { max-height: none !important; overflow: visible; background: none; }
  .tabla-contenedor .tabla th, .tabla-contenedor .tabla td { position: static !important; box-shadow: none !important; }
  .salto { break-before: page; }
  .tabla tr, .mapa { break-inside: avoid; }
  .insignia, .mapa .celda { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}
