:root {
    --cvr-primary: #4c3bcf;
    --cvr-primary-dark: #292173;
    --cvr-primary-soft: #efedff;
    --cvr-accent: #19a8a2;
    --cvr-ink: #1f2937;
    --cvr-muted: #6b7280;
    --cvr-border: #e4e7ef;
    --cvr-surface: #ffffff;
    --cvr-canvas: #f4f6fb;
    --cvr-sidebar: #f7f8fc;
    --cvr-sidebar-soft: #edf0f7;
    --cvr-sidebar-text: #344054;
    --cvr-sidebar-muted: #667085;
    --cvr-sidebar-icon: #667085;
    --cvr-sidebar-subtext: #475467;
    --cvr-sidebar-subhover: rgba(76, 59, 207, .08);
    --cvr-sidebar-subhover-text: #292173;
    --cvr-header-surface: rgba(255, 255, 255, .97);
    --cvr-header-icon: #667085;
    --cvr-header-hover: #f1f0fb;
    --cvr-header-active: #4c3bcf;
    --cvr-logo-surface: #ffffff;
    --cvr-danger: #dc4c64;
    --cvr-radius: 10px;
    --cvr-shadow: 0 10px 30px rgba(32, 33, 62, .09);
}

/* Acceso y recuperación ---------------------------------------------------- */

body.login.cvr-auth {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 12%, rgba(76, 59, 207, .17), transparent 31%),
        radial-gradient(circle at 88% 82%, rgba(25, 168, 162, .14), transparent 30%),
        linear-gradient(145deg, #f7f6ff 0%, #f3f7fb 50%, #eef8f7 100%) !important;
    color: var(--cvr-ink);
}

body.login.cvr-auth::before,
body.login.cvr-auth::after {
    position: fixed;
    z-index: 0;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(76, 59, 207, .12);
    border-radius: 44% 56% 63% 37%;
    content: "";
    pointer-events: none;
    transform: rotate(28deg);
}

body.login.cvr-auth::before {
    top: -105px;
    right: -72px;
}

body.login.cvr-auth::after {
    bottom: -145px;
    left: -85px;
    border-color: rgba(25, 168, 162, .13);
    transform: rotate(-18deg);
}

.cvr-auth .logo,
.cvr-auth .content,
.cvr-auth .copyright {
    position: relative;
    z-index: 1;
}

.cvr-auth .logo {
    margin: 0 auto !important;
    padding: 54px 0 20px !important;
    text-align: center;
}

.cvr-auth .logo a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    color: var(--cvr-primary-dark) !important;
    text-decoration: none;
}

.cvr-auth .logo img {
    width: auto;
    max-width: 224px !important;
    max-height: 64px;
    filter: drop-shadow(0 5px 10px rgba(41, 33, 115, .08));
}

.cvr-auth-version {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-top: 13px;
    padding: 3px 10px;
    border: 1px solid rgba(76, 59, 207, .16);
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .72);
    color: var(--cvr-primary-dark);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.login.cvr-auth .content {
    width: 440px;
    max-width: calc(100% - 32px);
    margin: 0 auto 24px;
    padding: 38px 40px 34px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 20px !important;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 24px 70px rgba(38, 35, 87, .14);
    backdrop-filter: blur(12px);
}

.cvr-auth .content form {
    margin: 0;
}

.cvr-auth .content .form-title {
    margin: 0 0 25px;
    color: var(--cvr-ink) !important;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
}

.cvr-auth .content .form-title > .form-title,
.cvr-auth .content .form-title > .form-subtitle {
    display: block;
}

.cvr-auth .content .form-subtitle {
    margin-top: 8px;
    color: var(--cvr-muted) !important;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0;
}

