/**
 * @package FacturaScripts
 * @author Carlos Moreno Gil <carlosmorenogil@gmail.com>
 * @description Hoja de estilos premium del tema Zolteka con variables de color e interactividad
 */

:root {
    /* 1. Colores corporativos base (Zolteka Emerald por defecto) */
    --v-primary: #10B981;
    --v-primary-rgb: 16, 185, 129;
    --v-primary-hover: #0D9488;
    --v-secondary: #475569;
    --v-bg-light: #F8FAFC;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #0F172A;
    --v-bg-dark-rgb: 15, 23, 42;
    --v-text: #475569;
    --v-heading-color: #0F172A;
    --v-text-muted: #94A3B8;
    --v-accent: #0D9488;
    --v-dark-accent: #2dd4bf;
    --v-dark-accent-rgb: 45, 212, 191;
    --v-icon-standard: #64748B;
    --v-icon-emerald: #10B981;
    --v-icon-security: #B08D57;
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(16, 185, 129, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);

    /* Bordes y tamaños dinámicos */
    --zolteka-radius-card: 12px;
    --zolteka-radius-btn: 8px;
    --zolteka-radius-input: 6px;

    /* Bootstrap Expose & Semantic Tokens */
    --bs-primary: var(--v-primary);
    --bs-primary-rgb: var(--v-primary-rgb);
    --bs-secondary: var(--v-secondary);
    --bs-secondary-rgb: 71, 85, 105;
    --bs-body-bg: #FFFFFF;
    --bs-secondary-bg: var(--v-bg-secondary);
    --bs-tertiary-bg: var(--v-bg-secondary);
    --bs-body-color: var(--v-text);
    --bs-heading-color: var(--v-heading-color);
    --bs-link-color: var(--v-primary);
    --bs-link-color-rgb: var(--v-primary-rgb);
    --bs-link-hover-color: var(--v-primary-hover);
    --bs-border-color: #E2E8F0;
    --bs-box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --bs-border-radius: var(--zolteka-radius-input, 6px);
    --bs-border-radius-sm: calc(var(--zolteka-radius-input, 6px) * 0.75);
    --bs-border-radius-lg: calc(var(--zolteka-radius-input, 6px) * 1.25);
    --bs-btn-border-radius: var(--zolteka-radius-btn, 8px);
    --bs-btn-border-radius-sm: calc(var(--zolteka-radius-btn, 8px) * 0.75);
    --bs-btn-border-radius-lg: calc(var(--zolteka-radius-btn, 8px) * 1.25);
    --bs-focus-ring-color: rgba(var(--bs-primary-rgb), 0.25);
    --bs-primary-bg-subtle: rgba(var(--bs-primary-rgb), 0.12);
    --bs-primary-border-subtle: rgba(var(--bs-primary-rgb), 0.25);
    --bs-primary-text-emphasis: var(--v-primary-hover, var(--v-primary));
    --bs-secondary-bg-subtle: rgba(108, 117, 125, 0.12);
    --bs-secondary-border-subtle: rgba(108, 117, 125, 0.25);
    --bs-secondary-text-emphasis: var(--v-secondary, #475569);
    --bs-table-hover-bg: rgba(var(--bs-primary-rgb), 0.035);
    --bs-table-active-bg: rgba(var(--bs-primary-rgb), 0.07);

    /* Componentes FacturaScripts: Tarjetas blancas impolutas y paneles secundarios tintados */
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #FFFFFF;
    --theme-sidebar-text: var(--v-secondary);
    --theme-sidebar-brand-text: var(--v-heading-color);
    --theme-input-focus-border: var(--v-primary);
    --theme-dropdown-hover-bg: rgba(16, 185, 129, 0.08);

    /* Menú vertical: ancho abierto y ancho del carril de iconos (2.24) */
    --zolteka-menu-ancho: 280px;
    --zolteka-carril-ancho: 72px;
    /* Texto apagado sobre menú oscuro (contraste ≈ 6,9:1 sobre #0F172A) */
    --zolteka-menu-apagado-oscuro: #ABAEB5;
}

/*
 * Tokens del menú derivados del tema (2.24). Se declaran en body y no en :root
 * porque los temas redefinen --v-* y --theme-sidebar-* en body.zolteka-theme-*:
 * en :root se resolverían con los valores por defecto. 2.27: también en los contenedores con
 * clase de tema fuera de un body con tema (login, vista previa de LoginZolteka), para que los
 * tokens derivados se recalculen con los colores de ese tema.
 */
body,
[class*="zolteka-theme-"] {
    --zolteka-menu-divisor: var(--bs-border-color);
    --zolteka-menu-apagado: var(--theme-sidebar-text);
    --zolteka-menu-campo-bg: color-mix(in srgb, var(--theme-sidebar-text) 6%, var(--theme-sidebar-bg));

    /*
     * 2.27 · Contraste por tema (README «Contraste por tema»). Valores por defecto; cada tema
     * los concreta en su bloque. --v-primary solo pinta rellenos; para escribir se usan estos:
     *  - --zolteka-acento-texto: el primario como TEXTO sobre blanco o tinte claro (≥ 4,6:1).
     *  - --zolteka-primary-relleno / -relleno-hover: relleno de los botones primarios (cyber lo oscurece un 5%).
     *  - --zolteka-primary-contraste: texto sobre ese relleno (blanco o #0F172A, el que más contraste da).
     *  - --zolteka-acento-contraste: texto sobre el color de acento (--v-accent).
     *  - --zolteka-texto-contenido: texto del contenido; el gris del menú oscuro se queda en el menú.
     *  - --zolteka-menu-texto / --zolteka-menu-acento: texto y acento SOBRE el fondo del menú.
     */
    --zolteka-acento-texto: var(--v-primary);
    --zolteka-acento-texto-rgb: var(--v-primary-rgb);
    --zolteka-primary-relleno: var(--v-primary);
    --zolteka-primary-relleno-hover: var(--v-primary-hover);
    --zolteka-primary-contraste: #FFFFFF;
    --zolteka-acento-contraste: #FFFFFF;
    --zolteka-texto-contenido: var(--v-secondary);
    --zolteka-menu-texto: var(--theme-sidebar-text);
    --zolteka-menu-acento: var(--zolteka-acento-texto);

    /* 2.27 · C1 + C5: Bootstrap sigue al tema (en :root se resolverían en esmeralda para todos) */
    --bs-link-color: var(--zolteka-acento-texto);
    --bs-link-color-rgb: var(--zolteka-acento-texto-rgb);
    --bs-link-hover-color: color-mix(in srgb, var(--zolteka-acento-texto) 85%, #000000);
    --bs-link-hover-color-rgb: var(--zolteka-acento-texto-rgb);
    --bs-primary-text-emphasis: var(--zolteka-acento-texto);
    --bs-primary-bg-subtle: rgba(var(--v-primary-rgb), 0.12);
    --bs-primary-border-subtle: rgba(var(--v-primary-rgb), 0.25);
    --bs-focus-ring-color: rgba(var(--v-primary-rgb), 0.25);
}

/* Temas con menú oscuro: separadores suaves y texto apagado legible */
body.zolteka-theme-zolteka_dark,
body.zolteka-theme-prestige,
body.zolteka-theme-cyber,
body.zolteka-theme-crimson,
body.zolteka-theme-serenity,
body.zolteka-theme-blaze,
body.zolteka-theme-nexus {
    --zolteka-menu-divisor: color-mix(in srgb, var(--theme-sidebar-text) 12%, transparent);
    --zolteka-menu-apagado: var(--zolteka-menu-apagado-oscuro);
}

body.zolteka-theme-zolteka,
.zolteka-theme-zolteka {
    --v-primary: #10B981;
    --v-primary-rgb: 16, 185, 129;
    --v-primary-hover: #0D9488;
    --v-accent: #0D9488;
    --v-bg-dark: #0F172A;
    --v-bg-dark-rgb: 15, 23, 42;
    --bs-primary: #10B981;
    --bs-primary-rgb: 16, 185, 129;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --theme-card-bg: #FFFFFF;
    --theme-input-focus-border: #10B981;
    --theme-dropdown-hover-bg: rgba(16, 185, 129, 0.08);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(16, 185, 129, 0.85) 0%, rgba(15, 23, 42, 0.95) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: #10705A;
    --zolteka-acento-texto-rgb: 16, 112, 90;
    --zolteka-primary-contraste: #0F172A;
    --zolteka-acento-contraste: #0F172A;
    --zolteka-primary-relleno-hover: color-mix(in srgb, var(--v-primary) 85%, #FFFFFF);
}

body.zolteka-theme-default,
.zolteka-theme-default {
    --v-primary: #0d6efd;
    --v-primary-rgb: 13, 110, 253;
    --v-primary-hover: #0b5ed7;
    --v-secondary: #6c757d;
    --v-bg-light: #f8f9fa;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #212529;
    --v-bg-dark-rgb: 33, 37, 41;
    --v-text: #212529;
    --v-heading-color: #212529;
    --v-text-muted: #6c757d;
    --v-accent: #0d6efd;
    --v-dark-accent: #6ea8fe;
    --v-dark-accent-rgb: 110, 168, 254;
    --bs-primary: #0d6efd;
    --bs-primary-rgb: 13, 110, 253;
    --theme-card-bg: #FFFFFF;
    --theme-input-focus-border: #86b7fe;
    --theme-dropdown-hover-bg: rgba(13, 110, 253, 0.08);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(13, 110, 253, 0.85) 0%, rgba(33, 37, 41, 0.95) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: #0C62E1;
    --zolteka-acento-texto-rgb: 12, 98, 225;
    --zolteka-primary-contraste: #FFFFFF;
    --zolteka-acento-contraste: #FFFFFF;
    --zolteka-texto-contenido: #495057;
    --zolteka-menu-acento: #FFFFFF;
    --zolteka-menu-texto: #FFFFFF;
}

body.zolteka-theme-zolteka_dark,
.zolteka-theme-zolteka_dark {
    --v-primary: #10B981;
    --v-primary-rgb: 16, 185, 129;
    --v-primary-hover: #0D9488;
    --v-secondary: #94A3B8;
    --v-bg-light: #F8FAFC;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #020617;
    --v-bg-dark-rgb: 2, 6, 23;
    --v-text: #475569;
    --v-heading-color: #0F172A;
    --v-text-muted: #64748B;
    --v-accent: #2DD4BF;
    --v-dark-accent: #2dd4bf;
    --v-dark-accent-rgb: 45, 212, 191;
    --bs-primary: #10B981;
    --bs-primary-rgb: 16, 185, 129;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #0F172A;
    --theme-sidebar-text: #FFFFFF;
    --theme-sidebar-brand-text: #FFFFFF;
    --theme-dropdown-hover-bg: rgba(45, 212, 191, 0.12);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(16, 185, 129, 0.85) 0%, rgba(2, 6, 23, 0.95) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: #0B7C56;
    --zolteka-acento-texto-rgb: 11, 124, 86;
    --zolteka-primary-contraste: #0F172A;
    --zolteka-acento-contraste: #0F172A;
    --zolteka-primary-relleno-hover: color-mix(in srgb, var(--v-primary) 85%, #FFFFFF);
    --zolteka-texto-contenido: #475569;
    --zolteka-menu-acento: var(--v-primary);
}

body.zolteka-theme-prestige,
.zolteka-theme-prestige {
    --v-primary: #B08D57;
    --v-primary-rgb: 176, 141, 87;
    --v-primary-hover: #967444;
    --v-secondary: #94A3B8;
    --v-bg-light: #F8FAFC;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #12100B;
    --v-bg-dark-rgb: 18, 16, 11;
    --v-text: #475569;
    --v-heading-color: #0F172A;
    --v-text-muted: #64748B;
    --v-accent: #D4AF37;
    --v-dark-accent: #E5C378;
    --v-dark-accent-rgb: 229, 195, 120;
    --bs-primary: #B08D57;
    --bs-primary-rgb: 176, 141, 87;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #12100B;
    --theme-sidebar-text: #FFFFFF;
    --theme-sidebar-brand-text: #FFFFFF;
    --theme-input-focus-border: #B08D57;
    --theme-dropdown-hover-bg: rgba(176, 141, 87, 0.12);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(176, 141, 87, 0.90) 0%, rgba(18, 16, 11, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: #826840;
    --zolteka-acento-texto-rgb: 130, 104, 64;
    --zolteka-primary-contraste: #0F172A;
    --zolteka-acento-contraste: #0F172A;
    --zolteka-primary-relleno-hover: color-mix(in srgb, var(--v-primary) 85%, #FFFFFF);
    --zolteka-texto-contenido: #475569;
    --zolteka-menu-acento: var(--v-primary);
}

body.zolteka-theme-cyber,
.zolteka-theme-cyber {
    --v-primary: #8B5CF6;
    --v-primary-rgb: 139, 92, 246;
    --v-primary-hover: #7C3AED;
    --v-secondary: #94A3B8;
    --v-bg-light: #F8FAFC;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #0F0C1B;
    --v-bg-dark-rgb: 15, 12, 27;
    --v-text: #475569;
    --v-heading-color: #0F172A;
    --v-text-muted: #64748B;
    --v-accent: #EC4899;
    --v-accent-rgb: 236, 72, 153;
    --v-dark-accent: #EC4899;
    --v-dark-accent-rgb: 236, 72, 153;
    --bs-primary: #8B5CF6;
    --bs-primary-rgb: 139, 92, 246;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #0F0C1B;
    --theme-sidebar-text: #FFFFFF;
    --theme-sidebar-brand-text: #FFFFFF;
    --theme-input-focus-border: #8B5CF6;
    --theme-dropdown-hover-bg: rgba(139, 92, 246, 0.12);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(139, 92, 246, 0.90) 0%, rgba(15, 12, 27, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: #7950D6;
    --zolteka-acento-texto-rgb: 121, 80, 214;
    --zolteka-primary-contraste: #FFFFFF;
    --zolteka-acento-contraste: #0F172A;
    --zolteka-primary-relleno: #8457EA;
    --zolteka-texto-contenido: #475569;
    --zolteka-menu-acento: #986EF7;
}

body.zolteka-theme-crimson,
.zolteka-theme-crimson {
    --v-primary: #E11D48;
    --v-primary-rgb: 225, 29, 72;
    --v-primary-hover: #BE123C;
    --v-secondary: #94A3B8;
    --v-bg-light: #FAFAFA;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #334155;
    --v-bg-dark-rgb: 51, 65, 85;
    --v-text: #475569;
    --v-heading-color: #0F172A;
    --v-text-muted: #64748B;
    --v-accent: #E11D48;
    --v-accent-rgb: 225, 29, 72;
    --v-dark-accent: #FB7185;
    --v-dark-accent-rgb: 251, 113, 133;
    --bs-primary: #E11D48;
    --bs-primary-rgb: 225, 29, 72;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #334155;
    --theme-sidebar-text: #FFFFFF;
    --theme-sidebar-brand-text: #FFFFFF;
    --theme-input-focus-border: #E11D48;
    --theme-dropdown-hover-bg: rgba(225, 29, 72, 0.12);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(225, 29, 72, 0.90) 0%, rgba(51, 65, 85, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: #CB1A41;
    --zolteka-acento-texto-rgb: 203, 26, 65;
    --zolteka-primary-contraste: #FFFFFF;
    --zolteka-acento-contraste: #FFFFFF;
    --zolteka-texto-contenido: #475569;
    --zolteka-menu-acento: #F4AEBD;
}

body.zolteka-theme-serenity,
.zolteka-theme-serenity {
    --v-primary: #2DD4BF;
    --v-primary-rgb: 45, 212, 191;
    --v-primary-hover: #14B8A6;
    --v-secondary: #475569;
    --v-bg-light: #F0FDFA;
    --v-bg-secondary: color-mix(in srgb, #2DD4BF 6%, #F0FDFA);
    --v-bg-dark: #134E4A;
    --v-bg-dark-rgb: 19, 78, 74;
    --v-text: #134E4A;
    --v-heading-color: #134E4A;
    --v-text-muted: #64748B;
    --v-accent: #2DD4BF;
    --v-dark-accent: #2DD4BF;
    --v-dark-accent-rgb: 45, 212, 191;
    --bs-primary: #14B8A6;
    --bs-primary-rgb: 20, 184, 166;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #134E4A;
    --theme-sidebar-text: #F0FDFA;
    --theme-sidebar-brand-text: #FFFFFF;
    --theme-input-focus-border: #2DD4BF;
    --theme-dropdown-hover-bg: rgba(45, 212, 191, 0.12);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(45, 212, 191, 0.90) 0%, rgba(19, 78, 74, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: #1A7B6F;
    --zolteka-acento-texto-rgb: 26, 123, 111;
    --zolteka-primary-contraste: #0F172A;
    --zolteka-acento-contraste: #0F172A;
    --zolteka-primary-relleno-hover: color-mix(in srgb, var(--v-primary) 85%, #FFFFFF);
    --zolteka-menu-acento: #5DDECE;
    /* Usuario de la cabecera del menú: el gris apagado común daba 4,27:1 sobre este verde */
    --zolteka-menu-apagado: color-mix(in srgb, var(--theme-sidebar-text) 80%, var(--theme-sidebar-bg));
}

body.zolteka-theme-blaze,
.zolteka-theme-blaze {
    --v-primary: #FF5F1F;
    --v-primary-rgb: 255, 95, 31;
    --v-primary-hover: #E04E12;
    --v-secondary: #94A3B8;
    --v-bg-light: #FAFAFA;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #000000;
    --v-bg-dark-rgb: 0, 0, 0;
    --v-text: #475569;
    --v-heading-color: #0F172A;
    --v-text-muted: #64748B;
    --v-accent: #FF5F1F;
    --v-accent-rgb: 255, 95, 31;
    --v-dark-accent: #FF7A45;
    --v-dark-accent-rgb: 255, 122, 69;
    --bs-primary: #FF5F1F;
    --bs-primary-rgb: 255, 95, 31;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #000000;
    --theme-sidebar-text: #FFFFFF;
    --theme-sidebar-brand-text: #FFFFFF;
    --theme-input-focus-border: #FF5F1F;
    --theme-dropdown-hover-bg: rgba(255, 95, 31, 0.12);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(255, 95, 31, 0.90) 0%, rgba(0, 0, 0, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: #BA4517;
    --zolteka-acento-texto-rgb: 186, 69, 23;
    --zolteka-primary-contraste: #0F172A;
    --zolteka-acento-contraste: #0F172A;
    --zolteka-primary-relleno-hover: color-mix(in srgb, var(--v-primary) 85%, #FFFFFF);
    --zolteka-texto-contenido: #475569;
    --zolteka-menu-acento: var(--v-primary);
}

body.zolteka-theme-nexus,
.zolteka-theme-nexus {
    --v-primary: #4F46E5;
    --v-primary-rgb: 79, 70, 229;
    --v-primary-hover: #4338CA;
    --v-secondary: #94A3B8;
    --v-bg-light: #F8FAFC;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #0F172A;
    --v-bg-dark-rgb: 15, 23, 42;
    --v-text: #475569;
    --v-heading-color: #0F172A;
    --v-text-muted: #64748B;
    --v-accent: #06B6D4;
    --v-accent-rgb: 6, 182, 212;
    --v-dark-accent: #22D3EE;
    --v-dark-accent-rgb: 34, 211, 238;
    --bs-primary: #4F46E5;
    --bs-primary-rgb: 79, 70, 229;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #0F172A;
    --theme-sidebar-text: #FFFFFF;
    --theme-sidebar-brand-text: #FFFFFF;
    --theme-input-focus-border: #4F46E5;
    --theme-dropdown-hover-bg: rgba(79, 70, 229, 0.12);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(79, 70, 229, 0.90) 0%, rgba(15, 23, 42, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: var(--v-primary);
    --zolteka-acento-texto-rgb: var(--v-primary-rgb);
    --zolteka-primary-contraste: #FFFFFF;
    --zolteka-acento-contraste: #0F172A;
    --zolteka-texto-contenido: #475569;
    --zolteka-menu-acento: #8B85EE;
}

body.zolteka-theme-zen,
.zolteka-theme-zen {
    --v-primary: #52796F;
    --v-primary-rgb: 82, 121, 111;
    --v-primary-hover: #3F6259;
    --v-secondary: #2F3E46;
    --v-bg-light: #F8F9FA;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #2F3E46;
    --v-bg-dark-rgb: 47, 62, 70;
    --v-text: #2F3E46;
    --v-heading-color: #2F3E46;
    --v-text-muted: #64748B;
    --v-accent: #84A98C;
    --v-dark-accent: #84A98C;
    --v-dark-accent-rgb: 132, 169, 140;
    --bs-primary: #52796F;
    --bs-primary-rgb: 82, 121, 111;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #FFFFFF;
    --theme-sidebar-text: #2F3E46;
    --theme-sidebar-brand-text: #2F3E46;
    --theme-input-focus-border: #52796F;
    --theme-dropdown-hover-bg: rgba(82, 121, 111, 0.12);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(82, 121, 111, 0.90) 0%, rgba(47, 62, 70, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: #4D7268;
    --zolteka-acento-texto-rgb: 77, 114, 104;
    --zolteka-primary-contraste: #FFFFFF;
    --zolteka-acento-contraste: #0F172A;
}

body.zolteka-theme-zafiro,
.zolteka-theme-zafiro {
    --v-primary: #1E3A8A;
    --v-primary-rgb: 30, 58, 138;
    --v-primary-hover: #172554;
    --v-secondary: #475569;
    --v-bg-light: #F8FAFC;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #0F172A;
    --v-bg-dark-rgb: 15, 23, 42;
    --v-text: #334155;
    --v-heading-color: #0F172A;
    --v-text-muted: #64748B;
    --v-accent: #2563EB;
    --v-accent-rgb: 37, 99, 235;
    --v-dark-accent: #60A5FA;
    --v-dark-accent-rgb: 96, 165, 250;
    --bs-primary: #1E3A8A;
    --bs-primary-rgb: 30, 58, 138;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #FFFFFF;
    --theme-sidebar-text: #475569;
    --theme-sidebar-brand-text: #0F172A;
    --theme-input-focus-border: #1E3A8A;
    --theme-dropdown-hover-bg: rgba(30, 58, 138, 0.08);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(30, 58, 138, 0.90) 0%, rgba(15, 23, 42, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: var(--v-primary);
    --zolteka-acento-texto-rgb: var(--v-primary-rgb);
    --zolteka-primary-contraste: #FFFFFF;
    --zolteka-acento-contraste: #FFFFFF;
}

body.zolteka-theme-nord,
.zolteka-theme-nord {
    --v-primary: #475569;
    --v-primary-rgb: 71, 85, 105;
    --v-primary-hover: #334155;
    --v-secondary: #64748B;
    --v-bg-light: #F8FAFC;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #1E293B;
    --v-bg-dark-rgb: 30, 41, 59;
    --v-text: #334155;
    --v-heading-color: #0F172A;
    --v-text-muted: #94A3B8;
    --v-accent: #64748B;
    --v-accent-rgb: 100, 116, 139;
    --v-dark-accent: #94A3B8;
    --v-dark-accent-rgb: 148, 163, 184;
    --bs-primary: #475569;
    --bs-primary-rgb: 71, 85, 105;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #FFFFFF;
    --theme-sidebar-text: #475569;
    --theme-sidebar-brand-text: #0F172A;
    --theme-input-focus-border: #475569;
    --theme-dropdown-hover-bg: rgba(71, 85, 105, 0.08);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(71, 85, 105, 0.90) 0%, rgba(30, 41, 59, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: var(--v-primary);
    --zolteka-acento-texto-rgb: var(--v-primary-rgb);
    --zolteka-primary-contraste: #FFFFFF;
    --zolteka-acento-contraste: #FFFFFF;
    --zolteka-texto-contenido: #475569;
}

body.zolteka-theme-terra,
.zolteka-theme-terra {
    --v-primary: #B45309;
    --v-primary-rgb: 180, 83, 9;
    --v-primary-hover: #92400E;
    --v-secondary: #78350F;
    --v-bg-light: #FFFCF9;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #FFFBEB);
    --v-bg-dark: #431407;
    --v-bg-dark-rgb: 67, 20, 7;
    --v-text: #431407;
    --v-heading-color: #431407;
    --v-text-muted: #92400E;
    --v-accent: #D97706;
    --v-accent-rgb: 217, 119, 6;
    --v-dark-accent: #F59E0B;
    --v-dark-accent-rgb: 245, 158, 11;
    --bs-primary: #B45309;
    --bs-primary-rgb: 180, 83, 9;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #FEF9EE;
    --theme-sidebar-text: #431407;
    --theme-sidebar-brand-text: #431407;
    --theme-input-focus-border: #B45309;
    --theme-dropdown-hover-bg: rgba(180, 83, 9, 0.08);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(180, 83, 9, 0.90) 0%, rgba(67, 20, 7, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: #AB4F09;
    --zolteka-acento-texto-rgb: 171, 79, 9;
    --zolteka-primary-contraste: #FFFFFF;
    --zolteka-acento-contraste: #0F172A;
}

body.zolteka-theme-pergamino,
.zolteka-theme-pergamino {
    --v-primary: #2C3E50;
    --v-primary-rgb: 44, 62, 80;
    --v-primary-hover: #1A252F;
    --v-secondary: #7F8C8D;
    --v-bg-light: #FDFBF7;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #1A252F;
    --v-bg-dark-rgb: 26, 37, 47;
    --v-text: #2C3E50;
    --v-heading-color: #2C3E50;
    --v-text-muted: #7F8C8D;
    --v-accent: #7F8C8D;
    --v-accent-rgb: 127, 140, 141;
    --v-dark-accent: #34495E;
    --v-dark-accent-rgb: 52, 73, 94;
    --bs-primary: #2C3E50;
    --bs-primary-rgb: 44, 62, 80;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #FDFBF7;
    --theme-sidebar-text: #2C3E50;
    --theme-sidebar-brand-text: #2C3E50;
    --theme-input-focus-border: #2C3E50;
    --theme-dropdown-hover-bg: rgba(44, 62, 80, 0.08);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(44, 62, 80, 0.90) 0%, rgba(26, 37, 47, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: var(--v-primary);
    --zolteka-acento-texto-rgb: var(--v-primary-rgb);
    --zolteka-primary-contraste: #FFFFFF;
    --zolteka-acento-contraste: #0F172A;
    --zolteka-texto-contenido: #626C6D;
}

body.zolteka-theme-kinetic,
.zolteka-theme-kinetic {
    --v-primary: #F97316;
    --v-primary-rgb: 249, 115, 22;
    --v-primary-hover: #EA580C;
    --v-secondary: #334155;
    --v-bg-light: #F8FAFC;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 3.5%, #F1F5F9);
    --v-bg-dark: #1E293B;
    --v-bg-dark-rgb: 30, 41, 59;
    --v-text: #334155;
    --v-heading-color: #0F172A;
    --v-text-muted: #64748B;
    --v-accent: #3B82F6;
    --v-accent-rgb: 59, 130, 246;
    --v-dark-accent: #60A5FA;
    --v-dark-accent-rgb: 96, 165, 250;
    --bs-primary: #F97316;
    --bs-primary-rgb: 249, 115, 22;
    --theme-card-bg: #FFFFFF;
    --theme-sidebar-bg: #FFFFFF;
    --theme-sidebar-text: #334155;
    --theme-sidebar-brand-text: #0F172A;
    --theme-input-focus-border: #F97316;
    --theme-dropdown-hover-bg: rgba(249, 115, 22, 0.08);
    --zolteka-overlay-gradient: linear-gradient(135deg, rgba(249, 115, 22, 0.90) 0%, rgba(30, 41, 59, 0.98) 100%);
    /* 2.27 · Contraste (tabla §3 del informe): texto del primario, texto sobre rellenos y acento */
    --zolteka-acento-texto: #AE510F;
    --zolteka-acento-texto-rgb: 174, 81, 15;
    --zolteka-primary-contraste: #0F172A;
    --zolteka-acento-contraste: #0F172A;
    --zolteka-primary-relleno-hover: color-mix(in srgb, var(--v-primary) 85%, #FFFFFF);
}


/*
 * Lienzo estándar de FacturaScripts: body y listados en blanco.
 * Solo .bg-light.pt-3 (pestañas) lleva el tintado. PROHIBIDO min-height
 * en ese div y PROHIBIDO pintar body o .tab-content con --v-bg-secondary:
 * el listado vive fuera y se ve un fondo distinto (Proyectos, Clientes, Logs).
 */
div.bg-light.pt-3,
.nav-tabs-wrapper {
    background-color: var(--v-bg-secondary) !important;
}

.tab-content,
.tab-pane,
.card,
.card-body,
.table-responsive {
    background-color: var(--bs-body-bg, #FFFFFF) !important;
}

/* Bloquear forzado de modo oscuro de navegador/sistema y garantizar esquema claro en el contenido */
:root,
body,
html {
    color-scheme: light !important;
}

.dark-mode,
[data-bs-theme="dark"] {
    color-scheme: light !important;
    --bs-body-bg: #1E293B !important;
    --bs-body-color: #F8FAFC !important;
    --v-bg-secondary: color-mix(in srgb, var(--v-primary) 10%, #0F172A) !important;
    --bs-tertiary-bg: var(--v-bg-secondary) !important;
    --bs-secondary-bg: var(--v-bg-secondary) !important;
    --theme-card-bg: #0F172A !important;
    --theme-sidebar-bg: #0F172A !important;
    --theme-sidebar-text: #FFFFFF !important;
    --theme-sidebar-brand-text: #FFFFFF !important;
    --theme-dropdown-hover-bg: rgba(45, 212, 191, 0.12) !important;
}

/* 3. Micro-diseños de Interactividad Premium */

/* Efecto de foco en inputs de formulario */
.form-control,
.form-select {
    border-radius: var(--zolteka-radius-input) !important;
}

.form-control:focus,
.form-select:focus {
    /* 2.27 · C1 (Z6): el borde del campo con foco es un indicador de estado (≥ 3:1 sobre blanco). Con
       --theme-input-focus-border se quedaba en 1,86-2,80:1 (default #86B7FE, zolteka, serenity, kinetic, custom);
       el tono legible del primario da ≥ 4,6:1 en todos. --theme-input-focus-border se conserva para otros plugins */
    border-color: var(--zolteka-acento-texto, var(--theme-input-focus-border)) !important;
    /* 2.27 · C5: la sombra sigue al tema (antes esmeralda fija en todos) */
    box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color) !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Redondeado moderno y sombras premium en tarjetas.
 * Sin overflow:hidden: los ListView (Colores/Imprimir) viven en .card y el
 * dropdown absolute se recortaría. Clip solo en widgets decorativos propios. */
.card {
    background-color: var(--theme-card-bg) !important;
    border: 1px solid var(--bs-border-color) !important;
    border-radius: var(--zolteka-radius-card) !important;
    overflow: visible;
    box-shadow: var(--bs-box-shadow) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05) !important;
}

/* Unificar bordes redondeados y transiciones en todos los botones */
.btn {
    border-radius: var(--zolteka-radius-btn) !important;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* Barra superior Edit/Panel: separación al wrapear botones (Core no pone gap-y) */
.container-fluid.d-print-none > .row > .col.pb-2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.25rem;
    row-gap: 0.35rem;
}

.container-fluid.d-print-none > .row > .col.pb-2 > nav[aria-label="breadcrumb"] {
    flex: 0 0 100%;
}

/* Pie EditView: .col / .col.text-center de row-actions (Core) tampoco tiene gap-y al wrap */
.card-footer .row.g-2 > div.col,
form .card-footer .row.g-2 > div.col {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    column-gap: 0.25rem;
    row-gap: 0.35rem;
}

/* btn-group: empalme clásico sin redondeo en uniones internas */
.btn-group > .btn:not(:first-child),
.btn-group > .btn-group:not(:first-child) > .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.btn-group > .btn:not(:last-child):not(.dropdown-toggle),
.btn-group > .btn.dropdown-toggle-split:first-child,
.btn-group > .btn-group:not(:last-child) > .btn {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle),
.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.btn-group > .btn:last-child:not(:first-child),
.btn-group > .btn-group:last-child:not(:first-child) > .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.btn-group > .btn:only-child,
.btn-group > .btn-group:only-child > .btn {
    border-radius: var(--zolteka-radius-btn) !important;
}

/* btn-group-vertical: empalme sin redondeo en uniones internas */
.btn-group-vertical > .btn:not(:first-child),
.btn-group-vertical > .btn-group:not(:first-child) > .btn {
    border-top-left-radius: 0 !important;
    border-top-right-radius: 0 !important;
}

.btn-group-vertical > .btn:not(:last-child),
.btn-group-vertical > .btn-group:not(:last-child) > .btn {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.btn-group-vertical > .btn:only-child,
.btn-group-vertical > .btn-group:only-child > .btn {
    border-radius: var(--zolteka-radius-btn) !important;
}

/* input-group: empalme clásico sin redondeo en uniones internas */
.input-group > .form-control:not(:first-child),
.input-group > .form-select:not(:first-child),
.input-group > .input-group-text:not(:first-child),
.input-group > .btn:not(:first-child),
.input-group > .btn-group:not(:first-child) > .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > .form-control:not(:last-child),
.input-group > .form-select:not(:last-child),
.input-group > .input-group-text:not(:last-child),
.input-group > .btn:not(:last-child):not(.dropdown-toggle),
.input-group > .btn.dropdown-toggle-split:first-child,
.input-group > .btn-group:not(:last-child) > .btn {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > .form-control:first-child:not(:last-child),
.input-group > .form-select:first-child:not(:last-child),
.input-group > .input-group-text:first-child:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.input-group > .form-control:last-child:not(:first-child),
.input-group > .form-select:last-child:not(:first-child),
.input-group > .input-group-text:last-child:not(:first-child),
.input-group > .btn:last-child:not(:first-child),
.input-group > .btn-group:last-child:not(:first-child) > .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > .form-control:only-child,
.input-group > .form-select:only-child,
.input-group > .input-group-text:only-child {
    border-radius: var(--zolteka-radius-input) !important;
}

.input-group > .btn:only-child,
.input-group > .btn-group:only-child > .btn {
    border-radius: var(--zolteka-radius-btn) !important;
}

/* Botón primario interactivo. 2.27 · C2: relleno del tema y texto que más contrasta con él */
.btn-primary {
    background-color: var(--zolteka-primary-relleno) !important;
    border-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
    font-weight: 500;
    border-radius: var(--zolteka-radius-btn) !important;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--zolteka-primary-relleno-hover) !important;
    border-color: var(--zolteka-primary-relleno-hover) !important;
    color: var(--zolteka-primary-contraste) !important;
}

body.zolteka-theme-cyber .btn-primary,
body.zolteka-theme-crimson .btn-primary,
body.zolteka-theme-blaze .btn-primary,
body.zolteka-theme-nexus .btn-primary,
body.zolteka-theme-zen .btn-primary,
body.zolteka-theme-zafiro .btn-primary,
body.zolteka-theme-nord .btn-primary,
body.zolteka-theme-terra .btn-primary,
body.zolteka-theme-pergamino .btn-primary,
body.zolteka-theme-kinetic .btn-primary {
    background-color: var(--zolteka-primary-relleno) !important;
    border-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
    font-weight: 600;
}

body.zolteka-theme-cyber .btn-primary:hover,
body.zolteka-theme-cyber .btn-primary:focus,
body.zolteka-theme-cyber .btn-primary:active,
body.zolteka-theme-crimson .btn-primary:hover,
body.zolteka-theme-crimson .btn-primary:focus,
body.zolteka-theme-crimson .btn-primary:active,
body.zolteka-theme-blaze .btn-primary:hover,
body.zolteka-theme-blaze .btn-primary:focus,
body.zolteka-theme-blaze .btn-primary:active,
body.zolteka-theme-nexus .btn-primary:hover,
body.zolteka-theme-nexus .btn-primary:focus,
body.zolteka-theme-nexus .btn-primary:active,
body.zolteka-theme-zen .btn-primary:hover,
body.zolteka-theme-zen .btn-primary:focus,
body.zolteka-theme-zen .btn-primary:active,
body.zolteka-theme-zafiro .btn-primary:hover,
body.zolteka-theme-zafiro .btn-primary:focus,
body.zolteka-theme-zafiro .btn-primary:active,
body.zolteka-theme-nord .btn-primary:hover,
body.zolteka-theme-nord .btn-primary:focus,
body.zolteka-theme-nord .btn-primary:active,
body.zolteka-theme-terra .btn-primary:hover,
body.zolteka-theme-terra .btn-primary:focus,
body.zolteka-theme-terra .btn-primary:active,
body.zolteka-theme-pergamino .btn-primary:hover,
body.zolteka-theme-pergamino .btn-primary:focus,
body.zolteka-theme-pergamino .btn-primary:active,
body.zolteka-theme-kinetic .btn-primary:hover,
body.zolteka-theme-kinetic .btn-primary:focus,
body.zolteka-theme-kinetic .btn-primary:active {
    background-color: var(--zolteka-primary-relleno-hover) !important;
    border-color: var(--zolteka-primary-relleno-hover) !important;
    color: var(--zolteka-primary-contraste) !important;
}

/* 2.27 · C1 (Z6): borde del campo con foco en el tono legible del primario (≥ 3:1 sobre blanco; kinetic
   daba 2,80:1). La sombra conserva el color corporativo (decorativa: el indicador es el borde y el contorno) */
body.zolteka-theme-cyber .form-control:focus,
body.zolteka-theme-cyber .form-select:focus {
    border-color: var(--zolteka-acento-texto) !important;
    box-shadow: 0 0 0 0.25rem rgba(139, 92, 246, 0.25) !important;
}

body.zolteka-theme-crimson .form-control:focus,
body.zolteka-theme-crimson .form-select:focus {
    border-color: var(--zolteka-acento-texto) !important;
    box-shadow: 0 0 0 0.25rem rgba(225, 29, 72, 0.25) !important;
}

body.zolteka-theme-blaze .form-control:focus,
body.zolteka-theme-blaze .form-select:focus {
    border-color: var(--zolteka-acento-texto) !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 95, 31, 0.25) !important;
}

body.zolteka-theme-nexus .form-control:focus,
body.zolteka-theme-nexus .form-select:focus {
    border-color: var(--zolteka-acento-texto) !important;
    box-shadow: 0 0 0 0.25rem rgba(79, 70, 229, 0.25) !important;
}

body.zolteka-theme-zen .form-control:focus,
body.zolteka-theme-zen .form-select:focus {
    border-color: var(--zolteka-acento-texto) !important;
    box-shadow: 0 0 0 0.25rem rgba(82, 121, 111, 0.25) !important;
}

body.zolteka-theme-zafiro .form-control:focus,
body.zolteka-theme-zafiro .form-select:focus {
    border-color: var(--zolteka-acento-texto) !important;
    box-shadow: 0 0 0 0.25rem rgba(30, 58, 138, 0.25) !important;
}

body.zolteka-theme-nord .form-control:focus,
body.zolteka-theme-nord .form-select:focus {
    border-color: var(--zolteka-acento-texto) !important;
    box-shadow: 0 0 0 0.25rem rgba(71, 85, 105, 0.25) !important;
}

body.zolteka-theme-terra .form-control:focus,
body.zolteka-theme-terra .form-select:focus {
    border-color: var(--zolteka-acento-texto) !important;
    box-shadow: 0 0 0 0.25rem rgba(180, 83, 9, 0.25) !important;
}

body.zolteka-theme-pergamino .form-control:focus,
body.zolteka-theme-pergamino .form-select:focus {
    border-color: var(--zolteka-acento-texto) !important;
    box-shadow: 0 0 0 0.25rem rgba(44, 62, 80, 0.25) !important;
}

body.zolteka-theme-kinetic .form-control:focus,
body.zolteka-theme-kinetic .form-select:focus {
    border-color: var(--zolteka-acento-texto) !important;
    box-shadow: 0 0 0 0.25rem rgba(249, 115, 22, 0.25) !important;
}

/* Botón de acento personalizado (usa la clase secundaria o de acento en el ERP) */
.btn-accent {
    background-color: var(--v-accent) !important;
    border-color: var(--v-accent) !important;
    /* 2.27 · C2: texto que más contrasta con el acento */
    color: var(--zolteka-acento-contraste) !important;
    border-radius: var(--zolteka-radius-btn) !important;
}

.btn-accent:hover {
    background-color: var(--zolteka-primary-relleno-hover) !important;
    border-color: var(--zolteka-primary-relleno-hover) !important;
    color: var(--zolteka-primary-contraste) !important;
}

/*
 * Botón outline-primary. 2.27 · C1: en reposo es texto sobre blanco (--zolteka-acento-texto);
 * al pasar, pulsar o marcarlo (.active, .btn-check) se rellena y el texto pasa al contraste del relleno.
 */
.btn-outline-primary {
    --bs-btn-color: var(--zolteka-acento-texto);
    --bs-btn-border-color: var(--zolteka-acento-texto);
    --bs-btn-hover-color: var(--zolteka-primary-contraste);
    --bs-btn-hover-bg: var(--zolteka-primary-relleno);
    --bs-btn-hover-border-color: var(--zolteka-primary-relleno);
    --bs-btn-active-color: var(--zolteka-primary-contraste);
    --bs-btn-active-bg: var(--zolteka-primary-relleno);
    --bs-btn-active-border-color: var(--zolteka-primary-relleno);
    color: var(--zolteka-acento-texto) !important;
    border-color: var(--zolteka-acento-texto) !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-check:checked + .btn-outline-primary,
.btn-check:active + .btn-outline-primary {
    background-color: var(--zolteka-primary-relleno) !important;
    border-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
}

/* 2.27 · C2: utilidades de relleno primario de Bootstrap con el texto del contraste */
/* 2.27 · C2 (Z12): y con el relleno del tema (en cyber, #8457EA: con #8B5CF6 el blanco se quedaba en 4,23:1).
   Las variantes con bg-opacity-* quedan fuera: son un tinte claro con su .text-primary, no un relleno
   (p. ej. la insignia de TwoFactor, que con esta regla salía en blanco sobre el tinte) */
.text-bg-primary,
:is(.badge.bg-primary, .bg-primary.text-white):not([class*="bg-opacity-"]) {
    background-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
}

/* 2.27 · C1: .text-primary es texto sobre claro: tono legible del primario */
.text-primary {
    color: rgba(var(--zolteka-acento-texto-rgb), var(--bs-text-opacity, 1)) !important;
}

/* Botón outline-secondary reactivo */
.btn-outline-secondary {
    --bs-btn-color: var(--v-secondary);
    --bs-btn-border-color: var(--v-secondary);
    --bs-btn-hover-bg: var(--v-secondary);
    --bs-btn-hover-border-color: var(--v-secondary);
    --bs-btn-active-bg: var(--v-secondary);
    --bs-btn-active-border-color: var(--v-secondary);
}

/* Utilidades semánticas sutiles Bootstrap 5 armonizadas con el tema activo */
.bg-primary-subtle {
    background-color: var(--bs-primary-bg-subtle, rgba(var(--bs-primary-rgb), 0.12)) !important;
}

.border-primary-subtle {
    border-color: var(--bs-primary-border-subtle, rgba(var(--bs-primary-rgb), 0.25)) !important;
}

.text-primary-emphasis {
    color: var(--bs-primary-text-emphasis, var(--zolteka-acento-texto)) !important;
}

.bg-secondary-subtle {
    background-color: var(--bs-secondary-bg-subtle, rgba(108, 117, 125, 0.12)) !important;
}

.border-secondary-subtle {
    border-color: var(--bs-secondary-border-subtle, rgba(108, 117, 125, 0.25)) !important;
}

.text-secondary-emphasis {
    color: var(--bs-secondary-text-emphasis, var(--v-secondary, #475569)) !important;
}

/* Tablas con hover reactivo al primario corporativo */
.table-hover > tbody > tr:hover > * {
    --bs-table-accent-bg: var(--bs-table-hover-bg, rgba(var(--bs-primary-rgb), 0.035));
}

/* Badges y destacados con el color de acento */
.badge-accent,
.badge.bg-accent,
.badge.bg-secondary,
#sidebar .badge,
.navbar .badge,
.navbar-custom .badge,
.z-badge-accent {
    background-color: var(--v-accent) !important;
    /* 2.27 · C2: texto que más contrasta con el acento */
    color: var(--zolteka-acento-contraste) !important;
}

.navbar-brand {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px;
}

/* Estilización de la barra de navegación del Core de FacturaScripts */
body.zolteka-theme-zolteka .navbar:not(.navbar-custom),
body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom),
body.zolteka-theme-prestige .navbar:not(.navbar-custom),
body.zolteka-theme-cyber .navbar:not(.navbar-custom),
body.zolteka-theme-crimson .navbar:not(.navbar-custom),
body.zolteka-theme-blaze .navbar:not(.navbar-custom),
body.zolteka-theme-serenity .navbar:not(.navbar-custom),
body.zolteka-theme-nexus .navbar:not(.navbar-custom),
body.zolteka-theme-zen .navbar:not(.navbar-custom),
body.zolteka-theme-zafiro .navbar:not(.navbar-custom),
body.zolteka-theme-nord .navbar:not(.navbar-custom),
body.zolteka-theme-terra .navbar:not(.navbar-custom),
body.zolteka-theme-pergamino .navbar:not(.navbar-custom),
body.zolteka-theme-kinetic .navbar:not(.navbar-custom) {
    background-color: var(--theme-sidebar-bg) !important;
    border-bottom: 1px solid var(--zolteka-menu-divisor, var(--bs-border-color)) !important;
    box-shadow: var(--bs-box-shadow-sm) !important;
}

body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-prestige .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-prestige .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-cyber .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-cyber .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-crimson .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-crimson .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-blaze .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-blaze .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-serenity .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-serenity .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-nexus .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-nexus .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-zen .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-zen .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-nord .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-nord .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-terra .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-terra .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .navbar-brand span,
body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .navbar-brand,
body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .navbar-brand span {
    color: var(--theme-sidebar-brand-text) !important;
}

/* Los logos de empresa se muestran siempre con sus colores originales.
 * No aplicamos filter alguno: el cliente puede subir un logo con su propia paleta.
 * El modo oscuro nativo de Bootstrap/FS ya gestiona la inversión si fuera necesaria. */

body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-prestige .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-cyber .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-crimson .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-blaze .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-serenity .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-nexus .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-zen .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-nord .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-terra .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .nav-link,
body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .nav-link {
    color: var(--theme-sidebar-text) !important;
    font-weight: 500;
}

body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-prestige .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-prestige .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-cyber .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-cyber .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-crimson .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-crimson .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-blaze .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-blaze .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-serenity .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-serenity .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-nexus .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-nexus .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-zen .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-zen .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-nord .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-nord .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-terra .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-terra .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .nav-link.active,
body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .nav-link:hover,
body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .nav-link.active {
    /* 2.27 · C1/C7: acento legible sobre el fondo de la barra (en zolteka, el tono oscurecido de la 2.24) */
    color: var(--zolteka-menu-acento) !important;
}

/* En modo oscuro, el texto del brand debe ser claro y el logo blanco */
.dark-mode .navbar .navbar-brand,
.dark-mode .navbar .navbar-brand span,
[data-bs-theme="dark"] .navbar .navbar-brand,
[data-bs-theme="dark"] .navbar .navbar-brand span {
    color: #F8FAFC !important;
}

.dark-mode .navbar .navbar-brand img,
[data-bs-theme="dark"] .navbar .navbar-brand img {
    filter: none !important;
}

/*
 * Toggler de la barra. 2.27 · C5: borde, icono y anillo siguen al tema (antes esmeralda fija).
 * El icono es una máscara pintada con currentColor, así toma el acento legible sobre la barra.
 */
.navbar-toggler {
    border: 1.5px solid var(--zolteka-menu-acento) !important;
    padding: 0.35rem 0.65rem !important;
    border-radius: 6px !important;
    background-color: transparent !important;
    color: var(--zolteka-menu-acento) !important;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color) !important;
    outline: none;
}

.navbar-toggler .navbar-toggler-icon {
    background-image: none !important;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23000' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") center / 100% 100% no-repeat;
    mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23000' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") center / 100% 100% no-repeat;
    width: 1.3em;
    height: 1.3em;
}

.dark-mode .navbar-toggler,
[data-bs-theme="dark"] .navbar-toggler {
    border-color: var(--v-dark-accent) !important;
}

.dark-mode .navbar-toggler .navbar-toggler-icon,
[data-bs-theme="dark"] .navbar-toggler .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%232DD4BF' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* ==========================================================================
   Submenús y desplegables en modo horizontal (Escritorio / PC)
   ========================================================================== */
@media (min-width: 992px) {
    .navbar:not(.navbar-custom) .zolteka-chevron {
        display: none !important;
    }

    /* Temas oscuros / personalizados: fondo del menú desplegable a juego con la barra de navegación */
    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-menu {
        background-color: var(--theme-sidebar-bg) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-radius: var(--zolteka-radius-card, 8px) !important;
        box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.35), 0 8px 10px -6px rgba(0, 0, 0, 0.25) !important;
        padding: 0.5rem 0.35rem !important;
    }

    /* Submenú anidado (segundo nivel y posteriores) */
    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-submenu > .dropdown-menu,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-submenu > .dropdown-menu,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-submenu > .dropdown-menu,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-submenu > .dropdown-menu,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-submenu > .dropdown-menu,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-submenu > .dropdown-menu,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-submenu > .dropdown-menu,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-submenu > .dropdown-menu {
        background-color: var(--theme-sidebar-bg) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.4) !important;
    }

    /* Elementos dentro del desplegable en temas oscuros / barra coloreada */
    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-item {
        color: var(--theme-sidebar-text, #FFFFFF) !important;
        font-size: var(--zolteka-font-size-base, 1rem) !important;
        font-weight: 500 !important;
        padding: 0.5rem 0.85rem !important;
        border-radius: var(--zolteka-radius-btn, 6px) !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.65rem !important;
        transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease !important;
    }

    /* Iconos dentro de los ítems del menú desplegable */
    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-item i {
        width: 1.25rem !important;
        text-align: center !important;
        opacity: 0.85 !important;
        color: inherit !important;
    }

    /* Efecto hover / activo en elementos del submenú */
    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-submenu:hover > a {
        background-color: rgba(255, 255, 255, 0.08) !important;
        /* 2.27 · C1/C7: acento legible sobre el desplegable oscuro («Más» incluido) */
        color: var(--zolteka-menu-acento) !important;
    }

    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-item.active i {
        opacity: 1 !important;
        color: var(--zolteka-menu-acento) !important;
    }

    /* Chevron de submenú en temas oscuros / barra coloreada (hereda currentColor) */
    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-submenu > a::after {
        border-color: transparent !important;
        border-right-color: currentColor !important;
        border-bottom-color: currentColor !important;
        opacity: 0.55;
    }

    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after {
        opacity: 1;
    }

    /* Divisores de submenú */
    body.zolteka-theme-zolteka_dark .navbar:not(.navbar-custom) .dropdown-divider,
    body.zolteka-theme-prestige .navbar:not(.navbar-custom) .dropdown-divider,
    body.zolteka-theme-cyber .navbar:not(.navbar-custom) .dropdown-divider,
    body.zolteka-theme-crimson .navbar:not(.navbar-custom) .dropdown-divider,
    body.zolteka-theme-blaze .navbar:not(.navbar-custom) .dropdown-divider,
    body.zolteka-theme-serenity .navbar:not(.navbar-custom) .dropdown-divider,
    body.zolteka-theme-nexus .navbar:not(.navbar-custom) .dropdown-divider,
    body.zolteka-theme-custom .navbar:not(.navbar-custom) .dropdown-divider {
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin: 0.35rem 0.25rem !important;
    }

    /* Tema Claro: Estilo estilizado del submenú sobre blanco / crema */
    body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-zen .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-nord .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-terra .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .dropdown-menu,
    body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .dropdown-menu {
        background-color: var(--theme-sidebar-bg, #FFFFFF) !important;
        border: 1px solid var(--bs-border-color) !important;
        border-radius: var(--zolteka-radius-card, 8px) !important;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
        padding: 0.5rem 0.35rem !important;
    }

    body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-zen .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-nord .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-terra .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .dropdown-item,
    body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .dropdown-item {
        color: var(--theme-sidebar-text, #475569) !important;
        font-size: var(--zolteka-font-size-base, 1rem) !important;
        font-weight: 500 !important;
        padding: 0.5rem 0.85rem !important;
        border-radius: var(--zolteka-radius-btn, 6px) !important;
        display: flex !important;
        align-items: center !important;
        gap: 0.65rem !important;
        transition: background-color 0.15s ease, color 0.15s ease !important;
    }

    body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-zen .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-nord .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-terra .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .dropdown-item i,
    body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .dropdown-item i {
        width: 1.25rem !important;
        text-align: center !important;
        color: #64748B !important;
    }

    body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-zen .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-zen .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-zen .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-zen .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-nord .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-nord .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-nord .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-nord .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-terra .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-terra .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-terra .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-terra .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .dropdown-submenu:hover > a,
    body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .dropdown-item:hover,
    body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .dropdown-item:focus,
    body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .dropdown-item.active,
    body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .dropdown-submenu:hover > a {
        background-color: var(--theme-dropdown-hover-bg, rgba(var(--v-primary-rgb, 30, 58, 138), 0.08)) !important;
        /* 2.27 · C1: texto sobre el tinte claro del desplegable */
        color: var(--zolteka-acento-texto) !important;
    }

    body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-zen .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-nord .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-terra .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .dropdown-item:hover i,
    body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-zen .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-nord .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-terra .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .dropdown-item.active i,
    body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .dropdown-item.active i {
        color: var(--zolteka-acento-texto) !important;
    }

    /* Chevron de submenú en tema claro */
    body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-zen .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-nord .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-terra .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .dropdown-submenu > a::after,
    body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .dropdown-submenu > a::after {
        border-color: transparent !important;
        border-right-color: currentColor !important;
        border-bottom-color: currentColor !important;
        opacity: 0.45;
    }

    body.zolteka-theme-zolteka .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-zen .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-zafiro .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-nord .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-terra .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-pergamino .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    body.zolteka-theme-kinetic .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after {
        opacity: 1;
    }

    /* Submenú anidado (Administrador > General, Zolteka, etc.): flyout a la derecha */
    .navbar:not(.navbar-custom) .dropdown-menu {
        overflow: visible !important;
    }

    .navbar:not(.navbar-custom) .dropdown-submenu {
        position: relative;
    }

    /* Espacio a la derecha para el chevron (textos largos no lo solapan) */
    .navbar:not(.navbar-custom) .dropdown-submenu > a {
        padding-right: 1.65rem !important;
    }

    /*
     * Chevron moderno: sustituye el triángulo legacy del Core
     * (.dropdown-submenu > a::after con float + border-left).
     * Compatible con display:flex de los .dropdown-item de Zolteka.
     */
    .navbar:not(.navbar-custom) .dropdown-submenu > a::after {
        content: "" !important;
        display: block !important;
        float: none !important;
        width: 0.42rem !important;
        height: 0.42rem !important;
        margin: 0 0 0 auto !important;
        padding: 0 !important;
        border-style: solid !important;
        border-width: 0 2px 2px 0 !important;
        border-color: transparent !important;
        border-right-color: currentColor !important;
        border-bottom-color: currentColor !important;
        border-left-width: 0 !important;
        border-left-color: transparent !important;
        transform: rotate(-45deg);
        opacity: 0.55;
        flex-shrink: 0;
        align-self: center;
        transition: opacity 0.15s ease, border-color 0.15s ease;
    }

    .navbar:not(.navbar-custom) .dropdown-submenu:hover > a::after,
    .navbar:not(.navbar-custom) .dropdown-submenu:focus-within > a::after {
        opacity: 1;
    }

    .navbar:not(.navbar-custom) .dropdown-submenu > .dropdown-menu {
        display: none;
        position: absolute !important;
        top: 0;
        left: 100%;
        margin-top: 0 !important;
        margin-left: 2px;
        min-width: 220px;
        z-index: 1060;
    }

    .navbar:not(.navbar-custom) .dropdown-submenu:hover > .dropdown-menu,
    .navbar:not(.navbar-custom) .dropdown-submenu:focus-within > .dropdown-menu {
        display: block !important;
    }
}

/* Estilos del menú desplegado en móvil — protegido con .navbar-expand-lg */
@media (max-width: 991.98px) {

    /* --- FIX: Forzar nombres completos del menú (el Core recorta a 2 letras con d-md-none) --- */
    .navbar-expand-lg .navbar-collapse .fs-menu-item .d-md-none {
        display: none !important;
    }

    .navbar-expand-lg .navbar-collapse .fs-menu-item .d-none.d-md-inline-block {
        display: inline !important;
    }

    /* --- Panel desplegable: overlay fullscreen diferenciado de la barra --- */
    .navbar-expand-lg .navbar-collapse {
        background-color: var(--theme-sidebar-bg) !important;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        padding: 1rem 0;
        border-top: 3px solid var(--v-primary) !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.12) !important;
        z-index: 1029;
        overflow-y: auto;
    }

    .dark-mode .navbar-expand-lg .navbar-collapse,
    [data-bs-theme="dark"] .navbar-expand-lg .navbar-collapse {
        background-color: var(--theme-card-bg) !important;
    }

    .navbar-expand-lg .navbar-collapse .navbar-nav {
        flex-direction: column !important;
        width: 100%;
        padding: 0 0.75rem;
    }

    .navbar-expand-lg .navbar-collapse .navbar-nav .nav-item {
        width: 100%;
        margin-bottom: 0;
    }

    /* --- Estilo acordeón al estilo RichiTheme: ítems de menú principales --- */
    .navbar-expand-lg .navbar-collapse .fs-menu-item>a.nav-link {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem !important;
        border-radius: 8px;
        color: var(--theme-sidebar-text) !important;
        font-size: var(--zolteka-font-size-base, 1rem);
        font-weight: 500;
        transition: background-color 0.15s ease, color 0.15s ease;
        text-decoration: none;
    }

    .navbar-expand-lg .navbar-collapse .fs-menu-item>a.nav-link:hover {
        background-color: rgba(var(--v-primary-rgb, 16, 185, 129), 0.08) !important;
        color: var(--zolteka-menu-acento) !important;
    }

    /* 2.27 · C6: blaze y nexus entran en el grupo oscuro */
    body.zolteka-theme-zolteka_dark .navbar-expand-lg .navbar-collapse .fs-menu-item>a.nav-link:hover,
    body.zolteka-theme-prestige .navbar-expand-lg .navbar-collapse .fs-menu-item>a.nav-link:hover,
    body.zolteka-theme-cyber .navbar-expand-lg .navbar-collapse .fs-menu-item>a.nav-link:hover,
    body.zolteka-theme-crimson .navbar-expand-lg .navbar-collapse .fs-menu-item>a.nav-link:hover,
    body.zolteka-theme-serenity .navbar-expand-lg .navbar-collapse .fs-menu-item>a.nav-link:hover,
    body.zolteka-theme-blaze .navbar-expand-lg .navbar-collapse .fs-menu-item>a.nav-link:hover,
    body.zolteka-theme-nexus .navbar-expand-lg .navbar-collapse .fs-menu-item>a.nav-link:hover {
        background-color: rgba(255, 255, 255, 0.05) !important;
        color: #FFFFFF !important;
    }

    /* Ítem activo */
    .navbar-expand-lg .navbar-collapse .fs-menu-item.zolteka-open>a.nav-link {
        background-color: rgba(var(--v-primary-rgb, 16, 185, 129), 0.1) !important;
        color: var(--zolteka-menu-acento) !important;
    }

    body.zolteka-theme-zolteka_dark .navbar-expand-lg .navbar-collapse .fs-menu-item.zolteka-open>a.nav-link,
    body.zolteka-theme-prestige .navbar-expand-lg .navbar-collapse .fs-menu-item.zolteka-open>a.nav-link,
    body.zolteka-theme-cyber .navbar-expand-lg .navbar-collapse .fs-menu-item.zolteka-open>a.nav-link,
    body.zolteka-theme-crimson .navbar-expand-lg .navbar-collapse .fs-menu-item.zolteka-open>a.nav-link,
    body.zolteka-theme-serenity .navbar-expand-lg .navbar-collapse .fs-menu-item.zolteka-open>a.nav-link,
    body.zolteka-theme-blaze .navbar-expand-lg .navbar-collapse .fs-menu-item.zolteka-open>a.nav-link,
    body.zolteka-theme-nexus .navbar-expand-lg .navbar-collapse .fs-menu-item.zolteka-open>a.nav-link {
        background-color: rgba(255, 255, 255, 0.08) !important;
        color: #FFFFFF !important;
    }

    /* --- Chevron animado (se inserta por JS) --- */
    .zolteka-chevron {
        display: inline-flex;
        align-items: center;
        margin-left: auto;
        padding-left: 0.5rem;
        color: var(--theme-sidebar-text);
        transition: transform 0.25s ease, color 0.15s ease;
        flex-shrink: 0;
    }

    .zolteka-chevron svg {
        width: 10px;
        height: 10px;
    }

    .fs-menu-item.zolteka-open .zolteka-chevron {
        transform: rotate(90deg);
        color: var(--zolteka-menu-acento);
    }

    /* Ocultar el caret de Bootstrap dropdown en móvil */
    .navbar-expand-lg .navbar-collapse .dropdown-toggle::after {
        display: none !important;
    }

    /* --- Submenú inline (acordeón) --- */
    .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu {
        display: none;
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
        border: none !important;
        border-left: 2px solid rgba(var(--v-primary-rgb, 16, 185, 129), 0.25) !important;
        border-radius: 0 0 8px 8px !important;
        box-shadow: none !important;
        background-color: transparent !important;
        padding: 0.25rem 0 0.5rem 0.75rem !important;
        animation: zoltekaSlideDown 0.2s ease;
    }

    @keyframes zoltekaSlideDown {
        from {
            opacity: 0;
            transform: translateY(-6px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .navbar-expand-lg .navbar-collapse .fs-menu-item.zolteka-open .dropdown-menu {
        display: block !important;
    }

    /* Items del submenú */
    .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item {
        padding: 0.55rem 0.75rem !important;
        border-radius: 6px !important;
        color: var(--theme-sidebar-text) !important;
        font-size: var(--zolteka-font-size-base, 1rem);
        transition: background-color 0.15s ease, color 0.15s ease;
    }

    .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item:hover,
    .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item.active {
        background-color: rgba(var(--v-primary-rgb, 16, 185, 129), 0.08) !important;
        color: var(--zolteka-menu-acento) !important;
    }

    body.zolteka-theme-zolteka_dark .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item:hover,
    body.zolteka-theme-zolteka_dark .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item.active,
    body.zolteka-theme-prestige .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item:hover,
    body.zolteka-theme-prestige .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item.active,
    body.zolteka-theme-cyber .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item:hover,
    body.zolteka-theme-cyber .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item.active,
    body.zolteka-theme-crimson .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item:hover,
    body.zolteka-theme-crimson .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item.active,
    body.zolteka-theme-serenity .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item:hover,
    body.zolteka-theme-serenity .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item.active,
    body.zolteka-theme-blaze .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item:hover,
    body.zolteka-theme-blaze .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item.active,
    body.zolteka-theme-nexus .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item:hover,
    body.zolteka-theme-nexus .navbar-expand-lg .navbar-collapse .fs-menu-item .dropdown-menu .dropdown-item.active {
        background-color: rgba(255, 255, 255, 0.08) !important;
        color: #FFFFFF !important;
    }

    /* --- Iconos de acceso rápido: fila horizontal centrada al pie del panel --- */
    .navbar-expand-lg .navbar-collapse .navbar-nav.flex-row {
        flex-direction: row !important;
        justify-content: center !important;
        border-top: 1px solid var(--bs-border-color);
        padding: 1rem 0.75rem !important;
        margin-top: auto;
        gap: 2rem;
    }

    .navbar-expand-lg .navbar-collapse .navbar-nav.flex-row .nav-item {
        width: auto;
        margin-bottom: 0;
    }

    .navbar-expand-lg .navbar-collapse .navbar-nav.flex-row .nav-link {
        font-size: 1.1rem;
        color: var(--theme-sidebar-text) !important;
    }

    .navbar-expand-lg .navbar-collapse .navbar-nav.flex-row .nav-link:hover {
        color: var(--zolteka-menu-acento) !important;
        background-color: transparent !important;
    }

    body.zolteka-theme-zolteka_dark .navbar-expand-lg .navbar-collapse .navbar-nav.flex-row .nav-link:hover,
    body.zolteka-theme-prestige .navbar-expand-lg .navbar-collapse .navbar-nav.flex-row .nav-link:hover,
    body.zolteka-theme-cyber .navbar-expand-lg .navbar-collapse .navbar-nav.flex-row .nav-link:hover,
    body.zolteka-theme-crimson .navbar-expand-lg .navbar-collapse .navbar-nav.flex-row .nav-link:hover,
    body.zolteka-theme-serenity .navbar-expand-lg .navbar-collapse .navbar-nav.flex-row .nav-link:hover,
    body.zolteka-theme-blaze .navbar-expand-lg .navbar-collapse .navbar-nav.flex-row .nav-link:hover,
    body.zolteka-theme-nexus .navbar-expand-lg .navbar-collapse .navbar-nav.flex-row .nav-link:hover {
        color: #FFFFFF !important;
        background-color: transparent !important;
    }
}

/* Adaptación del menú lateral colapsable de Zolteka */

.navbar-custom {
    background-color: var(--theme-sidebar-bg) !important;
    border-bottom: 1px solid var(--zolteka-menu-divisor, var(--bs-border-color)) !important;
    box-shadow: var(--bs-box-shadow-sm) !important;
    padding-left: 1rem;
    padding-right: 1rem;
}

.navbar-custom .nav-link,
.navbar-custom .navbar-brand,
.navbar-custom .navbar-brand span,
.navbar-custom .navbar-text {
    color: var(--theme-sidebar-brand-text) !important;
}

.navbar-custom .navbar-text i {
    color: var(--theme-sidebar-text) !important;
}

.navbar-custom .nav-link:hover {
    color: var(--zolteka-menu-acento) !important;
}

/* 2.27 · C6: nexus entra en el grupo oscuro */
body.zolteka-theme-zolteka_dark .navbar-custom .nav-link:hover,
body.zolteka-theme-prestige .navbar-custom .nav-link:hover,
body.zolteka-theme-cyber .navbar-custom .nav-link:hover,
body.zolteka-theme-crimson .navbar-custom .nav-link:hover,
body.zolteka-theme-blaze .navbar-custom .nav-link:hover,
body.zolteka-theme-serenity .navbar-custom .nav-link:hover,
body.zolteka-theme-nexus .navbar-custom .nav-link:hover {
    color: #FFFFFF !important;
}

.navbar-custom .dropdown-toggle::after {
    display: none;
}


#sidebar::-webkit-scrollbar {
    width: 5px;
}

#sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(var(--bs-primary-rgb), 0.2);
    border-radius: 4px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.4);
}

/* Cabecera del menú (revisión 2.24, A8): sin degradado, sin mayúsculas y en la escala de 8 */
.sidebar-header {
    border-bottom: 1px solid var(--zolteka-menu-divisor);
    padding: 16px;
    text-align: center;
    background: transparent;
}

.sidebar-header a {
    color: var(--theme-sidebar-brand-text) !important;
    font-weight: 600;
    text-decoration: none;
}

.sidebar-header img {
    border: none !important;
    padding: 0 !important;
    background-color: transparent !important;
    max-width: 100%;
}

/* Nombre de empresa: una línea con puntos suspensivos (el nombre completo va en title) */
.sidebar-header .zolteka-sidebar-empresa {
    display: block;
    font-size: var(--zolteka-font-size-base);
    font-weight: 600;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-header p {
    margin-bottom: 0;
    font-weight: 500;
    color: var(--zolteka-menu-apagado) !important;
}

.sidebar-header .zolteka-sidebar-usuario {
    font-size: calc(var(--zolteka-font-size-base) * 0.875);
    line-height: 1.35;
}

/* Buscador del cajón (solo móvil, A6): separación respecto al usuario */
.sidebar-header #zoltekaSidebarSearchForm {
    margin-top: 12px;
}

:is(#sidebar, #zoltekaCarrilPanel) ul {
    padding: 0.5rem 0.5rem;
    list-style: none;
    margin-bottom: 0;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Flex (.nav.flex-column): sin min-width:0 los li no encogen y la píldora del submenú se sale */
:is(#sidebar, #zoltekaCarrilPanel) .nav-item,
:is(#sidebar, #zoltekaCarrilPanel) ul li {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Anidación (A9 + A11): guía neutra de 1 px; cada nivel gasta unos 17 px */
:is(#sidebar, #zoltekaCarrilPanel) ul ul {
    border-left: 1px solid var(--zolteka-menu-divisor);
    margin-left: 12px;
    padding: 2px 0 2px 4px;
    max-width: calc(100% - 12px);
    box-sizing: border-box;
}

:is(#sidebar, #zoltekaCarrilPanel) ul ul a {
    font-size: var(--zolteka-font-size-base, 1rem) !important;
}

/* Caret del submenú dentro del sidebar: flex sin desbordar */
:is(#sidebar, #zoltekaCarrilPanel) .dropdown-toggle {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
}

:is(#sidebar, #zoltekaCarrilPanel) .dropdown-toggle::after {
    margin-left: auto;
    flex-shrink: 0;
    align-self: center;
}

/*
 * Jerarquía del activo (revisión 2.24, A3) en los temas zolteka, zolteka_dark y el grupo oscuro:
 * sin filete de 4 px; el grupo abierto se distingue por el peso, no por el color;
 * la píldora solo la lleva la página final (.sidebar-menu-item-active).
 */
body.zolteka-theme-zolteka :is(#sidebar, #zoltekaCarrilPanel) ul li.active,
body.zolteka-theme-zolteka_dark :is(#sidebar, #zoltekaCarrilPanel) ul li.active,
body.zolteka-theme-prestige :is(#sidebar, #zoltekaCarrilPanel) ul li.active,
body.zolteka-theme-cyber :is(#sidebar, #zoltekaCarrilPanel) ul li.active,
body.zolteka-theme-crimson :is(#sidebar, #zoltekaCarrilPanel) ul li.active,
body.zolteka-theme-serenity :is(#sidebar, #zoltekaCarrilPanel) ul li.active,
body.zolteka-theme-blaze :is(#sidebar, #zoltekaCarrilPanel) ul li.active,
body.zolteka-theme-nexus :is(#sidebar, #zoltekaCarrilPanel) ul li.active {
    background-color: transparent !important;
    border-left: 0 !important;
}

body.zolteka-theme-zolteka :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle,
body.zolteka-theme-zolteka_dark :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle,
body.zolteka-theme-prestige :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle,
body.zolteka-theme-cyber :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle,
body.zolteka-theme-crimson :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle,
body.zolteka-theme-serenity :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle,
body.zolteka-theme-blaze :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle,
body.zolteka-theme-nexus :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle {
    font-weight: 600 !important;
}

body.zolteka-theme-zolteka :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-zolteka_dark :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-prestige :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-cyber :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-crimson :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-serenity :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-blaze :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-nexus :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) {
    background-color: transparent !important;
    color: var(--theme-sidebar-brand-text) !important;
}

/* Icono y flecha del grupo abierto, neutros */
body.zolteka-theme-zolteka :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-zolteka :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-zolteka_dark :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-zolteka_dark :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-prestige :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-prestige :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-cyber :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-cyber :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-crimson :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-crimson :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-serenity :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-serenity :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-blaze :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-blaze :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-nexus :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-nexus :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after {
    color: var(--theme-sidebar-text) !important;
}

/*
 * Página final activa: única píldora, texto e icono en el acento legible sobre el menú.
 * 2.27 · C7: --zolteka-menu-acento (zolteka: el tono oscurecido; cyber y serenity: un poco más claro).
 */
body.zolteka-theme-zolteka :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active,
body.zolteka-theme-zolteka_dark :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active,
body.zolteka-theme-prestige :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active,
body.zolteka-theme-cyber :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active,
body.zolteka-theme-serenity :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active,
body.zolteka-theme-blaze :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    background-color: rgba(var(--v-primary-rgb, 16, 185, 129), 0.12) !important;
    color: var(--zolteka-menu-acento) !important;
    font-weight: 600 !important;
    border-radius: var(--zolteka-radius-btn);
    margin-top: 0.05rem;
    margin-bottom: 0.05rem;
}

body.zolteka-theme-zolteka :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active > :is(i, svg),
body.zolteka-theme-zolteka_dark :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active > :is(i, svg),
body.zolteka-theme-prestige :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active > :is(i, svg),
body.zolteka-theme-cyber :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active > :is(i, svg),
body.zolteka-theme-serenity :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active > :is(i, svg),
body.zolteka-theme-blaze :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active > :is(i, svg) {
    color: var(--zolteka-menu-acento) !important;
}

/* 2.27 · C7: en crimson y nexus el primario no llega como texto sobre el menú: píldora sólida (4,70 y 6,29) */
body.zolteka-theme-crimson :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active,
body.zolteka-theme-nexus :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    background-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
    font-weight: 600 !important;
    border-radius: var(--zolteka-radius-btn);
    margin-top: 0.05rem;
    margin-bottom: 0.05rem;
}

body.zolteka-theme-crimson :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active > :is(i, svg),
body.zolteka-theme-nexus :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active > :is(i, svg) {
    color: var(--zolteka-primary-contraste) !important;
}

/* Estado activo para el Sidebar Minimalista Zen (Píldora Verde Salvia y texto blanco) */
body.zolteka-theme-zen :is(#sidebar, #zoltekaCarrilPanel) ul li.active {
    background-color: transparent !important;
    border-left: none !important;
}

body.zolteka-theme-zen :is(#sidebar, #zoltekaCarrilPanel) ul li.active>a,
body.zolteka-theme-zen :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    /* 2.27 · C2: texto que más contrasta con el relleno (kinetic: oscuro) */
    background-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
    font-weight: 600 !important;
    border-radius: var(--zolteka-radius-btn, 8px) !important;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
}

body.zolteka-theme-zen :is(#sidebar, #zoltekaCarrilPanel) ul li.active a i,
body.zolteka-theme-zen :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active i,
body.zolteka-theme-zen :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active svg {
    color: var(--zolteka-primary-contraste) !important;
}

body.zolteka-theme-zen :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover {
    background-color: rgba(var(--v-primary-rgb, 82, 121, 111), 0.08) !important;
    color: var(--zolteka-menu-acento) !important;
}

/* Estado activo para el Sidebar Zafiro (Cápsula Azul Institucional y texto blanco, fondo blanco impoluto) */
body.zolteka-theme-zafiro #sidebar,
body.zolteka-theme-zafiro .sidebar-wrapper {
    background-color: #FFFFFF !important;
    border-right: 1px solid #E2E8F0 !important;
}

body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) ul li.active {
    background-color: transparent !important;
    border-left: none !important;
}

body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) ul li.active>a,
body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    /* 2.27 · C2: texto que más contrasta con el relleno (kinetic: oscuro) */
    background-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
    font-weight: 600 !important;
    border-radius: var(--zolteka-radius-btn, 8px) !important;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25) !important;
}

body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) ul li.active a i,
body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active i,
body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active svg {
    color: var(--zolteka-primary-contraste) !important;
}

body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) ul li a {
    color: #475569 !important;
}

body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover {
    background-color: rgba(30, 58, 138, 0.08) !important;
    color: var(--zolteka-menu-acento) !important;
    border-radius: var(--zolteka-radius-btn, 8px);
    margin-top: 0.05rem;
    margin-bottom: 0.05rem;
}

/* Estado activo para el Sidebar Nord / Acero Nórdico (Píldora Acero Forjado y texto blanco, fondo blanco impoluto) */
body.zolteka-theme-nord #sidebar,
body.zolteka-theme-nord .sidebar-wrapper {
    background-color: #FFFFFF !important;
    border-right: 1px solid #E2E8F0 !important;
}

body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) ul li.active {
    background-color: transparent !important;
    border-left: none !important;
}

body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) ul li.active>a,
body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    /* 2.27 · C2: texto que más contrasta con el relleno (kinetic: oscuro) */
    background-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
    font-weight: 600 !important;
    border-radius: var(--zolteka-radius-btn, 8px) !important;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
    box-shadow: 0 4px 12px rgba(71, 85, 105, 0.25) !important;
}

body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) ul li.active a i,
body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active i,
body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active svg {
    color: var(--zolteka-primary-contraste) !important;
}

body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) ul li a {
    color: #475569 !important;
}

body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover {
    background-color: rgba(71, 85, 105, 0.08) !important;
    color: var(--zolteka-menu-acento) !important;
    border-radius: var(--zolteka-radius-btn, 8px);
    margin-top: 0.05rem;
    margin-bottom: 0.05rem;
}

/* Estado activo para el Sidebar Terra (Cápsula Terracota y texto blanco, fondo crema cálido) */
body.zolteka-theme-terra #sidebar,
body.zolteka-theme-terra .sidebar-wrapper {
    background-color: var(--theme-sidebar-bg) !important;
    border-right: 1px solid rgba(180, 83, 9, 0.15) !important;
}

body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) ul li.active {
    background-color: transparent !important;
    border-left: none !important;
}

body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) ul li.active>a,
body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    /* 2.27 · C2: texto que más contrasta con el relleno (kinetic: oscuro) */
    background-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
    font-weight: 600 !important;
    border-radius: var(--zolteka-radius-btn, 8px) !important;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.25) !important;
}

body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) ul li.active a i,
body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active i,
body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active svg {
    color: var(--zolteka-primary-contraste) !important;
}

body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) ul li a {
    color: var(--theme-sidebar-text) !important;
}

body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover {
    background-color: rgba(180, 83, 9, 0.08) !important;
    color: var(--zolteka-menu-acento) !important;
    border-radius: var(--zolteka-radius-btn, 8px);
    margin-top: 0.05rem;
    margin-bottom: 0.05rem;
}

/* Estado activo para el Sidebar Legacy (Cápsula Azul Tinta y texto blanco, fondo Papel Marfil) */
body.zolteka-theme-pergamino #sidebar,
body.zolteka-theme-pergamino .sidebar-wrapper {
    background-color: var(--theme-sidebar-bg) !important;
    border-right: 1px solid rgba(127, 140, 141, 0.2) !important;
}

body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) ul li.active {
    background-color: transparent !important;
    border-left: none !important;
}

body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) ul li.active>a,
body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    /* 2.27 · C2: texto que más contrasta con el relleno (kinetic: oscuro) */
    background-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
    font-weight: 600 !important;
    border-radius: var(--zolteka-radius-btn, 8px) !important;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
    box-shadow: 0 4px 12px rgba(44, 62, 80, 0.25) !important;
}

body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) ul li.active a i,
body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active i,
body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active svg {
    color: var(--zolteka-primary-contraste) !important;
}

body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) ul li a {
    color: var(--theme-sidebar-text) !important;
}

body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover {
    background-color: rgba(44, 62, 80, 0.08) !important;
    color: var(--zolteka-menu-acento) !important;
    border-radius: var(--zolteka-radius-btn, 8px);
    margin-top: 0.05rem;
    margin-bottom: 0.05rem;
}

/* Estado activo para el Sidebar Kinetic (Cápsula Naranja Acción y texto blanco, fondo blanco impoluto) */
body.zolteka-theme-kinetic #sidebar,
body.zolteka-theme-kinetic .sidebar-wrapper {
    background-color: #FFFFFF !important;
    border-right: 1px solid #E2E8F0 !important;
}

body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) ul li.active {
    background-color: transparent !important;
    border-left: none !important;
}

body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) ul li.active>a,
body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    /* 2.27 · C2: texto que más contrasta con el relleno (kinetic: oscuro) */
    background-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
    font-weight: 600 !important;
    border-radius: var(--zolteka-radius-btn, 8px) !important;
    margin-top: 0.15rem;
    margin-bottom: 0.15rem;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.30) !important;
}

body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) ul li.active a i,
body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active i,
body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active svg {
    color: var(--zolteka-primary-contraste) !important;
}

body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) ul li a {
    color: #334155 !important;
}

body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover {
    background-color: rgba(249, 115, 22, 0.08) !important;
    color: var(--zolteka-menu-acento) !important;
    border-radius: var(--zolteka-radius-btn, 8px);
    margin-top: 0.05rem;
    margin-bottom: 0.05rem;
}

/*
 * Temas de píldora sólida (zen, zafiro, nord, terra, pergamino y kinetic), revisión 2.24 A3:
 * solo los grupos abiertos pierden el relleno; la píldora de la página activa no se toca.
 */
body.zolteka-theme-zen :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover),
body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) {
    background-color: transparent !important;
    color: var(--theme-sidebar-brand-text) !important;
    box-shadow: none !important;
}

