/*
 * UI MODERNA - capa de diseño general (ver .docs/ui-moderna.md)
 *
 * Se carga después de style.css, dark-theme.css y de los CSS de DataTables /
 * grid-views. Todas las reglas cuelgan de body.ui-modern para ganarle en
 * especificidad a las reglas heredadas (body.dark-mode .x) sin reescribirlas.
 * Los colores salen de los tokens --ui-*; el modo oscuro solo cambia tokens.
 */

/* ========================================================================
   TOKENS
   ======================================================================== */
body.ui-modern {
    --ui-font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --ui-bg: #f6f7f9;
    --ui-surface: #ffffff;
    --ui-surface-2: #f3f4f6;
    --ui-surface-3: #e9ebef;
    --ui-border: #e5e7eb;
    --ui-border-strong: #d1d5db;
    --ui-text: #0f172a;
    --ui-text-2: #475569;
    --ui-muted: #94a3b8;

    --ui-primary: #2563eb;
    --ui-primary-hover: #1d4ed8;
    --ui-primary-soft: #eff4ff;
    --ui-primary-text: #1d4ed8;
    --ui-ring: rgba(37, 99, 235, 0.18);

    --ui-success: #16a34a;
    --ui-success-soft: #ecfdf3;
    --ui-success-text: #15803d;
    --ui-danger: #dc2626;
    --ui-danger-soft: #fef2f2;
    --ui-danger-text: #b91c1c;
    --ui-warning: #d97706;
    --ui-warning-soft: #fffbeb;
    --ui-warning-text: #b45309;
    --ui-info: #0891b2;
    --ui-info-soft: #ecfeff;
    --ui-info-text: #0e7490;

    --ui-radius-sm: 8px;
    --ui-radius: 10px;
    --ui-radius-lg: 14px;
    --ui-radius-xl: 18px;

    --ui-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --ui-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --ui-shadow-md: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -6px rgba(15, 23, 42, 0.10);
    --ui-shadow-lg: 0 20px 48px -12px rgba(15, 23, 42, 0.25);

    --ui-header-h: 60px;
    --ui-ease: cubic-bezier(0.2, 0, 0, 1);

    /* Variables heredadas que usan style.css y grid-views.css */
    --brand-base: var(--ui-text);
    --brand-base-dark: #020617;
    --brand-base-soft: var(--ui-surface-2);
    --brand-accent: var(--ui-primary);
    --brand-success: var(--ui-success);
    --header-height: var(--ui-header-h);
    --filter-button-height: 36px;
    --filter-button-font-size: 13px;
    --filter-button-icon-size: 14px;
}

body.ui-modern.dark-mode {
    --ui-bg: #0b0d12;
    --ui-surface: #12151c;
    --ui-surface-2: #1a1e27;
    --ui-surface-3: #232834;
    --ui-border: #252a35;
    --ui-border-strong: #343a47;
    --ui-text: #e7e9ee;
    --ui-text-2: #a3aab8;
    --ui-muted: #6b7280;

    --ui-primary: #3b82f6;
    --ui-primary-hover: #60a5fa;
    --ui-primary-soft: rgba(59, 130, 246, 0.14);
    --ui-primary-text: #93c5fd;
    --ui-ring: rgba(59, 130, 246, 0.30);

    --ui-success-soft: rgba(34, 197, 94, 0.14);
    --ui-success-text: #86efac;
    --ui-danger-soft: rgba(239, 68, 68, 0.14);
    --ui-danger-text: #fca5a5;
    --ui-warning-soft: rgba(245, 158, 11, 0.14);
    --ui-warning-text: #fcd34d;
    --ui-info-soft: rgba(6, 182, 212, 0.14);
    --ui-info-text: #67e8f9;

    --ui-shadow-xs: none;
    --ui-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --ui-shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -6px rgba(0, 0, 0, 0.5);
    --ui-shadow-lg: 0 24px 56px -12px rgba(0, 0, 0, 0.7);

    --brand-base-dark: #ffffff;
}

/* dark-theme.css define sus colores en :root.dark-mode; se alinean a la paleta nueva */
:root.dark-mode {
    --bg-primary: #0b0d12;
    --bg-secondary: #1a1e27;
    --bg-tertiary: #232834;
    --bg-card: #12151c;
    --bg-hover: #1a1e27;
    --text-primary: #e7e9ee;
    --text-secondary: #a3aab8;
    --text-muted: #6b7280;
    --border-color: #252a35;
    --shadow: rgba(0, 0, 0, 0.4);
    --header-bg: #12151c;
    --sidebar-bg: #12151c;
    --input-bg: #12151c;
    --input-border: #343a47;
}

/* ========================================================================
   BASE
   ======================================================================== */
body.ui-modern {
    background: var(--ui-bg);
    color: var(--ui-text);
    font-family: var(--ui-font);
    font-size: 14px;
    letter-spacing: -0.006em;
    font-feature-settings: "cv11", "ss01";
}

body.ui-modern h1,
body.ui-modern h2,
body.ui-modern h3,
body.ui-modern h4,
body.ui-modern h5,
body.ui-modern h6,
body.ui-modern input,
body.ui-modern select,
body.ui-modern textarea,
body.ui-modern button,
body.ui-modern .btn,
body.ui-modern .sidebar-menu .dropdown-toggle,
body.ui-modern .user-info-dropdown .dropdown-toggle .user-name,
body.ui-modern .botonera span {
    font-family: var(--ui-font);
}

body.ui-modern h1,
body.ui-modern h2,
body.ui-modern h3,
body.ui-modern h4,
body.ui-modern h5,
body.ui-modern h6 {
    color: var(--ui-text);
    letter-spacing: -0.02em;
}

body.ui-modern a {
    color: var(--ui-primary-text);
    transition: color 0.15s ease;
}

body.ui-modern a:hover {
    color: var(--ui-primary-hover);
}

body.ui-modern .text-blue,
body.ui-modern .text-dark-blue {
    color: var(--ui-text) !important;
}

body.ui-modern .text-muted {
    color: var(--ui-muted) !important;
}

body.ui-modern ::selection {
    background: var(--ui-ring);
}

body.ui-modern :focus-visible {
    outline: 2px solid var(--ui-primary) !important;
    outline-offset: 2px;
}

/* Scrollbar finita */
body.ui-modern * {
    scrollbar-width: thin;
    scrollbar-color: var(--ui-border-strong) transparent;
}

body.ui-modern ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body.ui-modern ::-webkit-scrollbar-thumb {
    background: var(--ui-border-strong);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

body.ui-modern ::-webkit-scrollbar-track {
    background: transparent;
}

/* ========================================================================
   HEADER
   ======================================================================== */
body.ui-modern .header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--ui-header-h);
    min-height: var(--ui-header-h);
    padding: 0 16px 0 8px;
    background: color-mix(in srgb, var(--ui-surface) 82%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--ui-border);
    box-shadow: none;
    z-index: 1030;
}

body.ui-modern .header-left,
body.ui-modern .header-right {
    height: var(--ui-header-h);
    width: auto;
    align-items: center;
}

body.ui-modern .header-left {
    gap: 4px;
    min-width: 0;
}

body.ui-modern .header-right {
    display: flex;
}

body.ui-modern .header .menu-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--ui-radius);
    color: var(--ui-text-2);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

body.ui-modern .header .menu-icon:hover {
    background: var(--ui-surface-2);
    color: var(--ui-text);
}

body.ui-modern .header-left .brand-logo {
    height: var(--ui-header-h);
    width: auto;
    min-width: 0;
}

body.ui-modern .brand-logo a {
    gap: 10px;
    color: var(--ui-text);
}

body.ui-modern .brand-logo a img {
    width: 30px;
    max-width: 30px;
    height: 30px;
    object-fit: contain;
}

