/* ==============================================
   Heimdall · aspecto Linux Mint (Mint-Y claro y oscuro, con color de acento)
   ==============================================
   Tokens en :root; el oscuro con data-tema="oscuro" (o «auto» y el sistema en oscuro: public/js/tema.js).
   Encima de Bootstrap 5.3 (local). Prefijo de clases: h-. */

:root {
  --h-acento: #35a854;
  --h-acento-fuerte: #2a8a44;
  --h-acento-suave: rgba(53, 168, 84, 0.14);
  --h-texto-sobre-acento: #ffffff;
  --h-fondo: #ebebeb;
  --h-fondo-2: #f7f7f7;
  --h-superficie: #ffffff;
  --h-cabecera: #e3e3e3;
  --h-borde: #d4d4d4;
  --h-texto: #2e2e2e;
  --h-texto-2: #5c5c5c;
  --h-texto-3: #7d7d7d;
  --h-panel: #2f2f2f;
  --h-panel-texto: #eeeeee;
  --h-menu: #f2f2f2;
  --h-peligro: #d93025;
  --h-aviso: #e08a00;
  --h-bien: #2e9d4e;
  --h-sombra: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.06);
  --h-radio: 8px;
  --h-letra: "Ubuntu", "Inter", "Noto Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-acento="aguamarina"] { --h-acento: #1f9ede; --h-acento-fuerte: #187fb3; --h-acento-suave: rgba(31, 158, 222, 0.14); }
:root[data-acento="azul"] { --h-acento: #0c75de; --h-acento-fuerte: #095db1; --h-acento-suave: rgba(12, 117, 222, 0.14); }
:root[data-acento="naranja"] { --h-acento: #ff7139; --h-acento-fuerte: #d9582a; --h-acento-suave: rgba(255, 113, 57, 0.14); }
:root[data-acento="morado"] { --h-acento: #8c5dd9; --h-acento-fuerte: #7047b8; --h-acento-suave: rgba(140, 93, 217, 0.14); }
:root[data-acento="rojo"] { --h-acento: #e82127; --h-acento-fuerte: #bf1a1f; --h-acento-suave: rgba(232, 33, 39, 0.12); }
:root[data-acento="turquesa"] { --h-acento: #199ca8; --h-acento-fuerte: #137c86; --h-acento-suave: rgba(25, 156, 168, 0.14); }

:root[data-tema="oscuro"] {
  --h-fondo: #262626;
  --h-fondo-2: #2d2d2d;
  --h-superficie: #333333;
  --h-cabecera: #2b2b2b;
  --h-borde: #454545;
  --h-texto: #e6e6e6;
  --h-texto-2: #bdbdbd;
  --h-texto-3: #9a9a9a;
  --h-panel: #1e1e1e;
  --h-panel-texto: #eeeeee;
  --h-menu: #2b2b2b;
  --h-sombra: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--h-fondo);
  color: var(--h-texto);
  font-family: var(--h-letra);
  font-size: 15px;
}
a { color: var(--h-acento-fuerte); }
/* En oscuro, los enlaces sueltos del contenido (los del menú, el panel y los botones tienen su color) */
:root[data-tema="oscuro"] .h-principal a:not([class]) { color: var(--h-acento); }

/* ---------- Bootstrap con los colores de Mint ---------- */
.btn { border-radius: var(--h-radio); font-weight: 500; }
.btn-primary { background: var(--h-acento); border-color: var(--h-acento); color: var(--h-texto-sobre-acento); }
.btn-primary:hover, .btn-primary:focus { background: var(--h-acento-fuerte); border-color: var(--h-acento-fuerte); color: var(--h-texto-sobre-acento); }
.btn-secondary { background: var(--h-cabecera); border-color: var(--h-borde); color: var(--h-texto); }
.btn-secondary:hover { background: var(--h-borde); border-color: var(--h-borde); color: var(--h-texto); }
.form-control, .form-select { background-color: var(--h-superficie); border-color: var(--h-borde); color: var(--h-texto); border-radius: var(--h-radio); }
.form-control:focus, .form-select:focus { border-color: var(--h-acento); box-shadow: 0 0 0 3px var(--h-acento-suave); background-color: var(--h-superficie); color: var(--h-texto); }
.form-label { font-weight: 500; color: var(--h-texto-2); }
.card { background: var(--h-superficie); border: 1px solid var(--h-borde); border-radius: 10px; box-shadow: var(--h-sombra); color: var(--h-texto); }
.card-header { background: var(--h-cabecera); border-bottom: 1px solid var(--h-borde); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--h-texto); border-color: var(--h-borde); }
.text-muted { color: var(--h-texto-3) !important; }

/* ---------- Marco: menú a la izquierda (como el menú de Mint) y panel abajo (como el de Cinnamon) ---------- */
html[data-letra="grande"] body { font-size: 17px; }
.h-app { display: grid; grid-template-columns: 264px 1fr; grid-template-rows: 1fr auto; min-height: 100vh; }
.h-app.menu-plegado { grid-template-columns: 0 1fr; }
.h-app.menu-plegado .h-menu { visibility: hidden; padding: 0; border: 0; }

.h-menu { grid-row: 1 / 2; position: sticky; top: 0; height: calc(100vh - 44px); display: flex; flex-direction: column; background: var(--h-menu); border-right: 1px solid var(--h-borde); overflow: hidden; }
.h-menu-buscar { display: flex; align-items: center; gap: 8px; margin: 12px 12px 8px; padding: 0 10px; border: 1px solid var(--h-borde); border-radius: var(--h-radio); background: var(--h-superficie); }
.h-menu-buscar:focus-within { border-color: var(--h-acento); box-shadow: 0 0 0 3px var(--h-acento-suave); }
.h-menu-buscar i { color: var(--h-texto-3); }
.h-menu-buscar input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--h-texto); padding: 8px 0; }
.h-menu-lista { flex: 1; overflow-y: auto; padding: 4px 10px 10px; }
.h-menu-titulo { margin: 12px 8px 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--h-texto-3); }
.h-menu-desplegar { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: calc(100% - 16px); min-height: 40px; margin: 6px 8px 0; padding: 6px 4px; border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: var(--h-radio); color: var(--h-texto-2); font-family: inherit; }
.h-menu-desplegar:hover { background: var(--h-acento-suave); color: var(--h-texto); }
.h-menu-desplegar:focus-visible { outline: 2px solid var(--h-acento); outline-offset: 1px; }
.h-menu-desplegar i { font-size: 11px; transition: transform 0.18s ease; }
.h-desplegable.abierto .h-menu-desplegar i, .h-buscando .h-menu-desplegar i { transform: rotate(180deg); }
.h-desplegable .h-menu-cuerpo { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 0.18s ease, visibility 0s linear 0.18s; }
.h-desplegable .h-menu-cuerpo-interior { overflow: hidden; min-height: 0; }
.h-desplegable.abierto .h-menu-cuerpo, .h-buscando .h-desplegable .h-menu-cuerpo { grid-template-rows: 1fr; visibility: visible; transition-delay: 0s; }
.h-menu-lista a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0; border-radius: var(--h-radio); color: var(--h-texto); text-decoration: none; }
.h-menu-lista a i { width: 20px; text-align: center; color: var(--h-texto-2); }
.h-menu-lista a:hover { background: var(--h-acento-suave); }
.h-menu-lista a.activo { background: var(--h-acento); color: var(--h-texto-sobre-acento); }
.h-menu-lista a.activo i { color: var(--h-texto-sobre-acento); }
.h-menu-nada { margin: 12px 8px; color: var(--h-texto-3); }
.h-menu-usuario { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--h-borde); background: var(--h-cabecera); }
.h-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--h-acento); color: var(--h-texto-sobre-acento); font-weight: 700; font-size: 13px; }
.h-menu-quien { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.h-menu-quien strong { overflow-wrap: anywhere; }
.h-menu-quien small { color: var(--h-texto-3); }
.h-menu-salir { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--h-radio); color: var(--h-texto); text-decoration: none; border: 1px solid var(--h-borde); background: var(--h-superficie); font-size: 13.5px; }
.h-menu-salir:hover { border-color: var(--h-acento); color: var(--h-texto); }
/* «Salir» es un formulario con botón (POST con token), no un enlace: se ve igual */
.h-menu-salir-form { display: contents; margin: 0; }
button.h-menu-salir { font-family: inherit; line-height: inherit; cursor: pointer; }