/* Sin relleno, el blanco del icono de la píldora no se vería: icono y flecha neutros */
body.zolteka-theme-zen :is(#sidebar, #zoltekaCarrilPanel) ul li.active a:not(.sidebar-menu-item-active) i,
body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) ul li.active a:not(.sidebar-menu-item-active) i,
body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) ul li.active a:not(.sidebar-menu-item-active) i,
body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) ul li.active a:not(.sidebar-menu-item-active) i,
body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) ul li.active a:not(.sidebar-menu-item-active) i,
body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) ul li.active a:not(.sidebar-menu-item-active) i {
    color: var(--v-icon-standard) !important;
}

body.zolteka-theme-zen :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-zen :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-zafiro :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-nord :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-terra :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-pergamino :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after,
body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover) > :is(i, svg),
body.zolteka-theme-kinetic :is(#sidebar, #zoltekaCarrilPanel) ul li.active > a.dropdown-toggle:not(:hover)::after {
    color: var(--theme-sidebar-text) !important;
}

:is(#sidebar, #zoltekaCarrilPanel) ul li.active li {
    border-left-width: 0px !important;
    background-color: transparent !important;
}

/*
 * Enlaces del menú (A9): flex para que la segunda línea se alinee con el texto y no con el icono.
 * Sin puntos suspensivos: el nombre de la página se lee entero. Sin animar padding (A10).
 */