body.ui-modern .brand-logo a span.menu-app-name {
    margin-left: 0;
    color: var(--ui-text) !important;
    font-size: 15px;
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

body.ui-modern .brand-logo a span.menu-app-name br {
    display: none;
}

body.ui-modern .brand-logo a span small.menu-app-enterprise {
    margin-top: 1px;
    color: var(--ui-muted) !important;
    font-size: 11.5px;
    font-weight: 500;
    letter-spacing: 0;
}

/* Logo según el tema */
body.ui-modern .ui-logo-dark,
body.ui-modern.dark-mode .ui-logo-light,
body.ui-modern.header-custom .header .ui-logo-light {
    display: none !important;
}

body.ui-modern .ui-logo-light,
body.ui-modern.dark-mode .ui-logo-dark,
body.ui-modern.header-custom .header .ui-logo-dark {
    display: block !important;
}

/* Header con color configurado (settings > estilos): texto claro */
body.ui-modern.header-custom .header {
    border-bottom-color: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

body.ui-modern.header-custom .header .menu-icon,
body.ui-modern.header-custom .header .brand-logo a span.menu-app-name,
body.ui-modern.header-custom .header .user-info-dropdown .dropdown-toggle .user-name {
    color: #fff !important;
}

body.ui-modern.header-custom .header .brand-logo a span small.menu-app-enterprise {
    color: rgba(255, 255, 255, 0.7) !important;
}

body.ui-modern.header-custom .header .menu-icon:hover,
body.ui-modern.header-custom .header .user-info-dropdown .dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Usuario */
body.ui-modern .user-info-dropdown {
    padding: 0;
}

body.ui-modern .header .user-info-dropdown .dropdown-toggle {
    color: var(--ui-text);
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

body.ui-modern .user-info-dropdown .dropdown-toggle:hover,
body.ui-modern .user-info-dropdown .show > .dropdown-toggle {
    background: var(--ui-surface-2);
    border-color: var(--ui-border);
}

body.ui-modern .user-info-dropdown .dropdown-toggle::after {
    color: var(--ui-muted);
}

body.ui-modern .user-info-dropdown .dropdown-toggle .user-icon {
    width: 32px;
    height: 32px;
    border: 0;
    background: linear-gradient(135deg, #6366f1, #2563eb 55%, #0891b2);
    color: #fff;
    box-shadow: 0 0 0 2px var(--ui-surface), 0 0 0 3px var(--ui-border);
    font-size: 12px;
    font-weight: 600;
}

body.ui-modern .header .user-info-dropdown .dropdown-toggle .user-name {
    color: var(--ui-text);
    font-size: 13px;
    font-weight: 600;
}

body.ui-modern .user-info-dropdown .dropdown-menu {
    min-width: 240px;
    margin-top: 8px;
}

/* style.css posiciona estos íconos en absolute con padding-left: 45px; acá van en el flujo flex */
body.ui-modern .dropdown-menu-icon-list .dropdown-item {
    position: static;
    justify-content: flex-start;
    padding-left: 10px;
}

body.ui-modern .dropdown-menu-icon-list .dropdown-item i {
    position: static;
    flex: 0 0 auto;
    transform: none;
    font-size: 15px;
}

body.ui-modern .user-info-dropdown .dropdown-item-info {
    display: block;
    padding: 10px 12px 12px;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm) var(--ui-radius-sm) 0 0;
    color: var(--ui-text);
    font-size: 13.5px;
    cursor: default;
}

body.ui-modern .user-info-dropdown .dropdown-item-info:hover {
    background: transparent;
}

body.ui-modern .user-info-dropdown .dropdown-item-info span {
    overflow-wrap: anywhere;
    color: var(--ui-muted);
    font-size: 12.5px;
}

body.ui-modern .user-info-dropdown .dropdown-item-theme {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

body.ui-modern .user-info-dropdown form .dropdown-item {
    width: 100%;
    color: var(--ui-danger-text);
}

body.ui-modern .user-info-dropdown form .dropdown-item i {
    color: var(--ui-danger-text);
}

/* ========================================================================
   SIDEBAR
   ======================================================================== */
body.ui-modern .left-side-bar {
    width: var(--sidebar-width);
    background: var(--ui-surface);
    border-right: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow-lg);
    z-index: 1040;
}

body.ui-modern .left-side-bar .brand-logo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--ui-header-h);
    padding: 0 12px 0 16px;
    border-bottom: 1px solid var(--ui-border);
}

body.ui-modern .left-side-bar .brand-logo a {
    min-width: 0;
}

body.ui-modern .left-side-bar .close-sidebar {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--ui-radius-sm);
    color: var(--ui-muted);
    font-size: 16px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

body.ui-modern .left-side-bar .close-sidebar:hover {
    background: var(--ui-surface-2);
    color: var(--ui-text);
}

body.ui-modern .left-side-bar .menu-block {
    height: calc(100vh - var(--ui-header-h));
    padding: 12px 0;
}

body.ui-modern .menu-search-wrap {
    padding: 0 12px 10px;
}

body.ui-modern .menu-search-wrap i {
    left: 24px;
    top: calc(50% - 5px);
    color: var(--ui-muted);
    font-size: 13px;
}

body.ui-modern .menu-search-wrap input {
    height: 36px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-surface-2);
    color: var(--ui-text);
    font-size: 13px;
}

body.ui-modern .menu-search-wrap input:focus {
    background: var(--ui-surface);
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 3px var(--ui-ring);
}

body.ui-modern .sidebar-section-label {
    padding: 8px 22px 6px;
    color: var(--ui-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

body.ui-modern .sidebar-menu > ul > li {
    padding: 1px 10px;
}

body.ui-modern .sidebar-menu .dropdown-toggle,
body.ui-modern.sidebar-light .sidebar-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: var(--ui-radius-sm);
    background: transparent;
    color: var(--ui-text-2);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
    transition: background-color 0.15s ease, color 0.15s ease;
}

body.ui-modern .sidebar-menu .dropdown-toggle .micon,
body.ui-modern.sidebar-light .sidebar-menu .dropdown-toggle .micon {
    position: static;
    transform: none;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    background: transparent;
    color: var(--ui-muted);
    font-size: 16px;
}

body.ui-modern .sidebar-menu .dropdown-toggle .mtext {
    padding-top: 0;
}

body.ui-modern .sidebar-menu .dropdown-toggle:hover,
body.ui-modern.sidebar-light .sidebar-menu .dropdown-toggle:hover {
    background: var(--ui-surface-2);
    color: var(--ui-text);
}

body.ui-modern .sidebar-menu .dropdown-toggle:hover .micon,
body.ui-modern.sidebar-light .sidebar-menu .dropdown-toggle:hover .micon {
    background: transparent;
    color: var(--ui-text);
}

body.ui-modern .sidebar-menu > ul > li > .dropdown-toggle.active,
body.ui-modern.sidebar-light .sidebar-menu > ul > li > .dropdown-toggle.active {
    background: var(--ui-primary-soft);
    color: var(--ui-primary-text);
    font-weight: 600;
}

body.ui-modern .sidebar-menu > ul > li > .dropdown-toggle.active .micon,
body.ui-modern.sidebar-light .sidebar-menu > ul > li > .dropdown-toggle.active .micon {
    background: transparent;
    color: var(--ui-primary);
}

body.ui-modern .mobile-menu-overlay {
    background: rgba(15, 23, 42, 0.4);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 1;
    z-index: 1035;
}

/* ========================================================================
   CONTENEDOR
   ======================================================================== */
body.ui-modern .main-container {
    padding: 24px 24px 32px !important;
    max-width: 1600px;
    margin: 0 auto;
}

body.ui-modern .main-container > .pd-20,
body.ui-modern .main-container > .pd-ltr-20 {
    padding: 0 !important;
}

/* ========================================================================
   CARDS
   ======================================================================== */
body.ui-modern .card-box,
body.ui-modern .da-card,
body.ui-modern .page-header,
body.ui-modern .card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-sm);
    color: var(--ui-text);
}

body.ui-modern .card-header,
body.ui-modern .card-footer {
    background: transparent;
    border-color: var(--ui-border);
}

body.ui-modern .main-container > .card-box.pd-20 {
    padding: 24px 28px 28px !important;
}

/* Título de página (templates tabs) */
body.ui-modern .ui-page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px !important;
    color: var(--ui-text) !important;
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.025em;
}

body.ui-modern .ui-page-title .a-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    color: var(--ui-text-2);
    font-size: 13px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

body.ui-modern .ui-page-title .a-arrow:hover {
    background: var(--ui-surface-2);
    color: var(--ui-text);
}

body.ui-modern .ui-page-title .a-arrow i {
    margin: 0 !important;
}

