/* Paleta institucional: negro, azul, gris, dorado y blanco.
   DÍA   = gris claro azulado con texto negro azulado; el azul manda en lo accionable.
   NOCHE = azul marino profundo (nunca negro puro) con texto blanco humo.
   En los dos temas la barra superior de las pantallas sigue negra y el dorado es el acento de marca.
   Los cuadros van translúcidos para que se vean el emblema y los circuitos del fondo. */
html:root {
  color-scheme: light;
  --theme-bg: #eaeef5;
  --theme-bg-fondo: radial-gradient(120% 90% at 50% 0%, #f7f9fc 0%, #eef1f7 42%, #dfe6f1 100%);
  --theme-surface: #ffffff;
  --theme-soft: #e4eaf3;
  --theme-soft-bg: rgba(255,255,255,.62);
  --theme-border: #c6d1e2;
  --theme-control-border: #8fa1bb;
  --theme-text: #0f1725;
  --theme-muted: #55657e;
  --theme-gold: #9a7b18;
  --theme-gold-hover: #b8901d;
  --theme-link: #0d47a1;
  --theme-link-hover: #1663c4;
  --theme-primary: #0d47a1;
  --theme-primary-hover: #1663c4;
  --theme-success-text: #145c33;
  --theme-success-bg: #d7f3e1;
  --theme-warning-text: #8a4708;
  --theme-warning-bg: #fdecc8;
  --theme-danger-text: #a91d17;
  --theme-danger-bg: #fbdfdc;
  --theme-danger: #b3261e;
  /* Recordatorio de seguimiento («favor de registrar avances en comentarios»): naranja en los dos temas.
     En el claro es naranja sobre crema; en el nocturno el texto sube de tono para que se lea. */
  --aviso-avance-text: #9a3412;
  --aviso-avance-bg: #fff7ed;
  --theme-hover: rgba(13,71,161,.07);
  --theme-selected: rgba(13,71,161,.14);
  --theme-closed: #64748b;
  --theme-mark: .40;
  --theme-brand-bg: linear-gradient(160deg, rgba(13,71,161,.88), rgba(15,23,37,.92));
  --theme-paper-bg: rgba(255,255,255,.74);
  --theme-card-bg: rgba(255,255,255,.66);
  --theme-glass: blur(7px) saturate(1.12);
  --mesh-glow: rgba(13,71,161,.06);
  --mesh-fade: rgba(234,238,245,0);
  --mesh-line: rgba(13,71,161,.13);
  --mesh-gold-line: rgba(154,123,24,.22);
  --mesh-dot: #9aa9c0;
  --mesh-gold-dot: #b8901d;
  --theme-circuit: .85;
  --mesh-tile: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280' viewBox='0 0 280 280' fill='none'><g stroke='%230d47a1' stroke-opacity='.14' stroke-width='1' stroke-linecap='square'><path d='M8 44h44l18-18h56l14 14h48'/><path d='M248 20h-38l-16 16v42l-14 14H118'/><path d='M20 268v-44l22-22h50v-30h40'/><path d='M268 260h-46l-18-18h-40l-16 16h-48'/><path d='M74 128h56l16-16h60'/><path d='M150 232v-34l-20-20H60'/><path d='M4 148h36l18 18h52'/><path d='M276 118h-32l-20 20v40'/><path d='M112 4v40l18 18'/></g><g stroke='%239a7b18' stroke-opacity='.20' stroke-width='1'><path d='M0 96h70l20 20h72l20-20h78'/><path d='M190 280v-46l-18-18v-40'/></g><g fill='%230d47a1' fill-opacity='.24'><circle cx='230' cy='44' r='2.5'/><circle cx='14' cy='242' r='2.5'/><circle cx='264' cy='180' r='2.5'/><circle cx='96' cy='10' r='2.5'/></g><g fill='%239a7b18' fill-opacity='.30'><circle cx='92' cy='116' r='3'/><circle cx='196' cy='214' r='3'/></g></svg>");
}
html:root[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #0a1424;
  --theme-bg-fondo: radial-gradient(120% 90% at 50% 0%, #14263f 0%, #0d1a2e 45%, #070f1c 100%);
  --theme-surface: #14243c;
  --theme-soft: #1c3050;
  --theme-soft-bg: rgba(20,36,60,.58);
  --theme-border: #2c4468;
  --theme-control-border: #4b6891;
  --theme-text: #eef3fb;
  --theme-muted: #a2b5d1;
  --theme-gold: #d4af37;
  --theme-gold-hover: #eac75e;
  --theme-link: #6aa6ec;
  --theme-link-hover: #90c0f6;
  --theme-primary: #1f6fbf;
  --theme-primary-hover: #2b83d8;
  --theme-success-text: #8ce6ae;
  --theme-success-bg: #123a2a;
  --theme-warning-text: #fbcf6a;
  --theme-warning-bg: #3a2c14;
  --theme-danger-text: #ff9d94;
  --theme-danger-bg: #45191b;
  --theme-danger: #c9372c;
  --aviso-avance-text: #ffb266;
  --aviso-avance-bg: rgba(249, 115, 22, .16);
  --theme-hover: rgba(106,166,236,.13);
  --theme-selected: rgba(106,166,236,.22);
  --theme-closed: #7e8ea6;
  --theme-mark: .30;
  --theme-brand-bg: linear-gradient(160deg, rgba(31,111,191,.82), rgba(7,15,28,.92));
  --theme-paper-bg: rgba(20,36,60,.72);
  --theme-card-bg: rgba(20,36,60,.60);
  --theme-glass: blur(7px) saturate(1.10);
  --mesh-glow: rgba(46,110,190,.16);
  --mesh-fade: rgba(10,20,36,0);
  --mesh-line: rgba(106,166,236,.20);
  --mesh-gold-line: rgba(212,175,55,.34);
  --mesh-dot: #4b6891;
  --mesh-gold-dot: #d4af37;
  --theme-circuit: 1;
  --mesh-tile: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280' viewBox='0 0 280 280' fill='none'><g stroke='%236aa6ec' stroke-opacity='.20' stroke-width='1' stroke-linecap='square'><path d='M8 44h44l18-18h56l14 14h48'/><path d='M248 20h-38l-16 16v42l-14 14H118'/><path d='M20 268v-44l22-22h50v-30h40'/><path d='M268 260h-46l-18-18h-40l-16 16h-48'/><path d='M74 128h56l16-16h60'/><path d='M150 232v-34l-20-20H60'/><path d='M4 148h36l18 18h52'/><path d='M276 118h-32l-20 20v40'/><path d='M112 4v40l18 18'/></g><g stroke='%23d4af37' stroke-opacity='.26' stroke-width='1'><path d='M0 96h70l20 20h72l20-20h78'/><path d='M190 280v-46l-18-18v-40'/></g><g fill='%236aa6ec' fill-opacity='.30'><circle cx='230' cy='44' r='2.5'/><circle cx='14' cy='242' r='2.5'/><circle cx='264' cy='180' r='2.5'/><circle cx='96' cy='10' r='2.5'/></g><g fill='%23d4af37' fill-opacity='.36'><circle cx='92' cy='116' r='3'/><circle cx='196' cy='214' r='3'/></g></svg>");
}

/* Alias para las hojas existentes. */
html:root {
  --bg: var(--theme-bg);
  --fondo: var(--theme-bg);
  --panel: var(--theme-surface);
  /* Barras de filtros, cajas y filas de grupo: también translúcidas. */
  --panel-2: var(--theme-soft-bg);
  /* Las tarjetas usan el fondo translúcido para que el emblema se deje ver. */
  --card: var(--theme-card-bg);
  --input: var(--theme-surface);
  --borde: var(--theme-border);
  --border: var(--theme-border);
  --linea: var(--theme-border);
  --texto: var(--theme-text);
  --text: var(--theme-text);
  --suave: var(--theme-muted);
  --muted: var(--theme-muted);
  --azul: var(--theme-link);
  --azul-t: var(--theme-link-hover);
  --accent: var(--theme-link);
  --accent-hover: var(--theme-link-hover);
  --dorado: var(--theme-gold);
  --dorado-t: var(--theme-gold);
  --error: var(--theme-danger-text);
  --err: var(--theme-danger-text);
  --ok: #4fc38a;
  --warn: #efb744;
  --row-hover: var(--theme-hover);
  --selected: var(--theme-selected);
  --navy-900: var(--theme-bg);
  --navy-800: var(--theme-surface);
  --navy-700: var(--theme-soft);
  --navy-line: var(--theme-border);
  --gold: var(--theme-gold);
  --gold-soft: var(--theme-gold-hover);
  --ink: var(--theme-text);
  --ink-dim: var(--theme-muted);
  --ink-soft: var(--theme-muted);
  --paper: var(--theme-surface);
  /* login.css usa estos nombres propios: se alinean a la misma paleta. */
  --navy: var(--theme-primary);
  --navy-2: var(--theme-primary-hover);
  /* Barra superior de los paneles: negro con acento dorado, igual en día y en noche. */
  --theme-header-bg: #0a0a0a;
  --theme-header-text: #ffffff;
  --theme-header-muted: #cfd4dd;
  --theme-header-soft: rgba(255,255,255,.10);
  --theme-header-soft-hover: rgba(255,255,255,.20);
  --theme-header-line: rgba(255,255,255,.30);
}

/* Ancho unificado de las páginas del sistema: el mismo del Calendario de actividades
   (`min(1780px, 96vw)` dentro del cuerpo con padding de 16 px). El valor vive solo aquí; cada
   página lo toma con `max-width: var(--page-max-width)` en su contenedor o con la clase
   `.page-wide`. Inicio y Login no la usan, así que su diseño no cambia. */
html:root {
  --page-max-width: min(1780px, 96vw);
}
/* Contenedor de página ancha: ensancha el propio elemento y deja que las tarjetas `.card`
   que cuelguen directo de él lleguen hasta sus bordes (panel.css las topa en 1200 px). */
.page-wide { max-width: var(--page-max-width); }
.page-wide > .card { max-width: none; }

/* Tamaño de letra elegido en el botón ⚙ de la cabecera (`js/theme.js` pone `data-fuente` antes de
   pintar). Se escala la raíz, en porcentaje sobre el 100 % de siempre: crece todo lo que está en rem
   —la intranet y los doce paneles— y nada se queda fijo en píxeles. Sin atributo, 100 %. */
html:root[data-fuente="chica"] { font-size: 88%; }
html:root[data-fuente="grande"] { font-size: 118%; }

/* El interruptor Día/Noche de la cabecera (`.theme-toggle`, `.theme-toolbar`) se retiró junto con el
   botón: el tema se elige ahora en el bloque «Tema» del diálogo ⚙, que ya se pinta con las reglas
   `dialog.pref` de abajo. */

@media screen {
  /* Fondo azul (día) / azul marino (noche) con degradado fijo al viewport:
     al hacer scroll el emblema y los circuitos quedan quietos. */
  html {
    background-color: var(--theme-bg);
    background-image: var(--theme-bg-fondo);
    background-attachment: fixed;
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }
  body:is(.theme-intranet, .theme-panel, .theme-login) { background: transparent; color: var(--theme-text); }
  /* Circuitos del inicio también en el fondo de login y de los paneles:
     el inicio los dibuja en su canvas (#mesh); aquí se replican con un mosaico CSS. */
  body:is(.theme-panel, .theme-login)::after {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background-image: var(--mesh-tile);
    background-repeat: repeat;
    opacity: var(--theme-circuit);
  }
  /* Cuadros de vidrio: se ve el fondo y aun así el texto mantiene contraste. */
  body :is(.tarjeta, .card, .card-info, .table-wrap, .tabla-wrap, .lista-entradas li,
    .panel-tickets, .ticket-card, .ing-card, .mes-grid, .panel-usuarios, .usuario-card, .u-item,
    .caja, .panel-filtros, .filtros) { backdrop-filter: var(--theme-glass); -webkit-backdrop-filter: var(--theme-glass); }
  .theme-intranet :is(.search, .status, .tablewrap, .aviso, .app, .modal) { backdrop-filter: var(--theme-glass); -webkit-backdrop-filter: var(--theme-glass); }
  .fondo-logo { display: none !important; }
  body :is(input, select, textarea) { color-scheme: inherit; accent-color: var(--theme-link); }
  body :is(input, textarea)::placeholder { color: var(--theme-muted); opacity: 1; }
  body :is(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--theme-link); outline-offset: 3px; }

  /* Intranet: sustituir los fondos oscuros translúcidos, manteniendo la misma rejilla. */
  .theme-intranet { --ok: var(--theme-success-text); --warn: var(--theme-warning-text); }
  .theme-intranet :is(.search, .status, .tablewrap, .aviso, .app) { background: var(--theme-card-bg); }
  /* La rejilla de accesos usa el fondo del contenedor como línea separadora;
     con auto-fill eso pinta también la celda vacía. Se vuelven tarjetas sueltas. */
  .theme-intranet .apps { background: transparent; border: 0; gap: 12px; }
  .theme-intranet .app { border: 1px solid var(--theme-border); border-radius: 8px; }
  .theme-intranet .app:hover { background: var(--theme-soft); border-color: var(--theme-gold); }
  .theme-intranet :is(.help, .aviso-warn, .modal-error) { background: var(--theme-warning-bg); }
  .theme-intranet .news li[data-pausado] { opacity: 1; border-left: 3px dashed var(--theme-muted); padding-left: 10px; }
  .theme-intranet .top { gap: 12px; }
  .theme-intranet .who { margin-left: auto; }
  .theme-intranet :is(.modal-form input, .modal-form select, .modal-form textarea, .filtro input, .filtro select) { border-color: var(--theme-control-border); }

  /* Diálogo ⚙ de la cabecera: caja opaca (va sobre el oscuro del backdrop) con la paleta de la página. */
  .theme-intranet dialog.pref, .theme-panel dialog.pref { background: var(--theme-surface); border-color: var(--theme-border); }
  .theme-intranet dialog.pref, .theme-panel dialog.pref .pref-cab { background: var(--theme-surface); }
  .theme-intranet dialog.pref, .theme-panel dialog.pref :is(.pref-opciones label, .pref-linea input) { background: var(--theme-bg); border-color: var(--theme-control-border); color: var(--theme-text); }
  .theme-intranet dialog.pref, .theme-panel dialog.pref .pref-opciones label:hover { border-color: var(--theme-gold); }
  .theme-intranet dialog.pref, .theme-panel dialog.pref .pref-opciones label:has(input:checked) { background: var(--theme-selected); border-color: var(--theme-gold); }
  .theme-intranet dialog.pref, .theme-panel dialog.pref :is(.pref-cerrar, .pref-guardar, .pref-reintentar) { background: transparent; color: var(--theme-text); border-color: var(--theme-control-border); }
  .theme-intranet dialog.pref, .theme-panel dialog.pref :is(.pref-cerrar:hover, .pref-guardar:hover:not(:disabled), .pref-reintentar:hover) { background: var(--theme-primary); color: #fff; border-color: var(--theme-primary); }
  .theme-intranet dialog.pref, .theme-panel dialog.pref .pref-estado { color: var(--theme-muted); }
  .theme-intranet dialog.pref, .theme-panel dialog.pref .pref-estado.mal { background: var(--theme-warning-bg); color: var(--theme-warning-text); border-top-color: var(--theme-warning-text); }
  .theme-intranet .pref-btn { color: var(--theme-gold-hover); border-color: var(--theme-border); }
  .theme-intranet .pref-btn:hover { background: var(--theme-gold); color: var(--theme-bg); border-color: var(--theme-gold); }

  /* Login: panel de marca azul (sin emblema dentro, por solicitud) y formulario translúcido. */
  .theme-login .brand { background: var(--theme-brand-bg); }
  .theme-login .brand > .brand-content { z-index: 2; }
  .theme-login .brand-content h1 { color: #ffffff; }
  .theme-login .brand-mark { color: var(--theme-gold-hover); }
  .theme-login :is(.brand-sub, .footnote) { color: #d7deea; }
  .theme-login .panel { background: var(--theme-paper-bg); }
  .theme-login .panel-head h2 { color: var(--theme-text); }
  .theme-login .field input { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-control-border); }
  .theme-login .ver-pwd { color: var(--theme-muted); }
  .theme-login :is(.ver-pwd:hover, .ver-pwd:focus-visible) { color: var(--theme-text); background: var(--theme-hover); }
  .theme-login .forgot { color: var(--theme-link); }
  .theme-login .check input { accent-color: var(--theme-link); }
  .theme-login button[type="submit"] { background: var(--theme-primary); color: #fff; }
  .theme-login button[type="submit"]:hover { background: var(--theme-primary-hover); }
  .theme-login .error { background: var(--theme-danger-bg); color: var(--theme-danger-text); border-color: var(--theme-danger-text); }
  .theme-login .row { gap: 12px; flex-wrap: wrap; }

  /* Cabecera de los paneles: barra negra, texto blanco, acento dorado y controles legibles. */
  .theme-panel > header { background: var(--theme-header-bg); color: var(--theme-header-text); flex-wrap: wrap; }
  .theme-panel > header h1 { color: var(--theme-gold-hover); }
  .theme-panel > header :is(.badge, .derecha) { color: var(--theme-header-muted); overflow-wrap: anywhere; }
  /* El rótulo del centro va clavado al eje de la pantalla, no al hueco entre los botones. */
  .theme-panel > header .logo-centro {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    color: var(--theme-gold-hover);
  }
  .theme-panel > header .botones-nav { align-items: center; flex-wrap: wrap; max-width: 100%; }
  .theme-panel > header :is(.boton-nav, button) {
    background: var(--theme-header-soft); color: var(--theme-header-text);
    border-color: var(--theme-header-line);
  }
  .theme-panel > header :is(.boton-nav, button):hover { background: var(--theme-header-soft-hover); }
  .theme-panel :is(.tarjeta, .card, .card-info) { background: var(--theme-card-bg); }
  .theme-panel :is(.table-wrap, .tabla-wrap, .lista-entradas li, .panel-tickets, .ticket-card, .ing-card, .mes-grid, .panel-usuarios, .usuario-card, .u-item) { background: var(--theme-card-bg); color: var(--theme-text); }
  .theme-panel dialog.modal { background: var(--theme-surface); color: var(--theme-text); }
  .theme-panel :is(th, td, ul.log li) { border-color: var(--theme-border); }
  /* Chips de resultado de la bitácora: en la hoja van con texto oscuro,
     que sobre el azul nocturno no se lee. Aquí se les da su pareja clara. */
  html:root[data-theme="dark"] .theme-panel code.res.exito { color: #8ce6ae; background: rgba(34,197,94,.16); border-color: #4fc38a; }
  html:root[data-theme="dark"] .theme-panel code.res.parcial { color: #fbcf6a; background: rgba(245,158,11,.16); border-color: #e8a13a; }
  html:root[data-theme="dark"] .theme-panel code.res.error { color: #ff9d94; background: rgba(180,38,30,.22); border-color: #c9372c; }
  html:root[data-theme="dark"] .theme-panel code.res.cancelado { color: #cbd5e1; background: rgba(100,116,139,.22); border-color: #7e8ea6; }
  .theme-panel :is(input, select, textarea) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-control-border); color-scheme: inherit; }
  .theme-panel input[type="file"]::file-selector-button { background: var(--theme-soft); color: var(--theme-text); border: 1px solid var(--theme-control-border); border-radius: 4px; padding: 5px 8px; }
  .theme-panel button { background: var(--theme-surface); color: var(--theme-text); }
  .theme-panel :is(.btn-secondary, .secundario) { border-color: var(--theme-control-border); }
  .theme-panel :is(.btn-secondary, .secundario, .boton-nav):hover { background: var(--theme-soft); }
  .theme-panel :is(.btn-primary, .primario, .tab-unica),
  .theme-panel :is(.dia.hoy .num b, .usuario-card .u-cab .u-count, .panel-filtros button.on) { background: var(--theme-primary); border-color: var(--theme-primary); color: #fff; }
  .theme-panel :is(.btn-primary, .primario):hover:not(:disabled) { background: var(--theme-primary-hover); }
  .theme-panel :is(.btn-danger, .peligro, .chip.Cancelada, .estatus div.on[data-e="Cancelada"]) { background: var(--theme-danger); border-color: var(--theme-danger); color: #fff; }
  .theme-panel :is(.btn-success, .btn-download, .chip.Completada, .estatus div.on[data-e="Completada"]) { background: var(--ok); border-color: var(--ok); color: #052e16; }
  .theme-panel :is(.chip.Pendiente, .estatus div.on[data-e="Pendiente"]) { background: var(--warn); color: #432c07; }
  .theme-panel .chip .marca { background: var(--naranja); color: #2a1200; }
  .theme-panel :is(.ticket-card, .u-item):hover { background: var(--theme-hover); }
  .theme-panel tbody tr.selected { background: var(--theme-selected); }
  .theme-panel .tabla-wrap tr:hover td { background: var(--theme-hover); }
  .theme-panel :is(a:not(.boton-nav), button.pdf, button.editar, .dia .mas) { color: var(--theme-link); }
  .theme-panel :is(button.pdf, button.editar, .dia .mas, .tabs button) { background: transparent; }
  .theme-panel .dia .mas:hover { background: var(--theme-hover); }
  .theme-panel .tabs button { color: var(--theme-muted); }
  .theme-panel .tabs button.on { color: var(--theme-link); }
  .theme-panel .dia.fuera { background: var(--theme-soft); }
  .theme-panel .dia.fuera .num { color: var(--theme-muted); }
  .theme-panel :is(.avance .pista, .estatus div:not(.on)) { background: var(--theme-soft); color: var(--theme-muted); }
  .theme-panel :is(.aviso, .aviso-reporte, code.estado.inactivo, code.estado.desconectado, .msg-error:not(:empty)) { background: var(--theme-warning-bg); color: var(--theme-warning-text); border-color: var(--theme-warning-text); }
  /* El recordatorio de seguimiento es NARANJA en los dos temas, no ámbar: así se distingue del aviso
     del reporte de estatus solicitado, que vive en la misma tarjeta. Los tonos los traen las variables
     `--aviso-avance-*` de arriba (crema y óxido en el claro, naranja suave sobre azul nocturno en el oscuro). */
  .theme-panel .aviso-avance { background: var(--aviso-avance-bg); color: var(--aviso-avance-text); border-color: var(--naranja); }
  .theme-panel :is(.aviso-ok, .aviso.ok, code.estado:not(.inactivo):not(.desconectado), .ef-si) { background: var(--theme-success-bg); color: var(--theme-success-text); border-color: var(--theme-success-text); }
  .theme-panel :is(.log-ok, ul.log .ok) { color: var(--theme-success-text); }
  .theme-panel :is(.form-error, .log-err, ul.log .mal) { color: var(--theme-danger-text); }
  .theme-panel .form-error { background: var(--theme-danger-bg); }
  .theme-panel .msg-error[role="alert"]:not(:empty) { background: var(--theme-danger-bg); color: var(--theme-danger-text); border-color: var(--theme-danger-text); }
  .theme-panel .zona { border-color: var(--theme-control-border); }
  .theme-panel .zona.activa { border-color: var(--theme-gold); }
  .theme-panel .barra-hoja { background: var(--theme-primary); }
  .theme-panel .barra-hoja button { background: transparent; color: #fff; }
  .theme-panel .visor-barra { color: var(--theme-text); }

  /* Consulta lista de trabajo: `lista-trabajo.css` está escrito en claro, igual que `panel.css`,
     así que sus valores planos (blanco, grises, los tonos de aviso) se corrigen aquí.
     El prefijo `.theme-panel .lista-trabajo` gana por especificidad a las reglas propias. */
  .theme-panel .lista-trabajo .lt-panel { box-shadow: none; }
  .theme-panel .lista-trabajo :is(input, select) { background: var(--theme-surface); border-color: var(--theme-control-border); }
  .theme-panel .lista-trabajo .lt-button { background: var(--theme-surface); border-color: var(--theme-control-border); }
  .theme-panel .lista-trabajo .lt-button:hover:not(:disabled) { background: var(--theme-soft); border-color: var(--theme-link); }
  .theme-panel .lista-trabajo .lt-button:active:not(:disabled) { background: var(--theme-selected); }
  .theme-panel .lista-trabajo .lt-button.lt-primary { background: var(--theme-primary); border-color: var(--theme-primary); color: #fff; }
  .theme-panel .lista-trabajo .lt-button.lt-primary:hover:not(:disabled) { background: var(--theme-primary-hover); border-color: var(--theme-primary-hover); }
  .theme-panel .lista-trabajo .lt-table-scroll { background: var(--theme-surface); }
  .theme-panel .lista-trabajo .lt-table :is(th, td) { border-bottom-color: var(--theme-border); }
  .theme-panel .lista-trabajo .lt-message { background: var(--theme-card-bg); }
  .theme-panel .lista-trabajo .lt-message[data-kind="error"] { background: var(--theme-danger-bg); border-color: var(--theme-danger-text); color: var(--theme-danger-text); }
  .theme-panel .lista-trabajo .lt-message[data-kind="warning"] { background: var(--theme-warning-bg); color: var(--theme-warning-text); }
  .theme-panel .lista-trabajo .lt-message[data-kind="success"] { background: var(--theme-success-bg); color: var(--theme-success-text); }
  .theme-panel .lista-trabajo :is(.lt-ping[data-kind="success"], .lt-registro-table td[data-kind="success"]) { color: var(--theme-success-text); }
  .theme-panel .lista-trabajo :is(#lt-data-status[data-kind="warning"], #lt-destino[data-kind="warning"], .lt-registro-table td[data-kind="warning"]) { color: var(--theme-warning-text); }
  .theme-panel .lista-trabajo .lt-dialog { background: var(--theme-surface); }
  .theme-panel .lista-trabajo .lt-dialog::backdrop { background: var(--theme-header-bg); opacity: .72; }
  .theme-panel .lista-trabajo .lt-image-frame { background: var(--theme-header-bg); }

  /* Hoja institucional y PDF: conservar papel blanco, sin inversión. */
  .theme-panel .marco {
    color-scheme: light;
    background: #fff;
    color: #111;
    --texto: #111;
    --text: #111;
    --suave: #555;
    --muted: #555;
    --panel: #fff;
    --panel-2: #eee;
    --borde: #999;
    --azul: #0d47a1;
  }
  .theme-panel .marco :is(th, td) { color: #111; border-color: #000; }
  .theme-panel .marco th { background: #eee; }
  .theme-panel .marco tbody tr:hover { background: transparent; }
  .theme-panel .marco a { color: #0d47a1; }
  .theme-panel :is(.visor-marco iframe, .visor-marco embed, .visor-marco object) { color-scheme: light; background: #fff; }
}

/* Por debajo de este ancho el rótulo centrado chocaría con los botones: se oculta.
   La barra de `_LayoutPanel.cshtml` (Consulta lista de trabajo) llegó a necesitar su propio umbral
   de 1320 px porque llevaba cinco mandos a la derecha; con la ventana ⚙ fuera de esa cabecera
   quedan Regresar, Home y Salir y le sirve el mismo 1180 px que a los demás paneles. */
@media screen and (max-width: 1180px) {
  .theme-panel > header .logo-centro { display: none; }
}
@media screen and (max-width: 600px) {
  .theme-panel > header { position: static; padding-inline: 16px; }
  .theme-panel > header .botones-nav { width: 100%; margin-left: 0; gap: 6px; }
  .theme-panel :is(.card, .tarjeta) { padding: 18px 14px; }
  .theme-panel :is(.visor-barra, .visor-acciones, .fila-botones) { flex-wrap: wrap; }
  .theme-login .panel { padding: 24px 18px; }
  .theme-intranet .who { justify-items: start; margin-left: 0; }
  .theme-intranet .clock { text-align: left; }
}
@media print {
  html:root, html:root[data-theme="dark"] { color-scheme: light; background: #fff; }
  body, body * { color: #111 !important; background: transparent !important; box-shadow: none !important; text-shadow: none !important; }
  body { background: #fff !important; }
  body :is(#mesh, .fondo-logo, .barra-hoja) { display: none !important; }
  body::before { display: none !important; }
  body::after { display: none !important; }
  body :is(input, select, textarea) { color-scheme: light; }
  body :is(th, td) { border-color: #888; }
}