:is(#sidebar, #zoltekaCarrilPanel) ul li a {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.35;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.65rem 1rem;
    color: var(--theme-sidebar-text) !important;
    font-size: var(--zolteka-font-size-base, 1rem);
    font-weight: 500;
    transition: background-color 160ms ease, color 160ms ease;
    text-decoration: none;
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

:is(#sidebar, #zoltekaCarrilPanel) ul li a > :is(i, svg) {
    flex: 0 0 1.25em;
    margin-top: 0.1em;
    margin-right: 0 !important;
}

/* Píldora hover/activo: el inset lo da el padding del ul (sin margin horizontal) */
:is(#sidebar, #zoltekaCarrilPanel) ul li a:hover,
:is(#sidebar, #zoltekaCarrilPanel) ul li.active > a,
:is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
}

/* 2.27 · C1/C7: el texto al pasar es el acento legible sobre el fondo del menú */
:is(#sidebar, #zoltekaCarrilPanel) ul li a:hover {
    background-color: rgba(var(--v-primary-rgb, 16, 185, 129), 0.08) !important;
    color: var(--zolteka-menu-acento) !important;
    border-radius: var(--zolteka-radius-btn);
    margin-top: 0.05rem;
    margin-bottom: 0.05rem;
}

/* 2.27 · C6: crimson entra en el grupo oscuro */
body.zolteka-theme-zolteka_dark :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover,
body.zolteka-theme-prestige :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover,
body.zolteka-theme-cyber :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover,
body.zolteka-theme-crimson :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover,
body.zolteka-theme-serenity :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover,
body.zolteka-theme-blaze :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover,
body.zolteka-theme-nexus :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
    color: var(--zolteka-menu-acento) !important;
    border-radius: var(--zolteka-radius-btn);
    margin-top: 0.05rem;
    margin-bottom: 0.05rem;
}

.dark-mode :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover {
    background-color: rgba(var(--v-dark-accent-rgb), 0.04) !important;
    color: var(--v-dark-accent) !important;
}

/* Elemento del submenú activo (enlace final). Los temas de A3 lo concretan más arriba */
:is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    background-color: rgba(var(--v-primary-rgb, 16, 185, 129), 0.12) !important;
    color: var(--zolteka-menu-acento) !important;
    font-weight: 600;
    border-radius: var(--zolteka-radius-btn);
    margin-top: 0.05rem;
    margin-bottom: 0.05rem;
}