/* ========================================================================
   TABS
   ======================================================================== */
body.ui-modern .nav-tabs.customtab {
    gap: 4px;
    border-bottom: 1px solid var(--ui-border);
    flex-wrap: wrap;
}

body.ui-modern .nav-tabs.customtab .nav-item {
    margin-bottom: -1px;
}

body.ui-modern .nav-tabs.customtab .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--ui-muted);
    font-size: 13.5px;
    font-weight: 500;
    transition: color 0.15s ease, border-color 0.15s ease;
}

body.ui-modern .nav-tabs.customtab .nav-link:hover {
    color: var(--ui-text);
    border-bottom-color: var(--ui-border-strong);
}

body.ui-modern .nav-tabs.customtab .nav-link.active,
body.ui-modern .nav-tabs.customtab .nav-item.show .nav-link {
    background: transparent;
    color: var(--ui-text);
    border-bottom-color: var(--ui-primary);
    font-weight: 600;
}

body.ui-modern .nav-tabs.customtab .nav-link i {
    font-size: 14px;
}

body.ui-modern .nav-tabs.customtab .nav-link.active i {
    color: var(--ui-primary);
}

body.ui-modern .tab-content > .tab-pane > .pd-20 {
    padding: 24px 0 0 !important;
}

/* dark-theme.css pinta estos contenedores con el fondo de página y quedan como
   un bloque más oscuro dentro de la card: tienen que heredar el fondo de la card */
body.ui-modern .tab-content,
body.ui-modern .tab-pane,
body.ui-modern .card-box .pd-20,
body.ui-modern .card-box .pb-20,
body.ui-modern.vista-datatable .tab-pane .pd-20 {
    background: transparent !important;
}

/* ========================================================================
   BOTONES
   ======================================================================== */
body.ui-modern .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 7px 14px;
    border-radius: var(--ui-radius);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.005em;
    box-shadow: var(--ui-shadow-xs);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

body.ui-modern .btn:active {
    transform: translateY(1px);
}

body.ui-modern .btn-block {
    display: flex;
    width: 100%;
}

body.ui-modern .btn:focus,
body.ui-modern .btn.focus {
    box-shadow: 0 0 0 3px var(--ui-ring);
}

body.ui-modern .btn-sm {
    min-height: 30px;
    padding: 4px 10px;
    border-radius: var(--ui-radius-sm);
    font-size: 12.5px;
}

body.ui-modern .btn-lg {
    min-height: 44px;
    padding: 10px 20px;
    font-size: 15px;
}

body.ui-modern .btn-primary,
body.ui-modern .btn-info {
    background: var(--ui-primary);
    border-color: var(--ui-primary);
    color: #fff;
}

body.ui-modern .btn-primary:hover,
body.ui-modern .btn-primary:focus,
body.ui-modern .btn-info:hover,
body.ui-modern .btn-info:focus {
    background: var(--ui-primary-hover);
    border-color: var(--ui-primary-hover);
    color: #fff;
}

body.ui-modern .btn-success {
    background: var(--ui-success);
    border-color: var(--ui-success);
    color: #fff;
}

body.ui-modern .btn-success:hover,
body.ui-modern .btn-success:focus {
    background: #15803d;
    border-color: #15803d;
    color: #fff;
}

body.ui-modern .btn-danger {
    background: var(--ui-danger);
    border-color: var(--ui-danger);
    color: #fff;
}

body.ui-modern .btn-danger:hover,
body.ui-modern .btn-danger:focus {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #fff;
}

body.ui-modern .btn-warning {
    background: var(--ui-warning);
    border-color: var(--ui-warning);
    color: #fff;
}

body.ui-modern .btn-warning:hover,
body.ui-modern .btn-warning:focus {
    background: #b45309;
    border-color: #b45309;
    color: #fff;
}

/* Secundario / outline: estilo "outline" neutro */
body.ui-modern .btn-secondary,
body.ui-modern .btn-light,
body.ui-modern .btn-default,
body.ui-modern .btn-outline-secondary {
    background: var(--ui-surface);
    border-color: var(--ui-border-strong);
    color: var(--ui-text);
}

body.ui-modern .btn-secondary:hover,
body.ui-modern .btn-secondary:focus,
body.ui-modern .btn-light:hover,
body.ui-modern .btn-default:hover,
body.ui-modern .btn-outline-secondary:hover,
body.ui-modern .btn-outline-secondary:focus {
    background: var(--ui-surface-2);
    border-color: var(--ui-border-strong);
    color: var(--ui-text);
}

body.ui-modern .btn-outline-primary {
    border-color: var(--ui-primary);
    color: var(--ui-primary-text);
}

body.ui-modern .btn-outline-primary:hover {
    background: var(--ui-primary-soft);
    color: var(--ui-primary-text);
}

body.ui-modern .btn-link {
    box-shadow: none;
    color: var(--ui-primary-text);
}

/* ========================================================================
   TOOLBAR DE LISTADOS
   ======================================================================== */
body.ui-modern .contenedor-filtros {
    margin-bottom: 0;
}

/* Separación entre la toolbar de filtros y la grilla. Va en la grilla porque cada
   vista envuelve la toolbar distinto (pd-20, pdz-20, contenedor-filtros) */
body.ui-modern .dataTables_wrapper:has(.table-principal),
body.ui-modern .nx-cards-wrap {
    margin-top: 16px;
}

body.ui-modern .filtros-group:not(:empty) {
    margin-top: 10px;
}

body.ui-modern .btn-list-filters {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

body.ui-modern .btn-list-filters .btn,
body.ui-modern .btn-list-filter-control,
body.ui-modern .btn-toolbar-primary,
body.ui-modern .btn-toolbar-soft {
    height: 36px;
    min-height: 36px;
    min-width: 36px;
    border-radius: var(--ui-radius) !important;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--ui-shadow-xs);
}

body.ui-modern .btn-toolbar-soft,
body.ui-modern .btn-list-filters .btn[data-bgcolor="#EBF2F5"],
body.ui-modern .btn-list-filters .btn[data-bgcolor="#EDF2F6"] {
    background: var(--ui-surface) !important;
    border: 1px solid var(--ui-border-strong) !important;
    color: var(--ui-text-2) !important;
}

body.ui-modern .btn-toolbar-soft:hover,
body.ui-modern .btn-list-filters .btn[data-bgcolor="#EBF2F5"]:hover,
body.ui-modern .btn-list-filters .btn[data-bgcolor="#EDF2F6"]:hover,
body.ui-modern .btn-list-filters .show > .btn-toolbar-soft {
    background: var(--ui-surface-2) !important;
    color: var(--ui-text) !important;
}

body.ui-modern .btn-toolbar-primary,
body.ui-modern .btn-list-filters .btn-primary,
body.ui-modern .btn-list-filters .btn[data-bgcolor="#3b5998"],
body.ui-modern .btn-list-filters .btn[data-bgcolor="#3A7CA5"] {
    background: var(--ui-primary) !important;
    border: 1px solid var(--ui-primary) !important;
    color: #fff !important;
}

body.ui-modern .btn-toolbar-primary:hover,
body.ui-modern .btn-list-filters .btn-primary:hover,
body.ui-modern .btn-list-filters .btn[data-bgcolor="#3b5998"]:hover,
body.ui-modern .btn-list-filters .btn[data-bgcolor="#3A7CA5"]:hover {
    background: var(--ui-primary-hover) !important;
    border-color: var(--ui-primary-hover) !important;
}

/* Botón "Crear": muestra el texto en pantallas grandes */
body.ui-modern .btn-toolbar-primary[title="Crear"] {
    width: auto !important;
    padding: 0 14px !important;
}

@media (min-width: 768px) {
    body.ui-modern .btn-toolbar-primary[title="Crear"]::after {
        content: "Nuevo";
        font-size: 13px;
        font-weight: 500;
    }
}

/* Buscador */
body.ui-modern .filter-search-box {
    position: relative;
    height: 36px;
    min-height: 36px;
    gap: 0;
}

/* Cerrado: ancho 0 y sin borde/padding/sombra (el input también es .form-control) */
body.ui-modern .filter-search-box .search-text,
body.ui-modern .btn-list-filters .filter-search-box .search-text {
    width: 0;
    height: 36px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: var(--ui-radius);
    background: transparent;
    box-shadow: none;
    font-size: 13px;
    opacity: 0;
    transition: width 0.25s var(--ui-ease), padding 0.25s var(--ui-ease), opacity 0.15s ease;
}