.h-principal { grid-row: 1 / 2; padding: 22px 26px 30px; min-width: 0; }
.h-velo { display: none; }

.h-panel { grid-column: 1 / 3; position: sticky; bottom: 0; z-index: 30; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 8px; background: var(--h-panel); color: var(--h-panel-texto); font-size: 13.5px; box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); }
.h-panel button, .h-panel a, .h-panel-ventana { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--h-panel-texto); text-decoration: none; font: inherit; white-space: nowrap; cursor: pointer; }
.h-panel button:hover, .h-panel a:hover { background: rgba(255, 255, 255, 0.1); color: var(--h-panel-texto); }
.h-panel-menu { font-weight: 600; }
.h-panel-menu i { color: var(--h-acento); font-size: 17px; }
.h-panel-menu[aria-expanded="true"] { background: rgba(255, 255, 255, 0.08) !important; }
.h-panel-ventana { cursor: default; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 -2px 0 var(--h-acento); border-radius: 6px 6px 0 0; }
.h-panel-hueco { flex: 1; }
.h-panel-reloj { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; padding: 0 8px; }
.h-panel-reloj small { color: #b9b9b9; }
.h-pagina-cab { margin-bottom: 18px; }
.h-pagina-cab h1 { font-size: 24px; font-weight: 700; margin: 0 0 4px; }
.h-pagina-cab p { color: var(--h-texto-2); margin: 0; }
.h-migas { font-size: 13px; color: var(--h-texto-3); margin-bottom: 4px; }
.h-tarjetas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.h-dato { padding: 16px; }
.h-dato .h-dato-titulo { color: var(--h-texto-3); font-size: 13px; }
.h-dato .h-dato-valor { font-size: 22px; font-weight: 700; }
.h-dato-enlace { color: inherit; text-decoration: none; }
.h-dato-enlace:hover { border-color: var(--h-acento); }
.h-dato-mal .h-dato-valor { color: var(--h-peligro); }
.h-dato-aviso .h-dato-valor { color: var(--h-aviso); }
.h-aviso-linea { padding: 10px 14px; border-radius: var(--h-radio); margin-bottom: 14px; border: 1px solid; }
.h-aviso-linea.bien { background: rgba(46, 157, 78, 0.12); border-color: rgba(46, 157, 78, 0.35); }
.h-aviso-linea.aviso { background: rgba(224, 138, 0, 0.12); border-color: rgba(224, 138, 0, 0.45); }
.h-aviso-linea.mal { background: rgba(217, 48, 37, 0.1); border-color: rgba(217, 48, 37, 0.35); }
/* Segmentos (como los botones enlazados de GTK) y muestras de color */
.h-segmentos { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--h-borde); border-radius: var(--h-radio); overflow: hidden; }
.h-segmentos label { position: relative; margin: 0; padding: 7px 14px; cursor: pointer; border-right: 1px solid var(--h-borde); background: var(--h-superficie); white-space: nowrap; }
.h-segmentos label:last-child { border-right: 0; }
.h-segmentos input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.h-segmentos label:has(input:checked) { background: var(--h-acento); color: var(--h-texto-sobre-acento); }
.h-segmentos label:focus-within { outline: 2px solid var(--h-acento); outline-offset: -2px; }
/* Opciones largas una debajo de otra (Llamadas: «Las llamadas salen por»): el texto baja de línea, nunca se corta */
.h-segmentos-columna { display: flex; flex-direction: column; max-width: 100%; width: fit-content; }
.h-segmentos-columna label { white-space: normal; border-right: 0; border-bottom: 1px solid var(--h-borde); }
.h-segmentos-columna label:last-child { border-bottom: 0; }
.h-llamar-tel { overflow-wrap: anywhere; }
.h-muestras { display: flex; flex-wrap: wrap; gap: 10px; }
.h-muestras label { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 10px 6px 6px; border: 1px solid var(--h-borde); border-radius: 999px; cursor: pointer; background: var(--h-superficie); }
.h-muestras input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.h-muestras label:has(input:checked) { border-color: var(--h-texto); box-shadow: 0 0 0 2px var(--h-acento-suave); font-weight: 600; }
.h-muestras label:focus-within { outline: 2px solid var(--h-acento); }
.h-muestra { width: 22px; height: 22px; border-radius: 50%; }