.dark-mode :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    background-color: var(--v-dark-accent) !important;
    color: #000000 !important;
}

#sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--zolteka-menu-ancho);
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
    overflow-y: auto;
    z-index: 2001;
    background-color: var(--theme-sidebar-bg) !important;
    border-right: 1px solid var(--zolteka-menu-divisor) !important;
    color: var(--theme-sidebar-text) !important;
    box-shadow: none !important;
    /* A10: solo transform; el estado (abierto, carril, cajón) lo fija el <style> de MenuTemplate */
    transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* B3: sin desenfoque (coste en móviles modestos); opacidad algo mayor para distinguir el cajón */
#sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    z-index: 2000;
    background-color: rgba(15, 23, 42, 0.5);
    transition: opacity 0.3s ease;
}

/* ----------------------------------------------------
 * Carril de iconos del menú vertical (ordenador, 2.24)
 * #sidebar conserva su ancho y se desplaza con transform; su contenido se funde y
 * aparece esta columna, colocada a la derecha dentro de #sidebar. El estado
 * (body.zolteka-sidebar-carril) y el punto de corte van en el <style> de MenuTemplate.
 * ---------------------------------------------------- */
#sidebar > .sidebar-header,
#zoltekaSidebarMenu {
    transition: opacity 180ms ease, visibility 0s linear 0s;
}