body.ui-modern .filter-search-box.active > .search-text,
body.ui-modern .filter-search-box:hover > .search-text,
body.ui-modern .btn-list-filters .filter-search-box.active > .search-text,
body.ui-modern .btn-list-filters .filter-search-box:hover > .search-text {
    width: 240px;
    margin-right: 6px;
    padding: 0 12px;
    border: 1px solid var(--ui-border-strong);
    background: var(--ui-surface);
    color: var(--ui-text);
    box-shadow: var(--ui-shadow-xs);
    opacity: 1;
}

body.ui-modern .filter-search-box.active > .search-text {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 3px var(--ui-ring);
}

/* Chips de filtros activos */
body.ui-modern .filtros-group {
    gap: 6px;
    margin-top: 2px;
}

body.ui-modern .btn_filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 4px 10px;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    background: var(--ui-primary-soft);
    color: var(--ui-primary-text);
    font-size: 12px;
    font-weight: 500;
    box-shadow: none;
    transition: background-color 0.15s ease;
}

body.ui-modern .btn_filter:hover {
    background: var(--ui-danger-soft);
    color: var(--ui-danger-text);
}

body.ui-modern .btn_filter i {
    padding: 0;
    color: currentColor;
    font-size: 11px;
}

/* Selector listado / cajitas */
body.ui-modern .nx-grilla-toggle {
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius) !important;
    background: var(--ui-surface-2);
}

body.ui-modern .nx-grilla-toggle .btn,
body.ui-modern .btn-list-filters .nx-grilla-toggle .btn {
    height: 28px !important;
    min-height: 28px !important;
    min-width: 32px;
    padding: 0 8px !important;
    border: 0 !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: var(--ui-muted) !important;
    box-shadow: none !important;
}

body.ui-modern .nx-grilla-toggle .btn:hover {
    color: var(--ui-text) !important;
}

body.ui-modern .nx-grilla-toggle .btn.active {
    background: var(--ui-surface) !important;
    color: var(--ui-text) !important;
    box-shadow: var(--ui-shadow-sm) !important;
}

/* ========================================================================
   DROPDOWNS
   ======================================================================== */
body.ui-modern .dropdown-menu {
    padding: 6px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-lg);
    animation: ui-pop 0.14s var(--ui-ease);
}

body.ui-modern .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--ui-radius-sm);
    color: var(--ui-text);
    font-size: 13.5px;
}

body.ui-modern .dropdown-item i {
    width: 16px;
    color: var(--ui-muted);
}

body.ui-modern .dropdown-item:hover,
body.ui-modern .dropdown-item:focus {
    background: var(--ui-surface-2);
    color: var(--ui-text);
}

body.ui-modern .dropdown-item:hover i {
    color: var(--ui-text);
}

body.ui-modern .dropdown-divider {
    margin: 6px -6px;
    border-color: var(--ui-border);
}

