/* Superficies comunes y fichas: se carga después de los estilos de cada vista. */
html[data-theme="dark"] {
    --dark-surface: var(--theme-panel);
    --dark-surface-raised: var(--theme-raised);
    --dark-surface-hover: var(--theme-hover);
    --dark-text: var(--theme-text);
    --dark-muted: var(--theme-muted);
    --dark-border: var(--theme-border);
    --table-hover-bg: var(--theme-hover);
}


html[data-theme="dark"] :is(.modal-box, .confirm-box, .force-pwd-modal, .ax-modal-card,
    .pan-presionar-modal, .mon-folder-dialog, .mon-point-dialog, .aud-modal-caja,
    .perfil-photo-dialog) {
    background: var(--dark-surface);
    color: var(--dark-text);
    border-color: var(--dark-border);
}

html[data-theme="dark"] :is(.modal-box, .confirm-box, .force-pwd-modal,
    .mon-folder-dialog, .mon-point-dialog, .aud-modal-caja, .perfil-photo-dialog)
    :is(h1, h2, h3, h4, h5, label, dt, dd, strong, p) {
    color: var(--dark-text);
}

html[data-theme="dark"] :is(.modal-box, .mon-folder-dialog, .mon-point-dialog,
    .aud-modal-caja, .perfil-photo-dialog) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background: var(--dark-surface-raised);
    color: var(--dark-text);
    border-color: var(--dark-border);
}
html[data-theme="dark"] :is(.modal-box, .mon-folder-dialog, .mon-point-dialog,
    .aud-modal-caja, .perfil-photo-dialog) :is(input, textarea)::placeholder { color: var(--dark-muted); }

/* Monitoreo: listas, ficha de punto y tablas interiores. */
html[data-theme="dark"] :is(.mon-folder-item, .mon-folder-item:first-child,
    .mon-folder-metric, .mon-folder-footer, .mon-point-grid > section,
    .mon-point-ticket-head, .mon-point-tickets, .mon-point-metrics > div) {
    background: var(--dark-surface-raised);
    color: var(--dark-text);
    border-color: var(--dark-border);
}
html[data-theme="dark"] :is(.mon-folder-info b, .mon-folder-metric b,
    .mon-point-grid h4, .mon-point-grid dd, .mon-point-grid strong) { color: var(--dark-text); }
html[data-theme="dark"] :is(.mon-folder-info small, .mon-folder-metric small,
    .mon-folder-head p, .mon-point-grid dt, .mon-point-grid small,
    .mon-point-ticket-head) { color: var(--dark-muted); }