/* ---------- Listados con páginas y filtros (partials/listado-filtros.ejs y listado-paginas.ejs) ---------- */
.h-listado-fila { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.h-listado-buscar { position: relative; flex: 1 1 240px; min-width: 0; }
.h-listado-buscar > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--h-texto-3); pointer-events: none; }
.h-listado-buscar .form-control { padding-left: 36px; }
.h-listado-campo { display: flex; align-items: center; gap: 8px; }
.h-listado-campo .form-label { white-space: nowrap; font-size: 13px; color: var(--h-texto-3); }
.h-listado-campo .form-select { width: auto; max-width: 210px; }
.h-listado-campo .form-control { width: auto; }
.h-listado-activos { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.h-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 10px; border-radius: 50rem; font-size: 13px; font-weight: 500; text-decoration: none; overflow-wrap: anywhere; background: var(--h-acento-suave); color: var(--h-acento-fuerte); }
.h-chip i { font-size: 11px; opacity: 0.75; }
.h-listado-quitar { margin-left: 4px; font-size: 13px; }
.h-paginas { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 16px; border-top: 1px solid var(--h-borde); }
.h-paginas-info { color: var(--h-texto-3); font-size: 13px; }
.h-paginas .pagination { flex-wrap: wrap; gap: 4px; --bs-pagination-color: var(--h-acento-fuerte); --bs-pagination-bg: var(--h-superficie); --bs-pagination-border-color: var(--h-borde); --bs-pagination-active-bg: var(--h-acento); --bs-pagination-active-border-color: var(--h-acento); --bs-pagination-hover-bg: var(--h-cabecera); --bs-pagination-disabled-bg: var(--h-superficie); --bs-pagination-disabled-color: var(--h-texto-3); --bs-pagination-disabled-border-color: var(--h-borde); }
.h-paginas .page-item.h-paginas-de { display: none; }
.h-paginas-tamano { display: flex; align-items: center; gap: 8px; margin: 0; }
.h-paginas-tamano label { margin: 0; color: var(--h-texto-3); font-size: 13px; white-space: nowrap; }
.h-paginas-tamano .form-select { width: auto; }
@media (max-width: 575.98px) {
  .h-listado-buscar { flex-basis: 100%; }
  .h-listado-fila > .btn { flex: 1 1 auto; }
  .h-listado-campo { width: 100%; }
  .h-listado-campo .form-select { flex: 1 1 auto; max-width: none; }
  .h-listado-campo .form-control { flex: 1 1 auto; width: auto; min-width: 0; }
  .h-paginas { justify-content: center; text-align: center; }
  .h-paginas nav { width: 100%; }
  .h-paginas .pagination { justify-content: center; }
  .h-paginas .page-item.h-num, .h-paginas .page-item.h-hueco { display: none; }
  .h-paginas .page-item.h-paginas-de { display: block; }
}