@keyframes ui-pop {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

/* ========================================================================
   TABLAS / DATATABLES
   ======================================================================== */
body.ui-modern .dataTables_wrapper {
    background: var(--ui-surface);
    color: var(--ui-text);
}

body.ui-modern .dataTables_wrapper:has(.table-principal) {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    overflow: hidden;
}

body.ui-modern .contenedor-tabla {
    border-color: var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: none;
}

body.ui-modern .table,
body.ui-modern table.dataTable {
    color: var(--ui-text);
    border-color: var(--ui-border);
}

body.ui-modern table.dataTable,
body.ui-modern .dataTables_scrollHeadInner table.dataTable {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

body.ui-modern .table thead th,
body.ui-modern .table-principal thead th,
body.ui-modern table.dataTable thead th {
    padding: 11px 14px;
    background: var(--ui-surface-2);
    border-top: 0 !important;
    border-bottom: 1px solid var(--ui-border) !important;
    color: var(--ui-text-2);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

body.ui-modern .table-principal thead th:first-child,
body.ui-modern .table-principal thead th:last-child {
    border-radius: 0;
}

body.ui-modern .table td,
body.ui-modern .table-principal tbody td,
body.ui-modern table.dataTable tbody td {
    padding: 11px 14px;
    border-top: 1px solid var(--ui-border);
    background: transparent;
    color: var(--ui-text);
    font-size: 13.5px;
    line-height: 1.35;
    vertical-align: middle;
}

body.ui-modern .table-principal tbody tr:first-child td {
    border-top: 0;
}

body.ui-modern .table-principal tbody tr:nth-child(even) td,
body.ui-modern table.dataTable.stripe tbody tr.odd,
body.ui-modern table.dataTable.stripe tbody tr.even,
body.ui-modern table.dataTable tbody tr {
    background: transparent;
}

body.ui-modern .table-principal tbody tr:hover td,
body.ui-modern table.dataTable.hover tbody tr:hover,
body.ui-modern .table-hover tbody tr:hover {
    background: color-mix(in srgb, var(--ui-primary) 4%, var(--ui-surface));
}

body.ui-modern table.dataTable.no-footer,
body.ui-modern .dataTables_scrollBody {
    border-bottom: 0 !important;
}

body.ui-modern .dataTables_scrollHead {
    background: var(--ui-surface-2);
}

/* Botones de acción en filas: estilo suave tipo "icon button" (con o sin btn-sm) */
body.ui-modern .table-principal td .btn,
body.ui-modern .table-principal .btn-right-pad {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    padding: 0 !important;
    margin: 0 3px 0 0;
    border: 1px solid transparent;
    border-radius: var(--ui-radius-sm);
    box-shadow: none;
    font-size: 12px;
    line-height: 1;
    vertical-align: middle;
}

body.ui-modern .table-principal td .btn i {
    font-size: 12px;
}

/* Si el botón tiene texto, que crezca a lo ancho */
body.ui-modern .table-principal td .btn.btn-con-texto {
    width: auto;
    padding: 0 10px !important;
}

body.ui-modern .table-principal td .btn-primary,
body.ui-modern .table-principal td .btn-info {
    background: var(--ui-primary-soft);
    color: var(--ui-primary-text) !important;
}

body.ui-modern .table-principal td .btn-danger {
    background: var(--ui-danger-soft);
    color: var(--ui-danger-text) !important;
}

body.ui-modern .table-principal td .btn-success {
    background: var(--ui-success-soft);
    color: var(--ui-success-text) !important;
}

body.ui-modern .table-principal td .btn-warning {
    background: var(--ui-warning-soft);
    color: var(--ui-warning-text) !important;
}

body.ui-modern .table-principal td .btn-secondary {
    background: var(--ui-surface-2);
    color: var(--ui-text-2) !important;
}

body.ui-modern .table-principal td .btn:hover {
    border-color: currentColor;
}

/* Pie: info + paginado */
body.ui-modern .dataTables_wrapper:has(.table-principal) > .row:last-child {
    margin: 0;
    padding: 4px 6px;
    border-top: 1px solid var(--ui-border);
    align-items: center;
}

body.ui-modern div.dataTables_wrapper div.dataTables_info {
    padding: 10px 8px;
    color: var(--ui-muted);
    font-size: 12.5px;
}

body.ui-modern div.dataTables_wrapper div.dataTables_processing {
    top: 50%;
    padding: 10px 16px;
    margin-top: -20px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    color: var(--ui-text-2);
    box-shadow: var(--ui-shadow-md);
    font-size: 13px;
}

body.ui-modern .dataTables_wrapper .dataTables_paginate .pagination {
    gap: 4px;
    margin: 0;
}

body.ui-modern .dataTables_wrapper .dataTables_paginate .paginate_button,
body.ui-modern .dataTables_wrapper .dataTables_paginate .page-link {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: var(--ui-radius-sm) !important;
    background: transparent !important;
    color: var(--ui-text-2) !important;
    box-shadow: none !important;
    font-size: 13px;
    font-weight: 500;
}

body.ui-modern .dataTables_wrapper .dataTables_paginate li.paginate_button {
    padding: 0 !important;
}

body.ui-modern .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
body.ui-modern .dataTables_wrapper .dataTables_paginate .page-link:hover {
    background: var(--ui-surface-2) !important;
    color: var(--ui-text) !important;
}

body.ui-modern .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.ui-modern .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
body.ui-modern .dataTables_wrapper .dataTables_paginate .page-item.active .page-link,
body.ui-modern .dataTables_wrapper .dataTables_paginate .page-item.active .page-link:hover,
body.ui-modern .dataTables_wrapper .dataTables_paginate .page-item.active .page-link:focus {
    background: var(--ui-text) !important;
    color: var(--ui-surface) !important;
}

body.ui-modern .dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
    background: transparent !important;
    color: var(--ui-muted) !important;
    opacity: 0.6;
}

body.ui-modern div.dataTables_wrapper div.dataTables_length select,
body.ui-modern div.dataTables_wrapper div.dataTables_filter input {
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    color: var(--ui-text);
}

/* ========================================================================
   VISTA CAJITAS (grid-views.css)
   ======================================================================== */
body.ui-modern .nx-cards-wrap {
    --nx-card-bg: var(--ui-surface);
    --nx-card-border: var(--ui-border);
    --nx-card-shadow: var(--ui-shadow-sm);
    --nx-card-shadow-hover: var(--ui-shadow-md);
    --nx-card-text: var(--ui-text);
    --nx-card-muted: var(--ui-muted);
    --nx-card-divider: var(--ui-border);
}

body.ui-modern .nx-card {
    border-radius: var(--ui-radius-lg);
}

body.ui-modern .nx-card:hover {
    border-color: var(--ui-border-strong);
    transform: translateY(-2px);
}

body.ui-modern .nx-card::before {
    background: linear-gradient(90deg, #6366f1, var(--ui-primary), #06b6d4);
}

body.ui-modern .nx-card-titulo-texto {
    color: var(--ui-text);
}

body.ui-modern .nx-card > td.nx-card-id {
    background: var(--ui-surface-2) !important;
}

body.ui-modern .nx-cards-pager .page-item.active .page-link {
    background: var(--ui-text);
    color: var(--ui-surface);
}

/* ========================================================================
   BADGES Y ESTADOS
   ======================================================================== */
body.ui-modern .badge,
body.ui-modern .label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0;
}

body.ui-modern .label {
    background: var(--ui-surface-2);
    color: var(--ui-text-2);
}

body.ui-modern .label::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

body.ui-modern .badge-success,
body.ui-modern .label-success {
    background: var(--ui-success-soft) !important;
    color: var(--ui-success-text) !important;
}

body.ui-modern .badge-danger,
body.ui-modern .label-danger {
    background: var(--ui-danger-soft) !important;
    color: var(--ui-danger-text) !important;
}

body.ui-modern .badge-warning,
body.ui-modern .label-warning {
    background: var(--ui-warning-soft) !important;
    color: var(--ui-warning-text) !important;
}

body.ui-modern .badge-info,
body.ui-modern .label-info {
    background: var(--ui-info-soft) !important;
    color: var(--ui-info-text) !important;
}

body.ui-modern .badge-primary,
body.ui-modern .label-primary {
    background: var(--ui-primary-soft) !important;
    color: var(--ui-primary-text) !important;
    border: 0;
}

body.ui-modern .badge-secondary,
body.ui-modern .badge-light {
    background: var(--ui-surface-2) !important;
    color: var(--ui-text-2) !important;
}

/* ========================================================================
   FORMULARIOS
   ======================================================================== */
body.ui-modern label,
body.ui-modern .form-group > label {
    margin-bottom: 6px;
    color: var(--ui-text);
    font-size: 13px;
    font-weight: 500;
}

body.ui-modern label b {
    font-weight: 500;
}

body.ui-modern .form-group {
    margin-bottom: 20px;
}

body.ui-modern .form-group > label,
body.ui-modern .form-group > .weight-600 {
    display: block;
}

body.ui-modern .input-help-block,
body.ui-modern .form-text {
    display: block;
    margin-top: 6px;
    color: var(--ui-muted);
    font-size: 12.5px;
}

body.ui-modern .custom-control {
    min-height: 22px;
    padding-left: 28px;
}

body.ui-modern .custom-control-label {
    margin-bottom: 0;
    color: var(--ui-text-2);
    font-weight: 400;
    line-height: 22px;
}

body.ui-modern .custom-control-label::before,
body.ui-modern .custom-control-label::after {
    top: 3px;
    left: -28px;
    width: 16px;
    height: 16px;
}

body.ui-modern .custom-checkbox .custom-control-label::before {
    border-color: var(--ui-border-strong);
    border-radius: 5px;
    background: var(--ui-surface);
}

body.ui-modern .form-control,
body.ui-modern .custom-select {
    height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius);
    background-color: var(--ui-surface);
    color: var(--ui-text);
    font-size: 14px;
    box-shadow: var(--ui-shadow-xs);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.ui-modern textarea.form-control {
    height: auto;
    min-height: 90px;
}

body.ui-modern .form-control-sm,
body.ui-modern .right-sidebar .form-control-sm {
    height: 34px;
    padding: 6px 10px;
    border-radius: var(--ui-radius-sm);
    font-size: 13px;
}

body.ui-modern .form-control::placeholder {
    color: var(--ui-muted);
    opacity: 1;
}

body.ui-modern .form-control:focus,
body.ui-modern .custom-select:focus {
    border-color: var(--ui-primary);
    background-color: var(--ui-surface);
    color: var(--ui-text);
    box-shadow: 0 0 0 3px var(--ui-ring);
}

body.ui-modern .form-control:disabled,
body.ui-modern .form-control[readonly] {
    background-color: var(--ui-surface-2);
    color: var(--ui-text-2);
}

body.ui-modern .form-control.is-invalid,
body.ui-modern .was-validated .form-control:invalid {
    border-color: var(--ui-danger);
}

body.ui-modern .form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px var(--ui-danger-soft);
}

body.ui-modern .invalid-feedback,
body.ui-modern .text-danger {
    color: var(--ui-danger-text) !important;
}

body.ui-modern .input-group-text {
    border-color: var(--ui-border-strong);
    border-radius: var(--ui-radius);
    background: var(--ui-surface-2);
    color: var(--ui-text-2);
}

body.ui-modern .custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--ui-primary);
    background-color: var(--ui-primary);
}

/* Select2 */
body.ui-modern .select2-container--default .select2-selection--single,
body.ui-modern .select2-container--default .select2-selection--multiple {
    min-height: 38px;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-xs);
}

body.ui-modern .select2-container--default .select2-selection--single {
    height: 38px;
}

body.ui-modern .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding-left: 12px;
    color: var(--ui-text);
    line-height: 36px;
}

body.ui-modern .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 36px;
    right: 6px;
}

body.ui-modern .select2-container--default.select2-container--focus .select2-selection--multiple,
body.ui-modern .select2-container--default.select2-container--open .select2-selection--single,
body.ui-modern .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 3px var(--ui-ring);
}

body.ui-modern .select2-container--default .select2-selection--multiple .select2-selection__choice {
    border: 0;
    border-radius: 999px;
    background: var(--ui-primary-soft);
    color: var(--ui-primary-text);
    font-size: 12px;
}

body.ui-modern .select2-dropdown {
    overflow: hidden;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius) !important;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-lg);
}

body.ui-modern .select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    color: var(--ui-text);
}

body.ui-modern .select2-results__option {
    margin: 2px 4px;
    padding: 7px 10px;
    border-radius: var(--ui-radius-sm);
    color: var(--ui-text);
    font-size: 13.5px;
}

body.ui-modern .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--ui-primary-soft);
    color: var(--ui-primary-text);
}

body.ui-modern .select2-container--default .select2-results__option[aria-selected="true"] {
    background: var(--ui-surface-2);
    font-weight: 500;
}

/* Interruptor de tema del menú de usuario */
body.ui-modern .theme-toggle {
    margin: 0;
}

body.ui-modern .theme-toggle .slider {
    background: var(--ui-border-strong);
}

body.ui-modern .theme-toggle input:checked + .slider {
    background: var(--ui-primary);
}

/* ========================================================================
   PANEL DE FILTROS (derecha)
   ======================================================================== */