html[data-theme="dark"] :is(.mon-folder-item:hover, .mon-folder-item:focus-visible) {
    background: var(--dark-surface-hover);
    border-color: #8ab4f8;
}
html[data-theme="dark"] :is(.mon-folder-profile, .mon-folder-head button,
    .mon-folder-footer button, .modal-close) {
    background: var(--dark-surface-raised);
    color: var(--dark-text);
    border-color: var(--dark-border);
}
html[data-theme="dark"] .mon-folder-profile:hover { background: #c91d34; color: #fff; }

/* Ficha de ticket, incluidos los bloques insertados dinámicamente. */
html[data-theme="dark"] .ax-modal :is(.ax-modal-card, .ax-modal-cuerpo, .ax-modal-pie,
    .ax-ficha-quien li, .ax-ficha-hilo, .ax-ans-panel, .ax-observador-panel,
    .ax-observador-persona, .ax-observador-nota) {
    background: var(--dark-surface-raised);
    color: var(--dark-text);
    border-color: var(--dark-border);
}
html[data-theme="dark"] .ax-modal :is(.ax-ficha-quien li > div strong,
    .ax-ficha-desc, .ax-ficha-msg-txt, .ax-ans-datos b,
    .ax-observador-persona strong) { color: var(--dark-text); }
html[data-theme="dark"] .ax-modal :is(.ax-ficha-quien span, .ax-ficha-sec h4,
    .ax-ficha-paneles h4, .ax-ans-datos span, .ax-ans-panel small,
    .ax-observador-persona small, .ax-observador-panel li time) { color: var(--dark-muted); }
html[data-theme="dark"] .ax-modal :is(.ax-ficha-pill:not(.ax-ficha-estado), .ax-ficha-detalle-completo) {
    background: #303030;
    color: var(--dark-text);
    border-color: var(--dark-border);
}
html[data-theme="dark"] .ax-modal .ax-ficha-msg {
    background: #252d39;
    border-color: #414b5a;
    color: var(--dark-text);
}
html[data-theme="dark"] .ax-modal .ax-ficha-msg.es-presion { background: #39282e; border-color: #70414a; }
html[data-theme="dark"] .ax-modal .ax-ficha-msg.es-interno { background: #30303a; border-color: #51515d; }
html[data-theme="dark"] .ax-modal .ax-ficha-msg-top strong { color: var(--dark-text); }
html[data-theme="dark"] .ax-modal .ax-ficha-msg-top > span:not(.ax-ficha-tag) { color: var(--dark-muted); }
html[data-theme="dark"] .ax-modal :is(.ax-ficha-chat, .ax-ficha-presionar, .ax-ficha-presion-cancelar) {
    background: #2a3341; color: var(--dark-text); border-color: #475264;
}
html[data-theme="dark"] .ax-modal .ax-ficha-chat:hover { background: #354153; color: #fff; }
html[data-theme="dark"] .ax-modal .ax-ans-datos { background: rgba(14, 20, 30, .35); border-color: rgba(255,255,255,.1); }
html[data-theme="dark"] .ax-modal .ax-ans-panel[data-estado="vencido"] { background:#442426; color:#ffadb4; }
html[data-theme="dark"] .ax-modal .ax-ans-panel[data-estado="por-vencer"] { background:#46351d; color:#ffd68a; }
html[data-theme="dark"] .ax-modal .ax-ans-panel[data-estado="ok"] { background:#203c2e; color:#a9eac0; }

html[data-theme="dark"] :is(.modal-box, .confirm-box, .mon-folder-dialog,
    .mon-point-dialog, .ax-modal-card, .perfil-photo-dialog) :focus-visible {
    outline: 2px solid #92b9ff;
    outline-offset: 2px;
}

/* Encabezado compartido entre roles. */
html[data-theme="dark"] .topbar > .header-row {
    background: var(--theme-secondary);
    border-color: var(--dark-border);
}
html[data-theme="dark"] .topbar .topbar-titles h1 { color: var(--dark-text); }
html[data-theme="dark"] .topbar :is(.dogger-page-description, .dogger-page-breadcrumb,
    .dogger-crumb-root, .dogger-header-clock, .dogger-header-clock small,
    .dogger-header-session small) { color: var(--dark-muted); }
html[data-theme="dark"] .topbar :is(.dogger-header-clock, .dogger-header-session) {
    background: var(--dark-surface-raised);
    border-color: var(--dark-border);
}
html[data-theme="dark"] .topbar .dogger-header-session strong { color: #8de2ae; }
html[data-theme="dark"] .topbar .user-chip { color: var(--dark-text); }
html[data-theme="dark"] .topbar .user-chip-text { color: var(--dark-text); }
html[data-theme="dark"] .topbar .user-chip-text small { color: var(--dark-muted); }
html[data-theme="dark"] :is(.sidebar, .topbar-top) { background: var(--theme-secondary); }
html[data-theme="dark"] .corp-fab-item {
    background: #242424;
    color: var(--dark-text);
    border-color: #484848;
}
html[data-theme="dark"] .corp-fab-item:hover,
html[data-theme="dark"] .corp-fab-item:focus-visible { background: #333333; }
html[data-theme="dark"] .sidebar :is(.sidebar-brand-txt strong, .sidebar-link) { color: var(--dark-text); }

/* Mi panel del punto de venta: las reglas originales tienen selectores con ID. */
html[data-theme="dark"] .mi-panel-shell #pvDashboard {
    --pv-ink: var(--dark-text);
    --pv-muted: var(--dark-muted);
    color: var(--dark-text);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-supervisor-strip, .pv-kpi, .pv-card) {
    background: var(--dark-surface);
    color: var(--dark-text);
    border-color: var(--dark-border);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .2);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-supervision-card,
    .pv-supervision-escalate, .pv-middle-grid > .pv-card > header,
    .pv-press-card > header, .pv-ranking li:not(.pv-empty),
    .pv-ranking li:first-child:not(.pv-empty)) {
    background: var(--dark-surface-raised);
    color: var(--dark-text);
    border-color: var(--dark-border);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-supervision-heading,
    .pv-supervision-zone b, .pv-supervision-card b, .pv-supervision-escalate b,
    .pv-kpi-main b, .pv-kpi-main strong, .pv-card h3, .pv-state-body li b,
    .pv-ranking b, .pv-ranking strong, .pv-activity-copy b,
    .pv-category-item b) { color: var(--dark-text); }
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-supervision-zone small,
    .pv-supervision-card small, .pv-supervision-escalate small, .pv-kpi-bottom,
    .pv-state-body li, .pv-activity-copy small, .pv-ranking small,
    .pv-category-item span, .pv-donut span) { color: var(--dark-muted); }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-donut::after { background: var(--dark-surface); }
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-kpi-bottom em,
    .pv-ranking .pv-rank-link, .pv-chart-refresh, .pv-period-form label) {
    background: var(--dark-surface-raised);
    border-color: var(--dark-border);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-activity-action:hover,
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-activity-action:focus-visible {
    background: var(--dark-surface-hover);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-activity-icon {
    box-shadow: 0 0 0 4px var(--dark-surface);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-activity-item:not(:last-child)::after {
    background: var(--dark-border);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-supervision-detail > .icon,
    .pv-supervision-avatar, .pv-rank-avatar, .pv-ranking-heading > .icon) {
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: none;
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-supervision-avatar, .pv-rank-avatar) {
    color: #c4b5fd;
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-supervision-card em {
    color: #bdbdbd;
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, .14);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-supervision-card a {
    color: #70dba5;
    background: #0d0d0d;
    border-color: rgba(112, 219, 165, .35);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-supervision-card a:hover {
    background: #20352a;
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-ranking li strong {
    color: #ff9ba9;
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, .14);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-ranking > header > a {
    color: #9bbcff;
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, .14);
}
/* Gráficas y tabla de seguimiento del punto de venta. */
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-chart-card > header > span:nth-child(2),
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-chart-donut b, .pv-bar-item b,
    .pv-chart-tooltip b, .pv-press-table td, .pv-press-table td:nth-child(2) > a) {
    color: var(--dark-text);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-period-label, .pv-period-legend,
    .pv-chart-donut small, .pv-bar-item small, .pv-category-item b small,
    .pv-chart-tooltip small, .pv-press-title small, .pv-press-table td small) {
    color: var(--dark-muted);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-chart-donut::after { background: var(--dark-surface); }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-period-line text { fill: var(--dark-muted); }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-period-grid line { stroke: var(--dark-border); }
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-chart-tooltip, .pv-chart-controls select,
    .pv-press-count, .pv-priority, .pv-ans) {
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, .15);
    color: var(--dark-text);
    box-shadow: none;
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-chart-tooltip span { color: #ff8a98; }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-category-item.is-highlighted { background: var(--dark-surface-hover); }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-press-title > .icon {
    background: #0d0d0d;
    color: #ff8a98;
    border: 1px solid rgba(255, 255, 255, .15);
    box-shadow: none;
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-press-table { border-color: var(--dark-border); }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-press-table th {
    background: #202020;
    color: var(--dark-muted);
    border-color: var(--dark-border);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-press-table td { border-bottom-color: var(--dark-border); }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-press-table :is(.pv-press-row, .pv-press-row.is-vencido, .pv-press-row.is-por-vencer) {
    background: var(--dark-surface);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-press-table .pv-press-row:hover { background: var(--dark-surface-hover); }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-press-table td:first-child > a {
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, .15);
    color: #ff8a98;
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-press-count, .pv-ans.is-vencido, .pv-priority.is-urgente, .pv-priority.is-alta) { color: #ff8a98; }
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-priority.is-media, .pv-ans.is-por-vencer) { color: #ffc46b; }
html[data-theme="dark"] .pv-zone-dialog { background: var(--dark-surface); color: var(--dark-text); border-color: var(--dark-border); }
html[data-theme="dark"] .pv-zone-dialog :is(h3, dd) { color: var(--dark-text); }
html[data-theme="dark"] .pv-zone-dialog :is(p, dt) { color: var(--dark-muted); }
html[data-theme="dark"] .pv-zone-dialog dl div { background: var(--dark-surface-raised); }

/* Fondos de iconos neutros en modo oscuro; los trazos conservan su color. */
html[data-theme="dark"] :is(.category-shared-icon, .corp-title-icon, .pv-kpi-icon,
    .pv-supervision-icon, .pv-heading-icon, .pv-activity-icon, .pv-chart-heading-icon,
    .mon-folder-icon, .mon-folder-title-icon, .modal-head-ic, .chart-head-icon,
    .dash-stat-icon .dash-stat-glyph, .h1-ico) {
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, .13);
    box-shadow: none;
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-kpi-icon {
    background: #0d0d0d;
    color: var(--pv);
    border: 1px solid rgba(255, 255, 255, .13);
    box-shadow: none;
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-activity-icon {
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, .13);
    box-shadow: 0 0 0 4px var(--dark-surface);
}

/* Tabla de solicitudes y filtros del punto de venta. */
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card :is(.corp-title-wrap h3,
    .td-code .stub-code, .td-title .row-title, .cat-chip, .tickets-table tbody td) {
    color: var(--dark-text);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card :is(.search-field,
    .toolbar-corp select, .pv-table-period, .tickets-table-wrap, .tickets-table thead th) {
    background-color: #171717;
    color: var(--dark-text);
    border-color: rgba(255, 255, 255, .16);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .tickets-table tbody td {
    border-color: rgba(255, 255, 255, .12);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .tickets-table tbody tr:hover {
    background: var(--dark-surface-hover);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .tickets-table tbody tr.ticket-row:hover > td,
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .tickets-table tbody tr.ticket-row:focus-within > td {
    background: #292929;
    color: var(--dark-text);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .pv-row-menu > summary {
    background: #101010;
    color: #c9c9c9;
    border: 1px solid rgba(255, 255, 255, .18);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .pv-row-menu > summary:hover,
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .pv-row-menu[open] > summary {
    background: #303030;
    color: #ff8a98;
    border-color: rgba(255, 138, 152, .5);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .pv-row-menu > summary:focus-visible {
    outline: 2px solid #92b9ff;
    outline-offset: 2px;
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .pv-row-menu-popover {
    background: #1b1b1b;
    border-color: rgba(255, 255, 255, .18);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .5);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .pv-row-menu-popover .icon-btn {
    background: transparent;
    color: var(--dark-text);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .pv-row-menu-popover .icon-btn:hover,
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .pv-row-menu-popover .icon-btn:focus-visible {
    background: #303030;
    color: #ff8a98;
}

/* Etiquetas de estado, prioridad y ANS sobre fondo negro en tema oscuro. */
html[data-theme="dark"] :is(.status-pill, .meta-pill, .ans-time),
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card :is(.status-pill, .meta-pill, .ans-time) {
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, .14);
}
html[data-theme="dark"] :is(.status-resuelto, .meta-baja, .ans-resuelto, .ans-ok),
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card :is(.status-resuelto, .meta-baja, .ans-resuelto, .ans-ok) { color: #70dba5; }
html[data-theme="dark"] .status-cerrado,
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .status-cerrado { color: #a5bce1; }
html[data-theme="dark"] :is(.status-abierto, .meta-urgente, .ans-vencido),
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card :is(.status-abierto, .meta-urgente, .ans-vencido) { color: #ff8a98; }
html[data-theme="dark"] :is(.status-en-progreso, .meta-alta, .meta-media, .ans-por-vencer),
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card :is(.status-en-progreso, .meta-alta, .meta-media, .ans-por-vencer) { color: #ffc46b; }

/* Formulario de creación: análisis automático y confirmación. */
html[data-theme="dark"] .user-ticket-form :is(.auto-category-card, .ticket-form-actions) {
    background: var(--dark-surface-raised);
    color: var(--dark-text);
    border-color: var(--dark-border);
    box-shadow: none;
}
html[data-theme="dark"] .user-ticket-form .auto-category-card-head { border-color: var(--dark-border); }
html[data-theme="dark"] .user-ticket-form :is(.auto-category-card-head strong,
    .auto-category-meta strong, .auto-category-techs-head, .cat-analysis-pending strong) { color: var(--dark-text); }
html[data-theme="dark"] .user-ticket-form :is(.auto-category-card-head small, .cat-analysis-pending,
    .auto-category-meta small, .auto-category-techs-head small, .auto-tech-empty,
    .ticket-form-footnote) { color: var(--dark-muted); }
html[data-theme="dark"] .user-ticket-form .cat-analysis-pending a { color: #a5c4ff; }
html[data-theme="dark"] .user-ticket-form :is(.auto-category-icon, .auto-category-lock,
    .auto-category-meta > span, .auto-tech-profile) {
    background: #101010;
    border: 1px solid rgba(255, 255, 255, .15);
    color: #a5c4ff;
    box-shadow: none;
}
html[data-theme="dark"] .user-ticket-form .auto-category-techs { border-color: var(--dark-border); }
html[data-theme="dark"] .user-ticket-form .auto-category-card .cat-auto-hint {
    background: #13261c;
    border-color: #355f47;
    color: #9adab3;
}
html[data-theme="dark"] .user-ticket-form .auto-category-card .cat-auto-hint strong { color: #b6ebc9; }
html[data-theme="dark"] .user-ticket-form .auto-category-card .cat-suggest {
    background: #292315;
    border-color: #66532b;
    color: #e5c98c;
}
html[data-theme="dark"] .user-ticket-form input[type="file"]::file-selector-button {
    background: #101010;
    color: var(--dark-text);
    border: 1px solid var(--dark-border);
    border-radius: 6px;
    padding: 5px 9px;
    cursor: pointer;
}

/* Superficies reutilizables: la paleta vive en tokens semánticos del tema. */
html[data-theme="dark"] :is(body, #contenido) { background-color:var(--theme-bg); color:var(--theme-text); }
html[data-theme="dark"] :is(.panel, .chart-card, .corp-card, .corp-table-card, .table-card,
    .dash-stat, .profile-card, .settings-panel, .cat-group-card, .side-card) {
    background-color:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] :is(.modal-overlay, .ax-modal, .confirm-overlay) { background-color:rgba(3,7,18,.65); }
html[data-theme="dark"] :is(.modal-box, .confirm-box, .ax-modal-card, .mon-folder-dialog,
    .mon-point-dialog, .perfil-photo-dialog) { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] :is(.modal-box, .confirm-box, .ax-modal-card, .mon-folder-dialog,
    .mon-point-dialog, .perfil-photo-dialog) :is(.modal-head, .modal-actions, .modal-footer) {
    background:var(--theme-raised); border-color:var(--theme-border); color:var(--theme-text);
}
html[data-theme="dark"] :is(.modal-box, .confirm-box, .ax-modal-card, .mon-folder-dialog,
    .mon-point-dialog, .perfil-photo-dialog) :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea)::placeholder { color:var(--theme-subtle); opacity:1; }
html[data-theme="dark"] :is(input, select, textarea):focus-visible { outline:2px solid var(--theme-focus); outline-offset:2px; }
html[data-theme="dark"] :is(input, select, textarea):disabled { opacity:.7; }
html[data-theme="dark"] :is(input, textarea):-webkit-autofill { -webkit-text-fill-color:var(--theme-text); box-shadow:0 0 0 1000px var(--theme-input) inset; }
html[data-theme="dark"] :is(.actions-dropdown, .row-menu-panel, .sw-dd-panel,
    .global-search-results, .user-dropdown, .ax-busca, .sw-win, .sw-composer, .sw-bubble) {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .topbar .global-search-results a { color:var(--theme-text); }
html[data-theme="dark"] .topbar .global-search-results :is(a:hover, a:focus-visible, a.is-selected) { background:var(--theme-hover); }
html[data-theme="dark"] .topbar .global-search-results :is(small, .global-search-status, .global-search-heading) { color:var(--theme-muted); }
html[data-theme="dark"] .topbar .global-search-results mark { background:#735b24; color:#fff; }
html[data-theme="dark"] :is(.data-table, .attention-table, .mesa-tec-table) :is(th, td) { border-color:var(--theme-border); }
html[data-theme="dark"] :is(.data-table, .attention-table, .mesa-tec-table) thead th { background:var(--theme-raised); color:var(--theme-text); }
html[data-theme="dark"] :is(.data-table, .attention-table, .mesa-tec-table) tbody tr:hover { --table-hover-bg:var(--theme-hover); }

/* Indicadores compartidos por administrador, técnico y observador.
   Los estilos originales usan !important; estas excepciones solo aplican al tema oscuro. */
html[data-theme="dark"] :is(.admin-shell, .observador-shell, .tecnico-shell, .mi-panel-shell) :is(.dash-stat, .corp-kpi) {
    background:var(--theme-panel) !important;
    border-color:var(--theme-border);
    box-shadow:0 8px 22px rgba(0,0,0,.22) !important;
}
html[data-theme="dark"] :is(.admin-shell, .observador-shell, .tecnico-shell, .mi-panel-shell) :is(.dash-stat, .corp-kpi):is(:hover, :focus-visible) {
    background:var(--theme-hover) !important;
}
html[data-theme="dark"] :is(.admin-shell, .observador-shell, .tecnico-shell, .mi-panel-shell) :is(.dash-stat-value, .corp-kpi-num, .dash-stat-label, .corp-kpi-label) { color:var(--theme-text) !important; }
html[data-theme="dark"] :is(.admin-shell, .observador-shell, .tecnico-shell, .mi-panel-shell) :is(.dash-stat-hint, .corp-kpi-hint) { color:var(--theme-muted) !important; }
html[data-theme="dark"] :is(.dash-stat, .corp-kpi)::after { background:var(--theme-raised) !important; box-shadow:0 4px 12px rgba(0,0,0,.3); }

/* Indicadores de punto de venta y de monitoreo del observador. */
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-kpi,
html[data-theme="dark"] .observador-shell .obs-monitor-kpi {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
    box-shadow:0 8px 22px rgba(0,0,0,.22);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-kpi:is(:hover, :focus-visible),
html[data-theme="dark"] .observador-shell .obs-monitor-kpi:is(:hover, :focus-visible) { background:var(--theme-hover); color:var(--theme-text); }
html[data-theme="dark"] .observador-shell .obs-monitor-kpi :is(.obs-monitor-kpi-label, .obs-monitor-kpi-value) { color:var(--theme-text); }
html[data-theme="dark"] .observador-shell .obs-monitor-kpi :is(.obs-monitor-kpi-hint, .obs-monitor-kpi-empty) { color:var(--theme-muted); }
html[data-theme="dark"] :is(.obs-monitor-kpi-arrow, .pv-kpi-bottom em) { background:var(--theme-raised); border:1px solid var(--theme-border); box-shadow:none; }

/* Acciones y actualizadores de paneles: conservar su comportamiento y foco. */
html[data-theme="dark"] :is(.dash-header-actions .dash-refresh, .dash-refresh, .pv-chart-refresh, .chart-refresh, .obs-refresh) {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); box-shadow:none;
}
html[data-theme="dark"] :is(.dash-header-actions .dash-refresh, .dash-refresh, .pv-chart-refresh, .chart-refresh, .obs-refresh):is(:hover, :focus-visible) {
    background:var(--theme-hover); color:var(--theme-text); border-color:var(--theme-muted);
}
html[data-theme="dark"] :is(.dash-header-actions .dash-refresh, .dash-refresh, .pv-chart-refresh, .chart-refresh, .obs-refresh):focus-visible { outline:2px solid var(--theme-focus); outline-offset:2px; }

/* Filtros y métricas del panel de administración. */
html[data-theme="dark"] .admin-dashboard .dashboard-period-button,
html[data-theme="dark"] .admin-dashboard .dashboard-filter-popover.is-open .dashboard-period-button,
html[data-theme="dark"] .admin-dashboard .dashboard-filters {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .admin-dashboard .dashboard-period-button:is(:hover, :focus-visible) { background:var(--theme-hover); }
html[data-theme="dark"] .admin-dashboard .dashboard-period-button .icon { color:var(--theme-muted); }
html[data-theme="dark"] .admin-dashboard .dashboard-greeting-meta :is(.dogger-header-clock, .dogger-header-clock small, .dogger-header-session small) { color:var(--theme-muted); }
html[data-theme="dark"] .admin-dashboard .dashboard-greeting-meta .dogger-header-session strong { color:#75d9a4; }
html[data-theme="dark"] .admin-dashboard .dashboard-filters label { color:var(--theme-text); }
html[data-theme="dark"] .admin-dashboard .dashboard-filters select { background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .admin-dashboard .dashboard-filter-actions { border-color:var(--theme-border); }
html[data-theme="dark"] .admin-dashboard .performance-card { background:var(--theme-panel); border-color:var(--theme-border); box-shadow:none; }
html[data-theme="dark"] .admin-dashboard .performance-card :is(strong, h3, b, span:not(.performance-icon)) { color:var(--theme-text); }
html[data-theme="dark"] .admin-dashboard .performance-card :is(small, .ans-legend li) { color:var(--theme-muted); }
html[data-theme="dark"] .admin-dashboard .ans-donut::before { background:var(--theme-panel); }
html[data-theme="dark"] .admin-dashboard :is(.ans-hover-detail, .ans-ticket-popup, .spark-tooltip) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .admin-dashboard .ans-ticket-popup li a { color:var(--theme-text); }
html[data-theme="dark"] .admin-dashboard .ans-ticket-popup li a:is(:hover, :focus-visible) { background:var(--theme-hover); }
html[data-theme="dark"] .admin-dashboard .attention-card .chart-card-head > a { background:var(--theme-raised); color:#ff9ca5; border-color:#a54950; }
html[data-theme="dark"] .admin-dashboard .attention-card .chart-card-head > a:is(:hover, :focus-visible) { background:var(--theme-hover); color:#ffc2c6; }

/* Bandeja de tickets: filtros, tabla y acciones permanecen legibles. */
html[data-theme="dark"] .lista-page :is(.ticket-filter-panel, .ticket-listing-card, .ticket-listing-head, .ticket-table-wrap, .table-customize-menu) {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .lista-page .ticket-filter-row :is(select, .search-field) { background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .lista-page .ticket-filter-row :is(.mias-check, .toolbar-count, .link-clear) { color:var(--theme-muted); }
html[data-theme="dark"] .lista-page :is(.ticket-listing-head h2, .ticket-table-subject, .ticket-table-category, .ticket-table td) { color:var(--theme-text); }
html[data-theme="dark"] .lista-page .ticket-table th { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .lista-page .ticket-table td { background:var(--theme-panel); border-color:var(--theme-border); }
html[data-theme="dark"] .lista-page .ticket-table tbody tr:is(:hover, :focus-within) td { background:var(--theme-hover); }
html[data-theme="dark"] .lista-page :is(.ticket-listing-more, .ticket-table .row-menu-btn, .ticket-table .mini-btn, .ticket-table .ticket-view-btn) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .lista-page .tickets-kpis .dash-stat-icon .dash-stat-value { color:var(--theme-text) !important; }

/* Reportes: controles y gráficos sobre superficies oscuras. */
html[data-theme="dark"] .admin-shell :is(.rpt-filter-panel, .rpt-trend-section, .rpt-trend-section .chart-card, .rpt-trend-range, .rpt-export-options) {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .admin-shell :is(.rpt-section-head, .rpt-trend-section .chart-card-head h3, .rpt-filter-panel label) { color:var(--theme-text); }
html[data-theme="dark"] .admin-shell :is(.rpt-filter-panel input, .rpt-filter-panel select, .rpt-trend-range select) { background-color:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .admin-shell :is(.rpt-periodos button, .rpt-periodos a, .rpt-filter-reset, .rpt-trend-view) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .admin-shell :is(.rpt-periodos button, .rpt-periodos a, .rpt-filter-reset, .rpt-trend-view):is(:hover, :focus-visible) { background:var(--theme-hover); color:var(--theme-text); }
html[data-theme="dark"] .admin-shell .rpt-kpis .dash-stat-icon .dash-stat-value,
html[data-theme="dark"] .admin-shell .rpt-kpis .dash-stat-label { color:var(--theme-text) !important; }
html[data-theme="dark"] .admin-shell .rpt-kpis .dash-stat-hint { color:var(--theme-muted) !important; }

/* Resaltado uniforme y sin destellos claros al pasar por las filas. */
html[data-theme="dark"] :is(table.data-table, table.ticket-table, table.obs-tabla, table.rpt-tech-table, table.rpt-user-table, table.aud-tabla) tbody tr:is(:hover, :focus-within) {
    background:var(--theme-hover) !important;
    box-shadow:none;
}
html[data-theme="dark"] :is(table.data-table, table.ticket-table, table.obs-tabla, table.rpt-tech-table, table.rpt-user-table, table.aud-tabla) tbody tr:is(:hover, :focus-within) > td {
    background:var(--theme-hover) !important;
    color:var(--theme-text);
}

/* Tablas de rendimiento y sus filtros. */
html[data-theme="dark"] :is(.rpt-tech-report, .rpt-user-report, .rpt-tech-kpi, .rpt-user-kpi) { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] :is(.rpt-tech-head, .rpt-user-head) { border-color:var(--theme-border); }
html[data-theme="dark"] :is(.rpt-tech-title h2, .rpt-user-head h2, .rpt-tech-kpi b, .rpt-user-kpi b, .rpt-tech-person b, .rpt-user-person b) { color:var(--theme-text); }
html[data-theme="dark"] :is(.rpt-tech-title p, .rpt-user-head p, .rpt-tech-kpi small, .rpt-user-kpi small, .rpt-user-email, .rpt-tech-select label, .rpt-user-select span) { color:var(--theme-muted); }
html[data-theme="dark"] :is(.rpt-tech-search input, .rpt-user-search input, .rpt-tech-select select, .rpt-user-select select, .rpt-tech-filter, .rpt-tech-action, .rpt-user-action) { background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] :is(.rpt-tech-table, .rpt-user-table) th { background:var(--theme-raised); color:var(--theme-muted); }
html[data-theme="dark"] :is(.rpt-tech-table, .rpt-user-table) td { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }

/* Administración de usuarios. */
html[data-theme="dark"] .usuarios-page :is(.users-tabs-bar, .table-toolbar, .table-card, .users-toolbar-select, .users-toolbar-options, .search-field) { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .usuarios-page :is(.users-toolbar-picker button, .tabs-bar a, .row-menu-btn) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .usuarios-page #tablaUsuarios thead th { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .usuarios-page #tablaUsuarios tbody tr.ue-row > td { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .usuarios-page #tablaUsuarios :is(.ue-user-identity strong, .ue-row strong, .ue-row a, .ue-row b) { color:var(--theme-text); }
html[data-theme="dark"] .usuarios-page #tablaUsuarios .ue-user-identity small { color:var(--theme-muted); }

/* Categorías, zonas y registro de auditoría. */
html[data-theme="dark"] :is(.cat-stat, .mon-sup, .mon-right, .pan-sup, .pan-right, .pan-zc, .obs-tabla-wrap, .aud-card, .aud-controles) { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] :is(.cat-stat, .mon-sup, .mon-right, .pan-sup, .pan-right, .pan-zc) :is(strong, b, h3, h4) { color:var(--theme-text); }
html[data-theme="dark"] :is(.cat-stat, .mon-sup, .mon-right, .pan-zc) :is(small, p, .pan-zc-metrics, .pan-zc-activity) { color:var(--theme-muted); }
html[data-theme="dark"] :is(.obs-tabla, .aud-tabla) th { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] :is(.obs-tabla, .aud-tabla) td { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] :is(.aud-controles, .mon-sup, .mon-right) :is(input, select, button:not(.btn-primary)) { background-color:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border); }

/* Papelera y calendario. */
html[data-theme="dark"] :is(.pap-hero, .pap-card, .pap-empty, .prog-filters, .prog-day-side, .prog-side-day-card, .prog-side-summary, .prog-tech-trigger, .prog-tech-menu) { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] :is(.pap-hero, .pap-card, .prog-day-side, .prog-filters) :is(h2, h3, strong, b, dt, dd, p, a) { color:var(--theme-text); }
html[data-theme="dark"] :is(.pap-when, .pap-meta-none, .prog-filters-hint, .prog-side-empty, .prog-side-kicker) { color:var(--theme-muted); }
html[data-theme="dark"] :is(.prog-cal-title, .prog-day-side h3, .prog-tech-name) { color:var(--theme-text); }
html[data-theme="dark"] :is(.prog-cal, .prog-cal-weekdays, .prog-day) { border-color:var(--theme-border); }
html[data-theme="dark"] .prog-day:not(.out):not(.is-findesemana):not(.is-ausencia):not(.is-falta):not(.is-noausencia):not(.has-events) { background:#1d3024; }
html[data-theme="dark"] .prog-day.out, html[data-theme="dark"] .prog-day.is-findesemana { background:#25282d; }
html[data-theme="dark"] .prog-day:is(.is-festivo, .is-ausencia) { background:#48272a; }
html[data-theme="dark"] .prog-day:is(.is-falta, .is-noausencia, .has-events) { background:#44381d; }
html[data-theme="dark"] .prog-day.is-selected { background:#263b50 !important; }
html[data-theme="dark"] .prog-day .prog-day-num { color:var(--theme-text); }
html[data-theme="dark"] .prog-day.is-today .prog-day-num { color:#fff; }
html[data-theme="dark"] :is(.prog-view-controls button:not(.is-active), .prog-nav-btn, .prog-side-close) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .prog-day.is-noausencia { background:#263c2b !important; color:var(--theme-text); }
html[data-theme="dark"] :is(.users-header-live-item, .aud-fecha, .aud-lupa, .aud-chip) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .users-header-live-item :is(b, small) { color:var(--theme-text); }

/* Controles y superficies adicionales que conservaban colores del tema claro. */
html[data-theme="dark"] .custom-dropdown > summary,
html[data-theme="dark"] .custom-dropdown-options,
html[data-theme="dark"] .usuarios-page .users-toolbar-picker summary,
html[data-theme="dark"] .usuarios-page .users-toolbar-options {
    background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] :is(.custom-dropdown-options, .users-toolbar-options) button { color:var(--theme-text); }
html[data-theme="dark"] :is(.custom-dropdown-options, .users-toolbar-options) button:is(:hover, [aria-selected="true"]) { background:var(--theme-hover); color:var(--theme-text); }
html[data-theme="dark"] .usuarios-page .users-header-live .users-header-live-item { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .usuarios-page .users-header-live-item :is(b, small) { color:var(--theme-text); }
html[data-theme="dark"] .usuarios-page .row-menu-btn,
html[data-theme="dark"] .lista-page .ticket-table :is(button, a)[class*="btn"],
html[data-theme="dark"] .pan-zc-wrap button:not(.pan-zc) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }

/* Reportes y auditoría: filas, paginación y estados legibles. */
html[data-theme="dark"] .rpt-table-footer { background:var(--theme-panel); border-color:var(--theme-border); }
html[data-theme="dark"] .rpt-table-summary { color:var(--theme-muted); }
html[data-theme="dark"] :is(.rpt-page-size, .rpt-page-button, .rpt-page-number:not(.is-active)) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] :is(.rpt-page-button:not(:disabled), .rpt-page-number:not(.is-active)):hover { background:var(--theme-hover); color:var(--theme-text); }
html[data-theme="dark"] :is(.rpt-tech-time, .rpt-tech-status, .rpt-tech-top, .rpt-user-last, .rpt-user-state) { background:#292929; color:#e4e4e4; border-color:#505050; }
html[data-theme="dark"] :is(.rpt-tech-time.is-amber, .rpt-tech-top) { background:#40300f; color:#ffcf70; border-color:#755719; }
html[data-theme="dark"] .rpt-tech-time.is-red { background:#402023; color:#ff9ba2; }
html[data-theme="dark"] :is(.rpt-tech-status:not(.is-unassigned):not(.is-inactive), .rpt-user-state:not(.is-inactive):not(.is-unknown), .rpt-tech-time:not(.is-red):not(.is-amber):not(.is-empty)) { background:#163629; color:#83dfad; }
html[data-theme="dark"] :is(.rpt-user-last.is-progreso, .rpt-user-last:not(.is-abierto):not(.is-progreso)) { background:#40300f; color:#ffcf70; }
html[data-theme="dark"] .rpt-user-last.is-abierto { background:#402023; color:#ff9ba2; }
html[data-theme="dark"] :is(.rpt-tech-action, .rpt-user-action) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] :is(.rpt-tech-table, .rpt-user-table) th { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] table.obs-tabla.aud-tabla thead th { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }

/* Calendario y diálogos del programador. */
html[data-theme="dark"] .prog-day-side :is(.prog-side-date-tile, .prog-side-mini-stats > span, .prog-side-summary, .prog-side-summary > span) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .prog-day-side :is(.prog-side-date-tile strong, .prog-side-date-tile span, .prog-side-mini-stats b, .prog-side-mini-stats small, .prog-side-summary b, .prog-side-summary small) { color:var(--theme-text); }
html[data-theme="dark"] .prog-modal .modal-head,
html[data-theme="dark"] .prog-modal .modal-body,
html[data-theme="dark"] .prog-modal .prog-event-footer,
html[data-theme="dark"] .prog-modal .prog-disp-footer,
html[data-theme="dark"] #modalEvento[data-tipo] .prog-event-footer { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .prog-modal :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border); color-scheme:dark; }
html[data-theme="dark"] .prog-modal :is(input, select, textarea)::placeholder { color:var(--theme-muted); }
html[data-theme="dark"] .prog-modal :is(.modal-head-txt h3, .modal-head-sub) { color:var(--theme-text); }

/* Chat: mantener el encabezado corporativo y oscurecer el contenido. */
html[data-theme="dark"] .sw-win .sw-thread,
html[data-theme="dark"] .sw-win[data-modo="corporativo"] .sw-thread,
html[data-theme="dark"] .sw-dd-busca { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .sw-win .sw-msg-propio .sw-bubble { background:var(--dogger-red); color:#fff; }
html[data-theme="dark"] .sw-win[data-modo="corporativo"] .sw-msg-propio .sw-bubble { background:#4f46e5; }
html[data-theme="dark"] .sw-dd-row:hover { background:var(--theme-hover); }

/* Iconos de acceso: la superficie toma el color propio de cada indicador. */
html[data-theme="dark"] .lista-page .tickets-kpis .ticket-kpi-go {
    background:var(--kpi-color); color:#fff; box-shadow:none;
}
html[data-theme="dark"] .lista-page .ticket-table .ticket-row-actions .btn {
    background:#35577f !important; border-color:#52759d !important; color:#fff !important;
}
html[data-theme="dark"] .lista-page .ticket-table .ticket-row-actions .btn:hover,
html[data-theme="dark"] .lista-page .ticket-table .ticket-row-actions .btn[aria-expanded="true"] {
    background:#476d99 !important; border-color:#7fa4cf !important; color:#fff !important;
}
html[data-theme="dark"] :is(.rpt-tech-head-icon, .rpt-user-head-icon) {
    background:#d82331; color:#fff;
}

/* Encabezados del detalle y acciones de las zonas. */
html[data-theme="dark"] .corp-subsection-head h3,
html[data-theme="dark"] .corp-subsection-head.corp-desc-toggle:hover h3 {
    color:var(--theme-text);
}
html[data-theme="dark"] .ticket-empty-state {
    background:var(--theme-raised); color:var(--theme-muted); border-color:var(--theme-border);
}
html[data-theme="dark"] .pan-zc-wrap .obs-zona-acc {
    background:var(--theme-panel); border-color:var(--theme-border);
}
html[data-theme="dark"] .pan-zc-wrap .obs-zona-acc .obs-acc-ico {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .pan-zc-wrap .obs-zona-acc .obs-acc-ico.is-on {
    background:#2856b8; border-color:#5281e5; color:#fff;
}
html[data-theme="dark"] :is(.pan-sup-n, .mon-sup-n) {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border);
}

/* Fondos llenos para identificar estados, prioridades y roles también de noche. */
html[data-theme="dark"] :is(.pan-zc-ico, .pan-zc-state) { background:#087e45; color:#fff; }
html[data-theme="dark"] .pan-zc-amarillo :is(.pan-zc-ico, .pan-zc-state) { background:#a55b00; color:#fff; }
html[data-theme="dark"] .pan-zc-rojo :is(.pan-zc-ico, .pan-zc-state) { background:#bd1e30; color:#fff; }
html[data-theme="dark"] :is(.pan-rol, .mon-rol) { background:#2856b8; color:#fff; }
html[data-theme="dark"] :is(.status-pill.status-resuelto, .meta-pill.meta-baja, .ans-time.ans-resuelto, .ans-time.ans-ok),
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card :is(.status-resuelto, .meta-baja, .ans-resuelto, .ans-ok) { background:#087e45; border-color:#087e45; color:#fff; }
html[data-theme="dark"] :is(.status-pill.status-abierto, .meta-pill.meta-urgente, .ans-time.ans-vencido),
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card :is(.status-abierto, .meta-urgente, .ans-vencido) { background:#bd1e30; border-color:#bd1e30; color:#fff; }
html[data-theme="dark"] :is(.status-pill.status-en-progreso, .meta-pill.meta-alta, .meta-pill.meta-media, .ans-time.ans-por-vencer),
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card :is(.status-en-progreso, .meta-alta, .meta-media, .ans-por-vencer) { background:#975300; border-color:#975300; color:#fff; }
html[data-theme="dark"] :is(.status-pill.status-cerrado, .rpt-badge-cerrado) { background:#465e80; border-color:#465e80; color:#fff; }
html[data-theme="dark"] .usuarios-page #tablaUsuarios .badge-role.admin { background:#bd1e30; color:#fff; }
html[data-theme="dark"] .usuarios-page #tablaUsuarios .badge-role.tecnico { background:#2856b8; color:#fff; }
html[data-theme="dark"] .usuarios-page #tablaUsuarios .badge-role.observador { background:#6840a2; color:#fff; }
html[data-theme="dark"] .usuarios-page #tablaUsuarios .badge-role.usuario { background:#087e45; color:#fff; }
html[data-theme="dark"] :is(.rpt-tech-status:not(.is-unassigned):not(.is-inactive), .rpt-user-state:not(.is-inactive):not(.is-unknown), .rpt-tech-time:not(.is-red):not(.is-amber):not(.is-empty), .rpt-badge-resuelto) { background:#087e45; color:#fff; }
html[data-theme="dark"] :is(.rpt-tech-time.is-red, .rpt-user-last.is-abierto, .rpt-badge-abierto) { background:#bd1e30; color:#fff; }
html[data-theme="dark"] :is(.rpt-tech-time.is-amber, .rpt-tech-top, .rpt-user-last.is-progreso, .rpt-badge-en-progreso) { background:#975300; border-color:#975300; color:#fff; }

html[data-theme="dark"] .pan-sup-head { border-bottom:1px solid rgba(255,255,255,.16); }
html[data-theme="dark"] .mon-admin .obs-crate-global .obs-crate-seg b { color:#e7eef8; }
html[data-theme="dark"] .mon-admin .obs-crate-global .obs-crate-seg.s-abiertos b { color:#ff9a53; }
html[data-theme="dark"] .mon-admin .obs-avance-bar { background:#354252; }
html[data-theme="dark"] .mon-admin .obs-avance-num { color:#75d9a4; }
html[data-theme="dark"] .mon-supervisor-collapse:not([open]) > summary.pan-sup-head { border-bottom:0; }

/* Superficies compartidas: modales y menús disponibles para todos los roles. */
html[data-theme="dark"] :is(.modal-box, .confirm-box, .ax-modal-card, .mon-folder-dialog, .mon-point-dialog, .aud-modal-caja, .perfil-photo-dialog) :is(.modal-head, .modal-body, .modal-footer, .modal-actions, .corp-modal-actions) {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] :is(.actions-dropdown, .row-menu-panel, .custom-dropdown-options, .users-toolbar-options, .prog-tech-menu, .pv-row-menu-popover, .sw-dd-panel) {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] :is(.actions-dropdown, .row-menu-panel, .custom-dropdown-options, .users-toolbar-options, .prog-tech-menu, .pv-row-menu-popover, .sw-dd-panel) :is(button, a):not(.btn-primary):not(.btn-accent) {
    color:var(--theme-text);
}
html[data-theme="dark"] :is(.actions-dropdown, .row-menu-panel, .custom-dropdown-options, .users-toolbar-options, .prog-tech-menu, .pv-row-menu-popover, .sw-dd-panel) :is(button, a):is(:hover, :focus-visible, [aria-selected="true"]) {
    background:var(--theme-hover); color:var(--theme-text);
}
html[data-theme="dark"] :is(.modal-box, .confirm-box, .ax-modal-card, .prog-tech-menu, .custom-dropdown-options, .actions-dropdown) :focus-visible {
    outline:2px solid #92b9ff; outline-offset:2px;
}

/* Agenda: eventos generados dinámicamente, cabeceras y opciones de técnico. */
html[data-theme="dark"] :is(.prog-cal-weekdays, .prog-tabs, .prog-day-side-head) {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .prog-day-side :is(.prog-side-event, .prog-side-event.is-disponibilidad, .prog-side-event.is-disponibilidad.is-ocupado) {
    background:var(--theme-raised); color:var(--theme-text);
}
html[data-theme="dark"] .prog-day-side .prog-side-event :is(b, strong) { color:var(--theme-text); }
html[data-theme="dark"] .prog-day-side .prog-side-event :is(small, span:not(.prog-side-event-icon)) { color:var(--theme-muted); }
html[data-theme="dark"] .prog-day-side .prog-side-event-menu { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .prog-modal :is(.modal-box, .modal-head, .modal-body, .corp-modal-actions) {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .prog-modal :is(.corp-field, .modal-head-txt h3) { color:var(--theme-text); }
html[data-theme="dark"] .prog-modal :is(.ev-pista, .modal-head-sub) { color:var(--theme-muted); }
html[data-theme="dark"] .prog-modal :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border); color-scheme:dark;
}
html[data-theme="dark"] #modalEvento[data-tipo] :is(.modal-head, .modal-body, .prog-event-footer) {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] #modalEvento[data-tipo] .corp-field :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background-color:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border);
}

/* Encabezados de auditoría y selección de usuarios en monitoreo. */
html[data-theme="dark"] :is(#auditoria, #agregar) .obs-tabla thead :is(tr, th),
html[data-theme="dark"] #aud-tabla thead :is(tr, th) {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] :is(.mon-user-wrap, .pan-user-wrap, .mon-user, .pan-user) {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] :is(.mon-user-wrap, .pan-user-wrap, .mon-user, .pan-user):is(:hover, :focus-within, .is-marcado) {
    background:var(--theme-hover); color:var(--theme-text); border-color:#6385ba;
}
html[data-theme="dark"] :is(.mon-user-wrap, .pan-user-wrap) :is(strong, b) { color:var(--theme-text); }
html[data-theme="dark"] :is(.mon-user-wrap, .pan-user-wrap) :is(small, .mon-cifras, .pan-cifras) { color:var(--theme-muted); }

/* Los campos integrados en una barra usan la superficie del contenedor. */
html[data-theme="dark"] :is(.topbar .global-search-field, .search-field, .sw-dd-busca) > input {
    background:transparent;
    color:var(--theme-text);
    border:0;
    box-shadow:none;
    min-width:0;
}
html[data-theme="dark"] .topbar .global-search-field > input {
    flex:1 1 auto;
    width:0;
    height:auto;
    min-height:0;
    padding:0;
    border-radius:0;
    color:inherit;
}
html[data-theme="dark"] :is(.search-field, .sw-dd-busca) > input::placeholder { color:var(--theme-muted); opacity:1; }
html[data-theme="dark"] .topbar .global-search-field > input::placeholder { color:rgba(255,255,255,.8); opacity:1; }

/* El buscador ya tiene su propio botón de limpiar y su foco está en la barra. */
.global-search-field input[type="search"]::-webkit-search-cancel-button { -webkit-appearance:none; appearance:none; }
html[data-theme="dark"] .topbar .global-search-field > input:focus-visible { outline:none; }

/* Administración desplegable de zonas. */
html[data-theme="dark"] .mon-admin > summary,
html[data-theme="dark"] .mon-admin :is(.obs-zona-card, .obs-zona-head, .obs-miembro, .obs-crate-global, .obs-crate-seg) {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .mon-admin .obs-zona-head:hover { background:var(--theme-hover); }
html[data-theme="dark"] .mon-admin :is(.obs-zona-tit, .obs-miembro-id) :is(strong, a) { color:var(--theme-text); }
html[data-theme="dark"] .mon-admin :is(.obs-zona-tit, .obs-miembro-id) small { color:var(--theme-muted); }
html[data-theme="dark"] .mon-admin .obs-miembro.mon-miembro-ans-vencido { background:#2b1b1d; }
html[data-theme="dark"] .mon-admin .obs-miembro.mon-miembro-ans-por-vencer { background:#302719; }
html[data-theme="dark"] :is(.mon-user-wrap, .pan-user-wrap) .obs-pill-verde { background:#087e45; color:#fff; }
html[data-theme="dark"] :is(.mon-user-wrap, .pan-user-wrap) .obs-pill-amarillo { background:#975300; color:#fff; }
html[data-theme="dark"] :is(.mon-user-wrap, .pan-user-wrap) .obs-pill-rojo { background:#bd1e30; color:#fff; }
html[data-theme="dark"] :is(.mon-user-wrap, .pan-user-wrap) .obs-dot { background:currentColor; }
html[data-theme="dark"] :is(.mon-user-rol, .pan-user-rol) { background:#2856b8; color:#fff; }
html[data-theme="dark"] .mon-admin .obs-zona-ico { background:#bd1e30; color:#fff; }
html[data-theme="dark"] .mon-admin .obs-pill-verde { background:#087e45; color:#fff; }
html[data-theme="dark"] .mon-admin .obs-pill-amarillo { background:#975300; color:#fff; }
html[data-theme="dark"] .mon-admin .obs-pill-rojo { background:#bd1e30; color:#fff; }
html[data-theme="dark"] .mon-admin .obs-pill .obs-dot { background:currentColor; }

/* Ficha del punto de venta: encabezado y distintivos. */
html[data-theme="dark"] #monPointDialog > header {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] #monPointDialog > header :is(h3, p) { color:var(--theme-text); }
html[data-theme="dark"] #monPointDialog :is([data-point-zone], .mon-point-supervisor-count) { background:#2856b8; color:#fff; }
html[data-theme="dark"] #monPointDialog :is(.mon-point-supervisor-badge, .mon-point-header-status.is-activo, .mon-point-account-status.is-activo, .mon-point-status.is-resuelto, .mon-point-status.is-cerrado) { background:#087e45; color:#fff; }
html[data-theme="dark"] #monPointDialog :is(.mon-point-header-status.is-inactivo, .mon-point-account-status.is-inactivo, .mon-point-status.is-abierto) { background:#bd1e30; color:#fff; }
html[data-theme="dark"] #monPointDialog .mon-point-status.is-en-progreso { background:#975300; color:#fff; }
html[data-theme="dark"] #monPointDialog :is(.mon-point-header-status:not(.is-activo):not(.is-inactivo), .mon-point-account-status:not(.is-activo):not(.is-inactivo)) { background:#465e80; color:#fff; }
html[data-theme="dark"] #monPointDialog :is(.mon-point-chart > b, .mon-point-metrics b) { color:var(--theme-text); }
html[data-theme="dark"] #monPointDialog :is(.mon-point-general dl div, .mon-point-tickets .mon-point-ticket-head, .mon-point-tickets [data-point-tickets] > div, .mon-point-supervisor) { border-color:var(--theme-border); }

html[data-theme="dark"] .pan-zc-progress > span { background:#444; }
html[data-theme="dark"] :is(.obs-filtros, .aud-controles) :is(.obs-buscador-tipo, .obs-buscador-campo) {
    border:1px solid #383838; box-shadow:none; background:var(--theme-input); color:var(--theme-text);
}
html[data-theme="dark"] :is(.obs-filtros, .aud-controles) .obs-buscador-campo > input {
    background:transparent; border:0; box-shadow:none; color:var(--theme-text);
}
html[data-theme="dark"] :is(.obs-filtros, .aud-controles) :is(.obs-buscador-tipo:focus-visible, .obs-buscador-campo:focus-within) {
    outline:2px solid #92b9ff; outline-offset:2px;
}

/* Fechas y filtros dentro de sus propios contenedores. */
html[data-theme="dark"] .aud-fecha > input[type="date"] {
    background:transparent; color:var(--theme-text); border:0; box-shadow:none;
    min-height:0; padding:0; color-scheme:dark;
}
html[data-theme="dark"] .mon-folder-dialog .mon-folder-filters :is(select, .mon-folder-search) {
    background:var(--theme-input); color:var(--theme-text); border:1px solid #383838; box-shadow:none;
}
html[data-theme="dark"] .mon-folder-dialog .mon-folder-search > input {
    background:transparent; color:var(--theme-text); border:0; box-shadow:none;
}
html[data-theme="dark"] .obs-paleta { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .obs-paleta .obs-paleta-tit { color:var(--theme-text); }
html[data-theme="dark"] :is(.mon-sup, .pan-sup) .obs-paleta button.obs-paleta-pto:not(.is-sin) {
    background:var(--pto); border-color:rgba(255,255,255,.3);
}
html[data-theme="dark"] :is(.mon-sup, .pan-sup) .obs-paleta button.obs-paleta-pto.is-sin {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}

/* Gráfico de actividad del punto de venta. */
html[data-theme="dark"] #monPointDialog .mon-point-period {
    background:var(--theme-input); color:var(--theme-text); border:1px solid var(--theme-border); box-shadow:none; color-scheme:dark;
}
html[data-theme="dark"] #monPointDialog .mon-point-chart > [data-point-chart] {
    background:repeating-linear-gradient(to top, transparent 0 30px, #494949 31px 32px);
    border-color:#626262;
}
html[data-theme="dark"] #monPointDialog .mon-point-chart > [data-point-chart] > span,
html[data-theme="dark"] #monPointDialog .mon-point-chart > [data-point-chart] > span:nth-child(5n) { background:#63a8ff; }
html[data-theme="dark"] #monPointDialog .mon-point-chart > [data-point-chart] > span[tabindex]:is(:hover, :focus-visible) { background:#a8d0ff; }
html[data-theme="dark"] #monPointDialog .mon-point-chart :is(.mon-point-chart-axis, .mon-point-chart-dates) > span { color:#c4c4c4; background:transparent; }
html[data-theme="dark"] #monPointDialog .mon-point-chart .mon-point-chart-tooltip { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] #monPointDialog .mon-point-chart .mon-point-chart-tooltip :is(strong, span) { color:var(--theme-text); background:transparent; }
html[data-theme="dark"] .mon-folder-dialog .mon-folder-count { background:#bd1e30; color:#fff; }
html[data-theme="dark"] :is(#monFolderClose, #panPuntosCerrar) { background:var(--theme-raised); color:var(--theme-text); border:1px solid var(--theme-border); }
html[data-theme="dark"] :is(#monFolderClose, #panPuntosCerrar):hover { background:#bd1e30; color:#fff; }

/* Mi perfil y configuración de cuenta. */
html[data-theme="dark"] .perfil-page { background:var(--theme-bg, #0d0d0d); color:var(--theme-text); }
html[data-theme="dark"] .perfil-page :is(.settings-sidebar, .settings-profile-card, .settings-panel, .settings-avatar-edit, .settings-profile-link, .pagina-section, .cfg-row, .pagina-filter-bar) {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .perfil-page :is(.perfil-card-identity, .settings-panel-header, .pagina-hero) {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .perfil-page :is(.settings-profile-card h3, .settings-panel-header h3, .perfil-avatar-copy strong, .pagina-section-header h3, .cfg-label, .form-group label, .perfil-stats strong) { color:var(--theme-text); }
html[data-theme="dark"] .perfil-page :is(.settings-profile-card p, .settings-panel-header p, .perfil-avatar-copy small, .pagina-section-header p, .cfg-label small, .perfil-stats span) { color:var(--theme-muted); }
html[data-theme="dark"] .perfil-page .perfil-stats > div { background:#1c2d43; }
html[data-theme="dark"] .perfil-page .perfil-stats > div:nth-child(2) { background:#173728; }
html[data-theme="dark"] .perfil-page :is(.settings-nav-link, .settings-profile-link) { background:transparent; color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .perfil-page :is(.settings-nav-link:hover, .settings-profile-link:hover) { background:var(--theme-hover); }
html[data-theme="dark"] .perfil-page .settings-nav-link.active { background:#482023; color:#ff9ca5; border-left-color:#e12b38; }
html[data-theme="dark"] .perfil-page :is(.perfil-input, .perfil-input > span, .perfil-photo-action, .perfil-glpi-info, .perfil-notif-note) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .perfil-page .perfil-input :is(input, select, textarea) { background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .perfil-page .perfil-input :is(input, select):disabled { background:var(--theme-raised); color:var(--theme-muted); opacity:1; }
html[data-theme="dark"] .perfil-page #pagina :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .perfil-page :is(.perfil-head-icon, .pagina-head-icon, .pagina-section-icon) { background:#a51f2e; color:#fff; }
html[data-theme="dark"] .perfil-page .badge-role { background:#a51f2e; color:#fff; }
html[data-theme="dark"] .perfil-page .perfil-photo-action:hover { background:var(--theme-hover); color:var(--theme-text); }
html[data-theme="dark"] .perfil-shell .perfil-date-picker { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .perfil-shell .perfil-date-picker input { background:transparent; color:var(--theme-text); }
html[data-theme="dark"] .prof-radio .prof-radio-box { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .prof-radio input:checked + .prof-radio-box { background:#482023; border-color:#ed4a55; color:var(--theme-text); }
html[data-theme="dark"] .perfil-page #perfil .perfil-personal-head {
    background:var(--theme-raised); border-color:var(--theme-border);
}
html[data-theme="dark"] .perfil-page #perfil .form-group label { color:var(--theme-text); }
html[data-theme="dark"] .perfil-page #perfil .perfil-input,
html[data-theme="dark"] .perfil-page #perfil .perfil-input:has(input:disabled) {
    background:var(--theme-input); border-color:var(--theme-border);
}
html[data-theme="dark"] .perfil-page #perfil .perfil-input > span {
    background:var(--theme-raised); color:var(--theme-muted); border-color:var(--theme-border);
}
html[data-theme="dark"] .perfil-page #perfil .perfil-input input {
    background:var(--theme-input); color:var(--theme-text); border:0;
}
html[data-theme="dark"] .perfil-page #perfil .perfil-input input:disabled {
    background:var(--theme-raised); color:var(--theme-muted); opacity:1;
}
html[data-theme="dark"] .perfil-page #perfil .settings-actions { border-color:var(--theme-border); }
html[data-theme="dark"] .perfil-page #perfil .settings-actions :is(.perfil-btn-sync, .perfil-btn-cancel) {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); box-shadow:none;
}
html[data-theme="dark"] .perfil-page #perfil .settings-actions :is(.perfil-btn-sync, .perfil-btn-cancel):hover {
    background:var(--theme-hover); color:var(--theme-text); border-color:#777;
}
html[data-theme="dark"] .perfil-page #atajos :is(.ax-ajustes-op, .ax-ajustes-enlace) {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .perfil-page #atajos .ax-ajustes-op:has(input:checked) {
    background:#3a1e21; border-color:#e43b45; box-shadow:inset 0 0 0 1px #e43b45;
}
html[data-theme="dark"] .perfil-page #atajos .ax-ajustes-nombre { color:var(--theme-text); }
html[data-theme="dark"] .perfil-page #atajos .ax-ajustes-enlace :is(input, select) {
    background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .perfil-page #atajos .ax-ajustes-op input { accent-color:#dc2626; }
html[data-theme="dark"] .perfil-page #glpi .glpi-card {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); box-shadow:none;
}
html[data-theme="dark"] .perfil-page #glpi .glpi-card .cfg-row {
    background:transparent; color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .perfil-page #glpi :is(.cfg-label, code) { color:var(--theme-text); }
html[data-theme="dark"] .perfil-page #glpi :is(input:not([type="checkbox"]):not([type="hidden"]), select) {
    background:var(--theme-input); color:var(--theme-text); border:1px solid var(--theme-border); box-shadow:none;
}
html[data-theme="dark"] .perfil-page #glpi .glpi-pill.on { background:#087e45; color:#fff; }
html[data-theme="dark"] .perfil-page #glpi .glpi-pill.off { background:#83313a; color:#fff; }
html[data-theme="dark"] .perfil-page #atajos .ax-ajustes-quitar { background:var(--theme-input); color:var(--theme-text); border:1px solid var(--theme-border); }
html[data-theme="dark"] .perfil-page #atajos .ax-ajustes-quitar:hover { background:#bd1e30; color:#fff; }
html[data-theme="dark"] .ax-fab .ax-menu .ax-item { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .ax-fab .ax-menu .ax-item:hover { background:var(--theme-hover); border-color:#e43b45; }

/* Pestaña de configuración de la página y permisos por cuenta. */
html[data-theme="dark"] .perfil-page #pagina :is(.pagina-hero, .pagina-section, .pagina-filter-bar) {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .perfil-page #pagina .cfg-row {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .perfil-page #pagina :is(.pagina-section-header h3, .pagina-filter-title, .cfg-label) { color:var(--theme-text); }
html[data-theme="dark"] .perfil-page #pagina :is(.pagina-section-header p, .pagina-filter-title small, .cfg-label small) { color:var(--theme-muted); }
html[data-theme="dark"] .perfil-page #pagina :is(.pagina-head-icon, .pagina-section-icon) { background:#a51f2e; color:#fff; }
html[data-theme="dark"] .perfil-page #pagina .pagina-search-toggle { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .perfil-page #pagina .pagina-search-toggle:is(:hover, [aria-expanded="true"]) { background:#482023; color:#ff9ca5; border-color:#a83a43; }
html[data-theme="dark"] .perfil-page #pagina .perm-lista table thead th { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .perfil-page #pagina .perm-lista table tbody :is(td, a) { color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .perfil-page #pagina .pagina-permisos { background:transparent; border-color:rgba(151,166,186,.13); box-shadow:none; }
html[data-theme="dark"] .perfil-page #pagina .pagina-permisos .perm-lista .table-scroll { background:#1b2029; border-color:#353d49; }
html[data-theme="dark"] .perfil-page #pagina .pagina-permisos .perm-lista table thead th { background:#202733; color:#c3cddb; border-color:#343d49; }
html[data-theme="dark"] .perfil-page #pagina .pagina-permisos .perm-lista table tbody tr { background:#1b2029; }
html[data-theme="dark"] .perfil-page #pagina .pagina-permisos .perm-lista table tbody td { color:#dce2ea; border-color:rgba(151,166,186,.13); }
html[data-theme="dark"] .perfil-page #pagina .perm-lista .badge-role.admin { background:#bd1e30; color:#fff; }
html[data-theme="dark"] .perfil-page #pagina .perm-lista .badge-role.tecnico { background:#2856b8; color:#fff; }
html[data-theme="dark"] .perfil-page #pagina .perm-lista .badge-role.observador { background:#6840a2; color:#fff; }
html[data-theme="dark"] .perfil-page #pagina .perm-lista .badge-role.usuario { background:#087e45; color:#fff; }

/* Acento de interfaz compartido: respeta la paleta o el color personalizado. */
html .topbar-titles .dogger-page-section,
html .dogger-page-breadcrumb [aria-current="page"],
html .topbar-titles h1 .h1-ico,
html .profile-tabs button.is-active { color:var(--sb-accent, #d62b1f); }
html .profile-tabs button.is-active { border-color:var(--sb-accent, #d62b1f); }
html :is(.btn-primary, .btn-accent):not(:disabled) {
    background:var(--sb-accent, #d62b1f); border-color:var(--sb-accent, #d62b1f); color:#fff;
}
html :is(.btn-primary, .btn-accent):not(:disabled):hover {
    background:color-mix(in srgb, var(--sb-accent, #d62b1f) 85%, #000); border-color:var(--sb-accent, #d62b1f);
}
html .toggle-switch input:checked + .toggle-slider { background:var(--sb-accent, #d62b1f); }
html .prog-view-controls button.is-active {
    background:var(--sb-accent, #d62b1f); border-color:var(--sb-accent, #d62b1f); color:#fff;
    box-shadow:0 5px 12px color-mix(in srgb, var(--sb-accent, #d62b1f) 25%, transparent);
}

/* Modal de agenda: reglas por ID para superar los estilos claros específicos. */
html[data-theme="dark"] #modalDisp :is(.modal-head, .modal-body, .prog-disp-footer) {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] #modalDisp .prog-disp-form .corp-field :is(input, select, textarea),
html[data-theme="dark"] #modalEvento[data-tipo] .corp-field :is(input, select, textarea) {
    background-color:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border); color-scheme:dark;
}
html[data-theme="dark"] :is(#modalDisp, #modalEvento) .corp-field select {
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23d9d9d9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat:no-repeat; background-position:right 12px center; background-size:15px;
}
html[data-theme="dark"] #modalDisp .prog-disp-tipo { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] #modalDisp .prog-disp-tipo.is-selected { background:#392124; border-color:#f43f5e; }
html[data-theme="dark"] #modalDisp .prog-disp-tipo[data-tipo="no_ausencia"].is-selected { background:#19392a; border-color:#30c879; }
html[data-theme="dark"] #modalDisp .prog-disp-tipo :is(b, small) { color:var(--theme-text); }
html[data-theme="dark"] #modalDisp .prog-disp-symbol { color:#b9cbe4; }
html[data-theme="dark"] #modalDisp [data-tipo="falta"] .prog-disp-symbol i { background:#aabbd0; }
html[data-theme="dark"] #modalEvento[data-tipo] .ev-pista { background:#1b3047; color:#d5e7ff; }
html[data-theme="dark"] #modalEvento[data-tipo="green"] .ev-pista { background:#173c2a; color:#c1f3d7; }
html[data-theme="dark"] #modalEvento[data-tipo="amber"] .ev-pista { background:#423315; color:#ffe5a8; }
html[data-theme="dark"] #modalEvento[data-tipo="violet"] .ev-pista { background:#302444; color:#e8d6ff; }

/* Selectores personalizados de agenda; el menú se inserta fuera del modal. */
html[data-theme="dark"] .prog-modal .prog-select-trigger {
    background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .prog-select-popup {
    background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .prog-select-popup .prog-select-search {
    background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .prog-select-popup .prog-select-options button {
    background:transparent; color:var(--theme-text);
}
html[data-theme="dark"] .prog-select-popup .prog-select-options button:is(:hover, :focus-visible) {
    background:var(--theme-hover); color:var(--theme-text); outline:2px solid #92b9ff; outline-offset:-2px;
}
html[data-theme="dark"] .prog-select-popup .prog-select-options button[aria-selected="true"] { background:#492225; color:#ffb2b8; }
html[data-theme="dark"] .prog-select-popup[data-tono="green"] .prog-select-options button[aria-selected="true"] { background:#173d2c; color:#a6edc6; }
html[data-theme="dark"] .prog-select-popup[data-tono="amber"] .prog-select-options button[aria-selected="true"] { background:#463513; color:#ffe1a0; }
html[data-theme="dark"] .prog-select-popup[data-tono="blue"] .prog-select-options button[aria-selected="true"] { background:#1c3553; color:#bddaff; }
html[data-theme="dark"] .prog-select-popup[data-tono="violet"] .prog-select-options button[aria-selected="true"] { background:#38254c; color:#e1c7ff; }
html[data-theme="dark"] .prog-confirm-box, html[data-theme="dark"] .prog-confirm-box dl { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .prog-confirm-box :is(h2, dd) { color:var(--theme-text); }
html[data-theme="dark"] .prog-confirm-box :is(p, dt) { color:var(--theme-muted); }

html[data-theme="dark"] .prog-day-side .prog-side-day-card b.is-disponible { background:#087e45; color:#fff; }
html[data-theme="dark"] .prog-day-side .prog-side-day-info #progSideState:not([class]) { background:#514019; color:#fff; }
html[data-theme="dark"] .prog-day-side .prog-side-count { background:#2856b8; color:#fff; }
html[data-theme="dark"] .prog-day-side .prog-side-day-card b:is(.is-ocupado, .is-eventos) { background:#975300; color:#fff; }
html[data-theme="dark"] .prog-day-side .prog-side-day-card b.is-ausencia { background:#bd1e30; color:#fff; }
html[data-theme="dark"] .prog-day-side .prog-side-day-card b:is(.is-fin, .is-festivo, .is-offline) { background:#975300; color:#fff; }
html[data-theme="dark"] .prog-day-side .prog-side-day-card b.is-no_ausencia { background:#087e45; color:#fff; }
html[data-theme="dark"] .prog-day-side .prog-side-mini-stats > span:nth-child(1) .icon,
html[data-theme="dark"] .prog-day-side .prog-side-summary > span:nth-child(1) > .icon { background:#2856b8; color:#fff; }
html[data-theme="dark"] .prog-day-side .prog-side-mini-stats > span:nth-child(2) .icon,
html[data-theme="dark"] .prog-day-side .prog-side-summary > span:nth-child(2) > .icon { background:#a85e00; color:#fff; }
html[data-theme="dark"] .prog-day-side .prog-side-mini-stats > span:nth-child(3) .icon { background:#087e45; color:#fff; }
html[data-theme="dark"] .prog-cal-nav #mesHoy { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .prog-day .prog-chip:is(.ct-tarea, .cd-disponible) { background:#087e45; color:#fff; }
html[data-theme="dark"] .prog-day .prog-chip:is(.ct-recordatorio, .cd-ocupado) { background:#975300; color:#fff; }
html[data-theme="dark"] .prog-day .prog-chip.cd-ausencia { background:#bd1e30; color:#fff; }
html[data-theme="dark"] .prog-day .prog-chip.ct-anuncio { background:#6840a2; color:#fff; }
html[data-theme="dark"] .prog-day .prog-chip:is(.ct-proyecto, .ct-solicitud) { background:#2856b8; color:#fff; }
html[data-theme="dark"] #modalDetalleEvento :is(.prog-det-bloque, .prog-det-vacio) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] #modalDetalleEvento .prog-det-bloque :is(b, small) { color:var(--theme-text); }
html[data-theme="dark"] #modalDetalleEvento .prog-det-disponibilidad-lista li { background:#20342d; border-color:#36594b; }
html[data-theme="dark"] #modalDetalleEvento .prog-det-disponibilidad-lista li.is-ausencia { background:#39272d; border-color:#70404a; }
html[data-theme="dark"] #modalDetalleEvento .prog-det-disponibilidad-lista li.is-falta { background:#392e24; border-color:#705338; }
html[data-theme="dark"] #modalDetalleEvento .prog-det-disponibilidad-lista strong { color:#f0f2f7; }
html[data-theme="dark"] #modalDetalleEvento .prog-det-disponibilidad-lista small { color:#bec8d5; }
html[data-theme="dark"] #modalDetalleEvento .prog-det-evento { background:#252d39; border-color:#414b5a; }
html[data-theme="dark"] #modalDetalleEvento .prog-det-evento .prog-det-abrir:hover { background:#303b4a; }
html[data-theme="dark"] #modalDetalleEvento .prog-det-festivo { color:#b7d3ff; background:#243750; }
html[data-theme="dark"] .prog-availability :is(.tec-matrix-scroll, .tec-matrix, .mx-tec) { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .prog-availability .mx-profile-copy strong { color:var(--theme-text); }
html[data-theme="dark"] .prog-availability .mx-profile-copy small { color:var(--theme-muted); }
html[data-theme="dark"] .prog-availability .mx-profile:is(:hover, .is-summary-selected) { background:var(--theme-hover); }
html[data-theme="dark"] .prog-availability .prog-chart-note { background:#1b3047; color:#c8dfff; }
html[data-theme="dark"] .prog-subview { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .prog-subview :is(.prog-chart-head, .prog-list-head) { border-color:var(--theme-border); }
html[data-theme="dark"] .prog-subview .prog-section-title { color:var(--theme-text); }
html[data-theme="dark"] #panel-disponibilidad.prog-subview { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] #panel-disponibilidad .prog-month-summary { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] #panel-disponibilidad :is(.month-summary-profile, .month-summary-metric) { border-color:var(--theme-border); }
html[data-theme="dark"] #panel-disponibilidad :is(.month-summary-profile strong, .month-summary-title, .month-summary-metric b) { color:var(--theme-text); }
html[data-theme="dark"] #panel-disponibilidad :is(.month-summary-profile small, .month-summary-metric small, .month-summary-empty) { color:var(--theme-muted); }
html[data-theme="dark"] #panel-disponibilidad :is(.mx-row-status, .month-summary-status) { background:#087e45; color:#fff; }
html[data-theme="dark"] #panel-disponibilidad :is(.mx-row-status, .month-summary-status):is(.is-falta, .is-fin, .is-festivo, .is-offline) { background:#69501b; color:#fff; }
html[data-theme="dark"] #panel-disponibilidad :is(.mx-row-status, .month-summary-status).is-ausencia { background:#bd1e30; color:#fff; }
html[data-theme="dark"] .prog-subview .tec-count { background:var(--theme-raised); color:var(--theme-text); }
html[data-theme="dark"] .prog-subview .prog-ev-item { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .prog-subview .prog-ev-item:hover { background:var(--theme-hover); border-color:#777; }
html[data-theme="dark"] .prog-subview :is(.prog-ev-title, .prog-ev-meta b) { color:var(--theme-text); }
html[data-theme="dark"] .prog-subview :is(.prog-ev-meta, .prog-ev-desc) { color:var(--theme-muted); }
html[data-theme="dark"] .prog-subview .prog-ev-ic.t-tarea { background:#087e45; color:#fff; }
html[data-theme="dark"] .prog-subview .prog-ev-ic.t-recordatorio { background:#975300; color:#fff; }
html[data-theme="dark"] .prog-subview .prog-ev-ic.t-anuncio { background:#6840a2; color:#fff; }

/* Monitoreo del técnico: paneles, tarjetas y tablas propios de esta vista. */
html[data-theme="dark"] .tec-monitor-page :is(.tec-monitor-section, .tec-monitor-primary, .obs-tarjeta, .pres-ficha, .ans-ficha, .tec-monitor-overview) {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); box-shadow:none;
}
html[data-theme="dark"] .tec-monitor-page :is(.tec-monitor-primary-copy span, .tec-monitor-primary-copy strong, .obs-bloque-titulo, .tec-zone-info strong, .tec-puntos-name) { color:var(--theme-text); }
html[data-theme="dark"] .tec-monitor-page :is(.tec-monitor-primary-copy small, .obs-leyenda, .tec-zone-info small) { color:var(--theme-muted); }
html[data-theme="dark"] .tec-monitor-page .tec-monitor-primary::after { background:var(--theme-raised); color:var(--theme-text); }
html[data-theme="dark"] .tec-monitor-page .tec-puntos-table :is(th, td) { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .tec-monitor-page .tec-puntos-table th { background:var(--theme-raised); }
html[data-theme="dark"] .tec-monitor-page .tec-puntos-bar { background:#444; }
html[data-theme="dark"] .tec-monitor-page .tec-monitor-kpis .dash-stat { background:var(--theme-panel) !important; border-color:var(--theme-border) !important; box-shadow:none !important; }
html[data-theme="dark"] .tec-monitor-page .tec-monitor-kpis .dash-stat :is(.dash-stat-value, .dash-stat-label, .dash-stat-hint) { color:var(--theme-text) !important; }
html[data-theme="dark"] .tec-monitor-page :is(.tec-zone-person, .tec-zone-meta > span) { border-color:var(--theme-border); }
html[data-theme="dark"] .tec-monitor-page .tec-meta-copy b { color:var(--theme-text); }
html[data-theme="dark"] .tec-monitor-page .tec-zone-role { background:#087e45; color:#fff; }
html[data-theme="dark"] .tec-monitor-page .tec-zone-chip { background:#2856b8; color:#fff; }
html[data-theme="dark"] .tec-monitor-page .tec-meta-icon { background:#a51f2e; color:#fff; }
html[data-theme="dark"] .tec-monitor-page .tec-zone-label .tec-meta-icon { background:#2856b8; color:#fff; }
html[data-theme="dark"] .tec-monitor-page .tec-zone-carousel button { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .tec-monitor-page .pres-ficha-cita { background:var(--theme-raised); color:var(--theme-text); }
html[data-theme="dark"] .tec-monitor-page .obs-filtros-tabla { background:var(--theme-raised); border-color:var(--theme-border); }
html[data-theme="dark"] .tec-monitor-page .obs-filtros-tabla .obs-fchip { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .tec-monitor-page .obs-filtros-tabla .obs-fchip.is-on { background:var(--sb-accent, #d62b1f); border-color:var(--sb-accent, #d62b1f); color:#fff; }

/* Historial del técnico: indicadores y filas alternas legibles. */
html[data-theme="dark"] .hist-page .dash-stat[data-hist-spark] { background:var(--theme-panel) !important; border-color:var(--theme-border) !important; box-shadow:none !important; }
html[data-theme="dark"] .hist-page .dash-stat :is(.dash-stat-value, .dash-stat-label, .dash-stat-hint) { color:var(--theme-text) !important; }
html[data-theme="dark"] .hist-page .hist-spark-tip { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .hist-page .hist-table thead th { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .hist-page .hist-table tbody tr { background:var(--theme-panel); }
html[data-theme="dark"] .hist-page .hist-table tbody tr:nth-child(even) { background:#242424; }
html[data-theme="dark"] .hist-page .hist-table tbody tr:hover { background:var(--theme-hover); }
html[data-theme="dark"] .hist-page .hist-table tbody td { background:transparent; color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .hist-page .hist-table tbody :is(a, .hist-cell-strong) { color:#a8caff; }
html[data-theme="dark"] .hist-page .hist-busca input { background:var(--theme-input); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] #rolModal .rol-op { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] #rolModal .rol-op:hover { background:var(--theme-hover); }
html[data-theme="dark"] #rolModal .rol-op:has(input:checked) { background:#382024; border-color:var(--sb-accent, #d62b1f); }
html[data-theme="dark"] #rolModal .rol-op-txt strong { color:var(--theme-text); }
html[data-theme="dark"] #rolModal .rol-op-txt small { color:var(--theme-muted); }
html[data-theme="dark"] #rolModal .rol-badge-base { background:#087e45; color:#fff; border-color:#087e45; }
html[data-theme="dark"] #rolModal .rol-badge-activo { background:#975300; color:#fff; border-color:#975300; }

/* Monitoreo del observador: zonas y actividad. */
html[data-theme="dark"] :is(.zona-activa, .zona-activa-sin-zona, .zona-activa-tools, .zona-activa-persona, .zona-activa-respuesta) {
    background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border);
}
html[data-theme="dark"] .zona-activa-head { color:#fff; }
html[data-theme="dark"] .zona-activa-tools label { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .zona-activa-tools label input { background:transparent; color:var(--theme-text); border:0; box-shadow:none; }
html[data-theme="dark"] :is(.zona-activa-sin-zona, .zona-activa-persona) :is(strong, b) { color:var(--theme-text); }
html[data-theme="dark"] :is(.zona-activa-sin-zona, .zona-activa-persona) :is(p, small, li span) { color:var(--theme-muted); }
html[data-theme="dark"] .zona-activa-sin-zona li { border-color:var(--theme-border); }
html[data-theme="dark"] .zona-activa-sin-zona a, html[data-theme="dark"] .zona-activa-tools a { color:#a8caff; }
html[data-theme="dark"] .zona-activa .obs-zona-acc { background:var(--theme-raised); border-color:var(--theme-border); }
html[data-theme="dark"] .zona-activa .obs-zona-acc .obs-acc-ico { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .zona-carrusel-controls :is(.zona-carrusel-arrow, .zona-carrusel-dot:not(.is-active)) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .zona-carrusel-controls .zona-carrusel-dot.is-active { background:#2856b8; color:#fff; }
html[data-theme="dark"] .obs-reference-section :is(.obs-reference-card, .obs-reference-head, .obs-modern-ticket-columns, .obs-live-tech-columns) { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); box-shadow:none; }
html[data-theme="dark"] .obs-reference-section :is(.obs-reference-copy h3, .obs-modern-ticket-code, .obs-modern-ticket-request b, .obs-modern-tech-person strong, .obs-modern-tech-count b, .obs-modern-tech-percent) { color:var(--theme-text); }
html[data-theme="dark"] .obs-reference-section :is(.obs-reference-copy p, .obs-modern-ticket-request small, .obs-modern-ticket-owner, .obs-modern-ticket-date, .obs-modern-tech-person small, .obs-modern-tech-count small) { color:var(--theme-muted); }
html[data-theme="dark"] .obs-reference-section :is(.obs-modern-ticket-row, .obs-modern-tech-row) { background:transparent; border-color:var(--theme-border); color:var(--theme-text); }
html[data-theme="dark"] .obs-reference-section :is(.obs-modern-ticket-row, .obs-modern-tech-row):is(:hover, :focus-visible) { background:var(--theme-hover); }
html[data-theme="dark"] .obs-reference-section :is(.obs-modern-tech-load, .obs-tech-load) { background:#444; }
html[data-theme="dark"] .obs-reference-section .obs-tech-tip { background:#1b3047; color:#c8dfff; }
html[data-theme="dark"] .obs-reference-section .obs-tech-tip strong { color:#c8dfff; }
html[data-theme="dark"] .obs-reference-section .obs-modern-ticket-status.is-abierto { background:#bd1e30; color:#fff; }
html[data-theme="dark"] .obs-reference-section .obs-modern-ticket-status.is-en-progreso { background:#975300; color:#fff; }
html[data-theme="dark"] .obs-reference-section .obs-modern-ticket-status:is(.is-resuelto, .is-cerrado) { background:#087e45; color:#fff; }
html[data-theme="dark"] .rpt-filter-panel :is(.rpt-fld select, .rpt-fld input[type="date"], .rpt-persona-input input[type="text"]) {
    background:var(--theme-input); color:var(--theme-text); border:1px solid #444; box-shadow:none; color-scheme:dark;
}
html[data-theme="dark"] .rpt-filter-panel :is(.rpt-fld select, .rpt-fld input[type="date"], .rpt-persona-input input[type="text"]):focus-visible {
    outline:2px solid #92b9ff; outline-offset:2px; border-color:#92b9ff;
}
html[data-theme="dark"] :is(.rpt-tech-select, .rpt-user-select) select,
html[data-theme="dark"] :is(.rpt-tech-search, .rpt-user-search) input {
    background:var(--theme-input); color:var(--theme-text); border-color:#444; box-shadow:none; color-scheme:dark;
}
html[data-theme="dark"] #modalDetalleEvento :is(.prog-anuncio-data, .prog-anuncio-data dd) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] #modalDetalleEvento .prog-anuncio-data dt { color:var(--theme-muted); }
html[data-theme="dark"] #modalDetalleEvento .prog-anuncio-status { background:#173c2a; color:#b9efd0; border-color:#316b4a; }

/* Ficha expandida de usuarios y técnicos. */
html[data-theme="dark"] .usuarios-page .ue-ficha-row > td { background:var(--theme-panel) !important; border-color:var(--theme-border) !important; }
html[data-theme="dark"] .usuarios-page .ue-profile-head { background:var(--theme-raised) !important; border-color:var(--theme-border) !important; }
html[data-theme="dark"] .usuarios-page .ue-profile-tabs { background:var(--theme-panel); border-color:var(--theme-border); }
html[data-theme="dark"] .usuarios-page .ue-ficha-row :is(.ue-box, .ue-stat-link) { background:var(--theme-raised) !important; border-color:var(--theme-border) !important; }
html[data-theme="dark"] .usuarios-page .ue-ficha-row .ue-box h4 { color:var(--theme-text) !important; }
html[data-theme="dark"] .usuarios-page .ue-ficha-row :is(.ue-profile-identity h3, .ue-profile-summary b, .ue-kv span, .ue-ticket-stats b) { color:var(--theme-text); }
html[data-theme="dark"] .usuarios-page .ue-ficha-row :is(.ue-profile-identity p, .ue-profile-summary small, .ue-kv b, .ue-ticket-stats span) { color:var(--theme-muted); border-color:var(--theme-border); }
html[data-theme="dark"] .usuarios-page .ue-ficha-row .perm-chip { background:#173c2a !important; color:#b9efd0 !important; border-color:#316b4a !important; }
html[data-theme="dark"] .usuarios-page .ue-ficha-row .perm-chip.off { background:#333 !important; color:#ddd !important; border-color:#555 !important; }
html[data-theme="dark"] .usuarios-page #tablaUsuarios .row-menu-btn,
html[data-theme="dark"] .usuarios-page .ue-profile-collapse { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill:nth-child(1) .icon,
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill:nth-child(1).active .icon { background:#bd1e30; color:#fff; }
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill:nth-child(2) .icon,
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill:nth-child(2).active .icon { background:#2856b8; color:#fff; }
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill:nth-child(3) .icon,
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill:nth-child(3).active .icon { background:#087e45; color:#fff; }
html[data-theme="dark"] .usuarios-page .users-tabs-bar { background:var(--theme-panel); border-color:var(--theme-border); box-shadow:none; }
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); box-shadow:none; }
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill:hover { background:var(--theme-hover); color:var(--theme-text); border-color:#666; }
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill.active { background:#3a2023; color:#fff; border-color:#b63842; }
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill span { background:#343434; color:var(--theme-text); }
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill.active span { background:#a51f2e; color:#fff; }
html[data-theme="dark"] .usuarios-page .users-tabs-bar .tab-pill small { background:#64430e; color:#fff; }
html[data-theme="dark"] .usuarios-page .pagination-bar { background:var(--theme-panel); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .usuarios-page .pagination-bar :is(.per-page-bar label, .pagination-info) { color:var(--theme-muted); }
html[data-theme="dark"] .usuarios-page .pagination-bar .per-page-bar select,
html[data-theme="dark"] .usuarios-page .pagination-bar .page-pill:not(.current) { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .usuarios-page .pagination-bar .page-pill.disabled { color:var(--theme-muted); opacity:.65; }

/* Detalle del ANS y conversación del ticket. */
html[data-theme="dark"] .ans-modal .ans-modal-reloj.ans-ok { background:#173c2a; color:#a6edc6; border-color:#316b4a; }
html[data-theme="dark"] .ans-modal .ans-modal-reloj.ans-por-vencer { background:#463513; color:#ffe1a0; border-color:#80621d; }
html[data-theme="dark"] .ans-modal .ans-modal-reloj.ans-vencido { background:#492225; color:#ffb2b8; border-color:#8f4048; }
html[data-theme="dark"] .ans-modal .ans-modal-x { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); }
html[data-theme="dark"] .ans-modal .ans-modal-leyenda { background:var(--theme-panel); border-color:var(--theme-border); }
html[data-theme="dark"] .ticket-detail-grid .chat-thread { background:var(--theme-raised); color:var(--theme-text); border-color:var(--theme-border); box-shadow:none; }
html[data-theme="dark"] :is(.pan-zc, .mon-zc) { background:var(--theme-raised); }
html[data-theme="dark"] :is(.pan-zc, .mon-zc):is(:hover, :focus-visible) { background:var(--theme-hover); }
/* Leyenda de la gráfica de estado del punto de venta en modo oscuro. */
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-state-body li:hover,
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-state-body li:focus-visible {
    background: #30333a;
    color: #f1f5f9;
}

/* Contornos discretos en ventanas y tarjetas del panel de punto de venta. */
html[data-theme="dark"] :is(.modal-box, .confirm-box, .force-pwd-modal,
    .ax-modal-card, .pan-presionar-modal, .mon-folder-dialog, .mon-point-dialog,
    .aud-modal-caja, .perfil-photo-dialog, .pv-zone-dialog) {
    border-width: 1px;
    border-color: rgba(255, 255, 255, .14);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-supervisor-strip, .pv-kpi, .pv-card) {
    border-width: 1px;
    border-color: rgba(255, 255, 255, .14);
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-middle-grid > .pv-card > header {
    border-radius: 14px 14px 0 0;
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard :is(.pv-supervision-person, .pv-supervision-contact, .pv-supervision-escalate) {
    background:#111820; border-color:#293341;
}
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-contact-head-icon { background:#202b38; color:#bdc9d9; }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-contact-green { background:#153b2e; color:#14d77c; }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-contact-red { background:#38212f; color:#ff3150; }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-contact-note { border-color:#293341; }
html[data-theme="dark"] .mi-panel-shell #pvDashboard .pv-supervision-contact .pv-contact-button { background:#12ad5d; border-color:#12ad5d; color:#fff; }

/* Sistema visual compartido: solo afecta superficies en modo oscuro. */
html[data-theme="dark"] .sidebar { background:var(--bg-sidebar); border-color:var(--theme-border); }
html[data-theme="dark"] :is(.topbar-top, .topbar > .header-row) { background:var(--bg-main); border-color:var(--theme-border); }
html[data-theme="dark"] .sidebar .sidebar-link { border-radius:10px; transition:background-color .2s ease,color .2s ease; }
html[data-theme="dark"] .sidebar .sidebar-link:hover { background:var(--theme-hover); color:var(--theme-text); }
html[data-theme="dark"] .sidebar .sidebar-link:is(.active, .is-active, [aria-current="page"]) {
    background:#303b4b;
    box-shadow:none; color:var(--theme-text);
}
html[data-theme="dark"] :is(.chart-card, .corp-card, .table-card, .profile-card, .cat-group-card, .side-card) {
    border-radius:var(--radius-lg); border-color:var(--theme-border); box-shadow:var(--shadow-sm);
}
html[data-theme="dark"] :is(.modal-box, .confirm-box, .ax-modal-card, .mon-folder-dialog, .mon-point-dialog, .perfil-photo-dialog) {
    border-radius:20px; border-color:var(--theme-border); box-shadow:var(--shadow-lg);
}
html[data-theme="dark"] :is(.modal-overlay, .confirm-overlay) { backdrop-filter:blur(4px); }
html[data-theme="dark"] :is(.btn-primary, .btn-accent):not(:disabled) { background:var(--dogger-red); border-color:var(--dogger-red); color:#fff; }
html[data-theme="dark"] :is(.btn-primary, .btn-accent):not(:disabled):hover { background:var(--dogger-red-hover); border-color:var(--dogger-red-hover); }
html[data-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea):focus-visible {
    border-color:var(--dogger-red-hover); box-shadow:0 0 0 3px rgba(220,38,38,.2); outline:2px solid #ff9ba4; outline-offset:2px;
}
html[data-theme="dark"] :is(a, button, summary):focus-visible { outline:2px solid #a8caff; outline-offset:2px; }
/* Un único foco alrededor del buscador, no alrededor del input interior. */
html[data-theme="dark"] .topbar .global-search-field:focus-within { border-color:#ef666d; outline:none; box-shadow:0 0 0 2px #ef666d; }
html[data-theme="dark"] .topbar .global-search-field > input:is(:focus, :focus-visible) { border:0 !important; outline:none !important; box-shadow:none !important; }

/* Configuración de página: superficies neutras y consistentes en modo oscuro. */
html[data-theme="dark"] .perfil-page #pagina #escalamiento-editor { background:#1e2531; border-color:#343d4b; }
html[data-theme="dark"] .perfil-page #pagina #escalamiento-editor .esc-layout { background:#191e27; border-color:#394352; }
html[data-theme="dark"] .perfil-page #pagina #escalamiento-editor .esc-control { border-color:#343d4b; }
html[data-theme="dark"] .perfil-page #pagina #escalamiento-editor .esc-choice { background:#252d3a; border-color:#414b5a; }
html[data-theme="dark"] .perfil-page #pagina #escalamiento-editor .esc-choice:hover { background:#303a49; }
html[data-theme="dark"] .perfil-page #pagina #escalamiento-editor .esc-hours input { background:#171c24; border-color:#414b5a; color:#f1f4f9; }
html[data-theme="dark"] .perfil-page #pagina #horario-editor .horario-lista { background:#191e27; border-color:#394352; }
html[data-theme="dark"] .perfil-page #pagina #horario-editor .horario-columnas { background:#252d3a; color:#bec9d8; }
html[data-theme="dark"] .perfil-page #pagina #horario-editor .horario-fila + .horario-fila { border-color:#343d4b; }
html[data-theme="dark"] .perfil-page #pagina #horario-editor .horario-fila input { background:#171c24; border-color:#394352; color:#f1f4f9; }
html[data-theme="dark"] .perfil-page #pagina #horario-editor .horario-quitar:hover { background:#46272e; color:#ff8b94; }
html[data-theme="dark"] .perfil-page #pagina .pagina-hero-art { background:radial-gradient(circle at 50% 55%,#49303b,#292a37 70%); }
html[data-theme="dark"] .perfil-page #pagina .pagina-art-window { background:#303b49; border-color:#d84b55; }
html[data-theme="dark"] .perfil-page #pagina .pagina-art-window i { background:#708092; }
html[data-theme="dark"] .perfil-page #pagina .pagina-art-gear { border-color:#303b49; }
html[data-theme="dark"] .admin-dashboard .dash-hero--plano,
html[data-theme="dark"] .admin-dashboard .dash-hero--plano .dash-stat-row { background:transparent !important; border:0; box-shadow:none; }

/* El aviso de ANS vencido es texto, no una etiqueta con fondo sólido. */
html[data-theme="dark"] .ans-time.ans-vencido,
html[data-theme="dark"] .mi-panel-shell #pvDashboard ~ .corp-table-card .ans-time.ans-vencido {
    background:transparent; border-color:transparent; color:#ff6672;
}
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-main .table-card { background:#191e27; border-color:#343d49; }
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-main .data-table thead th { background:#202733; color:#d9e1ed; border-color:#343d49; }
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-main .data-table tbody tr { background:#191e27; }
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-main .data-table tbody tr:hover { background:#252d39; }
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-main .data-table tbody td { background:transparent; color:#e3e8f0; border-color:#343d49; }
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-main .pagination-bar { background:#191e27; border-color:#343d49; }
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-main :is(.per-page-bar label, .pagination-info) { color:#b4c0d0; }
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-main #perPageRecientes { background:#252d39; color:#eef2f7; border-color:#465365; color-scheme:dark; }
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-main .page-pill.disabled { background:#28313d; color:#8897a9; border-color:#3b4655; }
/* Resumen del equipo y tickets que requieren atención. */
html[data-theme="dark"] .admin-dashboard :is(.mesa-tec-card, .attention-card) { background:#191e27; border-color:#343d49; }
html[data-theme="dark"] body.admin-dashboard .mesa-tec-card { background:transparent; border:0; box-shadow:none; }
html[data-theme="dark"] .admin-dashboard :is(.mesa-tec-card, .attention-card) .chart-card-head h3 { color:#eef2f7; }
html[data-theme="dark"] .admin-dashboard .tec-performance-table-wrap { border-color:#434d5c; box-shadow:none; }
html[data-theme="dark"] .admin-dashboard .tec-performance-table-wrap .table-scroll { background:#202733; }
html[data-theme="dark"] .admin-dashboard .tec-performance-table-wrap .mesa-tec-table thead th { background:#252f3e; color:#e8edf5; }
html[data-theme="dark"] .admin-dashboard .tec-performance-table-wrap .mesa-tec-table :is(tbody, tbody tr, tbody td) { background:#191e27; color:#e4eaf2; border-color:#343d49; }
html[data-theme="dark"] .admin-dashboard .tec-performance-table-wrap .mesa-tec-table tbody tr:is(:hover,:focus-within) td { background:#252f3b; }
html[data-theme="dark"] .admin-dashboard .mesa-tec-table .tec-name-txt { color:#edf1f7; }
html[data-theme="dark"] .admin-dashboard .mesa-tec-table .tec-name-email { color:#aab9ca; }
html[data-theme="dark"] .admin-dashboard .tec-team-donut::before { background:#191e27; }
html[data-theme="dark"] .admin-dashboard .tec-team-donut-content { color:#edf1f7; }
html[data-theme="dark"] .admin-dashboard .tec-team-donut-content small { color:#b1bed0; }
html[data-theme="dark"] .admin-dashboard .tec-team-metric { background:#252d39; border-color:#404b5a; color:#edf1f7; }
html[data-theme="dark"] .admin-dashboard .tec-team-metric small { color:#b1bed0; }
html[data-theme="dark"] .admin-dashboard .attention-table thead th { background:#202733; color:#d9e1ed; border-color:#343d49; }
html[data-theme="dark"] .admin-dashboard .attention-table tbody tr:nth-child(n) { background:#191e27; }
html[data-theme="dark"] .admin-dashboard .attention-table tbody tr:hover { background:#252d39; }
html[data-theme="dark"] .admin-dashboard .attention-table tbody td { background:transparent; color:#e3e8f0; border-color:#343d49; }
html[data-theme="dark"] .admin-dashboard .dashboard-panel-title h2,
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-side .glpi-head h3 { color:#eef2f7; }
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-side .glpi-activity-text,
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-side .glpi-activity-link { color:#c8d8ee; }
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-side .glpi-activity-link:hover { color:#fff; }
html[data-theme="dark"] .admin-dashboard .dashboard-bottom-side .glpi-activity-time { color:#a8b6c8; }

/* Confirmación del ticket, con estado de asignación explícito. */
.ticket-ok-overlay .ticket-ok-box { box-sizing:border-box; width:min(480px,calc(100vw - 32px)); padding:28px; border:1px solid #e1e8ef; border-radius:20px; background:#fff; color:#17233c; box-shadow:0 24px 70px #1018283d; }
.ticket-ok-overlay .ticket-ok-icon { display:grid; place-items:center; width:56px; height:56px; margin:0 auto 16px; border-radius:18px; background:#e4f8ec; color:#16834d; box-shadow:none; }
.ticket-ok-overlay .ticket-ok-box h3 { margin:0; color:#17233c; font-size:22px; }
.ticket-ok-overlay .confirm-msg { margin:8px 0 18px; color:#64748b; }
.ticket-ok-overlay .ticket-ok-list { display:grid; gap:0; margin:0 0 16px; padding:4px 14px; border:1px solid #e3eaf2; border-radius:12px; background:#f8fafc; }
.ticket-ok-overlay .ticket-ok-list > div { display:grid; grid-template-columns:minmax(105px, .42fr) minmax(0,1fr); align-items:center; gap:12px; padding:9px 0; border-bottom:1px solid #e3eaf2; }
.ticket-ok-overlay .ticket-ok-list > div:last-child { border:0; }
.ticket-ok-overlay .ticket-ok-list dt { width:auto; color:#65758b; font-size:11px; }
.ticket-ok-overlay .ticket-ok-list dd { color:#1f2c43; }
.ticket-ok-overlay .ticket-ok-codigo dd { color:#cf2334; }
.ticket-ok-overlay .ticket-ok-pendiente { display:inline-flex; align-items:center; gap:5px; color:#a55e08; }
.ticket-ok-overlay .ticket-ok-note { margin:0 0 16px; color:#61718a; }
.ticket-ok-overlay .ticket-ok-done { width:100%; min-height:42px; border:0; border-radius:10px; background:#db242b; color:#fff; font-family:inherit; font-size:14px; font-weight:700; cursor:pointer; }
.ticket-ok-overlay .ticket-ok-done:hover { background:#bd1c26; }
html[data-theme="dark"] .ticket-ok-overlay .ticket-ok-box { background:#191e27; border-color:#354356; color:#e8eef7; }
html[data-theme="dark"] .ticket-ok-overlay .ticket-ok-box h3, html[data-theme="dark"] .ticket-ok-overlay .ticket-ok-list dd { color:#edf2f9; }
html[data-theme="dark"] .ticket-ok-overlay .ticket-ok-list { background:#222c3a; border-color:#354356; }
html[data-theme="dark"] .ticket-ok-overlay .ticket-ok-list > div { border-color:#354356; }
html[data-theme="dark"] .ticket-ok-overlay .ticket-ok-list dt, html[data-theme="dark"] .ticket-ok-overlay :is(.confirm-msg,.ticket-ok-note) { color:#b3c0d2; }
html[data-theme="dark"] .ticket-ok-overlay .ticket-ok-codigo dd { color:#ff8791; }
html[data-theme="dark"] .ticket-ok-overlay .ticket-ok-pendiente { color:#ffc470; }

/* Edición de cuentas: superficies y controles del modal. */
html[data-theme="dark"] #modal-usuario .modal-box,
html[data-theme="dark"] #modal-usuario .modal-body { background:#191e27; color:#e7edf6; }
html[data-theme="dark"] #modal-usuario .modal-head { background:linear-gradient(115deg,#202a39,#30222c); border-color:#344153; }
html[data-theme="dark"] #modal-usuario .usuario-modal-heading h3 { color:#f0f4fa; }
html[data-theme="dark"] #modal-usuario .usuario-modal-heading p,
html[data-theme="dark"] #modal-usuario .form-check-hint { color:#b2c0d2; }
html[data-theme="dark"] #modal-usuario .usuario-modal-icon { background:#49232d; color:#ff6673; }
html[data-theme="dark"] #modal-usuario .modal-head .modal-close,
html[data-theme="dark"] #modal-usuario .u-password-control button { background:#263243; border-color:#46556a; color:#dce6f4; }
html[data-theme="dark"] #modal-usuario .form-group > label,
html[data-theme="dark"] #modal-usuario .form-check-row label { color:#d1dceb; }
html[data-theme="dark"] #modal-usuario .usuario-input,
html[data-theme="dark"] #modal-usuario .u-role-picker > summary,
html[data-theme="dark"] #modal-usuario .u-role-options { background:#222c3a; border-color:#435064; color:#e7edf6; }
html[data-theme="dark"] #modal-usuario .usuario-input input { background:transparent; color:#f0f4fa; }
html[data-theme="dark"] #modal-usuario .usuario-input input::placeholder { color:#99abc2; }
html[data-theme="dark"] #modal-usuario .usuario-input .icon { color:#a4b8d2; }
html[data-theme="dark"] #modal-usuario .u-role-options button { color:#e7edf6; background:transparent; }
html[data-theme="dark"] #modal-usuario .u-role-options button:hover,
html[data-theme="dark"] #modal-usuario .u-role-options button:focus-visible { background:#344356; }
html[data-theme="dark"] #modal-usuario .modal-actions { background:#191e27; border-color:#344153; }

/* El color de la zona enmarca toda la tarjeta, sin franja lateral. */
.pan-zc-wrap .pan-zc { border:1px solid var(--zc, #16a34a); }
.pan-zc-wrap .pan-zc-amarillo { border-color:var(--zc, #f59e0b); }
.pan-zc-wrap .pan-zc-rojo { border-color:var(--zc, #ef4444); }
.pan-zc-state .icon { width:14px; height:14px; flex:none; }
.pan-zc-wrap .pan-zc-state { padding:0; background:transparent; color:var(--ink, #17233c); }
.pan-zc-wrap .pan-zc-state .icon { color:#16a34a; }
.pan-zc-wrap .pan-zc-amarillo .pan-zc-state .icon { color:#e69c14; }
.pan-zc-wrap .pan-zc-rojo .pan-zc-state .icon { color:#e1263f; }
html[data-theme="dark"] .pan-zc-wrap .pan-zc-state { background:transparent; color:var(--theme-text, #edf2f9); }
.pan-zc-wrap[style*="--zc"] .pan-zc { border-color:var(--zc); }
html[data-theme="dark"] .pan-zc-wrap .pan-zc { border-color:var(--zc, #16a34a); }
html[data-theme="dark"] .pan-zc-wrap .pan-zc-amarillo { border-color:var(--zc, #f59e0b); }
html[data-theme="dark"] .pan-zc-wrap .pan-zc-rojo { border-color:var(--zc, #ef4444); }
/* Formulario de creación de zonas. */
#cz-modal .cz-supervisor-select { position:relative; display:block; }
#cz-modal .cz-supervisor-trigger { display:flex; align-items:center; justify-content:space-between; width:100%; min-height:46px; padding:10px 14px; border:1px solid #cbd5e1; border-radius:12px; background:#fff; color:#18253a; font-family:inherit; font-size:14px; font-weight:600; text-align:left; cursor:pointer; }
#cz-modal .cz-supervisor-chevron { width:8px; height:8px; border-right:2px solid #8292a7; border-bottom:2px solid #8292a7; transform:rotate(45deg); transition:transform .2s; }
#cz-modal .cz-supervisor-trigger[aria-expanded="true"] .cz-supervisor-chevron { transform:rotate(225deg); }
#cz-modal .cz-supervisor-lista:not([hidden]) { position:absolute; z-index:70; top:calc(100% + 6px); left:0; right:0; display:grid; gap:3px; max-height:210px; overflow:auto; padding:6px; border:1px solid #d6dfeb; border-radius:12px; background:#fff; box-shadow:0 12px 28px rgba(0,0,0,.2); }
#cz-modal .cz-supervisor-option { display:flex; align-items:center; gap:10px; width:100%; padding:9px; border:0; border-radius:9px; background:transparent; color:#18253a; text-align:left; cursor:pointer; }
#cz-modal .cz-supervisor-option:hover, #cz-modal .cz-supervisor-option:focus-visible, #cz-modal .cz-supervisor-option.is-selected { background:#eef4fa; }
#cz-modal .cz-supervisor-avatar { display:grid; place-items:center; width:34px; height:34px; flex:none; border-radius:10px; background:#e4ecf9; color:#345cb4; font-weight:800; }
#cz-modal .cz-supervisor-info { display:grid; gap:3px; flex:1; text-transform:none; letter-spacing:0; }
#cz-modal .cz-supervisor-info strong { font-size:13px; }
#cz-modal .cz-supervisor-info small { display:flex; align-items:center; gap:5px; color:#16824c; font-size:11px; }
#cz-modal .cz-supervisor-info i { width:7px; height:7px; border-radius:50%; background:#22c55e; }
#cz-modal .cz-supervisor-mark { visibility:hidden; color:#16824c; }
#cz-modal .cz-supervisor-option.is-selected .cz-supervisor-mark { visibility:visible; }
#cz-modal .cz-supervisor-empty { padding:12px; color:#718096; text-transform:none; }
html[data-theme="dark"] #cz-modal .cz-supervisor-trigger, html[data-theme="dark"] #cz-modal .cz-supervisor-lista:not([hidden]) { background:#202a39; border-color:#46556a; color:#edf2f9; }
html[data-theme="dark"] #cz-modal .cz-supervisor-option { color:#edf2f9; }
html[data-theme="dark"] #cz-modal .cz-supervisor-option:hover, html[data-theme="dark"] #cz-modal .cz-supervisor-option:focus-visible, html[data-theme="dark"] #cz-modal .cz-supervisor-option.is-selected { background:#344356; }
html[data-theme="dark"] #cz-modal .cz-supervisor-avatar { background:#31435c; color:#bcd4ff; }
html[data-theme="dark"] #cz-modal .cz-supervisor-info small, html[data-theme="dark"] #cz-modal .cz-supervisor-mark { color:#6bd99b; }
#cz-modal #cz-cancelar:hover, #cz-modal #cz-cancelar:focus-visible, #cz-modal #cz-cancelar:active { background:#c92332; border-color:#c92332; color:#fff; }
#cz-modal #cz-guardar:not(:disabled), #cz-modal #cz-guardar.is-ok:not(:disabled) { background:#f2ba22; border-color:#f2ba22; color:#241b08; }
#cz-modal #cz-guardar:not(:disabled):hover, #cz-modal #cz-guardar:not(:disabled):focus-visible { background:#ffca3a; border-color:#ffca3a; color:#241b08; }
html[data-theme="dark"] #cz-modal .cz-supervisor-select option { background:#202a39; color:#edf2f9; }
html[data-theme="dark"] #cz-modal .cz-tab { background:#202a39; border-color:#394657; color:#bdc9d9; }
html[data-theme="dark"] #cz-modal .cz-tab.is-on { background:#48232d; border-color:#ef5461; color:#ff9ba3; }
html[data-theme="dark"] #cz-modal .cz-toggle { background:#263243; border-color:#46556a; color:#d4dfed; }
html[data-theme="dark"] #cz-modal .cz-toggle.is-on { background:#087e45; border-color:#20a866; color:#fff; }
html[data-theme="dark"] #cz-modal fieldset.cz-campo { min-width:0; padding:0; border:0; }
html[data-theme="dark"] #cz-modal .cz-perm { border-color:#364253; }
html[data-theme="dark"] #cz-modal .cz-perm b { color:#e5ebf3; }
html[data-theme="dark"] #cz-modal .cz-perm small { color:#aab9cd; }
html[data-theme="dark"] #cz-modal .cz-sug:not([hidden]),
html[data-theme="dark"] #cz-modal .cz-chip { background:#263243; border-color:#46556a; color:#e5ebf3; }
html[data-theme="dark"] #cz-modal #cz-guardar:disabled { background:#364252; border-color:#46556a; color:#b6c2d1; opacity:1; }
.pan-zc-wrap .obs-zona-acc,
html[data-theme="dark"] .pan-zc-wrap .obs-zona-acc {
    background:transparent;
    border:0;
    box-shadow:none;
    padding:0;
}

/* Ficha de cuenta abierta desde el monitoreo de zonas. */
.mon-cuenta-shell .page-corporate { display:block; max-width:none; }
html body.mon-cuenta-shell .page-corporate:has(#pvDashboard) { display:block; width:100%; max-width:none; }
html body.mon-cuenta-shell .page-corporate > .corp-hero { width:100%; box-sizing:border-box; }
.mon-cuenta-shell .corp-hero { position:relative; overflow:hidden; padding:24px; margin-bottom:20px; border:1px solid #dce4ee; border-radius:18px; background:#fff; box-shadow:0 8px 24px rgba(15,23,42,.05); }
.mon-cuenta-shell .corp-hero::before, .mon-cuenta-shell .corp-hero::after { display:none; }
.mon-cuenta-shell .corp-hero-inner { position:relative; display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:20px; }
.mon-cuenta-shell .corp-hero-text h2 { margin:6px 0; color:#17233c; font-size:clamp(20px,2vw,26px); }
.mon-cuenta-shell .corp-hero-text p { color:#64748b; }
.mon-cuenta-shell .corp-hero-actions .chip { padding:6px 10px; border:1px solid #dce4ee; border-radius:9px; background:#f5f8fc; color:#334155; }
.mon-cuenta-shell .pv-kpi-grid, .mon-cuenta-shell .corp-kpis { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.mon-cuenta-shell .pv-kpi { min-height:130px; padding:16px; border-radius:14px; }
.mon-cuenta-shell .pv-kpi:hover { transform:none; }
.mon-cuenta-shell .corp-card { margin-bottom:20px; border:1px solid #dce4ee; border-radius:16px; background:#fff; box-shadow:0 6px 20px rgba(15,23,42,.04); }
.mon-cuenta-shell .corp-table-card { padding:20px; }
.mon-cuenta-shell .corp-card-head h3 { color:#17233c; }
.mon-cuenta-shell .mon-conv { border-left-color:#cbd5e1; background:#f5f8fc; }
html[data-theme="dark"] .mon-cuenta-shell :is(.corp-hero,.corp-card) { background:#191e27; border-color:#303b4b; box-shadow:none; }
html[data-theme="dark"] .mon-cuenta-shell .corp-hero-text h2, html[data-theme="dark"] .mon-cuenta-shell .corp-card-head h3 { color:#edf2f9; }
html[data-theme="dark"] .mon-cuenta-shell .corp-hero-text p { color:#b0bed0; }
html[data-theme="dark"] .mon-cuenta-shell .corp-kicker { color:#b8c7d9; }
html[data-theme="dark"] .mon-cuenta-shell .corp-hero-actions .chip { background:#263243; border-color:#3a4b60; color:#d6e1ef; }
html[data-theme="dark"] .mon-cuenta-shell .pv-kpi { background:#202938; border-color:#354356; color:#edf2f9; box-shadow:none; }
html[data-theme="dark"] .mon-cuenta-shell .pv-kpi-bottom { color:#b1c0d2; }
html[data-theme="dark"] .mon-cuenta-shell .mon-conv { background:#232e3e; border-left-color:#53657c; color:#e0e8f2; }
html[data-theme="dark"] .mon-cuenta-shell .mon-conv-meta b { color:#edf2f9; }
@media(max-width:820px) { .mon-cuenta-shell .pv-kpi-grid, .mon-cuenta-shell .corp-kpis { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:520px) { .mon-cuenta-shell .corp-hero, .mon-cuenta-shell .corp-table-card { padding:16px; } .mon-cuenta-shell .pv-kpi-grid, .mon-cuenta-shell .corp-kpis { grid-template-columns:1fr; } }
html[data-theme="dark"] .admin-dashboard .dashboard-panel-title .badge-envivo { background:transparent; color:#ff5d69; }
html[data-theme="dark"] .chart-refresh-btn { background:#252e3b; border-color:#465365; color:#ccd6e3; }
html[data-theme="dark"] .chart-refresh-btn:hover { background:#303c4d; border-color:#ff858d; color:#ff9da4; }
html[data-theme="dark"] .chart-refresh-btn:focus-visible { outline:2px solid #a8caff; outline-offset:2px; }
html[data-theme="dark"] .dash-compact .chart-switch-btn { color:#d9e2ed; background:#252d39; border-color:#414d5c; }
html[data-theme="dark"] .dash-compact .chart-switch-btn:hover,
html[data-theme="dark"] .dash-compact .chart-switch[data-open] .chart-switch-btn { background:#313c4a; color:#f2f5fa; border-color:#627185; }
html[data-theme="dark"] .dash-compact .chart-switch-menu { background:#222a36; border-color:#465264; }
html[data-theme="dark"] .dash-compact .chart-switch-menu button { color:#e2e8f0; }
html[data-theme="dark"] .dash-compact .chart-switch-menu button:hover { background:#344052; }
html[data-theme="dark"] .dash-compact .chart-switch-menu button.is-active { background:#364252; color:#f2f5fa; }
@media (prefers-reduced-motion: reduce) {
    html[data-theme="dark"] .sidebar .sidebar-link { transition:none; }
}