/* ---------- Usuarios y actividad: tablas (en el móvil, fichas), ficha y permisos ---------- */
.h-tabla th, .h-tabla td { vertical-align: middle; }
.h-insignia { display: inline-block; padding: 2px 9px; border-radius: 50rem; font-size: 12px; font-weight: 600; background: var(--h-cabecera); color: var(--h-texto-2); border: 1px solid var(--h-borde); }
.h-insignia.bien { background: rgba(46, 157, 78, 0.14); color: var(--h-bien); border-color: rgba(46, 157, 78, 0.35); }
.h-insignia.mal { background: rgba(217, 48, 37, 0.1); color: var(--h-peligro); border-color: rgba(217, 48, 37, 0.35); }
.h-fichas { display: none; }
.h-ficha-lista { display: block; padding: 12px 16px; border-top: 1px solid var(--h-borde); color: inherit; text-decoration: none; }
.h-ficha-lista:first-child { border-top: 0; }
.h-ficha-lista .h-ficha-fila { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.h-ficha-lista small { display: block; color: var(--h-texto-3); overflow-wrap: anywhere; }
.h-permisos th, .h-permisos td { text-align: center; vertical-align: middle; }
.h-permisos th:first-child, .h-permisos td:first-child { text-align: left; }
.h-permisos td.h-cambiado { background: var(--h-acento-suave); box-shadow: inset 0 0 0 2px var(--h-acento); }
.h-permisos .form-check-input { margin: 0; width: 1.25em; height: 1.25em; }
.h-permisos .form-check-input:checked { background-color: var(--h-acento); border-color: var(--h-acento); }
.h-permisos .h-sin { color: var(--h-texto-3); }
/* Aviso de cierre de la sesión por inactividad */
.h-inactividad { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.45); }
.h-inactividad-panel { width: min(380px, 100%); padding: 24px; border-radius: var(--h-radio); background: var(--h-superficie); color: var(--h-texto); border: 1px solid var(--h-borde); text-align: center; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35); }
.h-inactividad-panel > i { display: block; font-size: 28px; color: var(--h-acento); margin-bottom: 10px; }
.h-inactividad-panel strong { display: block; font-size: 19px; margin-bottom: 6px; }
.h-inactividad-panel p { color: var(--h-texto-2); margin-bottom: 16px; }
.h-inactividad-panel .btn { width: 100%; }
.h-lista-ips { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; }
/* Cortafuegos: IP y rutas en letra de máquina, y la lista de países con su propio desplazamiento (sin barra visible) */
.h-ip { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.h-ruta-cf { max-width: 360px; overflow-wrap: anywhere; }
.h-lista-paises { max-height: 240px; overflow-y: auto; scrollbar-width: none; border: 1px solid var(--h-borde); border-radius: var(--h-radio); padding: 8px 10px 8px 34px; background: var(--h-superficie); }
.h-lista-paises::-webkit-scrollbar { display: none; }
.h-lista-paises .form-check { margin-bottom: 4px; }
.h-acciones-ficha { display: flex; flex-wrap: wrap; gap: 8px; }
/* Parte de trabajo de las órdenes: fotos y firma */
.h-fotos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.h-foto { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.h-foto img { width: 100%; height: 110px; object-fit: cover; border-radius: var(--h-radio); border: 1px solid var(--h-borde); display: block; }
.h-foto figcaption { font-size: 12px; color: var(--h-texto-3); overflow-wrap: anywhere; }
.h-firma-lienzo { display: block; width: 100%; height: 190px; background: #fff; border: 2px dashed var(--h-borde-fuerte, var(--h-borde)); border-radius: var(--h-radio); touch-action: none; cursor: crosshair; }
.h-firma-vista { background: #fff; border: 1px solid var(--h-borde); border-radius: var(--h-radio); padding: 6px; }
.h-firma-vista img { display: block; max-width: 100%; max-height: 160px; margin: 0 auto; }
.h-aviso-origen { padding: 10px 14px; border-radius: var(--h-radio); margin-bottom: 14px; border: 1px solid rgba(224, 138, 0, 0.45); background: rgba(224, 138, 0, 0.12); }
@media (max-width: 767.98px) {
  .h-tabla-grande { display: none; }
  .h-fichas { display: block; }
  .h-acciones-ficha .btn, .h-acciones-ficha form { flex: 1 1 100%; }
  .h-acciones-ficha form .btn { width: 100%; }
  .h-permisos { font-size: 13px; }
  .h-permisos th, .h-permisos td { padding: 6px 4px; }
}

@media (prefers-reduced-motion: reduce) { .h-menu, .h-desplegable .h-menu-cuerpo, .h-menu-desplegar i { transition: none !important; } }
@media (max-width: 820px) {
  .h-app, .h-app.menu-plegado { grid-template-columns: 1fr; }
  .h-app.menu-plegado .h-menu { visibility: visible; padding: initial; }
  .h-menu { position: fixed; z-index: 40; left: 0; top: 0; bottom: 44px; height: auto; width: min(320px, 86vw); transform: translateX(-105%); transition: transform 0.18s ease; box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25); }
  .h-app.menu-abierto .h-menu { transform: none; }
  .h-velo { display: block; position: fixed; inset: 0 0 44px 0; z-index: 35; background: rgba(0, 0, 0, 0.35); }
  .h-velo[hidden] { display: none; }
  .h-principal { padding: 16px 16px 24px; }
  .h-panel { grid-column: 1 / 2; position: fixed; left: 0; right: 0; bottom: 0; }
  .h-app { padding-bottom: 44px; }
  .h-panel-ventana { display: none; }
  .h-panel a, .h-panel button { padding: 0 10px; }
}
@media (max-width: 420px) {
  .h-panel-reloj small { display: none; }
  #hBotonTema span { display: none; }
  #hBotonTema::after { content: "Tema"; }
}

/* ---------- Entrada (sin menú) ---------- */
.h-acceso { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px 16px; background: var(--h-fondo); }
.h-tarjeta-acceso { width: min(420px, 100%); background: var(--h-superficie); border: 1px solid var(--h-borde); border-radius: 12px; box-shadow: var(--h-sombra); padding: 28px 26px; }
.h-tarjeta-acceso.ancha { width: min(560px, 100%); }
.h-cabeza { margin-bottom: 14px; }
.h-icono-app { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--h-acento); color: var(--h-texto-sobre-acento); font-size: 26px; margin-bottom: 14px; }
.h-titulo-grande { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.h-subtitulo { color: var(--h-texto-2); margin: 0 0 16px; line-height: 1.5; }
.h-aviso { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--h-radio); margin-bottom: 14px; }
.h-aviso.error { background: rgba(217, 48, 37, 0.1); color: var(--h-peligro); }
.h-aviso.bien { background: rgba(46, 157, 78, 0.12); color: var(--h-bien); }
.h-pasos { padding-left: 20px; line-height: 1.55; }
.h-pasos li { margin-bottom: 10px; }
.h-qr { background: #ffffff; border-radius: 10px; padding: 12px; margin: 10px 0; max-width: 240px; }
.h-qr svg { width: 100%; height: auto; display: block; }
.h-clave-manual summary { cursor: pointer; color: var(--h-acento-fuerte); }
.h-etiqueta { display: block; font-size: 12px; color: var(--h-texto-3); margin-top: 8px; }
.h-codigo { font-family: ui-monospace, "Ubuntu Mono", Consolas, monospace; font-size: 20px; letter-spacing: 0.08em; word-break: break-all; }
.h-codigo.pequeno { font-size: 15px; }
.h-grupo { margin-bottom: 14px; }
.h-fila { display: flex; align-items: center; gap: 10px; border: 1px solid var(--h-borde); border-radius: var(--h-radio); padding: 4px 12px; background: var(--h-fondo-2); }
.h-fila:focus-within { border-color: var(--h-acento); box-shadow: 0 0 0 3px var(--h-acento-suave); }
.h-fila + .h-fila { margin-top: 8px; }
.h-simbolo { color: var(--h-texto-3); width: 18px; text-align: center; }
.h-fila input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--h-texto); padding: 9px 0; font-size: 16px; min-width: 0; }
.h-entrada-codigo { font-size: 22px !important; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
.h-boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--h-radio); padding: 10px 16px; border: 1px solid transparent; font-weight: 600; text-decoration: none; cursor: pointer; font-size: 15px; }
.h-boton.principal { width: 100%; background: var(--h-acento); color: var(--h-texto-sobre-acento); }
.h-boton.principal:hover { background: var(--h-acento-fuerte); color: var(--h-texto-sobre-acento); }
.h-boton.secundario { background: var(--h-cabecera); border-color: var(--h-borde); color: var(--h-texto); }
.h-boton.texto { background: none; color: var(--h-acento-fuerte); padding: 8px 4px; }
:root[data-tema="oscuro"] .h-boton.texto { color: var(--h-acento); }
.h-botones-fila { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.h-pie { margin-top: 14px; text-align: center; color: var(--h-texto-3); font-size: 13.5px; }
.h-recuperacion { columns: 2; font-family: ui-monospace, "Ubuntu Mono", Consolas, monospace; font-size: 16px; padding-left: 28px; margin: 6px 0 16px; }

/* ---------- Ventana de confirmar / preguntar (public/js/confirmar.js) ---------- */
.h-pregunta { position: fixed; inset: 0; z-index: 3100; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, 0.4); }
.h-pregunta-panel { width: min(420px, 100%); padding: 22px; border-radius: 12px; background: var(--h-superficie); color: var(--h-texto); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25); border: 1px solid var(--h-borde); }
.h-pregunta-texto { margin: 0 0 16px; font-size: 16px; font-weight: 600; line-height: 1.4; white-space: pre-line; }
.h-pregunta-campo { margin-bottom: 16px; }
.h-pregunta-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.h-pregunta .btn-danger { background: var(--h-peligro); border-color: var(--h-peligro); color: #fff; }

/* ---------- Clientes: mapas, avisos de caducidad, visitas e importación ---------- */
.h-insignia.aviso { background: rgba(224, 138, 0, 0.14); color: var(--h-aviso); border-color: rgba(224, 138, 0, 0.45); }
.h-acciones-cab { display: flex; flex-wrap: wrap; gap: 8px; }
.h-mapa { position: relative; z-index: 0; isolation: isolate; width: 100%; border: 1px solid var(--h-borde); border-radius: var(--h-radio); background: var(--h-fondo-2); }
.h-mapa-ficha { height: 280px; }
.h-mapa-grande { height: min(68vh, 640px); min-height: 320px; }
.h-mapa-aviso { margin: 10px 0 0; padding: 8px 12px; border-radius: var(--h-radio); border: 1px solid rgba(224, 138, 0, 0.45); background: rgba(224, 138, 0, 0.12); font-size: 13.5px; }
.h-mapa-aviso[hidden] { display: none; }
.h-visitas { padding-left: 22px; }
.h-visitas li { margin-bottom: 2px; }
.h-errores-importar { padding-left: 20px; margin: 10px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.h-errores-importar li { margin-bottom: 4px; }
@media (max-width: 575.98px) {
  .h-acciones-cab { width: 100%; }
  .h-acciones-cab .btn { flex: 1 1 100%; }
  .h-mapa-ficha { height: 240px; }
}
/* En ninguna pantalla barras de desplazamiento visibles: el desplazamiento sigue, la barra no (regla de Gio, para
   escritorio y móvil) */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

/* ==============================================
   Agenda de los técnicos y citas (paso 6): rejilla de día y semana, lista del móvil y ruta del día
   ============================================== */
.h-ag-barra { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 14px; margin-bottom: 14px; }
.h-ag-nav, .h-ag-vistas, .h-ag-campos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.h-ag-campos .form-control, .h-ag-campos .form-select { width: auto; min-width: 150px; }
.h-ag-escritorio { overflow: hidden; }
.h-ag-scroll { overflow-x: auto; }
.h-ag-rejilla { display: grid; }
.h-ag-cab { display: flex; flex-direction: column; align-items: center; padding: 8px 10px; background: var(--h-cabecera); border-left: 1px solid var(--h-borde); border-bottom: 1px solid var(--h-borde); text-align: center; }
.h-ag-cab small { color: var(--h-texto-3); }
.h-ag-cab.es-hoy { background: var(--h-acento-suave); }
.h-ag-esquina { background: var(--h-cabecera); border-bottom: 1px solid var(--h-borde); }
.h-ag-etiqueta-dia { display: flex; align-items: center; justify-content: flex-end; padding: 4px 8px; border-bottom: 1px solid var(--h-borde); color: var(--h-texto-3); }
.h-ag-dia-entero { display: flex; flex-direction: column; gap: 3px; min-height: 32px; padding: 4px; border-left: 1px solid var(--h-borde); border-bottom: 1px solid var(--h-borde); }
.h-ag-chip { display: block; padding: 2px 6px; border-radius: 6px; border-left: 4px solid var(--h-borde); font-size: 12px; line-height: 1.3; color: var(--h-texto); text-decoration: none; overflow-wrap: anywhere; }
.h-ag-chip.h-ag-orden, .h-ag-item.h-ag-orden { border-left-color: #8c5dd9; background: rgba(140, 93, 217, 0.16); }
.h-ag-chip.h-ag-mant, .h-ag-item.h-ag-mant { border-left-color: #199ca8; background: rgba(25, 156, 168, 0.16); }
.h-ag-chip:hover { filter: brightness(0.96); }
.h-ag-eje { position: relative; border-right: 1px solid var(--h-borde); }
.h-ag-eje span { position: absolute; right: 6px; font-size: 11px; color: var(--h-texto-3); line-height: 1; padding-top: 2px; }
.h-ag-col { position: relative; border-left: 1px solid var(--h-borde); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 29px, rgba(128, 128, 128, 0.22) 29px, rgba(128, 128, 128, 0.22) 30px); }
.h-ag-col.es-hoy { background-color: var(--h-acento-suave); }
.h-ag-ev { position: absolute; z-index: 2; display: block; overflow: hidden; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--h-acento); border-left-width: 4px; background: var(--h-superficie); color: var(--h-texto); font-size: 12px; line-height: 1.25; text-decoration: none; user-select: none; -webkit-user-select: none; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); }
.h-ag-ev:hover { color: var(--h-texto); filter: brightness(0.97); }
.h-ag-ev strong { display: inline; font-weight: 600; }
.h-ag-ev-hora { margin-right: 4px; color: var(--h-texto-2); font-variant-numeric: tabular-nums; }
.h-ag-ev-cli { display: block; color: var(--h-texto-2); }
.h-ag-ev.e-pendiente { border-color: var(--h-aviso); background: rgba(224, 138, 0, 0.18); }
.h-ag-ev.e-confirmada { border-color: var(--h-acento); background: var(--h-acento-suave); }
.h-ag-ev.e-en_camino, .h-ag-ev.e-en_curso { border-color: #0c75de; background: rgba(12, 117, 222, 0.18); }
.h-ag-ev.e-hecha { border-color: var(--h-bien); background: rgba(46, 157, 78, 0.16); opacity: 0.85; }
.h-ag-ev.solapa { outline: 2px solid var(--h-peligro); outline-offset: -2px; }
.h-ag-ev.movible { cursor: grab; touch-action: none; }
.h-ag-ev.arrastrando { cursor: grabbing; opacity: 0.85; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
.h-ag-asa { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; }
.h-ag-asa::after { content: ""; position: absolute; right: 6px; bottom: 2px; width: 18px; height: 3px; border-radius: 2px; background: currentColor; opacity: 0.35; }
.h-ag-ev.estrecho { padding: 2px 3px; font-size: 11px; overflow-wrap: anywhere; }
.h-ag-ev.estrecho .h-ag-ev-hora { display: block; margin-right: 0; }
.h-ag-ev.estrecho .h-ag-ev-cli { display: none; }
.h-ag-pie { padding: 8px 14px; border-top: 1px solid var(--h-borde); }
.h-ag-leyenda { display: inline-flex; flex-wrap: wrap; align-items: center; margin-left: 10px; }
.h-ag-punto { display: inline-block; width: 11px; height: 11px; margin: 0 5px 0 12px; border-radius: 3px; background: var(--h-borde); }
.h-ag-punto.h-ag-orden { background: #8c5dd9; }
.h-ag-punto.h-ag-mant { background: #199ca8; }
.h-ag-punto.h-ag-solape { background: var(--h-peligro); }
.h-ag-lista { display: none; }
.h-ag-aviso-solape { color: var(--h-peligro) !important; }
.h-ag-deshacer { position: fixed; left: 50%; bottom: 60px; z-index: 1500; transform: translateX(-50%); display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; max-width: calc(100vw - 24px); padding: 10px 14px; border-radius: 10px; background: var(--h-panel); color: var(--h-panel-texto); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35); }
.h-ag-deshacer[hidden] { display: none; }
.h-fotos-cita { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.h-fotos-cita img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--h-borde); }
.h-ruta-marca span { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: var(--h-acento-fuerte); color: #fff; font-weight: 700; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.45); }
.h-ruta-num-lista { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-right: 6px; border-radius: 50%; background: var(--h-acento-fuerte); color: #fff; font-size: 13px; font-weight: 700; }
.h-parada a { overflow-wrap: anywhere; }
@media (max-width: 820px) {
  .h-ag-escritorio { display: none; }
  .h-ag-lista { display: block; }
  .h-ag-barra { gap: 10px; }
  .h-ag-nav { width: 100%; }
  .h-ag-nav .btn { flex: 1 1 0; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
  .h-ag-campos { width: 100%; }
  .h-ag-campos .form-control { flex: 1 1 140px; min-width: 0; }
  .h-ag-campos .form-select { flex: 1 1 100%; order: 3; min-width: 0; }
  .h-ag-vistas .btn { min-width: 84px; }
}

@media print {
  .h-menu, .h-panel, .h-botones-fila, .h-boton { display: none !important; }
}
/* Comunicación (paso 6B): envíos, plantillas, WhatsApp y empresa */
.h-resumen { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.h-resumen-dato { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--h-borde); border-radius: var(--h-radio); background: var(--h-superficie); color: var(--h-texto); text-decoration: none; }
.h-resumen-dato strong { font-size: 22px; line-height: 1.1; }
.h-resumen-dato span { font-size: 13px; color: var(--h-texto-2); }
.h-resumen-dato:hover { border-color: var(--h-acento); }
.h-logo-prev { display: flex; align-items: center; justify-content: center; min-height: 110px; margin-bottom: 10px; padding: 10px; border: 1px dashed var(--h-borde); border-radius: var(--h-radio); background: #ffffff; }
.h-logo-prev img { max-width: 100%; max-height: 100px; object-fit: contain; }
.h-logo-prev .text-muted { color: #6b6b6b !important; }
.h-wa-qr { background: #ffffff; border-radius: 10px; max-width: 280px; }
.h-wa-qr:empty { display: none; }
.h-wa-qr svg { width: 100%; height: auto; display: block; }
.h-vars { display: flex; flex-wrap: wrap; gap: 6px; }
.h-var { padding: 2px 9px; border-radius: 50rem; border: 1px solid var(--h-borde); background: var(--h-cabecera); color: var(--h-texto); font-family: ui-monospace, "Ubuntu Mono", Consolas, monospace; font-size: 12.5px; cursor: pointer; }
.h-var:hover { border-color: var(--h-acento); background: var(--h-acento-suave); }
.h-previa { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--h-borde); border-radius: var(--h-radio); background: var(--h-fondo-2); overflow-wrap: anywhere; }
.h-previa[hidden] { display: none; }
.h-previa hr { margin: 6px 0; }
.h-previa-texto { white-space: pre-wrap; margin-bottom: 6px; }
@media (max-width: 820px) {
  .h-resumen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.h-sugerencias { margin-top: 4px; border: 1px solid var(--h-borde); border-radius: var(--h-radio); background: var(--h-superficie); overflow: hidden; }
.h-sugerencias[hidden], .h-aviso-linea[hidden], [data-bloque-unidad][hidden] { display: none; }
.h-sugerencia { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 8px 12px; border: 0; border-top: 1px solid var(--h-borde); background: transparent; color: var(--h-texto); text-align: left; overflow-wrap: anywhere; }
.h-sugerencia:first-child { border-top: 0; }
.h-sugerencia:hover, .h-sugerencia:focus-visible { background: var(--h-acento-suave); outline: none; }
.h-sugerencia small, .h-sugerencia-vacia { color: var(--h-texto-3); }
.h-sugerencia-vacia { padding: 8px 12px; }
.h-mov-caja { padding: 12px 16px; border-top: 1px solid var(--h-borde); }
.h-mov-caja summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
.h-mov-caja summary::-webkit-details-marker { display: none; }
.h-mov-caja[open] summary { margin-bottom: 10px; }
.h-unidades-marcar { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; scrollbar-width: none; padding: 6px 2px; }
.h-unidades-marcar::-webkit-scrollbar { display: none; }
.h-unidades-marcar [hidden] { display: none; }
@media (max-width: 820px) {
  .h-mov-caja { padding: 12px; }
}

/* ---------- Paso 7B: avisos, encuestas, técnicos en ruta y zonas ---------- */
.h-contador { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 50rem; background: var(--h-peligro); color: #fff; font-size: 12px; font-weight: 700; }
.h-contador[hidden] { display: none; }
.h-avisos { position: fixed; right: 8px; bottom: 50px; z-index: 60; width: min(380px, calc(100vw - 16px)); max-height: min(70vh, 520px); display: flex; flex-direction: column; background: var(--h-superficie); color: var(--h-texto); border: 1px solid var(--h-borde); border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }
.h-avisos[hidden] { display: none; }
.h-avisos-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--h-borde); background: var(--h-cabecera); border-radius: 10px 10px 0 0; }
.h-avisos-lista { flex: 1; overflow-y: auto; scrollbar-width: none; }
.h-avisos-lista::-webkit-scrollbar { display: none; }
.h-avisos-nada { margin: 0; padding: 16px; color: var(--h-texto-3); }
.h-aviso-item { padding: 10px 12px; border-bottom: 1px solid var(--h-borde); border-left: 4px solid var(--h-borde); }
.h-aviso-item.aviso { border-left-color: var(--h-aviso); }
.h-aviso-item.grave { border-left-color: var(--h-peligro); }
.h-aviso-item.leido { opacity: 0.65; }
.h-aviso-texto { display: block; color: inherit; text-decoration: none; overflow-wrap: anywhere; font-weight: 500; }
a.h-aviso-texto:hover { text-decoration: underline; color: inherit; }
.h-aviso-pie { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; color: var(--h-texto-3); }
.h-avisos-pie { display: block; padding: 10px 12px; text-align: center; border-top: 1px solid var(--h-borde); }
.h-punto-nuevo { font-size: 8px; color: var(--h-acento); vertical-align: middle; }
.h-aviso-leido { opacity: 0.7; }
.h-tecnico-marca span { width: 34px; height: 34px; font-size: 12px !important; }
.h-ruta-tecnico { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-top: 1px solid var(--h-borde); color: inherit; cursor: pointer; font: inherit; }
.h-ruta-tecnico:hover { background: var(--h-acento-suave); }
.h-jornada-acciones { display: flex; flex-wrap: wrap; gap: 12px; }
.h-zona-sugerencia { margin-top: 6px; }
.h-zona-botones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.h-barra { display: grid; grid-template-columns: minmax(90px, 42%) 1fr 44px; align-items: center; gap: 10px; margin-bottom: 10px; }
.h-barra-etiqueta { overflow-wrap: anywhere; }
.h-barra-pista { height: 14px; border-radius: 50rem; background: var(--h-cabecera); border: 1px solid var(--h-borde); overflow: hidden; }
.h-barra-valor { display: block; height: 100%; border-radius: 50rem; background: var(--h-acento); }
.h-barra-valor.bien { background: var(--h-bien); }
.h-barra-valor.aviso { background: var(--h-aviso); }
.h-barra-valor.mal { background: var(--h-peligro); }
.h-barra-num { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.h-respuestas { margin: 8px 0 0; display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 4px 12px; }
.h-respuestas dt { font-weight: 500; color: var(--h-texto-2); }
.h-respuestas dd { margin: 0; overflow-wrap: anywhere; }
.h-comentario { font-style: italic; }
.h-pregunta-fila { margin-bottom: 14px; }
.h-pregunta-opciones { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 6px; }
.h-pregunta-opciones .form-select { width: auto; max-width: 100%; }
.h-encuesta-pregunta { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.h-encuesta-pregunta legend { float: none; width: auto; margin-bottom: 10px; font-size: 16px; font-weight: 600; }
.h-opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.h-opcion { position: relative; margin: 0; }
.h-opcion input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.h-opcion span { display: flex; align-items: center; justify-content: center; min-width: 44px; height: 46px; padding: 0 12px; border: 1px solid var(--h-borde); border-radius: var(--h-radio); background: var(--h-superficie); color: var(--h-texto); font-weight: 700; cursor: pointer; }
.h-opcion.ancha span { min-width: 110px; }
.h-opcion input:checked + span { background: var(--h-acento); border-color: var(--h-acento); color: var(--h-texto-sobre-acento); }
.h-opcion input:focus-visible + span { box-shadow: 0 0 0 3px var(--h-acento-suave), 0 0 0 2px var(--h-acento); }
.h-opciones-extremos { display: flex; justify-content: space-between; margin-top: 6px; color: var(--h-texto-3); }
@media (max-width: 820px) {
  .h-jornada-acciones .btn { flex: 1 1 100%; }
  .h-avisos { bottom: 50px; }
}
.h-solo-movil { display: none; }
@media (max-width: 560px) {
  .h-solo-pc { display: none; }
  .h-solo-movil { display: inline; }
  .h-respuestas { grid-template-columns: 1fr; }
  .h-respuestas dd { margin-bottom: 6px; }
  .h-panel .h-panel-usuario { display: none; }
  .h-barra { grid-template-columns: minmax(80px, 40%) 1fr 40px; gap: 8px; }
}
@media (max-width: 420px) {
  .h-panel { gap: 2px; padding: 0 4px; }
  .h-panel a, .h-panel button { padding: 0 7px; gap: 5px; }
  .h-panel-reloj { padding: 0 4px; }
}
/* Sistema: estado y copias */
/* En una tarjeta de alto completo, el pie de botones no crece (los botones no se estiran hacia abajo) */
.card > .card-body.h-acciones-ficha { flex: 0 0 auto; align-items: flex-start; }
.h-mono { font-family: ui-monospace, "Ubuntu Mono", Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.h-clave-copia { font-size: 24px; margin: 8px 0 14px; user-select: all; }
@media print {
  .h-menu, .h-panel, .h-velo, .h-no-imprimir { display: none !important; }
  .h-app { display: block; }
  .h-principal { margin: 0; padding: 0; }
}
@media (max-width: 575.98px) {
  .h-clave-copia { font-size: 18px; letter-spacing: 0.04em; }
}
/* Licencia: un módulo con su nombre, si está incluido y para qué sirve */
.h-modulo { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--h-borde); border-radius: 8px; }
.h-modulo-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
/* Llamada entrante: ventana en el panel de abajo con la ficha del cliente (public/js/llamadas.js) */
.h-llamada { position: fixed; right: 8px; bottom: 50px; z-index: 70; width: min(420px, calc(100vw - 16px)); max-height: min(78vh, 600px); display: flex; flex-direction: column; background: var(--h-superficie); color: var(--h-texto); border: 2px solid var(--h-acento); border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35); }
.h-llamada[hidden] { display: none; }
.h-llamada-cab { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--h-borde); background: var(--h-cabecera); border-radius: 8px 8px 0 0; }
.h-llamada-cab strong { display: block; font-size: 17px; overflow-wrap: anywhere; }
.h-llamada-cab small { color: var(--h-texto-3); }
.h-llamada-cuerpo { flex: 1; overflow-y: auto; scrollbar-width: none; padding: 10px 12px; }
.h-llamada-cuerpo::-webkit-scrollbar { display: none; }
.h-llamada-bloque { margin-bottom: 10px; }
.h-llamada-bloque h3 { margin: 0 0 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--h-texto-3); }
.h-llamada-bloque ul { margin: 0; padding-left: 18px; }
.h-llamada-bloque li, .h-llamada-bloque p { overflow-wrap: anywhere; }
.h-llamada-bloque p { margin: 0 0 2px; }
.h-llamada-acciones { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--h-borde); }
.h-llamada-acciones .btn { flex: 1 1 auto; }
.h-llamada-alta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.h-llamada-alta input { flex: 1 1 140px; min-width: 0; }
.h-panel .h-panel-llamada { background: var(--h-acento); color: var(--h-texto-sobre-acento); font-weight: 700; }
.h-panel .h-panel-llamada[hidden] { display: none; }
@media (max-width: 420px) {
  .h-panel .h-panel-llamada .h-solo-pc { display: none; }
  /* Con una llamada en curso, en el móvil la barra no cabe entera: se aparta lo que no urge (en ruta y reloj) */
  .h-panel:has(.h-panel-llamada:not([hidden])) .h-panel-ruta, .h-panel:has(.h-panel-llamada:not([hidden])) .h-panel-reloj { display: none; }
}
/* App de los técnicos: el código de 6 cifras de «Vincular móvil» */
.h-vinculo-codigo { font-family: ui-monospace, "Ubuntu Mono", Consolas, monospace; font-size: 40px; font-weight: 700; letter-spacing: 0.14em; line-height: 1.1; color: var(--h-acento); }
@media (max-width: 575.98px) {
  .h-vinculo-codigo { font-size: 32px; }
}
.h-elegir-archivo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.h-elegir-archivo span { overflow-wrap: anywhere; min-width: 0; }
/* Vigilancia de equipos: cifras altas, discos, orden de instalación y gráficos del historial (SVG propio) */
:root { --h-graf-cpu: #1f8f45; --h-graf-ram: #0c75de; --h-graf-disco: #c27400; --h-graf-rejilla: #d4d4d4; --h-graf-texto: #5c5c5c; }
:root[data-tema="oscuro"] { --h-graf-cpu: #4ed07a; --h-graf-ram: #5aa9ff; --h-graf-disco: #f0a73a; --h-graf-rejilla: #4d4d4d; --h-graf-texto: #bdbdbd; }
.h-cifra-alta { color: var(--h-peligro); font-weight: 700; }
.h-orden { margin: 0; padding: 12px; background: var(--h-fondo-2); border: 1px solid var(--h-borde); border-radius: 6px; color: var(--h-texto); font-family: ui-monospace, "Ubuntu Mono", Consolas, monospace; font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.h-discos { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.h-disco { display: flex; flex-direction: column; gap: 4px; }
.h-barra { height: 10px; border-radius: 50rem; background: var(--h-cabecera); border: 1px solid var(--h-borde); overflow: hidden; }
.h-barra-relleno { display: block; height: 100%; background: var(--h-bien); }
.h-barra-relleno.alto { background: var(--h-peligro); }
.h-selector-dias { display: flex; flex-wrap: wrap; gap: 6px; }
.h-graficos { display: grid; grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); gap: 18px; }
.h-disco .h-ficha-fila { display: flex; justify-content: space-between; gap: 8px; }
.h-grafico-caja { min-width: 0; }
.h-grafico-caja h3 { margin: 0 0 4px; }
.h-grafico { width: 100%; height: auto; display: block; }
.h-graf-rejilla { stroke: var(--h-graf-rejilla); stroke-width: 1; }
.h-graf-texto { fill: var(--h-graf-texto); font-size: 14px; font-family: var(--h-letra); }
.h-graf-linea { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.h-graf-area { stroke: none; opacity: 0.16; }
.h-graf-punto { stroke: none; }
.h-graf-linea.cpu, .h-graf-punto.cpu { stroke: var(--h-graf-cpu); }
.h-graf-linea.ram, .h-graf-punto.ram { stroke: var(--h-graf-ram); }
.h-graf-linea.disco, .h-graf-punto.disco { stroke: var(--h-graf-disco); }
.h-graf-punto.cpu { fill: var(--h-graf-cpu); }
.h-graf-punto.ram { fill: var(--h-graf-ram); }
.h-graf-punto.disco { fill: var(--h-graf-disco); }
.h-graf-area.cpu { fill: var(--h-graf-cpu); }
.h-graf-area.ram { fill: var(--h-graf-ram); }
.h-graf-area.disco { fill: var(--h-graf-disco); }
.h-graf-umbral { stroke: var(--h-peligro); stroke-width: 1; stroke-dasharray: 5 4; }
@media (max-width: 575.98px) {
  .h-graficos { grid-template-columns: 1fr; }
  .h-orden { font-size: 12px; }
}

/* ---------- Consola remota de Soporte (Vigilancia › Consola): terminal oscura, aspecto Mint, igual en claro y en oscuro ---------- */
.h-consola { background: #1b1d1f; border: 1px solid #0f1011; overflow: hidden; }
.h-consola-pantalla { margin: 0; padding: 12px 14px; height: min(60vh, 560px); min-height: 260px; overflow-y: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-family: "Ubuntu Mono", "DejaVu Sans Mono", Consolas, "Courier New", monospace; font-size: 13.5px; line-height: 1.4; color: #d8dee2; background: #1b1d1f; border-radius: 0; }
.h-consola-pantalla .sis { color: #8ae234; }
.h-consola-pantalla .ord { color: #fce94f; }
.h-consola-linea { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid #34383c; background: #222528; }
.h-consola-aviso { color: #8ae234; font-family: "Ubuntu Mono", "DejaVu Sans Mono", Consolas, monospace; font-size: 15px; }
.h-consola-orden { flex: 1 1 auto; min-width: 0; background: #111314; color: #eeeeec; border: 1px solid #3a3f44; border-radius: 6px; padding: 8px 10px; font-family: "Ubuntu Mono", "DejaVu Sans Mono", Consolas, monospace; font-size: 14px; }
.h-consola-orden::placeholder { color: #8b9298; }
.h-consola-orden:focus { outline: 2px solid var(--h-acento); outline-offset: 0; }
.h-consola-orden:disabled { opacity: 0.6; }
.h-consola-botones { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 10px; background: #222528; border-top: 1px solid #34383c; }
.h-consola .btn-secondary { background: #34383c; border-color: #4a5056; color: #eeeeec; }
.h-consola .btn-secondary:hover:not(:disabled) { background: #444a50; color: #fff; }
.h-consola-codigo { max-width: 560px; }
.h-consola-ordenes { list-style: none; margin: 0; padding: 8px 14px; max-height: 220px; overflow-y: auto; }
.h-consola-ordenes li { display: flex; gap: 10px; padding: 3px 0; border-top: 1px solid var(--h-borde); }
.h-consola-ordenes li:first-child { border-top: 0; }
.h-consola-ordenes .hora { flex: 0 0 auto; color: var(--h-texto-3); font-variant-numeric: tabular-nums; }
.h-consola-ordenes code { overflow-wrap: anywhere; color: var(--h-texto); }
@media (max-width: 575.98px) {
  .h-consola-pantalla { height: min(52vh, 420px); font-size: 12.5px; padding: 10px; }
  .h-consola-linea { flex-wrap: wrap; }
  .h-consola-orden { flex: 1 1 calc(100% - 28px); }
  .h-consola-linea .btn { flex: 1 1 100%; }
  .h-consola-botones .btn { flex: 1 1 100%; }
}