body.ui-modern .right-sidebar {
    width: 340px;
    right: -360px;
    background: var(--ui-surface);
    border-left: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow-lg);
    z-index: 1045;
    transition: right 0.28s var(--ui-ease);
}

body.ui-modern .right-sidebar.right-sidebar-visible {
    right: 0;
}

body.ui-modern .right-sidebar .sidebar-title {
    height: var(--ui-header-h);
    padding: 0 12px 0 18px;
    border-bottom: 1px solid var(--ui-border);
}

body.ui-modern .right-sidebar .sidebar-title h3 {
    color: var(--ui-text) !important;
    font-size: 15px !important;
    font-weight: 600;
}

body.ui-modern .right-sidebar .right-sidebar-body {
    height: calc(100% - var(--ui-header-h));
}

body.ui-modern .right-sidebar .right-sidebar-body .right-sidebar-body-content {
    padding: 18px;
}

body.ui-modern .right-sidebar .sidebar-title .btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: var(--ui-radius-sm);
}

body.ui-modern .right-sidebar .close-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--ui-radius-sm);
    color: var(--ui-muted);
}

body.ui-modern .right-sidebar .close-sidebar:hover {
    background: var(--ui-surface-2);
    color: var(--ui-text);
}

/* "Filtrar" y "Limpiar" en el panel */
body.ui-modern .apply-filter-button {
    background: var(--ui-primary) !important;
    border-color: var(--ui-primary) !important;
    color: #fff !important;
}

body.ui-modern .apply-filter-button:hover {
    background: var(--ui-primary-hover) !important;
    border-color: var(--ui-primary-hover) !important;
}

body.ui-modern .js-reset-filter-side-panel,
body.ui-modern .btn-clear-filter {
    background: var(--ui-surface) !important;
    border: 1px solid var(--ui-border-strong) !important;
    color: var(--ui-text) !important;
}

body.ui-modern .js-reset-filter-side-panel:hover,
body.ui-modern .btn-clear-filter:hover {
    background: var(--ui-surface-2) !important;
}

body.ui-modern .right-sidebar .reset-options {
    display: flex;
    gap: 8px;
    margin: 6px -18px -10px;
    padding: 14px 18px !important;
    border-top: 1px solid var(--ui-border);
}

body.ui-modern .right-sidebar .reset-options .btn {
    flex: 1 1 0;
    height: 38px;
}

/* ========================================================================
   MODALES / ALERTAS / NOTIFICACIONES
   ======================================================================== */
body.ui-modern .modal-backdrop.show {
    background: #0f172a;
    opacity: 0.45;
}

body.ui-modern .modal-content {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-xl);
    background: var(--ui-surface);
    color: var(--ui-text);
    box-shadow: var(--ui-shadow-lg);
    overflow: hidden;
}

body.ui-modern .modal-header {
    padding: 18px 22px 14px;
    border-bottom: 1px solid var(--ui-border);
}

body.ui-modern .modal-title {
    font-size: 16px;
    font-weight: 600;
}

body.ui-modern .modal-body {
    padding: 20px 22px;
}

body.ui-modern .modal-footer {
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid var(--ui-border);
    background: var(--ui-surface-2);
}

body.ui-modern .modal-footer > * {
    margin: 0;
}

body.ui-modern .modal-header .close {
    color: var(--ui-muted);
    text-shadow: none;
    opacity: 1;
}

body.ui-modern .swal2-modal,
body.ui-modern .swal2-popup {
    padding: 28px 24px 22px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-xl);
    background: var(--ui-surface) !important;
    color: var(--ui-text);
    font-family: var(--ui-font);
    box-shadow: var(--ui-shadow-lg);
}

body.ui-modern .swal2-input,
body.ui-modern .swal2-textarea,
body.ui-modern .swal2-select {
    background: var(--ui-surface-2);
    color: var(--ui-text);
    border-color: var(--ui-border-strong);
    color-scheme: light;
}

body.ui-modern.dark-mode .swal2-input,
body.ui-modern.dark-mode .swal2-textarea,
body.ui-modern.dark-mode .swal2-select {
    color-scheme: dark;
}

body.ui-modern .swal2-title {
    color: var(--ui-text);
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

body.ui-modern .swal2-content,
body.ui-modern .swal2-html-container {
    color: var(--ui-text-2);
    font-size: 14.5px;
}

body.ui-modern .swal2-actions {
    gap: 8px;
}

body.ui-modern .swal2-styled {
    margin: 0 !important;
    padding: 9px 18px !important;
    border-radius: var(--ui-radius) !important;
    font-size: 14px !important;
    font-weight: 500;
}

body.ui-modern .swal2-styled.swal2-confirm {
    background: var(--ui-primary) !important;
}

body.ui-modern .swal2-styled.swal2-cancel {
    border: 1px solid var(--ui-border-strong) !important;
    background: var(--ui-surface) !important;
    color: var(--ui-text) !important;
}

body.ui-modern .swal2-styled:focus {
    box-shadow: 0 0 0 3px var(--ui-ring) !important;
}

body.ui-modern .swal2-container.swal2-backdrop-show,
body.ui-modern .swal2-container.swal2-shown {
    background: rgba(15, 23, 42, 0.45);
}

body.ui-modern #toast-container > div {
    width: 340px;
    padding: 14px 16px 14px 50px;
    border-radius: var(--ui-radius-lg);
    background-position: 16px center;
    box-shadow: var(--ui-shadow-lg);
    opacity: 1;
    font-family: var(--ui-font);
    font-size: 13.5px;
}

body.ui-modern #toast-container > div:hover {
    box-shadow: var(--ui-shadow-lg);
}

body.ui-modern #toast-container > .toast-success { background-color: #15803d; }
body.ui-modern #toast-container > .toast-error { background-color: #b91c1c; }
body.ui-modern #toast-container > .toast-warning { background-color: #b45309; }
body.ui-modern #toast-container > .toast-info { background-color: #1e40af; }

body.ui-modern.dark-mode #toast-container > div {
    background-color: var(--ui-surface-2);
    background-repeat: no-repeat;
    color: var(--ui-text);
    border: 1px solid var(--ui-border-strong);
}

body.ui-modern.dark-mode #toast-container .toast-close-button {
    color: var(--ui-text);
    text-shadow: none;
    opacity: 0.8;
}

body.ui-modern .toast-title {
    font-weight: 600;
}

/* Overlay de NX.showLoading() */
body.ui-modern #nx-loading-overlay {
    background-color: rgba(15, 23, 42, 0.28) !important;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

body.ui-modern #nx-loading-overlay > div > div:first-child {
    width: 36px !important;
    height: 36px !important;
    border: 3px solid rgba(255, 255, 255, 0.35) !important;
    border-top-color: #fff !important;
    animation-duration: 0.7s !important;
}

body.ui-modern #nx-loading-overlay .nx-loading-message {
    font-size: 13.5px !important;
    font-weight: 500;
}

/* Alertas de Bootstrap */
body.ui-modern .alert {
    border: 1px solid transparent;
    border-radius: var(--ui-radius);
    font-size: 13.5px;
}

body.ui-modern .alert-success { background: var(--ui-success-soft); border-color: transparent; color: var(--ui-success-text); }
body.ui-modern .alert-danger { background: var(--ui-danger-soft); border-color: transparent; color: var(--ui-danger-text); }
body.ui-modern .alert-warning { background: var(--ui-warning-soft); border-color: transparent; color: var(--ui-warning-text); }
body.ui-modern .alert-info { background: var(--ui-info-soft); border-color: transparent; color: var(--ui-info-text); }

/* ========================================================================
   HOME
   ======================================================================== */