.zolteka-carril {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--zolteka-carril-ancho);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    box-sizing: border-box;
    color: inherit;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 180ms ease, visibility 0s linear 180ms;
}

.zolteka-carril-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: var(--zolteka-radius-btn);
    text-decoration: none;
}

.zolteka-carril-logo img {
    height: 32px;
    width: auto;
    max-width: 44px;
    object-fit: contain;
}

/* Columna de iconos de primer nivel: se desplaza en vertical si no cabe */
.zolteka-carril-iconos {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--zolteka-menu-divisor) transparent;
}

.zolteka-carril-boton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--zolteka-radius-btn);
    background-color: transparent;
    color: inherit;
    font-size: calc(var(--zolteka-font-size-base) * 1.125);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

.zolteka-carril-boton:hover,
.zolteka-carril-boton.abierto {
    background-color: color-mix(in srgb, currentColor 10%, transparent);
    color: inherit;
}

/* 2.27 · C11: foco con el texto del menú (en default, blanco sobre el azul) */
.zolteka-carril-boton:focus-visible,
.zolteka-carril-logo:focus-visible {
    outline: 2px solid var(--zolteka-menu-texto);
    outline-offset: -2px;
}

/* Menú de la página activa: un solo marcador (fondo suave e icono en el acento legible sobre el menú, 2.27 · C7/C8) */
.zolteka-carril-boton.active {
    background-color: rgba(var(--v-primary-rgb), 0.12);
    color: var(--zolteka-menu-acento);
}

.zolteka-carril-boton.active:hover,
.zolteka-carril-boton.active.abierto {
    background-color: rgba(var(--v-primary-rgb), 0.18);
    color: var(--zolteka-menu-acento);
}

/*
 * Etiqueta del icono al pasar el ratón (tooltip de Bootstrap en body): letra del menú,
 * misma superficie que el panel flotante y sin flecha. El desplazamiento lo fija el JS (offset).
 */
.tooltip.zolteka-carril-tooltip {
    --bs-tooltip-font-size: var(--zolteka-font-size-base);
    --bs-tooltip-padding-x: 12px;
    --bs-tooltip-padding-y: 8px;
    --bs-tooltip-max-width: none;
    --bs-tooltip-bg: var(--theme-sidebar-bg);
    --bs-tooltip-color: var(--theme-sidebar-brand-text);
    --bs-tooltip-opacity: 1;
    --bs-tooltip-border-radius: var(--zolteka-radius-btn);
    font-family: inherit;
    pointer-events: none;
}

.tooltip.zolteka-carril-tooltip .tooltip-inner {
    border: 1px solid var(--zolteka-menu-divisor);
    box-shadow: var(--bs-box-shadow-sm);
    font-weight: 500;
    line-height: 1.35;
    white-space: nowrap;
}

.tooltip.zolteka-carril-tooltip .tooltip-arrow {
    display: none;
}

/* Panel flotante con la rama de un menú. Va en body (whitelist de MenuTemplate) */
#zoltekaCarrilPanel {
    position: fixed;
    top: 8px;
    /* 8 px tras el borde del carril, igual que la etiqueta: tarjeta flotante, sin franja de página de 4 px */
    left: calc(var(--zolteka-carril-ancho) + 8px);
    width: var(--zolteka-menu-ancho);
    max-height: calc(100vh - 16px);
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    /* Barra de desplazamiento fina con los colores del menú (la nativa sale clara y gruesa sobre el panel oscuro) */
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--theme-sidebar-text) 30%, transparent) transparent;
    box-sizing: border-box;
    background-color: var(--theme-sidebar-bg);
    color: var(--theme-sidebar-text);
    border: 1px solid var(--zolteka-menu-divisor);
    border-radius: var(--zolteka-radius-card);
    box-shadow: var(--bs-box-shadow-sm);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 180ms ease, transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

#zoltekaCarrilPanel.visible {
    opacity: 1;
    transform: translateX(0);
}

#zoltekaCarrilPanel::-webkit-scrollbar {
    width: 6px;
}

#zoltekaCarrilPanel::-webkit-scrollbar-track {
    background: transparent;
}

#zoltekaCarrilPanel::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--theme-sidebar-text) 30%, transparent);
    border-radius: 3px;
}

/* Foco por teclado en el menú y en el panel: anillo del tema en vez del halo de Bootstrap (poco visible en oscuro) */
:is(#sidebar, #zoltekaCarrilPanel) .nav-link:focus {
    box-shadow: none;
}

:is(#sidebar, #zoltekaCarrilPanel) .nav-link:focus-visible {
    /* 2.27 · C11: texto del menú (el primario se perdía sobre menús de su color, como default) */
    outline: 2px solid var(--zolteka-menu-texto);
    outline-offset: -2px;
    box-shadow: none;
}

.zolteka-carril-panel-cabecera {
    position: sticky;
    top: 0;
    z-index: 1;
    /* Hereda el fondo del panel (en el tema default lo fija CssAfter) */
    background-color: inherit;
    padding: 12px 16px;
    border-bottom: 1px solid var(--zolteka-menu-divisor);
    color: var(--theme-sidebar-brand-text);
    font-size: var(--zolteka-font-size-base);
    font-weight: 600;
    line-height: 1.35;
}

/* La rama movida es un ul.collapse que puede venir cerrado del menú abierto */
.zolteka-carril-panel-cuerpo > ul.collapse {
    display: block !important;
    height: auto !important;
}

@media (prefers-reduced-motion: reduce) {
    #sidebar,
    #sidebar > .sidebar-header,
    #zoltekaSidebarMenu,
    .zolteka-carril,
    #zoltekaCarrilPanel {
        transition: opacity 120ms ease !important;
    }

    #zoltekaCarrilPanel,
    #zoltekaCarrilPanel.visible {
        transform: none !important;
    }
}

/*
 * Modales Bootstrap por encima del sidebar (z-index 2001).
 * Sin esto el menú vertical queda nítido e interactivo sobre el backdrop (~1050).
 */
body.zolteka-vertical-menu .modal-backdrop {
    z-index: 2100 !important;
    margin-left: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    left: 0 !important;
}

body.zolteka-vertical-menu .modal {
    z-index: 2110 !important;
}

/*
 * Librerías de desplegable flotante (Select2, Flatpickr, jQuery UI Autocomplete, TomSelect)
 * que el browser renderiza como hijo directo de <body>.
 * Al elevar los modales a 2110, estos flotantes quedarían enterrados por debajo.
 * Se elevan a 2150 para que siempre sean visibles e interactivos dentro de modales.
 * Solo aplica en modo menú vertical; en horizontal no hay cambio de z-index en modales.
 */
body.zolteka-vertical-menu .select2-container--open,
body.zolteka-vertical-menu .select2-dropdown {
    z-index: 2150 !important;
}

body.zolteka-vertical-menu .flatpickr-calendar {
    z-index: 2150 !important;
}

body.zolteka-vertical-menu .ui-autocomplete {
    z-index: 2150 !important;
}

body.zolteka-vertical-menu .ts-dropdown {
    z-index: 2150 !important;
}

/* Panel flotante del carril de iconos (2.24): va en body, por encima del menú y de los modales */
body.zolteka-vertical-menu #zoltekaCarrilPanel {
    z-index: 2150 !important;
}

/* Ajustes de Wrapper general para menú vertical */
body.zolteka-vertical-menu {
    padding-top: 0 !important;
}

/* Adaptación responsiva del Sidebar delegada a la plantilla Twig dinámica */

/* Barra superior en modo vertical (navbar-custom) con el color secundario sólido del menú */
body.zolteka-vertical-menu .navbar-custom {
    background-color: var(--theme-sidebar-bg) !important;
    border-bottom: 1px solid var(--zolteka-menu-divisor, var(--bs-border-color)) !important;
    box-shadow: var(--bs-box-shadow-sm) !important;
    padding-left: 0 !important;
    /* Totalmente pegado a la izquierda */
    padding-right: 1rem !important;
    height: 56px;
    display: flex;
    align-items: center;
    /* A10: el margen cambia sin transición (un solo recálculo al pasar a carril) */
}

/* Hamburguesa (A12): botón con zona de 44×44 px */
body.zolteka-vertical-menu .navbar-custom #menuIconSidebarToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin-left: 4px;
    padding: 0 !important;
    border: 0;
    background: transparent;
    border-radius: var(--zolteka-radius-btn);
}

body.zolteka-vertical-menu .navbar-custom #menuIconSidebarToggle:focus-visible {
    outline: 2px solid var(--zolteka-menu-texto);
    outline-offset: -2px;
}

body.zolteka-vertical-menu .navbar-custom .nav-link,
body.zolteka-vertical-menu .navbar-custom .navbar-brand,
body.zolteka-vertical-menu .navbar-custom .navbar-brand span,
body.zolteka-vertical-menu .navbar-custom .navbar-text,
body.zolteka-vertical-menu .navbar-custom .navbar-text i {
    color: var(--theme-sidebar-brand-text) !important;
}