.cvr-auth-kicker {
    display: block;
    margin-bottom: 10px;
    color: var(--cvr-primary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.cvr-auth .content .form-group {
    margin-bottom: 16px;
}

.cvr-auth .content .input-icon {
    position: relative;
}

.cvr-auth .content .input-icon > i {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 17px;
    width: 18px;
    margin: 0;
    color: #8b91a7;
    font-size: 17px;
    transform: translateY(-50%);
}

.login.cvr-auth .content .form-control {
    height: 50px;
    padding: 10px 15px;
    border: 1px solid #dfe3ec !important;
    border-radius: 10px !important;
    background: #fbfcfe !important;
    color: var(--cvr-ink) !important;
    font-size: 14px;
    box-shadow: none !important;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.login.cvr-auth .content .input-icon .form-control {
    padding-left: 48px;
}

.login.cvr-auth .content .form-control:focus {
    border-color: rgba(76, 59, 207, .62) !important;
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(76, 59, 207, .09) !important;
}

.login.cvr-auth .content .form-control::placeholder {
    color: #969caf;
    opacity: 1;
}

.cvr-auth .content .form-actions {
    margin: 20px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.cvr-auth .content .form-actions + .form-actions {
    margin-top: 16px;
}

.cvr-auth .content .btn-cvr-primary,
.cvr-auth .content .form-actions .btn.green,
.cvr-auth .content .form-actions .btn-primary {
    min-height: 48px;
    border: 0 !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, var(--cvr-primary-dark), var(--cvr-primary)) !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .055em;
    box-shadow: 0 10px 22px rgba(76, 59, 207, .25);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.cvr-auth .content .btn-cvr-primary:hover,
.cvr-auth .content .btn-cvr-primary:focus,
.cvr-auth .content .form-actions .btn.green:hover,
.cvr-auth .content .form-actions .btn.green:focus,
.cvr-auth .content .form-actions .btn-primary:hover,
.cvr-auth .content .form-actions .btn-primary:focus {
    color: #fff !important;
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(76, 59, 207, .3);
}

.cvr-auth .content .btn-default {
    min-height: 46px;
    border: 1px solid var(--cvr-border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #4b5563 !important;
    font-weight: 600;
}

.cvr-auth .forget-password-block {
    float: none !important;
    text-align: center;
}

.login.cvr-auth a.forget-password,
.login.cvr-auth .security-actions a,
.login.cvr-auth .security-actions .btn-link {
    color: var(--cvr-primary) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.login.cvr-auth a.forget-password:hover,
.login.cvr-auth .security-actions a:hover,
.login.cvr-auth .security-actions .btn-link:hover {
    color: var(--cvr-primary-dark) !important;
    text-decoration: none;
}

.cvr-auth .alert {
    border: 0;
    border-radius: 9px !important;
}

.cvr-auth .copyright {
    margin: 0 auto !important;
    padding: 0 16px 34px;
    color: #72788c !important;
    font-size: 11px;
    line-height: 1.7;
    text-align: center;
}

.cvr-auth .copyright a {
    color: var(--cvr-primary-dark) !important;
    font-weight: 600;
}

/* Segundo factor */

.login.cvr-auth.security-login .content {
    text-align: center;
}

.security-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 18px;
    border: 1px solid rgba(76, 59, 207, .13);
    border-radius: 17px !important;
    background: linear-gradient(145deg, #f6f4ff, #eceaff);
    color: var(--cvr-primary);
    font-size: 24px;
    box-shadow: 0 9px 20px rgba(76, 59, 207, .1);
}

.security-title {
    color: var(--cvr-ink);
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.security-subtitle {
    margin: 8px 0 12px;
    color: var(--cvr-muted);
    font-size: 14px;
    line-height: 1.55;
}

.security-email {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 22px;
    padding: 7px 12px;
    overflow: hidden;
    border: 1px solid var(--cvr-border);
    border-radius: 999px !important;
    background: #f7f8fc;
    color: var(--cvr-primary-dark);
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
}

.login.cvr-auth .content .security-code-input {
    height: 58px !important;
    padding-left: 21px !important;
    font-family: Consolas, Monaco, monospace;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 9px;
    text-align: center;
}

.security-primary-action {
    margin: 0 !important;
}

.security-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 19px;
    padding-top: 17px;
    border-top: 1px solid #edf0f5;
}

.security-actions form {
    display: inline-block;
}

.login.cvr-auth .security-actions .btn-link {
    border: 0 !important;
    background: transparent !important;
}

.login.cvr-auth .security-actions .btn-link[disabled] {
    color: #a0a6b8 !important;
    cursor: not-allowed;
}

/* Aplicación -------------------------------------------------------------- */

body.cvr-v2-shell {
    background: var(--cvr-canvas);
    color: var(--cvr-ink);
}

body.cvr-v2-shell.tema-oscuro {
    --cvr-canvas: #1b1e24;
    --cvr-sidebar: #12141a;
    --cvr-sidebar-soft: #232733;
    --cvr-sidebar-text: #c8c7d5;
    --cvr-sidebar-muted: #85829e;
    --cvr-sidebar-icon: #9693ad;
    --cvr-sidebar-subtext: #aaa8bd;
    --cvr-sidebar-subhover: rgba(255, 255, 255, .09);
    --cvr-sidebar-subhover-text: #ffffff;
    --cvr-header-surface: #12141a;
    --cvr-header-icon: #d4d7de;
    --cvr-header-hover: #232733;
    --cvr-header-active: #77d8d3;
    --cvr-logo-surface: #12141a;
}

.cvr-v2-shell .page-header.navbar {
    border: 0;
    border-bottom: 1px solid rgba(31, 41, 55, .07);
    background: var(--cvr-header-surface);
    box-shadow: 0 4px 18px rgba(31, 41, 55, .055);
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.cvr-v2-shell .page-header.navbar::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--cvr-primary-dark), var(--cvr-primary), var(--cvr-accent));
    content: "";
}

.cvr-v2-shell .page-header.navbar .page-logo {
    position: relative;
    background: var(--cvr-logo-surface) !important;
    transition: background-color .16s ease;
}

.cvr-v2-shell .page-header.navbar .page-logo > a {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.cvr-v2-shell .page-header.navbar .top-menu {
    background-color: var(--cvr-header-surface);
    transition: background-color .16s ease;
}

.cvr-v2-shell .page-header.navbar .page-logo .logo-default {
    transition: filter .16s ease, opacity .16s ease;
}

body.cvr-v2-shell.tema-oscuro .page-header.navbar .page-logo .logo-default {
    filter: brightness(0) invert(1);
    opacity: .94;
}

.cvr-v2-shell .page-header.navbar .top-menu .navbar-nav > li > .cvr-theme-toggle {
    display: inline-flex;
    width: 44px;
    height: 50px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 0 !important;
    background: transparent;
    color: var(--cvr-header-icon);
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease, opacity .16s ease;
}

.cvr-v2-shell .page-header.navbar .top-menu .navbar-nav > li > .cvr-theme-toggle:hover,
.cvr-v2-shell .page-header.navbar .top-menu .navbar-nav > li > .cvr-theme-toggle:focus {
    background: var(--cvr-header-hover);
    color: var(--cvr-header-active);
    outline: 0;
}

.cvr-v2-shell .page-header.navbar .top-menu .navbar-nav > li > .cvr-theme-toggle:focus-visible {
    box-shadow: inset 0 0 0 2px var(--cvr-primary);
}

.cvr-v2-shell .page-header.navbar .top-menu .navbar-nav > li > .cvr-theme-toggle:disabled {
    opacity: .55;
    cursor: wait;
}

.cvr-v2-shell .cvr-theme-toggle > i {
    font-size: 17px;
}

.cvr-version-mark {
    position: absolute;
    top: 8px;
    right: -28px;
    padding: 1px 6px;
    border-radius: 999px !important;
    background: var(--cvr-primary-soft);
    color: var(--cvr-primary);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cvr-v2-shell .page-sidebar,
.cvr-v2-shell .page-sidebar-wrapper,
.cvr-v2-shell .page-sidebar-menu {
    background: var(--cvr-sidebar) !important;
}

.cvr-v2-shell .page-sidebar-menu {
    padding-top: 12px !important;
    padding-bottom: 22px;
}

/* Cada menú heredado incluía un buscador de demostración sin funcionalidad.
   La búsqueda real vive en la cabecera; ocultarlo evita un bloque vacío. */
.cvr-v2-shell .page-sidebar-menu > .sidebar-search-wrapper {
    display: none !important;
}

.cvr-v2-shell .page-sidebar .page-sidebar-menu > li.heading {
    margin: 12px 0 4px;
    padding: 11px 18px 5px;
}

.cvr-v2-shell .page-sidebar .page-sidebar-menu > li.heading > h3 {
    color: var(--cvr-sidebar-muted) !important;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
}

.cvr-v2-shell .page-sidebar .page-sidebar-menu > li > a {
    display: flex;
    align-items: center;
    min-height: 42px;
    margin: 2px 9px;
    padding: 9px 12px 9px 14px;
    border: 0 !important;
    border-radius: 8px !important;
    color: var(--cvr-sidebar-text);
    line-height: 1.3;
    transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.cvr-v2-shell .page-sidebar .page-sidebar-menu > li > a > i {
    flex: 0 0 23px;
    width: 23px;
    margin-right: 8px;
    color: var(--cvr-sidebar-icon);
    text-align: center;
}

.cvr-v2-shell .page-sidebar .page-sidebar-menu > li > a > .title {
    flex: 1 1 auto;
    min-width: 0;
    white-space: normal;
}

/* El tema heredado posiciona los contadores con coordenadas absolutas.
   Al usar ahora filas flexibles eso los dejaba pegados a la parte superior. */
.cvr-v2-shell .page-sidebar .page-sidebar-menu > li > a > .badge {
    position: static;
    right: auto;
    top: auto;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin: 0 0 0 8px;
    padding: 0 5px;
    float: none;
    font-size: 11px;
    line-height: 1;
    text-align: center;
}

.cvr-v2-shell .page-sidebar .page-sidebar-menu > li > a > .arrow {
    flex: 0 0 auto;
    margin-left: 8px;
}

.cvr-v2-shell .page-sidebar .page-sidebar-menu > li.active > a,
.cvr-v2-shell .page-sidebar .page-sidebar-menu > li.open > a,
.cvr-v2-shell .page-sidebar .page-sidebar-menu > li:hover > a {
    background: linear-gradient(135deg, rgba(76, 59, 207, .95), rgba(92, 75, 220, .88)) !important;
    color: #fff !important;
    box-shadow: 0 7px 16px rgba(16, 13, 42, .25);
}

.cvr-v2-shell .page-sidebar .page-sidebar-menu > li.active > a > i,
.cvr-v2-shell .page-sidebar .page-sidebar-menu > li.open > a > i,
.cvr-v2-shell .page-sidebar .page-sidebar-menu > li:hover > a > i {
    color: #fff !important;
}

.cvr-v2-shell .page-sidebar .page-sidebar-menu .sub-menu > li > a {
    min-height: 36px;
    margin: 1px 9px 1px 17px;
    padding: 9px 12px 9px 27px !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: var(--cvr-sidebar-subtext);
    font-size: 12.5px;
    line-height: 1.35;
    white-space: normal;
}

.cvr-v2-shell .page-sidebar .page-sidebar-menu .sub-menu > li.active > a,
.cvr-v2-shell .page-sidebar .page-sidebar-menu .sub-menu > li.open > a,
.cvr-v2-shell .page-sidebar .page-sidebar-menu .sub-menu > li:hover > a {
    background: var(--cvr-sidebar-subhover) !important;
    color: var(--cvr-sidebar-subhover-text) !important;
}

.cvr-v2-shell .page-sidebar .page-sidebar-menu .sub-menu > li.active > a {
    box-shadow: inset 3px 0 0 var(--cvr-accent);
}

.cvr-v2-shell .page-content-wrapper .page-content {
    min-height: calc(100vh - 50px);
    background: var(--cvr-canvas);
}

.cvr-v2-shell .page-bar {
    margin-bottom: 23px;
    border: 1px solid var(--cvr-border);
    border-radius: var(--cvr-radius) !important;
    background: rgba(255, 255, 255, .82);
    box-shadow: 0 3px 12px rgba(31, 41, 55, .035);
}

.cvr-v2-shell .page-title {
    color: var(--cvr-ink);
    font-weight: 700;
    letter-spacing: -.025em;
}

.cvr-v2-shell .page-title small {
    color: #7b8190;
    font-weight: 400;
}

/* Accesos a aplicaciones del inicio. La antigua mancha de color se convierte
   en una tarjeta del mismo lenguaje visual que el resto del panel: superficie
   clara, acento propio, icono compacto y una acción inequívoca. */
.cvr-v2-shell .cvr-app-grid {
    display: flex;
    flex-wrap: wrap;
}

.cvr-v2-shell .cvr-app-grid > [class*="col-"] {
    display: flex;
    float: none;
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat {
    --cvr-app-color: #4f88b7;
    --cvr-app-soft: rgba(79, 136, 183, .13);
    position: relative;
    isolation: isolate;
    width: 100%;
    min-height: 156px;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid #e3e7f0 !important;
    border-top: 3px solid var(--cvr-app-color) !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, #fff 0%, #fbfcff 100%) !important;
    box-shadow: 0 8px 24px rgba(31, 41, 55, .08);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat::before {
    position: absolute;
    z-index: 0;
    top: -52px;
    right: -42px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: var(--cvr-app-soft);
    content: "";
    pointer-events: none;
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat.blue-madison {
    --cvr-app-color: #4f88b7;
    --cvr-app-soft: rgba(79, 136, 183, .13);
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat.yellow {
    --cvr-app-color: #b48622;
    --cvr-app-soft: rgba(180, 134, 34, .14);
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat.purple-intense {
    --cvr-app-color: #7c64a7;
    --cvr-app-soft: rgba(124, 100, 167, .14);
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat.grey-cascade {
    --cvr-app-color: #687f86;
    --cvr-app-soft: rgba(104, 127, 134, .14);
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat.green {
    --cvr-app-color: #169ca8;
    --cvr-app-soft: rgba(22, 156, 168, .13);
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat.blue-hoki {
    --cvr-app-color: #5e7692;
    --cvr-app-soft: rgba(94, 118, 146, .14);
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat.red-sunglo {
    --cvr-app-color: #d75a62;
    --cvr-app-soft: rgba(215, 90, 98, .13);
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat.blue-sharp {
    --cvr-app-color: #438bc4;
    --cvr-app-soft: rgba(67, 139, 196, .13);
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat.green-jungle {
    --cvr-app-color: #18a86b;
    --cvr-app-soft: rgba(24, 168, 107, .13);
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat:focus-within {
    border-color: var(--cvr-app-color) !important;
    box-shadow: 0 0 0 3px var(--cvr-app-soft), 0 14px 30px rgba(31, 41, 55, .12);
}

@media (hover: hover) and (pointer: fine) {
    .cvr-v2-shell .cvr-app-grid .dashboard-stat:hover {
        border-color: var(--cvr-app-color) !important;
        transform: translateY(-4px);
        box-shadow: 0 16px 34px rgba(31, 41, 55, .14);
    }
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat .visual {
    position: absolute;
    z-index: 1;
    top: 18px;
    left: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    float: none;
    border: 0;
    border-radius: 12px !important;
    background: var(--cvr-app-color) !important;
    box-shadow: 0 8px 18px var(--cvr-app-soft);
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat .visual > i {
    margin: 0;
    color: #fff !important;
    font-size: 22px;
    line-height: 1;
    opacity: 1;
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat .details {
    position: absolute;
    z-index: 1;
    top: 18px;
    right: 15px;
    left: 79px;
    min-width: 0;
    padding: 0;
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat .details .number {
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: #252b3a !important;
    font-size: clamp(18px, 1.55vw, 22px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.025em;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat .details .desc {
    margin-top: 6px;
    color: #777f90 !important;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    letter-spacing: 0;
    text-align: left;
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat .more {
    position: absolute;
    z-index: 2;
    right: 14px;
    bottom: 14px;
    left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 31px;
    padding: 7px 12px;
    border: 1px solid var(--cvr-app-soft);
    border-radius: 999px !important;
    background: var(--cvr-app-soft) !important;
    color: var(--cvr-app-color) !important;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: 1;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat .more::after {
    margin-left: 7px;
    content: "\2192";
    font-size: 15px;
    font-weight: 400;
    line-height: 1;
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat .more:hover,
.cvr-v2-shell .cvr-app-grid .dashboard-stat .more:focus {
    padding: 7px 12px;
    background: var(--cvr-app-color) !important;
    color: #fff !important;
    text-decoration: none;
    transform: translateX(2px);
    outline: 0;
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat .more:focus-visible {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--cvr-app-color);
}

.cvr-v2-shell .cvr-app-grid .dashboard-stat .more > i {
    display: none;
}

body.cvr-v2-shell.tema-oscuro .cvr-app-grid .dashboard-stat {
    border-color: #3a3f4b !important;
    border-top-color: var(--cvr-app-color) !important;
    background: linear-gradient(180deg, #292d36 0%, #252932 100%) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .24);
}

body.cvr-v2-shell.tema-oscuro .cvr-app-grid .dashboard-stat .details .number {
    color: #f1f2f5 !important;
}

body.cvr-v2-shell.tema-oscuro .cvr-app-grid .dashboard-stat .details .desc {
    color: #b9bec9 !important;
}

@media (max-width: 480px) {
    .cvr-v2-shell .cvr-app-grid .dashboard-stat {
        min-height: 146px;
    }

    .cvr-v2-shell .cvr-app-grid .dashboard-stat .visual {
        top: 16px;
        left: 15px;
        width: 44px;
        height: 44px;
    }

    .cvr-v2-shell .cvr-app-grid .dashboard-stat .details {
        top: 16px;
        right: 14px;
        left: 71px;
    }

    .cvr-v2-shell .cvr-app-grid .dashboard-stat .details .number {
        font-size: 19px;
    }

    .cvr-v2-shell .cvr-app-grid .dashboard-stat .more {
        right: 12px;
        bottom: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cvr-v2-shell .cvr-app-grid .dashboard-stat,
    .cvr-v2-shell .cvr-app-grid .dashboard-stat .more {
        transition: none;
    }
}

.cvr-v2-shell .portlet {
    overflow: hidden;
    border: 1px solid var(--cvr-border) !important;
    border-radius: 12px !important;
    background: var(--cvr-surface);
    box-shadow: var(--cvr-shadow);
}

.cvr-v2-shell .portlet > .portlet-title {
    min-height: 51px;
    border-bottom: 1px solid #eceef4;
}

.cvr-v2-shell .portlet > .portlet-title > .caption {
    color: #31394a;
    font-weight: 700;
}

/* Las cajas conservaban floats y paddings verticales distintos del tema CI3.
   Esta fila mantiene título, icono y acciones centrados con aire uniforme. */
.cvr-v2-shell .portlet.box > .portlet-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    min-height: 0;
    padding: 12px;
}

.cvr-v2-shell .portlet.box > .portlet-title::before,
.cvr-v2-shell .portlet.box > .portlet-title::after {
    display: none;
}

.cvr-v2-shell .portlet.box > .portlet-title > .caption {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    float: none;
    line-height: 1.25;
}

.cvr-v2-shell .portlet.box > .portlet-title > .caption > i {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    margin: 0;
    float: none;
}

.cvr-v2-shell .portlet.box > .portlet-title > .actions,
.cvr-v2-shell .portlet.box > .portlet-title > .tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 0;
    float: none;
}

.cvr-v2-shell .portlet.box.azul-cvr > .portlet-title,
.cvr-v2-shell .portlet.azul-cvr,
.cvr-v2-shell .portlet > .portlet-body.azul-cvr {
    background: linear-gradient(135deg, var(--cvr-primary-dark), var(--cvr-primary)) !important;
}

.cvr-v2-shell .portlet.box.azul-cvr > .portlet-title {
    border: 0;
}

.cvr-v2-shell .portlet.box.azul-cvr > .portlet-title > .caption,
.cvr-v2-shell .portlet.box.azul-cvr > .portlet-title > .caption > i {
    color: #fff !important;
}

.cvr-v2-shell .portlet.box > .portlet-title.kanban-column-title {
    background: #34495e;
}

.cvr-v2-shell .portlet.box > .portlet-title.kanban-column-title > .caption,
.cvr-v2-shell .portlet.box > .portlet-title.kanban-column-title > .caption > i,
.cvr-v2-shell .portlet.box > .portlet-title.kanban-column-title > .caption > .badge {
    color: #fff !important;
}

.cvr-v2-shell .portlet.box > .portlet-title.kanban-column-title > .caption > .badge {
    background: rgba(255, 255, 255, .2);
}

.cvr-v2-shell .portlet > .portlet-body {
    padding: 19px;
    background: #fff;
}

/* Las novedades tenían el fondo de cada entrada fijado en la vista. Estas
   clases conservan su aspecto claro y permiten que el tema oscuro lo adapte. */
.cvr-v2-shell .cvr-novedad-card {
    margin-bottom: 10px;
    padding: 7px 10px;
    border: 1px solid #edf0f5;
    border-left: 3px solid var(--cvr-novedad-accent, #3598dc);
    border-radius: 0 7px 7px 0 !important;
    background: #fbfbfb;
    color: var(--cvr-ink);
}

.cvr-v2-shell .cvr-novedad-card strong {
    color: var(--cvr-ink);
}

.cvr-v2-shell .cvr-novedad-fecha,
.cvr-v2-shell .cvr-novedad-descripcion {
    color: var(--cvr-muted) !important;
    font-size: 12px;
}

.cvr-v2-shell .btn {
    border-radius: 8px !important;
    font-weight: 600;
    box-shadow: none;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.cvr-v2-shell .btn:hover,
.cvr-v2-shell .btn:focus {
    transform: translateY(-1px);
}

.cvr-v2-shell .btn.blue,
.cvr-v2-shell .btn-primary {
    border-color: var(--cvr-primary) !important;
    background: linear-gradient(135deg, var(--cvr-primary-dark), var(--cvr-primary)) !important;
    color: #fff !important;
    box-shadow: 0 5px 13px rgba(76, 59, 207, .2);
}

.cvr-v2-shell .btn.green,
.cvr-v2-shell .btn-success {
    border-color: #15928d !important;
    background: linear-gradient(135deg, #12857f, var(--cvr-accent)) !important;
    color: #fff !important;
}

.cvr-v2-shell .btn.red,
.cvr-v2-shell .btn-danger {
    border-color: var(--cvr-danger) !important;
    background: var(--cvr-danger) !important;
    color: #fff !important;
}

.cvr-v2-shell .btn.default,
.cvr-v2-shell .btn-default {
    border-color: #dfe3eb;
    background: #fff;
    color: #4b5563;
}

.cvr-v2-shell .form-control,
.cvr-v2-shell .select2-container--bootstrap .select2-selection,
.cvr-v2-shell .bootstrap-select > .dropdown-toggle {
    border-color: #dfe3eb;
    border-radius: 8px !important;
    background-color: #fff;
    box-shadow: none;
}

.cvr-v2-shell .form-control:focus,
.cvr-v2-shell .select2-container--bootstrap.select2-container--focus .select2-selection {
    border-color: rgba(76, 59, 207, .62);
    box-shadow: 0 0 0 3px rgba(76, 59, 207, .08);
}

/* Casillas nativas: el tema antiguo elimina el padding del label, pero deja
   el margen negativo de Bootstrap en el input. Mantener ambos en el flujo
   también alinea el texto que ocupa varias líneas. */
.cvr-v2-shell label.cvr-checkbox {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
    padding: 0;
    margin: 0;
    line-height: 20px;
    font-weight: 400;
    vertical-align: middle;
    cursor: pointer;
}

.cvr-v2-shell .cvr-checkbox > input[type="checkbox"] {
    position: static;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    padding: 0;
    margin: 2px 0 0;
    accent-color: var(--cvr-primary);
}

.cvr-v2-shell .cvr-checkbox > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.cvr-v2-shell .cvr-checkbox-group,
.cvr-v2-shell .tareas-filtros {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
}

.cvr-v2-shell .cvr-checkbox-group {
    margin-top: 12px;
}

.cvr-v2-shell .tareas-filtros > .cvr-checkbox-group {
    margin-top: 0;
}

.cvr-v2-shell .tareas-filtros-fechas {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.cvr-v2-shell .tareas-filtros > .form-control {
    max-width: 100%;
}

body.cvr-v2-shell.tema-oscuro .cvr-checkbox > input[type="checkbox"] {
    color-scheme: dark;
}

@media (max-width: 767px) {
    .cvr-v2-shell .tareas-filtros > .form-control {
        flex: 1 1 160px;
        min-width: 0;
        width: auto !important;
    }

    .cvr-v2-shell .tareas-filtros-fechas {
        flex: 1 1 100%;
    }

    .cvr-v2-shell .tareas-filtros-fechas > span {
        flex: 0 0 100%;
    }

    .cvr-v2-shell .tareas-filtros-fechas > .form-control {
        flex: 1 1 130px;
        min-width: 0;
        width: auto;
    }
}

/* Cambios de estado sin leer: se muestran aunque la tarea haya terminado. */
.cvr-v2-shell .cvr-state-updates {
    --cvr-state-border: #e4e7ef;
    --cvr-state-surface: #f8f9fd;
    --cvr-state-text: #394150;
    --cvr-state-muted: #667085;
    --cvr-state-icon-surface: #efedff;
    --cvr-state-icon: #4c3bcf;
    margin-top: 18px;
    scroll-margin-top: 90px;
}

.cvr-v2-shell .cvr-state-updates > .portlet-title > .caption {
    flex-wrap: wrap;
    font-size: 17px;
}

.cvr-v2-shell .cvr-state-updates-help {
    margin: 0 0 14px;
    color: var(--cvr-state-muted);
    font-size: 13px;
    line-height: 1.5;
}

.cvr-v2-shell .cvr-state-updates-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cvr-v2-shell .cvr-state-update {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    border: 1px solid var(--cvr-state-border);
    border-radius: 10px !important;
    background: var(--cvr-state-surface);
}

.cvr-v2-shell .cvr-state-update + .cvr-state-update {
    margin-top: 8px;
}

.cvr-v2-shell .cvr-state-update-icon {
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px !important;
    background: var(--cvr-state-icon-surface);
    color: var(--cvr-state-icon);
    font-size: 16px;
}

.cvr-v2-shell .cvr-state-update-content {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.cvr-v2-shell .cvr-state-update-title {
    display: block;
    color: var(--cvr-state-text);
    font-size: 14px;
    line-height: 1.4;
}

.cvr-v2-shell .cvr-state-update-text {
    margin-top: 4px;
    color: var(--cvr-state-text);
    font-size: 13px;
    line-height: 1.5;
}

.cvr-v2-shell .cvr-state-update-date {
    margin-top: 7px;
    color: var(--cvr-state-muted);
    font-size: 12px;
}

.cvr-v2-shell .cvr-state-update-open {
    flex: 0 0 auto;
    align-self: center;
    margin: 0;
    white-space: nowrap;
}

.cvr-v2-shell .cvr-state-updates a:focus-visible {
    outline: 3px solid var(--cvr-state-icon);
    outline-offset: 3px;
}

.cvr-v2-shell .cvr-state-updates-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 24px 15px;
    border: 1px dashed var(--cvr-state-border);
    border-radius: 10px !important;
    color: var(--cvr-state-muted);
    text-align: center;
}

.cvr-v2-shell .cvr-state-updates-empty > i {
    margin-bottom: 5px;
    color: var(--cvr-state-icon);
    font-size: 28px;
}

.cvr-v2-shell .cvr-state-updates-empty strong {
    color: var(--cvr-state-text);
}

.cvr-v2-shell .cvr-state-updates-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 15px;
}

.cvr-v2-shell .cvr-state-updates-count {
    color: var(--cvr-state-muted);
    font-size: 12px;
}

.cvr-v2-shell .cvr-state-updates-page-links {
    display: flex;
    gap: 8px;
}

body.cvr-v2-shell.tema-oscuro .cvr-state-updates {
    --cvr-state-border: #3a3f4b;
    --cvr-state-surface: #2a2e37;
    --cvr-state-text: #e1e3e8;
    --cvr-state-muted: #aeb3bd;
    --cvr-state-icon-surface: #393454;
    --cvr-state-icon: #beb5ff;
}

body.cvr-v2-shell.tema-oscuro .cvr-state-updates-help {
    color: var(--cvr-state-muted) !important;
}

@media (max-width: 575px) {
    .cvr-v2-shell .cvr-state-update {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px;
    }

    .cvr-v2-shell .cvr-state-update-content {
        flex-basis: calc(100% - 44px);
    }

    .cvr-v2-shell .cvr-state-update-open {
        margin-left: 44px;
    }

    .cvr-v2-shell .cvr-state-updates-pagination {
        align-items: flex-start;
        flex-direction: column;
    }
}

.cvr-v2-shell .table {
    margin-bottom: 0;
    border-color: #e6e9f0;
    background: #fff;
}

.cvr-v2-shell .table > thead > tr > th,
.cvr-v2-shell table.dataTable thead th {
    padding: 11px 9px;
    border-bottom: 1px solid #dde1eb !important;
    background: #f3f2fb;
    color: #4b4c66;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
    vertical-align: middle;
}

.cvr-v2-shell .table > tbody > tr > td,
.cvr-v2-shell table.dataTable tbody td,
.cvr-v2-shell table.dataTable tbody th {
    padding: 10px 9px;
    border-color: #eceef3;
    color: #394150;
    vertical-align: middle;
}

.cvr-v2-shell .table-striped > tbody > tr:nth-of-type(odd) {
    background: #fafbfe;
}

.cvr-v2-shell .table-hover > tbody > tr:hover,
.cvr-v2-shell table.dataTable tbody tr:hover {
    background: #f1f0fc !important;
}

.cvr-v2-shell .dataTables_wrapper {
    overflow: hidden;
    border: 1px solid #e4e7ef;
    border-radius: 10px !important;
    background: #fff;
}

.cvr-v2-shell .dataTables_wrapper .row:first-child,
.cvr-v2-shell .dataTables_wrapper .row:last-child {
    margin: 0;
    padding: 12px 4px;
    background: #fafbfe;
}

.cvr-v2-shell .dataTables_wrapper .row:first-child {
    border-bottom: 1px solid #eceef3;
}

.cvr-v2-shell .dataTables_wrapper .row:last-child {
    border-top: 1px solid #eceef3;
}

.cvr-v2-shell .pagination > li > a,
.cvr-v2-shell .pagination > li > span {
    margin: 0 2px;
    border-color: #e0e3eb;
    border-radius: 7px !important;
    color: var(--cvr-primary-dark);
}

.cvr-v2-shell .pagination > .active > a,
.cvr-v2-shell .pagination > .active > a:hover {
    border-color: var(--cvr-primary);
    background: var(--cvr-primary);
    color: #fff;
}

.cvr-v2-shell .label,
.cvr-v2-shell .badge {
    border-radius: 999px !important;
    font-weight: 600;
}

.cvr-v2-shell .nav-tabs > li > a {
    border-radius: 8px 8px 0 0 !important;
    font-weight: 600;
}

.cvr-v2-shell .tabbable-custom > .nav-tabs > li.active {
    border-color: var(--cvr-primary);
}

.cvr-v2-shell .modal-content,
.cvr-v2-shell .dropdown-menu,
.cvr-v2-shell .alert {
    border-radius: 10px !important;
    box-shadow: var(--cvr-shadow);
}

.cvr-v2-shell .page-footer {
    background: #eeeff5;
    color: #777d8b;
}

/* Centro de notificaciones */

.cvr-v2-shell .notification-bulk-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cvr-v2-shell .notification-bulk-actions form,
.cvr-v2-shell .notification-delete {
    margin: 0;
}

.cvr-v2-shell .notification-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: -2px 0 14px;
    padding-bottom: 13px;
    border-bottom: 1px solid #e7e9f0;
}

.cvr-v2-shell .notification-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.cvr-v2-shell .notification-filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid #dfe3ec;
    border-radius: 8px !important;
    background: #fff;
    color: #596174;
    font-size: 12px;
    font-weight: 600;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.cvr-v2-shell .notification-filter:hover,
.cvr-v2-shell .notification-filter:focus {
    border-color: var(--cvr-primary);
    color: var(--cvr-primary-dark);
    text-decoration: none;
}

.cvr-v2-shell .notification-filter span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px !important;
    background: #eef0f5;
    color: #687184;
    font-size: 11px;
}

.cvr-v2-shell .notification-filter.is-active {
    border-color: var(--cvr-primary);
    background: var(--cvr-primary);
    color: #fff;
}

.cvr-v2-shell .notification-filter.is-active span {
    background: rgba(255, 255, 255, .2);
    color: #fff;
}

.cvr-v2-shell .notification-summary {
    flex: 0 0 auto;
    color: #7b8393;
    font-size: 12px;
}

.cvr-v2-shell .notification-list {
    overflow: hidden;
    border: 1px solid #e4e7ee;
    border-radius: 10px !important;
}

.cvr-v2-shell .notification-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 82px;
    padding: 14px;
    border-bottom: 1px solid #e8eaf0;
    background: #fff;
}

.cvr-v2-shell .notification-item:last-child {
    border-bottom: 0;
}

.cvr-v2-shell .notification-item.is-unread {
    background: linear-gradient(90deg, #f0f7ff 0, #f8fbff 58%, #fff 100%);
    box-shadow: inset 3px 0 0 #4a9bd5;
}

.cvr-v2-shell .notification-icon {
    display: inline-flex;
    flex: 0 0 36px;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px !important;
    background: #edf4fb;
    color: #337fb7;
    font-size: 16px;
}

.cvr-v2-shell .notification-content {
    min-width: 0;
    flex: 1 1 auto;
}

.cvr-v2-shell .notification-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding-right: 40px;
}

.cvr-v2-shell .notification-heading > a {
    color: #18233b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.cvr-v2-shell .notification-text {
    margin-top: 4px;
    overflow-wrap: anywhere;
    color: #555e70;
    font-size: 13px;
    line-height: 1.45;
}

.cvr-v2-shell .notification-date {
    margin-top: 7px;
    color: #9299a8;
    font-size: 11px;
}

.cvr-v2-shell .notification-delete {
    position: absolute;
    top: 12px;
    right: 12px;
}

.cvr-v2-shell .notification-delete .btn {
    border-color: transparent;
    background: transparent;
    color: #969dad;
}

.cvr-v2-shell .notification-delete .btn:hover,
.cvr-v2-shell .notification-delete .btn:focus {
    border-color: #f3d4d8;
    background: #fff1f3;
    color: #cf3f51;
}

.cvr-v2-shell .notification-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 230px;
    padding: 38px 20px;
    border: 1px dashed #d8dce6;
    border-radius: 10px !important;
    color: #8991a1;
    text-align: center;
}

.cvr-v2-shell .notification-empty > i {
    margin-bottom: 12px;
    color: #56b9aa;
    font-size: 38px;
}

.cvr-v2-shell .notification-empty strong {
    margin-bottom: 4px;
    color: #394257;
    font-size: 15px;
}

.cvr-v2-shell .notification-pagination {
    text-align: center;
}

.cvr-v2-shell .notification-pagination .pagination {
    margin: 18px 0 2px;
}

.cvr-v2-shell .notification-compose-help {
    margin: 11px 0 0;
    line-height: 1.4;
}

/* Error público */

body.cvr-error-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(76, 59, 207, .15), transparent 34%),
        linear-gradient(145deg, #f7f6ff, #eff7f7) !important;
}

.cvr-error-page .page-inner {
    display: none;
}

.cvr-error-page .error-404 {
    width: 560px;
    max-width: calc(100% - 32px);
    margin: 12vh auto 0;
    padding: 50px 42px;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 20px !important;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 24px 70px rgba(38, 35, 87, .14);
    text-align: center;
}

.cvr-error-page .error-404 h1 {
    margin: 0;
    color: var(--cvr-primary);
    font-size: 92px;
    font-weight: 800;
    letter-spacing: -.07em;
}

.cvr-error-page .error-404 h2 {
    color: var(--cvr-ink);
    font-weight: 700;
}

.cvr-error-page .error-404 p {
    color: var(--cvr-muted);
    line-height: 1.6;
}

.cvr-error-page .error-404 .btn {
    margin-top: 13px;
    padding: 10px 22px;
    border: 0;
    border-radius: 9px !important;
    background: linear-gradient(135deg, var(--cvr-primary-dark), var(--cvr-primary));
    color: #fff;
}

/* Tema oscuro */

body.cvr-v2-shell.tema-oscuro,
body.cvr-v2-shell.tema-oscuro .page-content {
    background: #1b1e24 !important;
}

body.cvr-v2-shell.tema-oscuro .page-container {
    background: var(--cvr-sidebar) !important;
}

body.cvr-v2-shell.tema-oscuro .page-header.navbar {
    border-bottom-color: #000 !important;
    background: var(--cvr-header-surface) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .2);
}

body.cvr-v2-shell.tema-oscuro .page-header.navbar .top-menu,
body.cvr-v2-shell.tema-oscuro .page-header.navbar .top-menu .navbar-nav > li > a {
    background-color: var(--cvr-header-surface);
}

body.cvr-v2-shell.tema-oscuro .page-header.navbar .top-menu .navbar-nav > li > a,
body.cvr-v2-shell.tema-oscuro .page-header.navbar .top-menu .navbar-nav > li > a i,
body.cvr-v2-shell.tema-oscuro .page-header.navbar .top-menu .navbar-nav > li.dropdown .dropdown-toggle > i {
    color: var(--cvr-header-icon) !important;
}

body.cvr-v2-shell.tema-oscuro .page-header.navbar .top-menu .navbar-nav > li > a:hover,
body.cvr-v2-shell.tema-oscuro .page-header.navbar .top-menu .navbar-nav > li.open > a {
    background-color: var(--cvr-header-hover) !important;
}

body.cvr-v2-shell.tema-oscuro .page-header.navbar .menu-toggler > span,
body.cvr-v2-shell.tema-oscuro .page-header.navbar .menu-toggler > span::before,
body.cvr-v2-shell.tema-oscuro .page-header.navbar .menu-toggler > span::after {
    background: var(--cvr-header-icon) !important;
}

body.cvr-v2-shell.tema-oscuro .page-header.navbar #busqueda_global,
body.cvr-v2-shell.tema-oscuro .page-header.navbar .top-menu input.form-control {
    border-color: #3a3f4b !important;
    background: #2a2e37 !important;
    color: #c9ccd1 !important;
}

body.cvr-v2-shell.tema-oscuro .page-header.navbar #busqueda_global::placeholder {
    color: #8a8f99 !important;
}

body.cvr-v2-shell.tema-oscuro .portlet,
body.cvr-v2-shell.tema-oscuro .portlet.light,
body.cvr-v2-shell.tema-oscuro .portlet > .portlet-body,
body.cvr-v2-shell.tema-oscuro .dataTables_wrapper,
body.cvr-v2-shell.tema-oscuro .dataTables_wrapper .row:first-child,
body.cvr-v2-shell.tema-oscuro .dataTables_wrapper .row:last-child {
    border-color: #3a3f4b !important;
    background: #252932 !important;
}

/* El modo oscuro daba fondo al envoltorio de DataTables pero no color a su
   texto, así que «Mostrando 1 a 25 de 300», el selector de filas y la
   paginación se quedaban con los grises que Metronic calcula para fondo
   blanco: sobre #252932 apenas se leen. Afecta a todos los listados. */
body.cvr-v2-shell.tema-oscuro .dataTables_wrapper .dataTables_info,
body.cvr-v2-shell.tema-oscuro .dataTables_wrapper .dataTables_length,
body.cvr-v2-shell.tema-oscuro .dataTables_wrapper .dataTables_length label,
body.cvr-v2-shell.tema-oscuro .dataTables_wrapper .dataTables_filter label,
body.cvr-v2-shell.tema-oscuro .dataTables_wrapper .dataTables_paginate,
body.cvr-v2-shell.tema-oscuro .dataTables_wrapper .seleccionados,
body.cvr-v2-shell.tema-oscuro .table-container .dataTables_info {
    color: #c9ccd1 !important;
}

body.cvr-v2-shell.tema-oscuro .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-color: #3a3f4b !important;
    background: #2a2e37 !important;
    color: #c9ccd1 !important;
}

body.cvr-v2-shell.tema-oscuro .dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled) {
    background: #333844 !important;
    color: #ffffff !important;
}

body.cvr-v2-shell.tema-oscuro .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: #6f757f !important;
}

body.cvr-v2-shell.tema-oscuro .portlet > .portlet-title {
    border-color: #3a3f4b !important;
}

body.cvr-v2-shell.tema-oscuro .portlet > .portlet-title > .caption,
body.cvr-v2-shell.tema-oscuro .portlet > .portlet-title > .caption > i,
body.cvr-v2-shell.tema-oscuro .portlet > .portlet-title > .caption > .caption-subject {
    color: #e1e3e8 !important;
}

body.cvr-v2-shell.tema-oscuro .cvr-novedades {
    border-color: #3a3f4b !important;
    background: #252932 !important;
}

body.cvr-v2-shell.tema-oscuro .cvr-novedades .caption-helper {
    color: #aeb3bd !important;
}

body.cvr-v2-shell.tema-oscuro .cvr-novedad-card {
    border-color: #3a3f4b;
    border-left-color: var(--cvr-novedad-accent, #3598dc);
    background: #2a2e37 !important;
    color: #d8dbe1 !important;
}

body.cvr-v2-shell.tema-oscuro .cvr-novedad-card strong {
    color: #f0f1f4 !important;
}

body.cvr-v2-shell.tema-oscuro .cvr-novedades .label-default {
    background: #454b57 !important;
    color: #f1f3f7 !important;
}

body.cvr-v2-shell.tema-oscuro .cvr-novedades .label-danger {
    color: #fff !important;
}

body.cvr-v2-shell.tema-oscuro .well,
body.cvr-v2-shell.tema-oscuro .form-control,
body.cvr-v2-shell.tema-oscuro .table {
    border-color: #3a3f4b !important;
    background: #2a2e37 !important;
    color: #c9ccd1 !important;
}

body.cvr-v2-shell.tema-oscuro .page-title,
body.cvr-v2-shell.tema-oscuro h1,
body.cvr-v2-shell.tema-oscuro h2,
body.cvr-v2-shell.tema-oscuro h3,
body.cvr-v2-shell.tema-oscuro h4,
body.cvr-v2-shell.tema-oscuro td,
body.cvr-v2-shell.tema-oscuro th,
body.cvr-v2-shell.tema-oscuro p,
body.cvr-v2-shell.tema-oscuro label,
body.cvr-v2-shell.tema-oscuro .text-muted {
    color: #c9ccd1 !important;
}

/* ---------------------------------------------------------------------------
   Correcciones del modo oscuro
   ---------------------------------------------------------------------------
   La regla de arriba iguala h1..h4, td, th, p, label y .text-muted al mismo
   color y con !important. Eso deja tres efectos que hay que deshacer aquí,
   por orden y por especificidad: el texto secundario pierde la jerarquía, los
   avisos en rojo o en verde pierden su color, y todo lo que vive sobre fondo
   blanco heredado (modales) se queda con letra gris clara encima.
   -------------------------------------------------------------------------- */

/* El texto secundario tiene que verse SECUNDARIO. */
body.cvr-v2-shell.tema-oscuro .text-muted,
body.cvr-v2-shell.tema-oscuro small.text-muted,
body.cvr-v2-shell.tema-oscuro .help-block,
body.cvr-v2-shell.tema-oscuro .caption-helper,
body.cvr-v2-shell.tema-oscuro .form-group .help-block {
    color: #9aa0aa !important;
}

/* Los colores que significan algo mandan sobre el gris general. */
body.cvr-v2-shell.tema-oscuro .text-danger,
body.cvr-v2-shell.tema-oscuro p.text-danger,
body.cvr-v2-shell.tema-oscuro td.text-danger,
body.cvr-v2-shell.tema-oscuro .font-red,
body.cvr-v2-shell.tema-oscuro .font-red-sunglo {
    color: #ef8b82 !important;
}

body.cvr-v2-shell.tema-oscuro .text-success,
body.cvr-v2-shell.tema-oscuro p.text-success,
body.cvr-v2-shell.tema-oscuro td.text-success,
body.cvr-v2-shell.tema-oscuro .font-green,
body.cvr-v2-shell.tema-oscuro .font-green-jungle {
    color: #7fc79b !important;
}

body.cvr-v2-shell.tema-oscuro .text-warning,
body.cvr-v2-shell.tema-oscuro p.text-warning,
body.cvr-v2-shell.tema-oscuro td.text-warning,
body.cvr-v2-shell.tema-oscuro .font-yellow {
    color: #e0b163 !important;
}

/* Modales. Sin esto conservan el fondo blanco de Bootstrap mientras su título
   y sus etiquetas se pintan en gris claro: texto fantasma sobre blanco. Y en
   este módulo el modal es la ÚNICA forma de crear una acción. */
body.cvr-v2-shell.tema-oscuro .modal-content,
body.cvr-v2-shell.tema-oscuro .modal-header,
body.cvr-v2-shell.tema-oscuro .modal-body,
body.cvr-v2-shell.tema-oscuro .modal-footer {
    border-color: #3a3f4b !important;
    background: #252932 !important;
}

body.cvr-v2-shell.tema-oscuro .modal-header .close {
    color: #c9ccd1 !important;
    opacity: 0.8;
    text-shadow: none;
}

/* Casillas y radios del tema: marcada y sin marcar tienen que distinguirse. */
body.cvr-v2-shell.tema-oscuro .mt-checkbox > span,
body.cvr-v2-shell.tema-oscuro .mt-radio > span {
    border-color: #5a616e !important;
    background: #2a2e37 !important;
}

body.cvr-v2-shell.tema-oscuro .mt-checkbox:hover > input:not([disabled]) ~ span,
body.cvr-v2-shell.tema-oscuro .mt-radio:hover > input:not([disabled]) ~ span {
    border-color: #7a828f !important;
}

body.cvr-v2-shell.tema-oscuro .mt-checkbox > input:checked ~ span,
body.cvr-v2-shell.tema-oscuro .mt-radio > input:checked ~ span {
    border-color: #3598dc !important;
    background: #3598dc !important;
}

body.cvr-v2-shell.tema-oscuro .mt-checkbox > input:checked ~ span::after {
    border-color: #ffffff !important;
}

/* Un campo bloqueado tiene que parecer bloqueado. */
body.cvr-v2-shell.tema-oscuro .form-control[disabled],
body.cvr-v2-shell.tema-oscuro .form-control[readonly],
body.cvr-v2-shell.tema-oscuro fieldset[disabled] .form-control {
    border-color: #333844 !important;
    background: #22262d !important;
    color: #8a8f99 !important;
    cursor: not-allowed;
}

/* `code` se usa en todo el módulo para dominios, códigos de campo y claves. */
body.cvr-v2-shell.tema-oscuro code,
body.cvr-v2-shell.tema-oscuro kbd {
    border: 1px solid #3a3f4b;
    background: #2a2e37 !important;
    color: #9fd0f5 !important;
}

body.cvr-v2-shell.tema-oscuro pre {
    border-color: #3a3f4b !important;
    background: #22262d !important;
    color: #c9ccd1 !important;
}

/* Pestañas: la activa se quedaba blanca con un filo claro sobre fondo oscuro. */
body.cvr-v2-shell.tema-oscuro .nav-tabs {
    border-bottom-color: #3a3f4b !important;
}

body.cvr-v2-shell.tema-oscuro .nav-tabs > li > a {
    border-color: transparent !important;
    color: #aeb3bd !important;
}

body.cvr-v2-shell.tema-oscuro .nav-tabs > li > a:hover {
    border-color: #3a3f4b !important;
    background: #2a2e37 !important;
    color: #e1e3e8 !important;
}

body.cvr-v2-shell.tema-oscuro .nav-tabs > li.active > a,
body.cvr-v2-shell.tema-oscuro .nav-tabs > li.active > a:hover,
body.cvr-v2-shell.tema-oscuro .nav-tabs > li.active > a:focus {
    border-color: #3a3f4b #3a3f4b transparent !important;
    background: #252932 !important;
    color: #ffffff !important;
}

/* Dentro de un .well los campos tenían el mismo color que la caja. */
body.cvr-v2-shell.tema-oscuro .well .form-control,
body.cvr-v2-shell.tema-oscuro .well .input-group-addon {
    border-color: #454b57 !important;
    background: #22262d !important;
}

body.cvr-v2-shell.tema-oscuro .cvr-novedad-fecha,
body.cvr-v2-shell.tema-oscuro .cvr-novedad-descripcion {
    color: #aeb3bd !important;
}

body.cvr-v2-shell.tema-oscuro a {
    color: #5aa9f0;
}

body.cvr-v2-shell.tema-oscuro .table-striped > tbody > tr:nth-of-type(odd) {
    background: #242830 !important;
}

body.cvr-v2-shell.tema-oscuro .table > thead > tr > th,
body.cvr-v2-shell.tema-oscuro table.dataTable thead th {
    border-color: #3a3f4b !important;
    background: #303540 !important;
    color: #d4d7de !important;
}

body.cvr-v2-shell.tema-oscuro .table > tbody > tr > td,
body.cvr-v2-shell.tema-oscuro .table > tbody > tr > th,
body.cvr-v2-shell.tema-oscuro .table > tfoot > tr > td,
body.cvr-v2-shell.tema-oscuro .table > tfoot > tr > th {
    border-color: #3a3f4b !important;
}

body.cvr-v2-shell.tema-oscuro .table-hover > tbody > tr:hover,
body.cvr-v2-shell.tema-oscuro table.dataTable tbody tr:hover {
    background: #323744 !important;
}

body.cvr-v2-shell.tema-oscuro .dropdown-menu,
body.cvr-v2-shell.tema-oscuro .dropdown-menu .dropdown-menu-list li a {
    background: #2a2e37 !important;
    color: #c9ccd1 !important;
}

body.cvr-v2-shell.tema-oscuro .dropdown-menu .external h3 {
    background: #22252d !important;
    color: #c9ccd1 !important;
}

body.cvr-v2-shell.tema-oscuro .page-bar {
    border-color: #3a3f4b !important;
    background: #22252d !important;
}

body.cvr-v2-shell.tema-oscuro .page-breadcrumb > li,
body.cvr-v2-shell.tema-oscuro .page-breadcrumb > li > a,
body.cvr-v2-shell.tema-oscuro .page-breadcrumb > li > span,
body.cvr-v2-shell.tema-oscuro .page-breadcrumb > li > i {
    color: #a3a7af !important;
}

body.cvr-v2-shell.tema-oscuro .gb-panel {
    border-color: #3a3f4b;
    background: #2a2e37;
}

body.cvr-v2-shell.tema-oscuro .gb-grupo-titulo,
body.cvr-v2-shell.tema-oscuro .gb-pie {
    border-color: #3a3f4b;
    background: #22252d;
}

body.cvr-v2-shell.tema-oscuro .gb-resultado {
    border-color: #3a3f4b;
    color: #d5d8dd !important;
}

body.cvr-v2-shell.tema-oscuro .gb-resultado:hover,
body.cvr-v2-shell.tema-oscuro .gb-resultado.activo {
    background: #343a46;
}

body.cvr-v2-shell.tema-oscuro .vr-panel,
body.cvr-v2-shell.tema-oscuro .vr-contenido,
.cvr-v2-shell .vr-capa.tema-oscuro .vr-panel {
    background: #22252d;
}

body.cvr-v2-shell.tema-oscuro .vr-cabecera,
body.cvr-v2-shell.tema-oscuro .vr-metrica,
body.cvr-v2-shell.tema-oscuro .vr-bloque,
.cvr-v2-shell .vr-capa.tema-oscuro .vr-cabecera,
.cvr-v2-shell .vr-capa.tema-oscuro .vr-metrica,
.cvr-v2-shell .vr-capa.tema-oscuro .vr-bloque {
    border-color: #3a3f4b;
    background: #2a2e37;
}

body.cvr-v2-shell.tema-oscuro .vr-metrica strong,
body.cvr-v2-shell.tema-oscuro .vr-bloque dd,
body.cvr-v2-shell.tema-oscuro .vr-bloque h3,
body.cvr-v2-shell.tema-oscuro .vr-cabecera strong,
.cvr-v2-shell .vr-capa.tema-oscuro .vr-metrica strong,
.cvr-v2-shell .vr-capa.tema-oscuro .vr-bloque dd,
.cvr-v2-shell .vr-capa.tema-oscuro .vr-bloque h3,
.cvr-v2-shell .vr-capa.tema-oscuro .vr-cabecera strong {
    color: #d6d9de;
}

body.cvr-v2-shell.tema-oscuro .notification-toolbar,
body.cvr-v2-shell.tema-oscuro .notification-list,
body.cvr-v2-shell.tema-oscuro .notification-item {
    border-color: #3a3f4b;
}

body.cvr-v2-shell.tema-oscuro .notification-filter,
body.cvr-v2-shell.tema-oscuro .notification-item {
    background: #252932;
    color: #d4d7de;
}

body.cvr-v2-shell.tema-oscuro .notification-item.is-unread {
    background: linear-gradient(90deg, #28384a, #252932);
}

body.cvr-v2-shell.tema-oscuro .notification-heading > a,
body.cvr-v2-shell.tema-oscuro .notification-empty strong {
    color: #f0f1f4;
}

body.cvr-v2-shell.tema-oscuro .notification-text {
    color: #c1c5ce;
}

@media (max-width: 767px) {
    .cvr-auth .logo {
        padding-top: 30px !important;
    }

    .login.cvr-auth .content {
        padding: 31px 24px 28px;
        border-radius: 16px !important;
    }

    .cvr-auth .content .form-title {
        font-size: 24px;
    }

    .login.cvr-auth .content .security-code-input {
        padding-left: 16px !important;
        font-size: 23px;
        letter-spacing: 6px;
    }

    .cvr-v2-shell .page-content-wrapper .page-content {
        padding: 18px 12px;
    }

    .cvr-v2-shell .portlet > .portlet-body {
        padding: 13px;
    }

    .cvr-v2-shell .notification-center > .portlet-title {
        align-items: flex-start;
        flex-direction: column;
    }

    .cvr-v2-shell .notification-bulk-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .cvr-v2-shell .notification-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .cvr-v2-shell .notification-summary {
        align-self: flex-end;
    }

    .cvr-v2-shell .notification-item {
        padding: 12px 10px;
    }

    .cvr-v2-shell .notification-delete {
        top: 9px;
        right: 8px;
    }

    .cvr-version-mark {
        display: none;
    }
}

@media (min-width: 992px) {
    .cvr-v2-shell .page-container {
        background: var(--cvr-sidebar);
    }

    .cvr-v2-shell .page-content-wrapper {
        /* El wrapper ocupa todo el ancho. El primer tramo mantiene la columna
           lateral oscura durante toda la altura real del contenido. */
        background: linear-gradient(
            to right,
            var(--cvr-sidebar) 0,
            var(--cvr-sidebar) 235px,
            var(--cvr-canvas) 235px,
            var(--cvr-canvas) 100%
        );
    }

    .cvr-v2-shell.page-sidebar-closed .page-content-wrapper {
        background: linear-gradient(
            to right,
            var(--cvr-sidebar) 0,
            var(--cvr-sidebar) 45px,
            var(--cvr-canvas) 45px,
            var(--cvr-canvas) 100%
        );
    }

    .cvr-v2-shell.page-sidebar-closed .page-sidebar .page-sidebar-menu > li > a {
        justify-content: center;
        margin-right: 5px;
        margin-left: 5px;
        padding-right: 8px;
        padding-left: 8px;
    }

    .cvr-v2-shell.page-sidebar-closed .page-sidebar .page-sidebar-menu > li > a > i {
        flex-basis: 22px;
        width: 22px;
        margin-right: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cvr-auth *,
    .cvr-v2-shell * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