body.ui-modern .ui-home {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

body.ui-modern .ui-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 32px 36px;
    overflow: hidden;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-xl);
    background:
        radial-gradient(600px 240px at 0% 0%, color-mix(in srgb, #6366f1 12%, transparent), transparent 70%),
        radial-gradient(500px 260px at 100% 100%, color-mix(in srgb, #06b6d4 12%, transparent), transparent 70%),
        var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
}

/* Trama de puntos sutil */
body.ui-modern .ui-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(var(--ui-border-strong) 1px, transparent 1px);
    background-size: 18px 18px;
    -webkit-mask-image: linear-gradient(90deg, transparent 35%, #000 100%);
    mask-image: linear-gradient(90deg, transparent 35%, #000 100%);
    opacity: 0.5;
    pointer-events: none;
}

body.ui-modern .ui-hero > * {
    position: relative;
}

body.ui-modern .ui-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 4px 10px 4px 8px;
    border: 1px solid var(--ui-border);
    border-radius: 999px;
    background: var(--ui-surface);
    color: var(--ui-text-2);
    font-size: 12px;
    font-weight: 500;
}

body.ui-modern .ui-hero-eyebrow .ui-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ui-success);
    box-shadow: 0 0 0 3px var(--ui-success-soft);
}

body.ui-modern .ui-hero-title {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.035em;
}

body.ui-modern .ui-hero-title span {
    background: linear-gradient(90deg, #6366f1, var(--ui-primary) 50%, #0891b2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.ui-modern .ui-hero-sub {
    max-width: 520px;
    margin: 10px 0 0;
    color: var(--ui-text-2);
    font-size: 15px;
    line-height: 1.55;
}

body.ui-modern .ui-hero-art {
    flex: 0 0 auto;
    width: 260px;
    max-height: 190px;
    object-fit: contain;
}

body.ui-modern .ui-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

body.ui-modern .ui-section-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Buscador del home */
body.ui-modern .ui-search {
    position: relative;
    display: block;
    width: 260px;
    max-width: 100%;
    margin: 0;
}

body.ui-modern .ui-search i {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: var(--ui-muted);
    font-size: 13px;
    pointer-events: none;
}

body.ui-modern .ui-search input {
    width: 100%;
    height: 36px;
    padding: 0 12px 0 34px;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius);
    background: var(--ui-surface);
    color: var(--ui-text);
    font-size: 13.5px;
    box-shadow: var(--ui-shadow-xs);
    outline: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.ui-modern .ui-search input::placeholder {
    color: var(--ui-muted);
}

body.ui-modern .ui-search input:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 3px var(--ui-ring);
}

body.ui-modern .ui-tiles-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 36px 16px;
    border: 1px dashed var(--ui-border-strong);
    border-radius: var(--ui-radius-lg);
    color: var(--ui-text-2);
    font-size: 13.5px;
    text-align: center;
}

body.ui-modern .ui-tiles-empty[hidden] {
    display: none;
}

body.ui-modern .ui-tiles-empty i {
    color: var(--ui-muted);
    font-size: 22px;
}

body.ui-modern .ui-tiles-empty span {
    color: var(--ui-text);
    font-weight: 600;
}

body.ui-modern .ui-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

body.ui-modern .ui-tile {
    --tile-h: 220;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background: var(--ui-surface);
    color: var(--ui-text);
    box-shadow: var(--ui-shadow-xs);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ui-ease);
    animation: ui-rise 0.35s var(--ui-ease) both;
    animation-delay: calc(var(--i, 0) * 40ms);
}

body.ui-modern .ui-tile:hover {
    border-color: hsl(var(--tile-h), 70%, 70%);
    box-shadow: var(--ui-shadow-md);
    color: var(--ui-text);
    transform: translateY(-2px);
}

body.ui-modern .ui-tile-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: hsl(var(--tile-h), 90%, 96%);
    color: hsl(var(--tile-h), 65%, 42%);
    font-size: 19px;
    box-shadow: inset 0 0 0 1px hsl(var(--tile-h), 70%, 90%);
    transition: transform 0.2s var(--ui-ease);
}

body.ui-modern .ui-tile:hover .ui-tile-icon {
    transform: scale(1.06);
}

body.ui-modern .ui-tile-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding-right: 18px;
}

body.ui-modern .ui-tile-title {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

body.ui-modern .ui-tile-desc {
    color: var(--ui-text-2);
    font-size: 13px;
    line-height: 1.45;
}

body.ui-modern .ui-tile-arrow {
    position: absolute;
    top: 16px;
    right: 16px;
    color: var(--ui-muted);
    font-size: 14px;
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: opacity 0.2s ease, transform 0.2s var(--ui-ease);
}

body.ui-modern .ui-tile:hover .ui-tile-arrow {
    opacity: 1;
    transform: none;
}

body.ui-modern.dark-mode .ui-tile-icon {
    background: hsl(var(--tile-h), 40%, 16%);
    color: hsl(var(--tile-h), 80%, 72%);
    box-shadow: inset 0 0 0 1px hsl(var(--tile-h), 40%, 24%);
}

body.ui-modern.dark-mode .ui-tile:hover {
    border-color: hsl(var(--tile-h), 40%, 36%);
}

body.ui-modern.dark-mode .ui-hero-art {
    opacity: 0.85;
}

@keyframes ui-rise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    body.ui-modern .ui-tile,
    body.ui-modern .dropdown-menu {
        animation: none;
    }

    body.ui-modern .ui-tile:hover,
    body.ui-modern .nx-card:hover {
        transform: none;
    }
}

/* ========================================================================
   RESPONSIVE
   ======================================================================== */
@media (max-width: 1024px) {
    body.ui-modern .header {
        position: sticky;
    }
}

@media (max-width: 767px) {
    body.ui-modern {
        --ui-header-h: 56px;
    }

    body.ui-modern .header {
        position: sticky;
        padding: 0 8px 0 4px;
    }

    body.ui-modern .main-container {
        padding: 16px 16px 24px !important;
    }

    body.ui-modern .main-container > .card-box.pd-20 {
        padding: 16px !important;
    }

    body.ui-modern .brand-logo a span small.menu-app-enterprise {
        display: none !important;
    }

    body.ui-modern .user-info-dropdown .dropdown-toggle {
        padding: 2px;
    }

    body.ui-modern .user-info-dropdown .dropdown-toggle .user-name,
    body.ui-modern .user-info-dropdown .dropdown-toggle::after {
        display: none;
    }

    body.ui-modern .ui-page-title {
        font-size: 18px;
        margin-bottom: 12px !important;
    }

    body.ui-modern .nav-tabs.customtab {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    body.ui-modern .nav-tabs.customtab .nav-link {
        white-space: nowrap;
    }

    body.ui-modern .btn-list-filters {
        width: 100%;
    }

    /* style.css convierte "Acciones" en un botón de tres puntos */
    body.ui-modern .btn-list-filters .dropdown .dropdown-toggle {
        width: 36px;
        padding: 0;
        font-size: 0;
    }

    body.ui-modern .filter-search-box.active > .search-text,
    body.ui-modern .filter-search-box:hover > .search-text,
    body.ui-modern .btn-list-filters .filter-search-box.active > .search-text,
    body.ui-modern .btn-list-filters .filter-search-box:hover > .search-text {
        width: 170px;
    }

    body.ui-modern .right-sidebar {
        width: 100%;
        right: -105%;
    }

    body.ui-modern .ui-hero {
        padding: 22px 20px;
    }

    body.ui-modern .ui-hero-art {
        display: none;
    }

    body.ui-modern .ui-search {
        width: 100%;
    }

    body.ui-modern .ui-tiles {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body.ui-modern .ui-tile {
        padding: 14px;
    }

    body.ui-modern #toast-container > div {
        width: calc(100vw - 24px);
    }
}

/* ========================================================================
   AJUSTES SOBRE dark-theme.css (usa !important en tablas y menú)
   ======================================================================== */
body.ui-modern .header-table-text {
    color: inherit !important;
}

body.ui-modern.dark-mode .table-principal,
body.ui-modern.dark-mode .table-principal tbody,
body.ui-modern.dark-mode .table-principal tbody tr,
body.ui-modern.dark-mode .table-principal tbody tr:nth-of-type(odd),
body.ui-modern.dark-mode .table-striped tbody tr:nth-of-type(odd),
body.ui-modern.dark-mode .table-striped tbody tr:nth-of-type(even) {
    background: transparent !important;
}

body.ui-modern.dark-mode .table-principal tbody tr:hover,
body.ui-modern.dark-mode .table-hover tbody tr:hover {
    background: color-mix(in srgb, var(--ui-primary) 7%, var(--ui-surface)) !important;
}

body.ui-modern.dark-mode .table-principal thead,
body.ui-modern.dark-mode .table-principal thead th {
    background: var(--ui-surface-2) !important;
    color: var(--ui-text-2) !important;
    border-color: var(--ui-border) !important;
}

body.ui-modern.dark-mode .table-principal tbody td {
    border-color: var(--ui-border) !important;
}

body.ui-modern.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.ui-modern.dark-mode .dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
    background: var(--ui-text) !important;
    color: var(--ui-surface) !important;
}