/* Layout centrado: 1fr | minmax | 1fr = centro geométrico + ancho usable del pill (no auto/intrinsic) */
body.zolteka-vertical-menu .navbar-custom .container-fluid.zolteka-navbar-grid,
.zolteka-navbar-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 450px) minmax(0, 1fr) !important;
    align-items: center !important;
    width: 100% !important;
    column-gap: 0.5rem !important;
}

.zolteka-navbar-grid>ul:first-child {
    justify-self: start !important;
    min-width: 0;
    margin-right: 0 !important;
    overflow: hidden;
    flex-wrap: nowrap;
}

.zolteka-navbar-grid>ul:first-child>li {
    flex-shrink: 0;
}

.zolteka-navbar-grid>ul:first-child>li.zolteka-navbar-breadcrumb {
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
}

.zolteka-navbar-grid>ul:first-child .navbar-text {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zolteka-navbar-grid>#zoltekaVerticalSearchForm,
.zolteka-vertical-search-form {
    justify-self: stretch !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

.zolteka-navbar-grid>ul:last-child {
    justify-self: end !important;
    margin-left: 0 !important;
    flex-shrink: 0;
}

/* Portátil / desktop estrecho: pill más corto, sigue centrado */
@media (max-width: 1399.98px) {
    body.zolteka-vertical-menu .navbar-custom .container-fluid.zolteka-navbar-grid,
    .zolteka-navbar-grid {
        grid-template-columns: minmax(0, 1fr) minmax(240px, 320px) minmax(0, 1fr) !important;
    }
}

@media (max-width: 1199.98px) {
    body.zolteka-vertical-menu .navbar-custom .container-fluid.zolteka-navbar-grid,
    .zolteka-navbar-grid {
        grid-template-columns: minmax(0, 1fr) minmax(200px, 260px) minmax(0, 1fr) !important;
    }
}

/* Estilos de submenú dropdown centralizados */
.dropdown-menu,
.navbar .dropdown-menu {
    background-color: #FFFFFF !important;
    border: 1px solid var(--bs-border-color, #E2E8F0) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    border-radius: var(--zolteka-radius-card, 8px) !important;
    padding: 0.5rem !important;
    margin-top: 0.25rem !important;
}

.dropdown-menu .dropdown-item,
.navbar .dropdown-item {
    color: #334155 !important;
    background-color: transparent !important;
    border-radius: var(--zolteka-radius-btn, 6px) !important;
    padding: 0.5rem 1rem !important;
    font-weight: 500;
    transition: background-color 0.15s ease, color 0.15s ease;
}

/* 2.27 · C1: el ítem al pasar o activo es texto sobre el tinte claro */
.dropdown-item:hover,
.dropdown-item.active,
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item.active {
    background-color: var(--theme-dropdown-hover-bg, rgba(16, 185, 129, 0.08)) !important;
    color: var(--zolteka-acento-texto) !important;
}

/* Modo oscuro para submenús. 2.27 · C6: crimson entra en el grupo oscuro */
.dark-mode .dropdown-menu,
[data-bs-theme="dark"] .dropdown-menu,
body.zolteka-theme-zolteka_dark .dropdown-menu,
body.zolteka-theme-prestige .dropdown-menu,
body.zolteka-theme-cyber .dropdown-menu,
body.zolteka-theme-crimson .dropdown-menu,
body.zolteka-theme-serenity .dropdown-menu,
body.zolteka-theme-blaze .dropdown-menu,
body.zolteka-theme-nexus .dropdown-menu {
    background-color: #1E293B !important;
    border-color: #334155 !important;
}

.dark-mode .dropdown-menu .dropdown-item,
[data-bs-theme="dark"] .dropdown-menu .dropdown-item,
body.zolteka-theme-zolteka_dark .dropdown-menu .dropdown-item,
body.zolteka-theme-prestige .dropdown-menu .dropdown-item,
body.zolteka-theme-cyber .dropdown-menu .dropdown-item,
body.zolteka-theme-crimson .dropdown-menu .dropdown-item,
body.zolteka-theme-serenity .dropdown-menu .dropdown-item,
body.zolteka-theme-blaze .dropdown-menu .dropdown-item,
body.zolteka-theme-nexus .dropdown-menu .dropdown-item {
    color: #F1F5F9 !important;
}

/* 2.27 · C1/C7: hover y activo con el acento legible sobre oscuro (antes el activo salía oscuro sobre oscuro) */
.dark-mode .dropdown-menu .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-menu .dropdown-item:hover,
body.zolteka-theme-zolteka_dark .dropdown-menu .dropdown-item:hover,
body.zolteka-theme-prestige .dropdown-menu .dropdown-item:hover,
body.zolteka-theme-cyber .dropdown-menu .dropdown-item:hover,
body.zolteka-theme-crimson .dropdown-menu .dropdown-item:hover,
body.zolteka-theme-serenity .dropdown-menu .dropdown-item:hover,
body.zolteka-theme-blaze .dropdown-menu .dropdown-item:hover,
body.zolteka-theme-nexus .dropdown-menu .dropdown-item:hover,
body.zolteka-theme-zolteka_dark .dropdown-menu .dropdown-item.active,
body.zolteka-theme-prestige .dropdown-menu .dropdown-item.active,
body.zolteka-theme-cyber .dropdown-menu .dropdown-item.active,
body.zolteka-theme-crimson .dropdown-menu .dropdown-item.active,
body.zolteka-theme-serenity .dropdown-menu .dropdown-item.active,
body.zolteka-theme-blaze .dropdown-menu .dropdown-item.active,
body.zolteka-theme-nexus .dropdown-menu .dropdown-item.active {
    background-color: var(--theme-dropdown-hover-bg, rgba(79, 70, 229, 0.12)) !important;
    /* Desplegable general (#1E293B, más claro que el menú): el acento del menú aclarado un 40% */
    color: color-mix(in srgb, var(--zolteka-menu-acento) 60%, #FFFFFF) !important;
}

/* 2.27 · C6: cabeceras de los desplegables oscuros (el h6 del contenido se leía oscuro sobre oscuro) */
body.zolteka-theme-zolteka_dark .dropdown-menu .dropdown-header,
body.zolteka-theme-prestige .dropdown-menu .dropdown-header,
body.zolteka-theme-cyber .dropdown-menu .dropdown-header,
body.zolteka-theme-crimson .dropdown-menu .dropdown-header,
body.zolteka-theme-serenity .dropdown-menu .dropdown-header,
body.zolteka-theme-blaze .dropdown-menu .dropdown-header,
body.zolteka-theme-nexus .dropdown-menu .dropdown-header {
    color: var(--zolteka-menu-apagado-oscuro) !important;
}



/* --- 4. Reglas Estrictas de Jerarquía de Color y Fuentes --- */

body,
body.zolteka-theme-zolteka,
body.zolteka-theme-zolteka_dark,
body.zolteka-theme-prestige,
body.zolteka-theme-cyber,
body.zolteka-theme-serenity,
body.zolteka-theme-blaze,
body.zolteka-theme-nexus,
body.zolteka-theme-zen,
body.zolteka-theme-zafiro,
body.zolteka-theme-nord,
body.zolteka-theme-terra,
body.zolteka-theme-pergamino,
body.zolteka-theme-kinetic,
body.zolteka-theme-custom,
body.zolteka-theme-default {
    background-color: var(--bs-body-bg, #FFFFFF) !important;
    /* 2.27 · C3: texto propio del contenido; el gris del menú oscuro (#94A3B8) no llega sobre blanco */
    color: var(--zolteka-texto-contenido) !important;
}

/* Únicamente el contenedor de cabecera de opciones lleva el tinte 3.5% */
div.bg-light.pt-3,
.nav-tabs-wrapper {
    background-color: var(--v-bg-secondary) !important;
}

/* Encabezados */
/*
 * 2.27 · C4: el color de los títulos no gana a las utilidades de color (.text-danger, .text-white…)
 * ni a los títulos dentro de .text-bg-* o de un bloque .text-white (p. ej. «Deudores» del informe).
 * :where() deja la especificidad como antes. C6: crimson entra en la regla.
 */
body:is(.zolteka-theme-zolteka, .zolteka-theme-zolteka_dark, .zolteka-theme-prestige, .zolteka-theme-cyber, .zolteka-theme-crimson, .zolteka-theme-serenity, .zolteka-theme-blaze, .zolteka-theme-nexus, .zolteka-theme-zen, .zolteka-theme-zafiro, .zolteka-theme-nord, .zolteka-theme-terra, .zolteka-theme-pergamino, .zolteka-theme-kinetic) :is(h1, h2, h3),
body:is(.zolteka-theme-zolteka, .zolteka-theme-zolteka_dark, .zolteka-theme-prestige, .zolteka-theme-cyber, .zolteka-theme-crimson, .zolteka-theme-serenity, .zolteka-theme-blaze, .zolteka-theme-nexus, .zolteka-theme-zen, .zolteka-theme-zafiro, .zolteka-theme-nord, .zolteka-theme-terra, .zolteka-theme-pergamino, .zolteka-theme-kinetic) :is(.h1, .h2, .h3) {
    font-weight: 700 !important;
}

body:is(.zolteka-theme-zolteka, .zolteka-theme-zolteka_dark, .zolteka-theme-prestige, .zolteka-theme-cyber, .zolteka-theme-crimson, .zolteka-theme-serenity, .zolteka-theme-blaze, .zolteka-theme-nexus, .zolteka-theme-zen, .zolteka-theme-zafiro, .zolteka-theme-nord, .zolteka-theme-terra, .zolteka-theme-pergamino, .zolteka-theme-kinetic) :is(h1, h2, h3):not(:where(.text-primary, .text-secondary, .text-success, .text-danger, .text-warning, .text-info, .text-light, .text-dark, .text-white, .text-black, .text-muted, .text-body, .text-body-secondary, .text-body-tertiary, .text-body-emphasis, .text-primary-emphasis, .text-secondary-emphasis, .text-success-emphasis, .text-danger-emphasis, .text-warning-emphasis, .text-info-emphasis, .text-light-emphasis, .text-dark-emphasis, .text-reset, [class*="text-bg-"] *, .text-white *, .text-light *, .dropdown-menu *)),
body:is(.zolteka-theme-zolteka, .zolteka-theme-zolteka_dark, .zolteka-theme-prestige, .zolteka-theme-cyber, .zolteka-theme-crimson, .zolteka-theme-serenity, .zolteka-theme-blaze, .zolteka-theme-nexus, .zolteka-theme-zen, .zolteka-theme-zafiro, .zolteka-theme-nord, .zolteka-theme-terra, .zolteka-theme-pergamino, .zolteka-theme-kinetic) :is(.h1, .h2, .h3):not(:where(.text-primary, .text-secondary, .text-success, .text-danger, .text-warning, .text-info, .text-light, .text-dark, .text-white, .text-black, .text-muted, .text-body, .text-body-secondary, .text-body-tertiary, .text-body-emphasis, .text-primary-emphasis, .text-secondary-emphasis, .text-success-emphasis, .text-danger-emphasis, .text-warning-emphasis, .text-info-emphasis, .text-light-emphasis, .text-dark-emphasis, .text-reset, [class*="text-bg-"] *, .text-white *, .text-light *, .dropdown-menu *)) {
    color: var(--v-heading-color) !important;
}

body:is(.zolteka-theme-zolteka, .zolteka-theme-zolteka_dark, .zolteka-theme-prestige, .zolteka-theme-cyber, .zolteka-theme-crimson, .zolteka-theme-serenity, .zolteka-theme-blaze, .zolteka-theme-nexus, .zolteka-theme-zen, .zolteka-theme-zafiro, .zolteka-theme-nord, .zolteka-theme-terra, .zolteka-theme-pergamino, .zolteka-theme-kinetic) :is(h4, h5, h6),
body:is(.zolteka-theme-zolteka, .zolteka-theme-zolteka_dark, .zolteka-theme-prestige, .zolteka-theme-cyber, .zolteka-theme-crimson, .zolteka-theme-serenity, .zolteka-theme-blaze, .zolteka-theme-nexus, .zolteka-theme-zen, .zolteka-theme-zafiro, .zolteka-theme-nord, .zolteka-theme-terra, .zolteka-theme-pergamino, .zolteka-theme-kinetic) :is(.h4, .h5, .h6) {
    font-weight: 600 !important;
}

/* 2.27 · C3: h4-h6 con el texto del contenido (antes, el gris del menú oscuro) */
body:is(.zolteka-theme-zolteka, .zolteka-theme-zolteka_dark, .zolteka-theme-prestige, .zolteka-theme-cyber, .zolteka-theme-crimson, .zolteka-theme-serenity, .zolteka-theme-blaze, .zolteka-theme-nexus, .zolteka-theme-zen, .zolteka-theme-zafiro, .zolteka-theme-nord, .zolteka-theme-terra, .zolteka-theme-pergamino, .zolteka-theme-kinetic) :is(h4, h5, h6):not(:where(.text-primary, .text-secondary, .text-success, .text-danger, .text-warning, .text-info, .text-light, .text-dark, .text-white, .text-black, .text-muted, .text-body, .text-body-secondary, .text-body-tertiary, .text-body-emphasis, .text-primary-emphasis, .text-secondary-emphasis, .text-success-emphasis, .text-danger-emphasis, .text-warning-emphasis, .text-info-emphasis, .text-light-emphasis, .text-dark-emphasis, .text-reset, [class*="text-bg-"] *, .text-white *, .text-light *, .dropdown-menu *)),
body:is(.zolteka-theme-zolteka, .zolteka-theme-zolteka_dark, .zolteka-theme-prestige, .zolteka-theme-cyber, .zolteka-theme-crimson, .zolteka-theme-serenity, .zolteka-theme-blaze, .zolteka-theme-nexus, .zolteka-theme-zen, .zolteka-theme-zafiro, .zolteka-theme-nord, .zolteka-theme-terra, .zolteka-theme-pergamino, .zolteka-theme-kinetic) :is(.h4, .h5, .h6):not(:where(.text-primary, .text-secondary, .text-success, .text-danger, .text-warning, .text-info, .text-light, .text-dark, .text-white, .text-black, .text-muted, .text-body, .text-body-secondary, .text-body-tertiary, .text-body-emphasis, .text-primary-emphasis, .text-secondary-emphasis, .text-success-emphasis, .text-danger-emphasis, .text-warning-emphasis, .text-info-emphasis, .text-light-emphasis, .text-dark-emphasis, .text-reset, [class*="text-bg-"] *, .text-white *, .text-light *, .dropdown-menu *)) {
    color: var(--zolteka-texto-contenido) !important;
}

/* 2.27 · C4: dentro de .text-bg-* o de un bloque .text-white/.text-light el título hereda su color */
body[class*="zolteka-theme-"] :is([class*="text-bg-"], .text-white, .text-light) :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6):not(:where(.text-primary, .text-secondary, .text-success, .text-danger, .text-warning, .text-info, .text-dark, .text-black, .text-muted, .text-body)) {
    color: inherit !important;
}

/* Config agenda: tipografía = tokens ConfigZolteka (base + h5/h6; sin rem/px fijos) */
.zolteka-calendar-config-block {
    font-size: var(--zolteka-font-size-base, 1rem);
}

.zolteka-calendar-config-title {
    font-size: var(--zolteka-font-size-h5, var(--zolteka-font-size-base, 1rem));
    line-height: 1.3;
}

.zolteka-calendar-config-label {
    font-size: var(--zolteka-font-size-h6, calc(var(--zolteka-font-size-base, 1rem) * 0.875));
}

.zolteka-calendar-config-help {
    font-size: calc(var(--zolteka-font-size-base, 1rem) * 0.875);
    line-height: 1.4;
}

.zolteka-calendar-config-accordion-btn {
    font-size: var(--zolteka-font-size-h5, var(--zolteka-font-size-base, 1rem)) !important;
    font-weight: 600;
    color: var(--bs-body-color, #0f172a) !important;
    background-color: var(--bs-body-bg, #fff) !important;
    box-shadow: none !important;
}

.zolteka-calendar-config-accordion-btn:not(.collapsed) {
    color: var(--bs-body-color, #0f172a) !important;
    background-color: var(--bs-tertiary-bg, #f8fafc) !important;
}

.zolteka-calendar-config-accordion-btn .fa-solid,
.zolteka-calendar-config-accordion-btn .fa-brands {
    color: var(--zolteka-acento-texto, var(--v-primary));
}

.zolteka-calendar-pwa-icon {
    background-color: rgba(var(--bs-primary-rgb, 16, 185, 129), 0.04);
}

.zolteka-push-step-icon {
    width: 2.4rem;
    height: 2.4rem;
    font-size: calc(var(--zolteka-font-size-base, 1rem) * 0.95);
}

/* Aviso SMTP calendario: bloque plano integrado en el footer del formulario */
.zolteka-calendar-email-info {
    background-color: rgba(var(--bs-primary-rgb), 0.04);
}

/* Botones neutros (secondary, light, default) y de contorno con legibilidad y contraste garantizados */
.btn-secondary,
.btn-light,
.btn-default {
    background-color: #E2E8F0 !important;
    border-color: #CBD5E1 !important;
    color: #1E293B !important;
    font-weight: 500;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active,
.btn-light:hover,
.btn-light:focus,
.btn-light:active,
.btn-default:hover,
.btn-default:focus,
.btn-default:active {
    background-color: #CBD5E1 !important;
    border-color: #94A3B8 !important;
    color: #0F172A !important;
}

.btn-outline-secondary,
.btn-outline-light {
    background-color: #FFFFFF !important;
    border-color: #CBD5E1 !important;
    color: #475569 !important;
    font-weight: 500;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-outline-light:hover,
.btn-outline-light:focus,
.btn-outline-light:active {
    background-color: #E2E8F0 !important;
    border-color: #94A3B8 !important;
    color: #0F172A !important;
}

/* btn-check:checked (EditPageOption, Wizard, etc.): el !important base
   anula el estado marcado nativo de Bootstrap; hay que redefinirlo aquí. */
.btn-check:checked + .btn-outline-secondary,
.btn-check:active + .btn-outline-secondary,
.btn-check:checked + .btn-outline-light,
.btn-check:active + .btn-outline-light {
    background-color: var(--zolteka-primary-relleno) !important;
    border-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
}

.btn-check:checked:focus + .btn-outline-secondary,
.btn-check:checked:focus + .btn-outline-light {
    box-shadow: 0 0 0 0.2rem rgba(var(--v-primary-rgb, 16, 185, 129), 0.35) !important;
}

.dark-mode .btn-secondary,
.dark-mode .btn-light,
.dark-mode .btn-default,
[data-bs-theme="dark"] .btn-secondary,
[data-bs-theme="dark"] .btn-light,
[data-bs-theme="dark"] .btn-default,
body.zolteka-theme-zolteka_dark .btn-secondary,
body.zolteka-theme-zolteka_dark .btn-light,
body.zolteka-theme-zolteka_dark .btn-default,
body.zolteka-theme-prestige .btn-secondary,
body.zolteka-theme-prestige .btn-light,
body.zolteka-theme-prestige .btn-default,
body.zolteka-theme-cyber .btn-secondary,
body.zolteka-theme-cyber .btn-light,
body.zolteka-theme-cyber .btn-default,
body.zolteka-theme-crimson .btn-secondary,
body.zolteka-theme-crimson .btn-light,
body.zolteka-theme-crimson .btn-default,
body.zolteka-theme-serenity .btn-secondary,
body.zolteka-theme-serenity .btn-light,
body.zolteka-theme-serenity .btn-default,
body.zolteka-theme-blaze .btn-secondary,
body.zolteka-theme-blaze .btn-light,
body.zolteka-theme-blaze .btn-default,
body.zolteka-theme-nexus .btn-secondary,
body.zolteka-theme-nexus .btn-light,
body.zolteka-theme-nexus .btn-default {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #F8FAFC !important;
}

.dark-mode .btn-secondary:hover,
.dark-mode .btn-light:hover,
.dark-mode .btn-default:hover,
[data-bs-theme="dark"] .btn-secondary:hover,
[data-bs-theme="dark"] .btn-light:hover,
[data-bs-theme="dark"] .btn-default:hover,
body.zolteka-theme-zolteka_dark .btn-secondary:hover,
body.zolteka-theme-zolteka_dark .btn-light:hover,
body.zolteka-theme-zolteka_dark .btn-default:hover,
body.zolteka-theme-prestige .btn-secondary:hover,
body.zolteka-theme-prestige .btn-light:hover,
body.zolteka-theme-prestige .btn-default:hover,
body.zolteka-theme-cyber .btn-secondary:hover,
body.zolteka-theme-cyber .btn-light:hover,
body.zolteka-theme-cyber .btn-default:hover,
body.zolteka-theme-crimson .btn-secondary:hover,
body.zolteka-theme-crimson .btn-light:hover,
body.zolteka-theme-crimson .btn-default:hover,
body.zolteka-theme-serenity .btn-secondary:hover,
body.zolteka-theme-serenity .btn-light:hover,
body.zolteka-theme-serenity .btn-default:hover,
body.zolteka-theme-blaze .btn-secondary:hover,
body.zolteka-theme-blaze .btn-light:hover,
body.zolteka-theme-blaze .btn-default:hover,
body.zolteka-theme-nexus .btn-secondary:hover,
body.zolteka-theme-nexus .btn-light:hover,
body.zolteka-theme-nexus .btn-default:hover {
    background-color: #475569 !important;
    border-color: #64748B !important;
    color: #FFFFFF !important;
}

.dark-mode .btn-outline-secondary,
.dark-mode .btn-outline-light,
[data-bs-theme="dark"] .btn-outline-secondary,
[data-bs-theme="dark"] .btn-outline-light,
body.zolteka-theme-zolteka_dark .btn-outline-secondary,
body.zolteka-theme-zolteka_dark .btn-outline-light,
body.zolteka-theme-prestige .btn-outline-secondary,
body.zolteka-theme-prestige .btn-outline-light,
body.zolteka-theme-cyber .btn-outline-secondary,
body.zolteka-theme-cyber .btn-outline-light,
body.zolteka-theme-crimson .btn-outline-secondary,
body.zolteka-theme-crimson .btn-outline-light,
body.zolteka-theme-serenity .btn-outline-secondary,
body.zolteka-theme-serenity .btn-outline-light,
body.zolteka-theme-blaze .btn-outline-secondary,
body.zolteka-theme-blaze .btn-outline-light,
body.zolteka-theme-nexus .btn-outline-secondary,
body.zolteka-theme-nexus .btn-outline-light {
    background-color: #1E293B !important;
    border-color: #475569 !important;
    color: #E2E8F0 !important;
}

.dark-mode .btn-outline-secondary:hover,
.dark-mode .btn-outline-light:hover,
[data-bs-theme="dark"] .btn-outline-secondary:hover,
[data-bs-theme="dark"] .btn-outline-light:hover,
body.zolteka-theme-zolteka_dark .btn-outline-secondary:hover,
body.zolteka-theme-zolteka_dark .btn-outline-light:hover,
body.zolteka-theme-prestige .btn-outline-secondary:hover,
body.zolteka-theme-prestige .btn-outline-light:hover,
body.zolteka-theme-cyber .btn-outline-secondary:hover,
body.zolteka-theme-cyber .btn-outline-light:hover,
body.zolteka-theme-crimson .btn-outline-secondary:hover,
body.zolteka-theme-crimson .btn-outline-light:hover,
body.zolteka-theme-serenity .btn-outline-secondary:hover,
body.zolteka-theme-serenity .btn-outline-light:hover,
body.zolteka-theme-blaze .btn-outline-secondary:hover,
body.zolteka-theme-blaze .btn-outline-light:hover,
body.zolteka-theme-nexus .btn-outline-secondary:hover,
body.zolteka-theme-nexus .btn-outline-light:hover {
    background-color: #334155 !important;
    border-color: #64748B !important;
    color: #FFFFFF !important;
}

.dark-mode .btn-check:checked + .btn-outline-secondary,
.dark-mode .btn-check:active + .btn-outline-secondary,
.dark-mode .btn-check:checked + .btn-outline-light,
.dark-mode .btn-check:active + .btn-outline-light,
[data-bs-theme="dark"] .btn-check:checked + .btn-outline-secondary,
[data-bs-theme="dark"] .btn-check:active + .btn-outline-secondary,
[data-bs-theme="dark"] .btn-check:checked + .btn-outline-light,
[data-bs-theme="dark"] .btn-check:active + .btn-outline-light,
body.zolteka-theme-zolteka_dark .btn-check:checked + .btn-outline-secondary,
body.zolteka-theme-zolteka_dark .btn-check:active + .btn-outline-secondary,
body.zolteka-theme-zolteka_dark .btn-check:checked + .btn-outline-light,
body.zolteka-theme-zolteka_dark .btn-check:active + .btn-outline-light,
body.zolteka-theme-prestige .btn-check:checked + .btn-outline-secondary,
body.zolteka-theme-prestige .btn-check:active + .btn-outline-secondary,
body.zolteka-theme-prestige .btn-check:checked + .btn-outline-light,
body.zolteka-theme-prestige .btn-check:active + .btn-outline-light,
body.zolteka-theme-cyber .btn-check:checked + .btn-outline-secondary,
body.zolteka-theme-cyber .btn-check:active + .btn-outline-secondary,
body.zolteka-theme-cyber .btn-check:checked + .btn-outline-light,
body.zolteka-theme-cyber .btn-check:active + .btn-outline-light,
body.zolteka-theme-crimson .btn-check:checked + .btn-outline-secondary,
body.zolteka-theme-crimson .btn-check:active + .btn-outline-secondary,
body.zolteka-theme-crimson .btn-check:checked + .btn-outline-light,
body.zolteka-theme-crimson .btn-check:active + .btn-outline-light,
body.zolteka-theme-serenity .btn-check:checked + .btn-outline-secondary,
body.zolteka-theme-serenity .btn-check:active + .btn-outline-secondary,
body.zolteka-theme-serenity .btn-check:checked + .btn-outline-light,
body.zolteka-theme-serenity .btn-check:active + .btn-outline-light,
body.zolteka-theme-blaze .btn-check:checked + .btn-outline-secondary,
body.zolteka-theme-blaze .btn-check:active + .btn-outline-secondary,
body.zolteka-theme-blaze .btn-check:checked + .btn-outline-light,
body.zolteka-theme-blaze .btn-check:active + .btn-outline-light,
body.zolteka-theme-nexus .btn-check:checked + .btn-outline-secondary,
body.zolteka-theme-nexus .btn-check:active + .btn-outline-secondary,
body.zolteka-theme-nexus .btn-check:checked + .btn-outline-light,
body.zolteka-theme-nexus .btn-check:active + .btn-outline-light {
    background-color: var(--zolteka-primary-relleno) !important;
    border-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
}



/* Tarjetas sobre bloques oscuros (por ejemplo, el sidebar oscuro) */
body.zolteka-theme-zolteka_dark #sidebar .card,
body.zolteka-theme-prestige #sidebar .card,
body.zolteka-theme-cyber #sidebar .card,
body.zolteka-theme-serenity #sidebar .card,
body.zolteka-theme-blaze #sidebar .card,
body.zolteka-theme-nexus #sidebar .card,
.zolteka-dark-block .card,
.bg-dark .card {
    background-color: #1E293B !important;
    border-color: #334155 !important;
    color: #F8FAFC !important;
    box-shadow: none !important;
}

/* Iconos y Decoraciones */
.nav-link i,
:is(#sidebar, #zoltekaCarrilPanel) ul li a i {
    color: var(--v-icon-standard) !important;
}

/* 2.27 · C1: icono de la pestaña al pasar o activa, con el acento legible sobre claro */
.nav-link:hover i,
.nav-link.active i {
    color: var(--zolteka-acento-texto) !important;
}

/* …y dentro del menú o de las barras, con el acento legible sobre su fondo */
:is(#sidebar, #zoltekaCarrilPanel) ul li a:hover i,
:is(#sidebar, #zoltekaCarrilPanel, .navbar, .navbar-custom, .mobile-top-header) .nav-link:hover i,
:is(#sidebar, #zoltekaCarrilPanel, .navbar, .navbar-custom, .mobile-top-header) .nav-link.active i {
    color: var(--zolteka-menu-acento) !important;
}

/* Iconos del activo en el menú oscuro: los fija el bloque de jerarquía A3 (grupo neutro, página en el acento) */

/* Clases de utilidad para iconos corporativos */
.icon-standard,
i.standard {
    color: #64748B !important;
}

.icon-brand,
i.brand,
i.highlighted {
    color: #10B981 !important;
    /* Verde Esmeralda para marca/destacados */
}

.icon-security,
i.security,
i.certification {
    color: #B08D57 !important;
    /* Bronce Envejecido para seguridad/certificación */
}

/* ==========================================================================
   5. DISEÑO DE NAVEGACIÓN MÓVIL Y TABLET PREMIUM (2026)
   ========================================================================== */

/* Cabecera móvil fija */
.mobile-top-header {
    height: 56px !important;
    background-color: var(--theme-sidebar-bg) !important;
    border-bottom: 1px solid var(--zolteka-menu-divisor, var(--bs-border-color)) !important;
    box-shadow: var(--bs-box-shadow-sm) !important;
    z-index: 1020 !important;
    display: flex;
    align-items: center;
    padding: 0 1rem;
    margin-left: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* B1: zona de toque de 44×44 px (el Twig quita el hueco entre iconos con gap-0) */
.mobile-top-header .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 !important;
    color: var(--theme-sidebar-text) !important;
    font-weight: 500;
    transition: color 0.15s ease;
}

/* 2.27 · C6: iconos con el texto apagado del menú (el gris fijo no llegaba sobre los menús oscuros) */
.mobile-top-header .nav-link :is(i, svg) {
    color: var(--zolteka-menu-apagado) !important;
    transition: color 0.15s ease;
}

.mobile-top-header .nav-link:hover :is(i, svg),
.mobile-top-header .nav-link.active :is(i, svg),
.mobile-top-header .nav-link:focus :is(i, svg) {
    color: var(--zolteka-menu-acento) !important;
}

/* Barra de navegación inferior móvil fija */
.mobile-bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background-color: var(--theme-sidebar-bg) !important;
    border-top: 1px solid var(--bs-border-color) !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05) !important;
    z-index: 1030 !important;
    /* Por encima del contenido, por debajo de sidebar overlay */
    padding-bottom: env(safe-area-inset-bottom) !important;
    height: calc(56px + env(safe-area-inset-bottom)) !important;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-left: 0 !important;
    max-width: 100% !important;
}

.mobile-bottom-nav-item {
    flex: 1;
    text-align: center;
    color: var(--theme-sidebar-text);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 100%;
    transition: color 0.15s ease-in-out;
}

/* B2: icono de 20 px con su etiqueta debajo */
.mobile-bottom-nav-item i,
.mobile-bottom-nav-item svg {
    font-size: 20px !important;
    color: var(--v-icon-standard);
    transition: color 0.15s ease-in-out;
}

.mobile-bottom-nav-etiqueta {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: calc(var(--zolteka-font-size-base) * 0.75);
    font-weight: 500;
    line-height: 1.2;
    color: inherit;
}

/*
 * 2.27 · C6/C8: Font Awesome puede pintar <svg> en lugar de <i>: las reglas cubren los dos.
 * Activo y hover con el acento legible sobre la barra.
 */
.mobile-bottom-nav-item:hover :is(i, svg),
.mobile-bottom-nav-item.active :is(i, svg) {
    color: var(--zolteka-menu-acento);
}

/* Grupo oscuro (crimson incluido): iconos en reposo con el texto apagado (:where no sube la especificidad: el hover sigue ganando) y activo con el acento oscuro del tema */
:where(body.zolteka-theme-zolteka_dark, body.zolteka-theme-prestige, body.zolteka-theme-cyber, body.zolteka-theme-crimson, body.zolteka-theme-serenity, body.zolteka-theme-blaze, body.zolteka-theme-nexus) .mobile-bottom-nav-item :is(i, svg) {
    color: var(--zolteka-menu-apagado);
}

.dark-mode .mobile-bottom-nav-item.active i,
[data-bs-theme="dark"] .mobile-bottom-nav-item.active i,
body.zolteka-theme-zolteka_dark .mobile-bottom-nav-item.active :is(i, svg),
body.zolteka-theme-prestige .mobile-bottom-nav-item.active :is(i, svg),
body.zolteka-theme-cyber .mobile-bottom-nav-item.active :is(i, svg),
body.zolteka-theme-crimson .mobile-bottom-nav-item.active :is(i, svg),
body.zolteka-theme-serenity .mobile-bottom-nav-item.active :is(i, svg),
body.zolteka-theme-blaze .mobile-bottom-nav-item.active :is(i, svg),
body.zolteka-theme-nexus .mobile-bottom-nav-item.active :is(i, svg) {
    color: var(--v-dark-accent) !important;
}

/* Soporte de alto contraste para Tema Predeterminado (Default) en Móvil */
.zolteka-theme-default .mobile-top-header {
    background-color: var(--v-primary) !important;
}

.zolteka-theme-default .mobile-top-header,
.zolteka-theme-default .mobile-top-header .mobile-top-title,
.zolteka-theme-default .mobile-top-header .navbar-text,
.zolteka-theme-default .mobile-top-header span,
.zolteka-theme-default .mobile-top-header>.container-fluid>a,
.zolteka-theme-default .mobile-top-header>.container-fluid>ul>li>a,
.zolteka-theme-default .mobile-top-header i {
    color: #ffffff !important;
}

/* Forzar color de texto legible en los elementos del desplegable del menú de usuario en móvil */
.mobile-top-header .dropdown-menu .dropdown-item,
.zolteka-theme-default .mobile-top-header .dropdown-menu .dropdown-item {
    color: #334155 !important;
}

.mobile-top-header .dropdown-menu .dropdown-item:hover,
.zolteka-theme-default .mobile-top-header .dropdown-menu .dropdown-item:hover {
    color: var(--zolteka-acento-texto) !important;
}

.zolteka-theme-default .mobile-bottom-nav {
    background-color: var(--v-primary) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.zolteka-theme-default .mobile-bottom-nav .mobile-bottom-nav-item,
.zolteka-theme-default .mobile-bottom-nav .mobile-bottom-nav-item i,
.zolteka-theme-default .mobile-bottom-nav .mobile-bottom-nav-item span,
.zolteka-theme-default .mobile-bottom-nav-item,
.zolteka-theme-default .mobile-bottom-nav-item :is(i, svg),
.zolteka-theme-default .mobile-bottom-nav-item.active :is(i, svg) {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* ----------------------------------------------------
 * Buscador expandible (menú horizontal desktop)
 * ---------------------------------------------------- */
.zolteka-search-expand {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 2.5rem;
}

.zolteka-search-expand .zolteka-search-expand-trigger {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: var(--bs-nav-link-padding-y, 0.5rem) var(--bs-nav-link-padding-x, 0.5rem);
    line-height: 1;
    z-index: 2;
}

/* 2.27 · C6 (Z16): la lupa cerrada es un icono sobre la barra: texto del menú, no el gris fijo de `.nav-link i`
   (#64748B daba 2,18:1 en crimson y 1,99:1 en serenity). El hover sigue con --zolteka-menu-acento (regla de las barras) */
.navbar .zolteka-search-expand-trigger :is(i, svg) {
    color: var(--zolteka-menu-texto) !important;
}

.zolteka-search-expand .zolteka-search-expand-panel {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    max-width: 0;
    opacity: 0;
    overflow: visible;
    pointer-events: none;
    transition: max-width 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
    z-index: 1;
}

.zolteka-search-expand.is-expanded .zolteka-search-expand-trigger {
    display: none;
}

/* Al expandir: el input entra en el flujo y se ocultan el resto de iconos (evita desborde) */
.navbar-nav:has(> #zoltekaHorizontalSearchRoot.is-expanded) > li:not(#zoltekaHorizontalSearchRoot) {
    display: none !important;
}

.zolteka-search-expand.is-expanded {
    flex: 1 1 auto;
    min-width: 280px;
    max-width: 480px;
    justify-content: stretch;
}

.zolteka-search-expand.is-expanded .zolteka-search-expand-panel {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    opacity: 1;
    pointer-events: auto;
}

.zolteka-search-expand .zolteka-search-results-dropdown {
    min-width: 100%;
    right: 0;
    left: auto;
}

/* ----------------------------------------------------
 * Menú «Más» (menú horizontal desktop)
 * Las reglas de encogido solo aplican con .zolteka-menu-mas-activo, que pone
 * zolteka-menu-mas.js: sin el script la barra se ve como antes, sin ocultar nada.
 * README § «Menú «Más» en la barra horizontal».
 * ---------------------------------------------------- */
.zolteka-topbar-horizontal.zolteka-menu-mas-activo .navbar-collapse {
    flex: 1 1 0%;
    min-width: 0;
}

.zolteka-topbar-horizontal.zolteka-menu-mas-activo .zolteka-menu-principal {
    flex-wrap: nowrap;
    min-width: 0;
}

/* Los iconos (MenuIcon* y los que añadan otros plugins) no se encogen nunca */
.zolteka-topbar-horizontal.zolteka-menu-mas-activo .navbar-collapse > .navbar-nav.ms-auto {
    flex-shrink: 0;
}

.zolteka-topbar-horizontal .zolteka-menu-mas-oculto {
    display: none !important;
}

/* Nombre de la empresa recortado con puntos suspensivos (el completo va en el title) */
@media (min-width: 576px) {
    .zolteka-topbar-horizontal .navbar-brand {
        display: inline-flex !important;
        align-items: center;
        flex: 0 1 auto;
        min-width: 0;
    }
}

.zolteka-topbar-horizontal .zolteka-topbar-empresa {
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* «Más» está pegado a los iconos: sus submenús se abren hacia la izquierda */
.zolteka-topbar-horizontal .zolteka-menu-mas .dropdown-submenu > .dropdown-menu {
    left: auto !important;
    right: 100%;
    margin-left: 0;
    margin-right: 2px;
}

.zolteka-topbar-horizontal .zolteka-menu-mas .dropdown-submenu > a::after {
    transform: rotate(135deg);
}

/* En táctil no hay hover: el toque abre el submenú (zolteka-menu-mas.js) */
.zolteka-topbar-horizontal .zolteka-menu-mas .dropdown-submenu.zolteka-menu-mas-abierto > .dropdown-menu {
    display: block !important;
}

/* ----------------------------------------------------
 * Modal de búsqueda móvil/tablet (command palette)
 * Márgenes simétricos L/R + safe-area; sin desborde a la derecha.
 * ---------------------------------------------------- */
.zolteka-mobile-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    box-sizing: border-box;
    overflow-x: hidden;
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
    padding-bottom: 0.75rem;
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.zolteka-mobile-search-overlay.d-none {
    display: none !important;
}

.zolteka-mobile-search-dialog {
    width: 100%;
    max-width: min(560px, 100%);
    min-width: 0;
    flex: 0 1 auto;
    max-height: min(70dvh, calc(100dvh - 1.5rem));
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.35);
    overflow: hidden;
    animation: zoltekaDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 575.98px) {
    .zolteka-mobile-search-overlay {
        padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
        padding-right: max(0.65rem, env(safe-area-inset-right, 0px));
        padding-bottom: 0.65rem;
        padding-left: max(0.65rem, env(safe-area-inset-left, 0px));
    }

    .zolteka-mobile-search-dialog {
        border-radius: 14px;
        max-height: min(65dvh, calc(100dvh - 1.3rem));
    }
}

.dark-mode .zolteka-mobile-search-dialog,
[data-bs-theme="dark"] .zolteka-mobile-search-dialog {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
}

.zolteka-mobile-search-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
}

.zolteka-mobile-search-dialog .zolteka-search-input-container {
    width: auto;
    min-width: 0;
    box-sizing: border-box;
    margin: 0.65rem 0.65rem 0.35rem;
    flex-shrink: 0;
    border-radius: 14px;
}

.zolteka-mobile-search-dialog .zolteka-search-input {
    min-width: 0;
    flex: 1 1 auto;
}

.zolteka-mobile-search-dialog .zolteka-search-submit-btn,
.zolteka-mobile-search-dialog .zolteka-mobile-search-close {
    flex-shrink: 0;
}

.zolteka-mobile-search-results.zolteka-search-results-dropdown {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    max-height: none;
    margin: 0 0.35rem 0.5rem;
    width: auto;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: none;
    border: none;
    border-radius: 12px;
    background: transparent;
    animation: none;
    padding: 0.15rem 0.25rem 0.4rem;
    box-sizing: border-box;
}

.zolteka-mobile-search-results .zolteka-search-item {
    min-width: 0;
    max-width: 100%;
}

.zolteka-mobile-search-results .zolteka-search-item-left {
    min-width: 0;
    flex: 1 1 auto;
}

.zolteka-mobile-search-results .zolteka-search-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zolteka-mobile-search-results .zolteka-search-item-badge {
    flex-shrink: 1;
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zolteka-mobile-search-close {
    border: none;
    background: transparent;
    color: #64748b;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    margin-left: 0.15rem;
}

.zolteka-mobile-search-close:hover {
    background: rgba(148, 163, 184, 0.2);
    color: #0f172a;
}

.dark-mode .zolteka-mobile-search-close:hover,
[data-bs-theme="dark"] .zolteka-mobile-search-close:hover {
    color: #f8fafc;
}

body.zolteka-search-modal-open {
    overflow: hidden !important;
}

.mobile-bottom-nav-item {
    border: 0;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

/* ----------------------------------------------------
 * Estilos para el Buscador Superior Interactivo (Modo Vertical PC)
 * ---------------------------------------------------- */
.zolteka-search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    background: rgba(241, 245, 249, 0.8);
    border: 1px solid rgba(203, 213, 225, 0.7);
    border-radius: 20px;
    padding: 0.25rem 0.5rem 0.25rem 2.25rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-mode .zolteka-search-input-container,
[data-bs-theme="dark"] .zolteka-search-input-container {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(51, 65, 85, 0.8);
}

.zolteka-search-input-container:hover {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dark-mode .zolteka-search-input-container:hover,
[data-bs-theme="dark"] .zolteka-search-input-container:hover {
    background: #0f172a;
    border-color: #475569;
}

.zolteka-search-input-container:focus-within {
    background: #ffffff;
    border-color: var(--v-primary, #0d6efd);
    box-shadow: 0 0 0 3px rgba(var(--v-primary-rgb, 13, 110, 253), 0.15), 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dark-mode .zolteka-search-input-container:focus-within,
[data-bs-theme="dark"] .zolteka-search-input-container:focus-within {
    background: #0f172a;
    border-color: var(--v-primary, #0d6efd);
}

.zolteka-search-icon {
    position: absolute;
    left: 0.85rem;
    color: #64748b;
    font-size: 0.85rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.zolteka-search-input-container:focus-within .zolteka-search-icon {
    color: var(--zolteka-acento-texto);
}

.zolteka-search-input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.875rem;
    color: #0f172a;
    padding: 0.2rem 0.25rem;
    box-shadow: none !important;
}

.dark-mode .zolteka-search-input,
[data-bs-theme="dark"] .zolteka-search-input {
    color: #f8fafc;
}

.zolteka-search-input::placeholder {
    color: #94a3b8;
    font-size: 0.825rem;
}

/* A7: botón de enviar neutro (el acento queda para la acción principal), 32×32 px y sin escalar */
.zolteka-search-submit-btn {
    border: none;
    background: transparent;
    color: var(--v-icon-standard);
    border-radius: var(--zolteka-radius-btn);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--zolteka-font-size-base) * 0.8125);
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
    flex-shrink: 0;
}

.zolteka-search-submit-btn:hover {
    background: color-mix(in srgb, currentColor 12%, transparent);
}

/* Pista de teclado (Ctrl K / ⌘ K) con el campo vacío; con texto se ve el botón de enviar */
.zolteka-search-kbd {
    flex-shrink: 0;
    padding: 1px 6px;
    margin: 0 4px 0 0;
    border: 1px solid var(--zolteka-menu-divisor);
    border-radius: 4px;
    background: transparent;
    box-shadow: none;
    /* 2.27 · C9: la pista «Ctrl K» usa el texto del menú (el apagado se quedaba en 3,6-3,9:1) */
    color: var(--theme-sidebar-text);
    font-family: inherit;
    font-size: calc(var(--zolteka-font-size-base) * 0.75);
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
}

.zolteka-search-con-pista:not(.tiene-texto) .zolteka-search-submit-btn,
.zolteka-search-con-pista.tiene-texto .zolteka-search-kbd {
    display: none;
}

/* Sin teclado físico la pista no sirve: el buscador del cajón solo se ve en móvil y las pantallas táctiles la ocultan */
#sidebar .zolteka-search-kbd {
    display: none;
}

@media (hover: none) {
    .zolteka-search-kbd {
        display: none;
    }
}

/*
 * A5: buscador sobre el cromado del menú (menú lateral y barra superior del modo vertical).
 * Fondo, borde y textos con los tokens del menú: legible en temas claros y oscuros.
 */
#sidebar .zolteka-search-input-container,
.navbar-custom .zolteka-search-input-container,
#sidebar .zolteka-search-input-container:hover,
.navbar-custom .zolteka-search-input-container:hover {
    background: var(--zolteka-menu-campo-bg);
    border: 1px solid var(--zolteka-menu-divisor);
    box-shadow: none;
}

#sidebar .zolteka-search-input-container:focus-within,
.navbar-custom .zolteka-search-input-container:focus-within {
    background: var(--zolteka-menu-campo-bg);
    border-color: var(--v-primary);
    box-shadow: none;
}

#sidebar .zolteka-search-icon,
.navbar-custom .zolteka-search-icon,
#sidebar .zolteka-search-input-container:focus-within .zolteka-search-icon,
.navbar-custom .zolteka-search-input-container:focus-within .zolteka-search-icon,
#sidebar .zolteka-search-submit-btn,
.navbar-custom .zolteka-search-submit-btn {
    color: var(--zolteka-menu-apagado);
}

#sidebar .zolteka-search-input,
.navbar-custom .zolteka-search-input {
    color: var(--theme-sidebar-brand-text);
    font-size: calc(var(--zolteka-font-size-base) * 0.875);
}

#sidebar .zolteka-search-input::placeholder,
.navbar-custom .zolteka-search-input::placeholder {
    color: var(--zolteka-menu-apagado);
    opacity: 1;
    font-size: calc(var(--zolteka-font-size-base) * 0.875);
}

.zolteka-search-results-dropdown {
    container-type: inline-size;
    container-name: zolteka-buscador;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 14px;
    box-shadow: 0 16px 32px -6px rgba(15, 23, 42, 0.12), 0 6px 12px -4px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    max-height: 380px;
    overflow-y: auto;
    padding: 0.4rem;
    animation: zoltekaDropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.dark-mode .zolteka-search-results-dropdown,
[data-bs-theme="dark"] .zolteka-search-results-dropdown {
    background: #0f172a;
    border-color: #1e293b;
    box-shadow: 0 16px 32px -6px rgba(0, 0, 0, 0.5);
}

@keyframes zoltekaDropdownFade {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.zolteka-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.85rem;
    margin-bottom: 2px;
    border-radius: 10px;
    color: #334155;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.dark-mode .zolteka-search-item,
[data-bs-theme="dark"] .zolteka-search-item {
    color: #cbd5e1;
}

/* 2.27 · C1: en el buscador, el primario como texto o icono usa el tono legible */
.zolteka-search-item:hover,
.zolteka-search-item.active {
    background: rgba(var(--v-primary-rgb, 13, 110, 253), 0.08) !important;
    color: var(--zolteka-acento-texto) !important;
    transform: translateX(3px);
}

.zolteka-search-item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.zolteka-search-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(var(--v-primary-rgb, 13, 110, 253), 0.08);
    color: var(--zolteka-acento-texto);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.825rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.zolteka-search-item:hover .zolteka-search-item-icon,
.zolteka-search-item.active .zolteka-search-item-icon {
    background: var(--zolteka-primary-relleno);
    color: var(--zolteka-primary-contraste);
}

.zolteka-search-item-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
}

.dark-mode .zolteka-search-item-title,
[data-bs-theme="dark"] .zolteka-search-item-title {
    color: #f1f5f9;
}

.zolteka-search-item:hover .zolteka-search-item-title,
.zolteka-search-item.active .zolteka-search-item-title {
    color: var(--zolteka-acento-texto);
    font-weight: 600;
}

.zolteka-search-item-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    background: rgba(226, 232, 240, 0.8);
    /* 2.27 · C9: #64748B daba 4,03:1 sobre el fondo de la insignia */
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.dark-mode .zolteka-search-item-badge,
[data-bs-theme="dark"] .zolteka-search-item-badge {
    background: #1e293b;
    color: #94a3b8;
}

/* 2.27 · C1 (Z8): la insignia va sobre la fila, que ya lleva el tinte del 8 %: los dos se suman. Con el 12 %
   el tono legible se quedaba en 4,12-4,36:1; con el 4 % (≈ 12 % en total) da ≥ 4,62:1 en todos los temas */
.zolteka-search-item:hover .zolteka-search-item-badge,
.zolteka-search-item.active .zolteka-search-item-badge {
    background: rgba(var(--v-primary-rgb, 13, 110, 253), 0.04);
    color: var(--zolteka-acento-texto);
}

/* ----------------------------------------------------
 * Buscador del sidebar: anular herencia de .sidebar-header a
 * (uppercase + font-weight 700) y igualar tipografía al buscador superior.
 * NO modificar estilos globales .zolteka-search-* (barra superior).
 * ---------------------------------------------------- */
#sidebar .zolteka-search-item {
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: #334155 !important;
    text-align: left;
}

#sidebar .zolteka-search-item-left {
    text-align: left;
    min-width: 0;
    flex: 1 1 auto;
}

#sidebar .zolteka-search-item-title {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    color: #1e293b !important;
    text-align: left;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

#sidebar .zolteka-search-item:hover .zolteka-search-item-title,
#sidebar .zolteka-search-item.active .zolteka-search-item-title {
    color: var(--zolteka-acento-texto) !important;
    font-weight: 600 !important;
}

#sidebar .zolteka-search-item-badge {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    flex-shrink: 0;
}

/* ----------------------------------------------------
 * 2.26 · Desplegables de búsqueda estrechos (cajón móvil, ventana de la barra
 * inferior, barra superior compactada, lupa horizontal): los títulos largos se
 * recortaban palabra a palabra con «…». Con menos de 380 px de desplegable el
 * ítem se apila: icono + título completo en varias líneas y la insignia debajo,
 * alineada con el título. Por encima de 380 px nada cambia.
 * Los selectores repiten #sidebar y .zolteka-mobile-search-results para ganar
 * en especificidad a sus reglas de recorte.
 * ---------------------------------------------------- */
@container zolteka-buscador (max-width: 380px) {
    .zolteka-search-item {
        flex-wrap: wrap;
        align-items: flex-start;
        row-gap: 0.2rem;
        column-gap: 0.5rem;
    }

    .zolteka-search-item-left,
    #sidebar .zolteka-search-item-left,
    .zolteka-mobile-search-results .zolteka-search-item-left {
        flex: 1 1 100%;
        min-width: 0;
        align-items: flex-start;
    }

    .zolteka-search-item-title,
    #sidebar .zolteka-search-item-title,
    .zolteka-mobile-search-results .zolteka-search-item-title {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        overflow-wrap: anywhere;
        min-width: 0;
    }

    .zolteka-search-item-badge,
    #sidebar .zolteka-search-item-badge,
    .zolteka-mobile-search-results .zolteka-search-item-badge {
        margin-left: calc(30px + 0.75rem);
        max-width: calc(100% - 30px - 0.75rem);
        flex-shrink: 1;
        white-space: normal;
        overflow: visible;
        overflow-wrap: anywhere;
        text-overflow: clip;
    }
}

/* Tamaño del texto del buscador del menú: ver el bloque A5 (tokens de tipografía) */

/* ----------------------------------------------------
 * Reglas de Consistencia para Tema Personalizado (Primary color hover & selected)
 * ---------------------------------------------------- */
/* Menú horizontal (nivel 1): solo ilumina el texto del color primario, sin fondo ni sombreado */
body.zolteka-theme-custom .navbar:not(.navbar-custom) .navbar-nav>.nav-item>.nav-link:hover,
body.zolteka-theme-custom .navbar:not(.navbar-custom) .navbar-nav>.nav-item>.nav-link.active {
    background-color: transparent !important;
    color: var(--v-primary) !important;
}

/* Menú lateral vertical: hover y activo usan el color primario con transparencia */
body.zolteka-theme-custom :is(#sidebar, #zoltekaCarrilPanel) ul li.active>a,
body.zolteka-theme-custom :is(#sidebar, #zoltekaCarrilPanel) .nav-link.active,
body.zolteka-theme-custom :is(#sidebar, #zoltekaCarrilPanel) .sidebar-menu-item-active {
    color: var(--v-primary) !important;
    background-color: rgba(var(--v-primary-rgb, 16, 185, 129), 0.12) !important;
    font-weight: 600 !important;
}

body.zolteka-theme-custom :is(#sidebar, #zoltekaCarrilPanel) .nav-link:hover,
body.zolteka-theme-custom :is(#sidebar, #zoltekaCarrilPanel) ul li a:hover {
    color: var(--v-primary) !important;
    background-color: rgba(var(--v-primary-rgb, 16, 185, 129), 0.12) !important;
}

/* 2.27 · C1/C2: el desplegable general es claro; texto legible y activo con el contraste del relleno */
body.zolteka-theme-custom .dropdown-item:hover {
    color: var(--zolteka-acento-texto) !important;
    background-color: rgba(var(--v-primary-rgb, 16, 185, 129), 0.12) !important;
}

body.zolteka-theme-custom .dropdown-item.active {
    background-color: var(--zolteka-primary-relleno) !important;
    color: var(--zolteka-primary-contraste) !important;
}

/* ====================================================
 * Unificación de Jerarquía de Fondos para Todos los Temas
 * ====================================================
 * - Fondo global (html, body) y listados: blanco del Core (--bs-body-bg).
 * - Zona superior (pestañas): --v-bg-secondary, sin min-height.
 * - tab-content, tarjetas y tablas: blanco. No transparentar el listado.
 */
html,
body {
    background-color: var(--bs-body-bg, #FFFFFF) !important;
}

div.bg-light.pt-3,
.nav-tabs-wrapper {
    background-color: var(--v-bg-secondary) !important;
}

.tab-content,
.tab-pane,
.table-responsive,
.card,
.card-body {
    background-color: var(--bs-body-bg, #FFFFFF) !important;
}
/* ====================================================
 * 2.27 · C11: foco visible con el teclado (WCAG 2.4.7)
 * ====================================================
 * Solo :focus-visible: el clic con ratón no cambia (salvo en campos de texto, donde el navegador
 * siempre considera visible el foco). Contorno de 2 px:
 *  - sobre el contenido, el acento legible del tema (≥ 3:1 sobre blanco);
 *  - sobre el menú y las barras, el texto del menú;
 *  - dentro de un desplegable, el color del propio ítem (siempre legible sobre su fondo).
 * Especificidad (0,2,0), como el `outline: 0` de Bootstrap: gana por orden de carga y
 * respeta los focos propios más concretos de otras hojas.
 */
:is(.btn, .nav-link, .dropdown-item, .page-link, .form-control, .form-select, .form-check-input, .list-group-item-action):focus-visible,
:where(a, button, input, select, textarea, summary, [tabindex]):not(.zolteka-search-input):focus-visible,
.btn-check:focus-visible + .btn {
    outline: 2px solid var(--zolteka-acento-texto);
    outline-offset: 2px;
}

:where(#sidebar, #zoltekaCarrilPanel, .navbar, .navbar-custom, .mobile-top-header, .mobile-bottom-nav) :is(.nav-link, .btn, a, button, [tabindex]):focus-visible {
    outline: 2px solid var(--zolteka-menu-texto);
    outline-offset: -2px;
}

:where(.dropdown-menu) :is(.dropdown-item, .nav-link, .btn, a, button, [tabindex]):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
}

/* Buscadores: el campo no lleva contorno propio; lo lleva su cápsula (antes no tenía indicador) */
.zolteka-search-input-container:has(> .zolteka-search-input:focus-visible) {
    outline: 2px solid var(--zolteka-acento-texto);
    outline-offset: 2px;
}

:is(#sidebar, .navbar, .navbar-custom) .zolteka-search-input-container:has(> .zolteka-search-input:focus-visible) {
    outline-color: var(--zolteka-menu-texto);
}

/* 2.27 · C9: pie del login legible sobre el degradado oscuro del panel izquierdo (text-white-50 se quedaba en 3,6-4,1:1) */
.zolteka-login-container .zolteka-login-footer {
    color: color-mix(in srgb, #FFFFFF 85%, transparent) !important;
}