body.ui-modern.dark-mode .sidebar-menu .dropdown-toggle,
body.ui-modern.dark-mode .sidebar-menu .dropdown-toggle .mtext {
    color: var(--ui-text-2) !important;
}

body.ui-modern.dark-mode .sidebar-menu .dropdown-toggle:hover,
body.ui-modern.dark-mode .sidebar-menu .dropdown-toggle:hover .mtext {
    color: var(--ui-text) !important;
}

body.ui-modern.dark-mode .sidebar-menu > ul > li > .dropdown-toggle.active,
body.ui-modern.dark-mode .sidebar-menu > ul > li > .dropdown-toggle.active .mtext {
    color: var(--ui-primary-text) !important;
}

/* ========================================================================
   LOGIN Y RECUPERO DE CONTRASEÑA (auth.layout, sin style.css)
   ======================================================================== */
body.ui-modern.ui-auth {
    min-height: 100vh;
    margin: 0;
}

body.ui-modern.ui-auth a {
    text-decoration: none;
}

body.ui-modern .ui-auth-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    min-height: 100vh;
}

/* Panel de marca */
body.ui-modern .ui-auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    padding: 40px 48px;
    overflow: hidden;
    background:
        radial-gradient(700px 400px at 0% 0%, rgba(99, 102, 241, 0.55), transparent 65%),
        radial-gradient(600px 420px at 100% 100%, rgba(6, 182, 212, 0.40), transparent 65%),
        linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
}

body.ui-modern .ui-auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 85%);
    mask-image: linear-gradient(180deg, #000, transparent 85%);
    pointer-events: none;
}

body.ui-modern .ui-auth-brand > * {
    position: relative;
}

body.ui-modern .ui-auth-brand-top {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

body.ui-modern .ui-auth-brand-top img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

body.ui-modern .ui-auth-brand-copy h2 {
    max-width: 460px;
    margin: 0;
    color: #fff;
    font-size: clamp(26px, 2.6vw, 36px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

body.ui-modern .ui-auth-brand-copy p {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 15px;
}

body.ui-modern .ui-auth-brand-art {
    width: 100%;
    max-width: 440px;
    max-height: 36vh;
    object-fit: contain;
    align-self: center;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.35));
}

/* Panel del formulario */
body.ui-modern .ui-auth-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 40px 24px;
    background: var(--ui-bg);
}

body.ui-modern .ui-auth-card {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-xl);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-md);
    animation: ui-rise 0.35s var(--ui-ease) both;
}

body.ui-modern .ui-auth-logo {
    display: none;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    color: var(--ui-text);
    font-size: 16px;
    font-weight: 650;
}

body.ui-modern .ui-auth-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

body.ui-modern .ui-auth-head {
    margin-bottom: 24px;
}

body.ui-modern .ui-auth-head h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

body.ui-modern .ui-auth-head p {
    margin: 6px 0 0;
    color: var(--ui-text-2);
    font-size: 14px;
}

body.ui-modern .ui-auth-card .form-group {
    margin-bottom: 16px;
}

body.ui-modern .ui-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

body.ui-modern .ui-label-row a {
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 500;
}

/* Input con ícono y acción (mostrar contraseña) */
body.ui-modern .ui-input-icon {
    position: relative;
}

body.ui-modern .ui-input-icon > i {
    position: absolute;
    top: 50%;
    left: 13px;
    transform: translateY(-50%);
    color: var(--ui-muted);
    font-size: 15px;
    pointer-events: none;
}

body.ui-modern .ui-input-icon .form-control {
    height: 44px;
    padding-left: 38px;
    font-size: 14.5px;
}

body.ui-modern .ui-input-icon .form-control:focus ~ i,
body.ui-modern .ui-input-icon:focus-within > i {
    color: var(--ui-primary);
}

body.ui-modern .ui-input-icon:has(.ui-input-action) .form-control {
    padding-right: 44px;
}

body.ui-modern .ui-input-action {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: var(--ui-radius-sm);
    background: transparent;
    color: var(--ui-muted);
    cursor: pointer;
}

body.ui-modern .ui-input-action:hover {
    background: var(--ui-surface-2);
    color: var(--ui-text);
}

body.ui-modern .ui-auth-card .btn-block {
    height: 44px;
    margin-top: 8px;
}

body.ui-modern .ui-auth-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    color: var(--ui-text-2);
    font-size: 13.5px;
}

body.ui-modern .ui-auth-back:hover {
    color: var(--ui-text);
}

/* components.badge_errors viene envuelto en col-md-12 */
body.ui-modern .ui-auth-card .col-md-12 {
    padding: 0;
}

body.ui-modern .ui-auth-card .alert {
    margin-bottom: 16px;
}

body.ui-modern .ui-auth-card .alert ul {
    margin: 0;
    padding-left: 18px;
}

body.ui-modern .ui-auth-foot {
    margin: 0;
    color: var(--ui-muted);
    font-size: 12.5px;
}

@media (max-width: 991px) {
    body.ui-modern .ui-auth-wrap {
        grid-template-columns: 1fr;
    }

    body.ui-modern .ui-auth-brand {
        display: none;
    }

    body.ui-modern .ui-auth-logo {
        display: flex;
    }
}

@media (max-width: 480px) {
    body.ui-modern .ui-auth-panel {
        justify-content: flex-start;
        padding: 32px 16px;
    }

    body.ui-modern .ui-auth-card {
        padding: 24px 20px;
    }
}

/* Búsquedas y resultados: contenido delimitado y estados legibles en ambos temas. */
body.ui-modern .table-principal td.radar-cell {white-space:normal!important;overflow-wrap:anywhere;min-width:160px;max-width:360px;vertical-align:top;}
.radar-status, .radar-age {white-space:normal;line-height:1.4;}
.radar-age {background:#dbeafe!important;color:#1e3a8a!important;}
.radar-status-maybe {background:#fef3c7!important;color:#78350f!important;}
.radar-status-like {background:#dcfce7!important;color:#14532d!important;}
.radar-status-dislike {background:#fee2e2!important;color:#7f1d1d!important;}
.radar-status-almost_discarded {background:#ffedd5!important;color:#7c2d12!important;}
body.dark-mode .radar-age {background:#1e3a8a!important;color:#dbeafe!important;}
body.dark-mode .radar-status-maybe {background:#78350f!important;color:#fef3c7!important;}
body.dark-mode .radar-status-like {background:#14532d!important;color:#dcfce7!important;}
body.dark-mode .radar-status-dislike {background:#7f1d1d!important;color:#fee2e2!important;}
body.dark-mode .radar-status-almost_discarded {background:#7c2d12!important;color:#ffedd5!important;}

/* Paneles compartidos de asignación: Fuentes, Roles y Usuarios. */
body.ui-modern .filtered-list {
    width: 100%;
    min-width: 0;
    background: var(--ui-surface);
    color: var(--ui-text);
    border-color: var(--ui-border);
}

body.ui-modern .filtered-list .title {
    border-color: var(--ui-border);
}

body.ui-modern .filtered-list input.filter {
    background: var(--ui-surface-2);
    color: var(--ui-text);
    border-color: var(--ui-border) !important;
}

body.ui-modern .filtered-list input.filter::placeholder {
    color: var(--ui-text-2);
    opacity: 1;
}

body.ui-modern .filtered-list input.filter:focus {
    border-color: var(--ui-primary) !important;
    box-shadow: 0 0 0 3px var(--ui-ring);
}

body.ui-modern .filtered-list .vlist a.option {
    color: var(--ui-text);
    border-radius: var(--ui-radius-sm);
    overflow-wrap: anywhere;
}

body.ui-modern .filtered-list .vlist a.option:hover,
body.ui-modern .filtered-list .vlist a.option:focus-visible {
    background: var(--ui-primary-soft);
    color: var(--ui-primary-text);
}

body.ui-modern .filtered-list .vlist a.option:focus-visible {
    outline: 2px solid var(--ui-primary);
    outline-offset: -2px;
}
