:root {
    --contrix-blue: #2563EB;
    --contrix-blue-dark: #1D4ED8;
    --contrix-blue-soft: #EEF4FF;
    --contrix-green: #10B981;
    --contrix-green-dark: #059669;
    --contrix-green-soft: #ECFDF5;
    --contrix-navy: #202132;
    --contrix-navy-2: #191A29;
    --contrix-navy-3: #292B40;
    --contrix-text: #273043;
    --contrix-muted: #747C90;
    --contrix-page: #F4F6FB;
    --contrix-card: #FFFFFF;
    --contrix-border: #E4E8F0;
    --contrix-border-strong: #D4DAE5;
    --contrix-shadow: 0 8px 24px rgba(31, 41, 55, .055);

    --vm-black: var(--contrix-text);
    --vm-black-2: var(--contrix-navy);
    --vm-black-3: #334155;
    --vm-teal: var(--contrix-blue);
    --vm-teal-2: var(--contrix-green);
    --vm-teal-soft: var(--contrix-blue-soft);
    --vm-border: var(--contrix-border);
    --vm-text: var(--contrix-text);
    --vm-muted: var(--contrix-muted);
    --vm-page: var(--contrix-page);
    --vm-success: var(--contrix-green-dark);
}

html {
    background: var(--contrix-page);
}

body.cx-admin-body {
    margin: 0;
    overflow-x: hidden;
    color: var(--contrix-text);
    background: var(--contrix-page);
    font-family:
        Inter,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
}

.cx-admin-shell {
    display: flex;
    min-height: 100vh;
}

.cx-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1040;
    width: 272px;
    height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #FFFFFF;
    background:
        linear-gradient(
            180deg,
            var(--contrix-navy) 0%,
            var(--contrix-navy-2) 100%
        );
    box-shadow: 10px 0 30px rgba(15, 23, 42, .11);
}

.cx-sidebar-header {
    min-height: 92px;
    padding: 18px 20px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.cx-brand {
    min-width: 0;
    flex: 1;
    display: block;
    padding: 10px 12px;
    overflow: hidden;
    border-radius: 5px;
    background: #FFFFFF;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .15);
}

.cx-brand img {
    display: block;
    width: 100%;
    height: 46px;
    object-fit: contain;
}

.cx-sidebar-close {
    display: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 5px;
    color: rgba(255, 255, 255, .82);
    background: rgba(255, 255, 255, .08);
    font-size: 1.4rem;
    line-height: 1;
}

.cx-sidebar-scroll {
    flex: 1;
    padding: 10px 0 22px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .18) transparent;
}

.cx-sidebar-scroll::-webkit-scrollbar {
    width: 6px;
}

.cx-sidebar-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
}

.cx-nav-section {
    padding: 18px 22px 8px;
}

.cx-nav-section span {
    color: rgba(255, 255, 255, .38);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.cx-nav {
    display: grid;
    gap: 2px;
}

.cx-nav-link {
    width: 100%;
    min-height: 44px;
    padding: 10px 20px;
    display: grid;
    grid-template-columns: 23px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 0;
    color: rgba(255, 255, 255, .75);
    background: transparent;
    text-align: left;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 600;
    transition:
        color .15s ease,
        background-color .15s ease,
        border-color .15s ease;
}

.cx-nav a.cx-nav-link {
    grid-template-columns: 23px minmax(0, 1fr);
}

.cx-nav-link:hover,
.cx-nav-link:focus {
    color: #FFFFFF;
    background: rgba(255, 255, 255, .055);
}

.cx-nav-link.active {
    color: #FFFFFF;
    border-left-color: var(--contrix-green);
    background: var(--contrix-blue);
    box-shadow: none;
}

.cx-nav-icon {
    width: 23px;
    height: 23px;
    display: inline-grid;
    place-items: center;
    color: currentColor;
    font-size: 1rem;
    font-weight: 900;
    opacity: .95;
}

.cx-nav-chevron {
    display: inline-grid;
    place-items: center;
    font-size: 1.25rem;
    transition: transform .18s ease;
}

.cx-nav-toggle[aria-expanded="true"] .cx-nav-chevron {
    transform: rotate(90deg);
}

.cx-submenu {
    padding: 3px 0 6px;
    background: rgba(0, 0, 0, .09);
}

.cx-submenu a {
    min-height: 36px;
    padding: 8px 20px 8px 56px;
    display: flex;
    align-items: center;
    position: relative;
    color: rgba(255, 255, 255, .60);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 550;
    transition:
        color .15s ease,
        background-color .15s ease;
}

.cx-submenu a::before {
    content: "";
    position: absolute;
    left: 38px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .35);
}

.cx-submenu a:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, .045);
}

.cx-submenu a.active {
    color: #FFFFFF;
    background: rgba(37, 99, 235, .28);
}

.cx-submenu a.active::before {
    background: var(--contrix-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .13);
}

.cx-sidebar-footer {
    min-height: 70px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-top: 1px solid rgba(255, 255, 255, .07);
    background: rgba(0, 0, 0, .10);
}

.cx-sidebar-footer-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    color: #FFFFFF;
    background:
        linear-gradient(
            135deg,
            var(--contrix-blue),
            var(--contrix-green)
        );
    font-size: .72rem;
    font-weight: 900;
}

.cx-sidebar-footer strong,
.cx-sidebar-footer span {
    display: block;
    line-height: 1.1;
}

.cx-sidebar-footer strong {
    color: #FFFFFF;
    font-size: .78rem;
    letter-spacing: .04em;
}

.cx-sidebar-footer span {
    margin-top: 4px;
    color: rgba(255, 255, 255, .42);
    font-size: .68rem;
}

.cx-main {
    width: calc(100% - 272px);
    min-width: 0;
    margin-left: 272px;
    background: var(--contrix-page);
}

.cx-topbar {
    min-height: 82px;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 1020;
    border-bottom: 1px solid var(--contrix-border);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 2px 10px rgba(30, 41, 59, .035);
    backdrop-filter: blur(10px);
}

.cx-topbar-left {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 14px;
}

.cx-menu-button {
    display: none;
    width: 40px;
    height: 40px;
    border: 1px solid var(--contrix-border);
    border-radius: 5px;
    color: var(--contrix-text);
    background: #FFFFFF;
    font-size: 1.15rem;
}

.cx-breadcrumb {
    margin-bottom: 3px;
    color: var(--contrix-muted);
    font-size: .69rem;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.cx-breadcrumb span {
    padding: 0 5px;
    color: #B0B7C5;
}

.cx-topbar h1 {
    max-width: 720px;
    margin: 0;
    overflow: hidden;
    color: #232A38;
    font-size: 1.32rem;
    font-weight: 700;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-topbar-actions {
    flex-wrap: nowrap;
    gap: 15px;
}

.cx-content {
    padding: 24px;
    background:
        linear-gradient(
            180deg,
            #F6F8FC 0,
            var(--contrix-page) 180px
        );
}

/* Sede activa */
.cx-branch-switcher {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.cx-control-label {
    margin: 0;
    color: var(--contrix-muted);
    font-size: .67rem;
    font-weight: 800;
    letter-spacing: .075em;
    text-transform: uppercase;
    white-space: nowrap;
}

.cx-branch-select {
    min-width: 180px;
    height: 40px;
    padding: 7px 34px 7px 12px;
    border: 1px solid var(--contrix-border-strong);
    border-radius: 5px;
    color: var(--contrix-text);
    background-color: #FFFFFF;
    font-size: .84rem;
    font-weight: 650;
}

.cx-branch-pill {
    padding: 8px 11px;
    border: 1px solid #B7EEDB;
    border-radius: 5px;
    color: #047857;
    background: var(--contrix-green-soft);
    font-size: .82rem;
    font-weight: 750;
}

/* Usuario superior */
.cx-user-button {
    min-width: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    background: transparent;
    text-align: left;
}

.cx-user-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 5px;
    color: var(--contrix-blue-dark);
    border: 1px solid #BFDBFE;
    background: var(--contrix-blue-soft);
}

.cx-user-copy {
    max-width: 190px;
    min-width: 0;
}

.cx-user-copy strong,
.cx-user-copy small {
    display: block;
    overflow: hidden;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-user-copy strong {
    color: var(--contrix-text);
    font-size: .84rem;
    font-weight: 750;
}

.cx-user-copy small {
    margin-top: 3px;
    color: var(--contrix-muted);
    font-size: .70rem;
}

.cx-user-chevron {
    color: #9AA2B1;
    font-size: .9rem;
}

.cx-user-menu {
    width: 245px;
    padding: 7px;
    border: 1px solid var(--contrix-border);
    border-radius: 6px;
    box-shadow: 0 16px 36px rgba(30, 41, 59, .14);
}

.cx-user-menu-header {
    padding: 9px 10px;
}

.cx-user-menu-header strong,
.cx-user-menu-header span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-user-menu-header strong {
    color: var(--contrix-text);
    font-size: .84rem;
}

.cx-user-menu-header span {
    margin-top: 3px;
    color: var(--contrix-muted);
    font-size: .72rem;
}

.cx-user-menu .dropdown-item {
    padding: 8px 10px;
    border-radius: 4px;
    font-size: .81rem;
}

/* Tarjetas y paneles: estilo tipo CMS */
.vm-card,
.vm-action-card,
.vm-stat-card,
.purchase-kpi-card,
.vm-product-summary-card,
.accordion-item,
.card {
    border: 1px solid var(--contrix-border) !important;
    border-radius: 6px !important;
    background: var(--contrix-card);
    box-shadow: var(--contrix-shadow) !important;
}

.vm-card {
    padding: 20px;
}

.vm-card-title {
    color: #2B3343;
    font-size: 1rem;
    font-weight: 700;
}

.vm-grid {
    gap: 14px;
}

.vm-action-card {
    padding: 18px;
}

.vm-action-card:hover {
    border-color: #B7C9FB !important;
    box-shadow: 0 10px 26px rgba(37, 99, 235, .08) !important;
    transform: translateY(-1px);
}

.vm-kpi::before,
.purchase-kpi-card::before {
    width: 3px !important;
    background: var(--contrix-blue) !important;
}

.vm-kpi strong {
    font-size: 1.55rem;
}

.accordion-button {
    min-height: 58px;
    border-radius: 6px !important;
    color: var(--contrix-text);
    background: #FFFFFF;
    font-weight: 700;
    box-shadow: none !important;
}

.accordion-button:not(.collapsed) {
    color: var(--contrix-blue-dark);
    background: #F7F9FE;
}

.accordion-body {
    border-top: 1px solid var(--contrix-border);
    background: #FFFFFF;
}

/* Formularios */
.form-label {
    margin-bottom: 6px;
    color: #3E4656;
    font-size: .82rem;
    font-weight: 600;
}

.form-control,
.form-select,
.vm-form .form-control,
.vm-form .form-select {
    min-height: 42px;
    border: 1px solid var(--contrix-border-strong);
    border-radius: 5px;
    color: var(--contrix-text);
    background-color: #FFFFFF;
    font-size: .86rem;
}

.form-control:focus,
.form-select:focus,
.vm-form .form-control:focus,
.vm-form .form-select:focus {
    border-color: #7AA2F7;
    box-shadow: 0 0 0 .18rem rgba(37, 99, 235, .12);
}

textarea.form-control {
    min-height: 94px;
}

.input-group .btn {
    border-radius: 5px;
}

/* Botones */
.btn {
    border-radius: 5px;
    font-size: .84rem;
    font-weight: 650;
}

.btn-primary {
    color: #FFFFFF;
    border-color: var(--contrix-blue);
    background: var(--contrix-blue);
    box-shadow: none;
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--contrix-blue-dark);
    background: var(--contrix-blue-dark);
}

.btn-success {
    color: #FFFFFF;
    border-color: var(--contrix-green);
    background: var(--contrix-green);
}

.btn-outline-primary {
    color: var(--contrix-blue);
    border-color: #98B5F7;
    background: #FFFFFF;
}

.btn-outline-primary:hover {
    color: #FFFFFF;
    border-color: var(--contrix-blue);
    background: var(--contrix-blue);
}

.btn-outline-secondary,
.btn-outline-dark {
    color: #596174;
    border-color: #C9D0DC;
    background: #FFFFFF;
}

/* Tablas */
.table-responsive {
    border-radius: 5px;
}

.table,
.vm-table {
    margin-bottom: 0;
    color: var(--contrix-text);
    background: #FFFFFF;
}

.table thead th,
.vm-table thead th {
    padding: 12px 11px;
    border-color: var(--contrix-border);
    color: #596174;
    background: #F7F8FB;
    font-size: .70rem;
    font-weight: 800;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.table tbody td,
.vm-table tbody td {
    padding: 12px 11px;
    border-color: #EDF0F5;
    font-size: .83rem;
}

.table tbody tr:hover,
.vm-table tbody tr:hover {
    background: #F9FAFD;
}

/* Resúmenes y etiquetas */
.vm-preview {
    gap: 10px;
}

.vm-preview div {
    padding: 13px;
    border: 1px solid var(--contrix-border);
    border-radius: 5px;
    background: #F8F9FC;
}

.vm-note,
.vm-summary-pill,
.contrix-rule {
    border: 1px solid #C9D8FB;
    border-left: 3px solid var(--contrix-blue);
    border-radius: 5px;
    color: #26447E;
    background: var(--contrix-blue-soft);
}

.vm-badge {
    border: 1px solid #B7EEDB;
    border-radius: 4px;
    color: #047857;
    background: var(--contrix-green-soft);
}

.alert {
    border-radius: 5px;
}

.modal-content {
    border: 1px solid var(--contrix-border);
    border-radius: 7px;
    box-shadow: 0 22px 60px rgba(30, 41, 59, .20);
}

.modal-header,
.modal-footer {
    border-color: var(--contrix-border);
}

/* Login mantiene marca CONTRIX */
.vm-auth-left {
    background:
        linear-gradient(
            150deg,
            var(--contrix-navy) 0%,
            #151625 100%
        );
}

.vm-auth-logo-box {
    border-radius: 7px;
    background: #FFFFFF;
}

.cx-sidebar-backdrop {
    display: none;
}

@media (max-width: 1200px) {
    .cx-topbar {
        align-items: flex-start;
    }

    .cx-topbar-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .cx-user-copy {
        display: none;
    }
}

@media (max-width: 991px) {
    .cx-sidebar {
        transform: translateX(-100%);
        transition: transform .20s ease;
    }

    .cx-sidebar.is-open {
        transform: translateX(0);
    }

    .cx-sidebar-close,
    .cx-menu-button {
        display: inline-grid;
        place-items: center;
    }

    .cx-main {
        width: 100%;
        margin-left: 0;
    }

    .cx-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1035;
        pointer-events: none;
        opacity: 0;
        background: rgba(15, 23, 42, .50);
        transition: opacity .20s ease;
    }

    .cx-sidebar-backdrop.is-visible {
        pointer-events: auto;
        opacity: 1;
    }

    body.cx-sidebar-open {
        overflow: hidden;
    }

    .cx-topbar {
        padding: 13px 18px;
    }

    .cx-content {
        padding: 18px;
    }

    .cx-branch-switcher {
        display: none;
    }
}

@media (max-width: 640px) {
    .cx-topbar {
        min-height: 72px;
    }

    .cx-topbar h1 {
        max-width: 220px;
        font-size: 1.06rem;
    }

    .cx-breadcrumb {
        display: none;
    }

    .cx-user-chevron {
        display: none;
    }

    .cx-content {
        padding: 13px;
    }

    .vm-card {
        padding: 15px;
    }

    .vm-grid-4,
    .vm-grid-3,
    .vm-grid-2,
    .vm-preview {
        grid-template-columns: 1fr;
    }
}


/* Alcance visual del usuario principal */
.cx-principal-scope-note {
    margin: 22px 18px;
    padding: 14px;
    border: 1px solid rgba(96, 165, 250, .24);
    border-left: 3px solid var(--contrix-green);
    border-radius: 6px;
    color: rgba(255, 255, 255, .68);
    background: rgba(37, 99, 235, .10);
}

.cx-principal-scope-note strong,
.cx-principal-scope-note span {
    display: block;
}

.cx-principal-scope-note strong {
    margin-bottom: 5px;
    color: #FFFFFF;
    font-size: .78rem;
}

.cx-principal-scope-note span {
    font-size: .70rem;
    line-height: 1.45;
}


/* =========================================================
   CONTRIX - CORRECCIÓN DEFINITIVA DE CENTRADO
   Evita que los estilos anteriores reserven dos veces
   el ancho del menú lateral.
   ========================================================= */

.cx-admin-shell {
    display: block !important;
    width: 100% !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

.vm-sidebar.cx-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0 !important;

    width: 272px !important;
    min-width: 272px !important;
    max-width: 272px !important;

    height: 100vh !important;
    min-height: 100vh !important;
    max-height: 100vh !important;

    margin: 0 !important;
    padding: 0 !important;

    flex: none !important;
    align-self: auto !important;
    overflow: hidden !important;
}

.vm-main.cx-main {
    display: block !important;

    width: calc(100% - 272px) !important;
    min-width: 0 !important;
    max-width: none !important;

    min-height: 100vh !important;
    height: auto !important;

    margin: 0 0 0 272px !important;
    padding: 0 !important;

    flex: none !important;
    overflow: visible !important;
}

.vm-topbar.cx-topbar {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    left: auto !important;
    right: auto !important;

    box-sizing: border-box !important;
}

.vm-content.cx-content {
    width: 100% !important;
    max-width: none !important;

    margin: 0 !important;
    padding-left: clamp(20px, 2.2vw, 36px) !important;
    padding-right: clamp(20px, 2.2vw, 36px) !important;

    box-sizing: border-box !important;
}

/* Centra el contenido real de cada página dentro del espacio disponible. */
.vm-content.cx-content > * {
    width: 100% !important;
    max-width: 1500px !important;

    margin-left: auto !important;
    margin-right: auto !important;

    box-sizing: border-box !important;
}

/* Corrige contenedores antiguos que podrían conservar margen lateral. */
.cx-main .vm-card,
.cx-main .vm-grid,
.cx-main .vm-toolbar,
.cx-main .vm-page,
.cx-main .container,
.cx-main .container-fluid {
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 991px) {
    .vm-sidebar.cx-sidebar {
        transform: translateX(-100%);
    }

    .vm-sidebar.cx-sidebar.is-open {
        transform: translateX(0);
    }

    .vm-main.cx-main {
        width: 100% !important;
        margin-left: 0 !important;
    }

    .vm-content.cx-content > * {
        max-width: 100% !important;
    }
}


/* =========================================================
   CONTRIX - DISEÑO PROFESIONAL DE MÓDULOS
   Productos e inventario
   ========================================================= */

.cx-module-page {
    width: 100%;
    display: grid;
    gap: 20px;
}

.cx-module-page *,
.cx-module-page *::before,
.cx-module-page *::after {
    box-sizing: border-box;
}

.cx-module-hero {
    position: relative;
    min-height: 138px;
    padding: 26px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    overflow: hidden;
    border: 1px solid #DCE5F5;
    border-radius: 16px;
    background:
        radial-gradient(
            circle at 88% 20%,
            rgba(16, 185, 129, .14),
            transparent 27%
        ),
        linear-gradient(
            135deg,
            #FFFFFF 0%,
            #F6F9FF 58%,
            #EFF5FF 100%
        );
    box-shadow: 0 12px 32px rgba(37, 99, 235, .06);
}

.cx-module-hero::after {
    content: "";
    position: absolute;
    right: -52px;
    bottom: -92px;
    width: 230px;
    height: 230px;
    border: 34px solid rgba(37, 99, 235, .055);
    border-radius: 50%;
    pointer-events: none;
}

.cx-module-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.cx-module-eyebrow,
.cx-section-eyebrow {
    display: block;
    margin-bottom: 7px;
    color: var(--contrix-blue);
    font-size: .70rem;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.cx-module-hero h2 {
    margin: 0;
    color: #172033;
    font-size: clamp(1.35rem, 2vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -.025em;
}

.cx-module-hero p {
    max-width: 680px;
    margin: 9px 0 0;
    color: #667085;
    font-size: .91rem;
    line-height: 1.55;
}

.cx-module-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.cx-module-hero-actions .btn {
    min-height: 42px;
    padding-inline: 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.cx-alert {
    min-height: 54px;
    margin: 0;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 11px;
    border-radius: 12px;
    font-size: .86rem;
}

.cx-alert-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: currentColor;
    background: rgba(255, 255, 255, .58);
    font-weight: 900;
}

.cx-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.cx-kpi-card {
    position: relative;
    min-height: 116px;
    padding: 19px;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 15px;
    overflow: hidden;
    border: 1px solid #E1E7F0;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(30, 41, 59, .045);
}

.cx-kpi-card::after {
    content: "";
    position: absolute;
    inset: auto -18px -30px auto;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: currentColor;
    opacity: .045;
}

.cx-kpi-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: 1.18rem;
    font-weight: 900;
}

.cx-kpi-card.is-blue {
    color: #2563EB;
}

.cx-kpi-card.is-blue .cx-kpi-icon {
    background: #EEF4FF;
}

.cx-kpi-card.is-green {
    color: #059669;
}

.cx-kpi-card.is-green .cx-kpi-icon {
    background: #ECFDF5;
}

.cx-kpi-card.is-amber {
    color: #D97706;
}

.cx-kpi-card.is-amber .cx-kpi-icon {
    background: #FFF7E6;
}

.cx-kpi-card.is-red {
    color: #DC2626;
}

.cx-kpi-card.is-red .cx-kpi-icon {
    background: #FEF2F2;
}

.cx-kpi-copy {
    min-width: 0;
}

.cx-kpi-copy span,
.cx-kpi-copy strong,
.cx-kpi-copy small {
    display: block;
}

.cx-kpi-copy span {
    color: #667085;
    font-size: .75rem;
    font-weight: 700;
}

.cx-kpi-copy strong {
    margin-top: 3px;
    color: #172033;
    font-size: 1.65rem;
    font-weight: 850;
    line-height: 1;
    letter-spacing: -.035em;
}

.cx-kpi-copy small {
    margin-top: 7px;
    overflow: hidden;
    color: #98A2B3;
    font-size: .68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-filter-panel {
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border: 1px solid #E1E7F0;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 7px 22px rgba(30, 41, 59, .04);
}

.cx-filter-panel-main {
    min-width: 0;
    display: flex;
    align-items: center;
    flex: 1;
    gap: 13px;
}

.cx-search-form {
    min-width: 310px;
    max-width: 515px;
    display: flex;
    flex: 1;
    gap: 9px;
}

.cx-search-control {
    position: relative;
    min-width: 0;
    flex: 1;
}

.cx-search-control .form-control {
    width: 100%;
    padding-left: 39px;
}

.cx-search-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    z-index: 2;
    transform: translateY(-52%);
    color: #98A2B3;
    font-size: 1.05rem;
    font-weight: 800;
    pointer-events: none;
}

.cx-search-control-compact {
    width: 290px;
    flex: none;
}

.cx-filter-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid #E5E9F1;
    border-radius: 10px;
    background: #F7F9FC;
}

.cx-filter-tab {
    min-height: 34px;
    padding: 7px 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    color: #667085;
    text-decoration: none;
    font-size: .74rem;
    font-weight: 750;
    white-space: nowrap;
}

.cx-filter-tab:hover {
    color: var(--contrix-blue);
    background: #FFFFFF;
}

.cx-filter-tab.active {
    color: #FFFFFF;
    background: var(--contrix-blue);
    box-shadow: 0 4px 10px rgba(37, 99, 235, .20);
}

.cx-filter-panel-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.cx-filter-panel-actions .btn {
    min-height: 40px;
    white-space: nowrap;
}

.cx-rule-card {
    min-height: 78px;
    padding: 15px 17px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    border: 1px solid #CFE0FC;
    border-radius: 13px;
    color: #294E8D;
    background:
        linear-gradient(
            90deg,
            #EEF5FF,
            #F8FBFF
        );
}

.cx-rule-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #FFFFFF;
    background: var(--contrix-blue);
    font-family: Georgia, serif;
    font-size: 1rem;
    font-weight: 800;
}

.cx-rule-card strong {
    display: block;
    color: #1E4484;
    font-size: .82rem;
}

.cx-rule-card p {
    margin: 4px 0 0;
    color: #5270A4;
    font-size: .76rem;
    line-height: 1.45;
}

.cx-rule-meta {
    min-width: 145px;
    padding-left: 15px;
    border-left: 1px solid #CFE0FC;
    text-align: right;
}

.cx-rule-meta span,
.cx-rule-meta strong {
    display: block;
}

.cx-rule-meta span {
    color: #7390BF;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
}

.cx-rule-meta strong {
    margin-top: 4px;
    color: #294E8D;
    font-size: .76rem;
}

.cx-data-card {
    overflow: hidden;
    border: 1px solid #E1E7F0;
    border-radius: 15px;
    background: #FFFFFF;
    box-shadow: 0 10px 30px rgba(30, 41, 59, .05);
}

.cx-data-card-header {
    min-height: 92px;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid #E9EDF3;
}

.cx-data-card-header h2 {
    margin: 0;
    color: #202939;
    font-size: 1.05rem;
    font-weight: 800;
}

.cx-data-card-header p {
    margin: 5px 0 0;
    color: #7A8496;
    font-size: .78rem;
}

.cx-record-count {
    padding: 7px 10px;
    border: 1px solid #C9F0E1;
    border-radius: 8px;
    color: #047857;
    background: #ECFDF5;
    font-size: .71rem;
    font-weight: 800;
    white-space: nowrap;
}

.cx-record-count.is-warning {
    color: #B45309;
    border-color: #F5DEAA;
    background: #FFF8E8;
}

.cx-table-scroll {
    max-width: 100%;
}

.cx-data-table {
    min-width: 1050px;
}

.cx-data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 13px 12px;
    color: #667085;
    background: #F8FAFC;
    font-size: .66rem;
    letter-spacing: .055em;
}

.cx-data-table tbody td {
    padding: 15px 12px;
    vertical-align: middle;
}

.cx-data-table tbody tr {
    transition:
        background-color .14s ease,
        box-shadow .14s ease;
}

.cx-data-table tbody tr:hover {
    background: #FAFCFF;
}

.cx-product-cell {
    min-width: 195px;
    display: flex;
    align-items: center;
    gap: 11px;
}

.cx-product-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border: 1px solid #CFE0FC;
    border-radius: 10px;
    color: #2563EB;
    background:
        linear-gradient(
            135deg,
            #F0F5FF,
            #E8F0FF
        );
    font-size: .80rem;
    font-weight: 850;
}

.cx-product-cell > div {
    min-width: 0;
}

.cx-product-cell strong,
.cx-product-cell span {
    display: block;
}

.cx-product-cell strong {
    max-width: 210px;
    overflow: hidden;
    color: #202939;
    font-size: .80rem;
    font-weight: 800;
    line-height: 1.3;
    text-overflow: ellipsis;
}

.cx-product-cell span {
    margin-top: 4px;
    color: #8A94A6;
    font-size: .68rem;
}

.cx-reference-cell {
    min-width: 130px;
}

.cx-reference-cell strong,
.cx-reference-cell span {
    display: block;
}

.cx-reference-cell strong {
    color: #344054;
    font-size: .75rem;
    font-weight: 750;
}

.cx-reference-cell span {
    margin-top: 4px;
    color: #98A2B3;
    font-size: .65rem;
    line-height: 1.3;
}

.cx-category-pill,
.cx-branch-label,
.cx-coverage-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    white-space: nowrap;
}

.cx-category-pill {
    padding: 6px 9px;
    color: #475467;
    background: #F2F4F7;
    font-size: .67rem;
    font-weight: 700;
}

.cx-branch-label {
    padding: 6px 9px;
    color: #1E4E94;
    border: 1px solid #D6E4FA;
    background: #F2F7FF;
    font-size: .67rem;
    font-weight: 700;
}

.cx-stock-cell {
    min-width: 200px;
}

.cx-stock-cell-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
}

.cx-stock-cell-top strong {
    color: #202939;
    font-size: .88rem;
}

.cx-stock-cell-top small {
    color: #98A2B3;
    font-size: .62rem;
    font-weight: 600;
}

.cx-progress-track {
    height: 7px;
    margin-top: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: #EEF1F5;
}

.cx-progress-value {
    display: block;
    height: 100%;
    min-width: 3px;
    border-radius: inherit;
    background: #7A8AA0;
}

.cx-progress-value.success {
    background: #10B981;
}

.cx-progress-value.warning {
    background: #F59E0B;
}

.cx-progress-value.danger {
    background: #EF4444;
}

.cx-progress-value.neutral {
    background: #2563EB;
}

.cx-stock-limits {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    gap: 7px;
    color: #98A2B3;
    font-size: .62rem;
}

.cx-status-pill {
    min-height: 26px;
    padding: 5px 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .64rem;
    font-weight: 800;
    white-space: nowrap;
}

.cx-status-pill.success {
    color: #047857;
    border-color: #B7EEDB;
    background: #ECFDF5;
}

.cx-status-pill.warning {
    color: #B45309;
    border-color: #F5D999;
    background: #FFF7E6;
}

.cx-status-pill.danger {
    color: #B42318;
    border-color: #F4C7C7;
    background: #FEF2F2;
}

.cx-status-pill.neutral {
    color: #475467;
    border-color: #E0E5ED;
    background: #F6F7F9;
}

.cx-rotation-cell {
    min-width: 155px;
}

.cx-rotation-cell strong,
.cx-rotation-cell > span {
    display: block;
}

.cx-rotation-cell strong {
    color: #202939;
    font-size: .78rem;
}

.cx-rotation-cell strong small {
    color: #98A2B3;
    font-size: .62rem;
    font-weight: 600;
}

.cx-rotation-cell > span {
    margin-top: 4px;
    color: #8A94A6;
    font-size: .64rem;
}

.cx-coverage-badge {
    width: fit-content;
    margin-top: 7px !important;
    padding: 5px 8px;
    color: #1E4E94 !important;
    background: #EFF5FF;
    font-size: .60rem !important;
    font-weight: 750;
}

.cx-finance-cell {
    min-width: 145px;
    display: grid;
    gap: 7px;
}

.cx-finance-cell div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.cx-finance-cell span {
    color: #98A2B3;
    font-size: .59rem;
}

.cx-finance-cell strong {
    color: #344054;
    font-size: .69rem;
    white-space: nowrap;
}

.cx-finance-cell .is-profit strong {
    color: #059669;
}

.cx-state-badge {
    padding: 6px 9px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    font-size: .65rem;
    font-weight: 800;
}

.cx-state-badge > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.cx-state-badge.is-active {
    color: #047857;
    background: #ECFDF5;
}

.cx-state-badge.is-active > span {
    background: #10B981;
}

.cx-state-badge.is-inactive {
    color: #667085;
    background: #F2F4F7;
}

.cx-state-badge.is-inactive > span {
    background: #98A2B3;
}

.cx-row-actions {
    min-width: 145px;
    display: flex;
    justify-content: flex-end;
    gap: 7px;
}

.cx-row-actions form {
    margin: 0;
}

.cx-empty-state {
    min-height: 240px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
}

.cx-empty-state-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: #2563EB;
    background: #EEF4FF;
    font-size: 1.1rem;
}

.cx-empty-state strong {
    margin-top: 12px;
    color: #344054;
    font-size: .87rem;
}

.cx-empty-state p {
    margin: 5px 0 13px;
    color: #98A2B3;
    font-size: .75rem;
}

/* Inventario */
.cx-inventory-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 16px;
}

.cx-workflow-card,
.cx-upload-card {
    padding: 22px;
    border: 1px solid #E1E7F0;
    border-radius: 15px;
    background: #FFFFFF;
    box-shadow: 0 9px 28px rgba(30, 41, 59, .045);
}

.cx-workflow-card h2,
.cx-upload-card h2 {
    margin: 0;
    color: #202939;
    font-size: 1.02rem;
    font-weight: 800;
}

.cx-workflow-card header p,
.cx-upload-card header p {
    margin: 5px 0 0;
    color: #7A8496;
    font-size: .76rem;
}

.cx-workflow-steps {
    margin-top: 21px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
}

.cx-workflow-step {
    position: relative;
    padding-right: 16px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
}

.cx-workflow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 32px;
    right: 0;
    top: 15px;
    height: 1px;
    background: #DDE3EC;
}

.cx-workflow-step > span {
    position: relative;
    z-index: 1;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 1px solid #DCE3EC;
    border-radius: 50%;
    color: #667085;
    background: #FFFFFF;
    font-size: .68rem;
    font-weight: 850;
}

.cx-workflow-step.is-complete > span {
    color: #FFFFFF;
    border-color: var(--contrix-blue);
    background: var(--contrix-blue);
}

.cx-workflow-step div {
    position: relative;
    z-index: 1;
    padding-top: 1px;
    background: #FFFFFF;
}

.cx-workflow-step strong {
    color: #344054;
    font-size: .70rem;
}

.cx-workflow-step p {
    margin: 5px 0 0;
    color: #98A2B3;
    font-size: .61rem;
    line-height: 1.4;
}

.cx-upload-form {
    margin-top: 17px;
    display: grid;
    gap: 11px;
}

.cx-file-drop {
    min-height: 152px;
    padding: 20px;
    display: grid;
    place-items: center;
    align-content: center;
    border: 1.5px dashed #B7C7E5;
    border-radius: 13px;
    color: #526682;
    background: #F8FBFF;
    cursor: pointer;
    text-align: center;
    transition:
        border-color .15s ease,
        background-color .15s ease;
}

.cx-file-drop:hover {
    border-color: #6E98F1;
    background: #F2F7FF;
}

.cx-file-drop input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.cx-file-drop-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #FFFFFF;
    background: var(--contrix-blue);
    font-size: 1.15rem;
    font-weight: 800;
}

.cx-file-drop strong {
    max-width: 280px;
    margin-top: 11px;
    overflow: hidden;
    color: #344054;
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-file-drop small {
    margin-top: 5px;
    color: #98A2B3;
    font-size: .65rem;
}

.cx-security-note {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #526B94;
}

.cx-security-note > span {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #FFFFFF;
    background: #7B9BD1;
    font-family: Georgia, serif;
    font-size: .72rem;
    font-weight: 800;
}

.cx-security-note p {
    margin: 2px 0 0;
    font-size: .67rem;
    line-height: 1.45;
}

.cx-inventory-table-header {
    align-items: flex-end;
}

.cx-table-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cx-stock-number strong,
.cx-stock-number span {
    display: block;
}

.cx-stock-number strong {
    color: #202939;
    font-size: .88rem;
}

.cx-stock-number span {
    margin-top: 3px;
    color: #98A2B3;
    font-size: .64rem;
}

.cx-range-cell {
    min-width: 145px;
    display: flex;
    gap: 7px;
}

.cx-range-cell span {
    min-width: 66px;
    padding: 7px 8px;
    border-radius: 8px;
    color: #98A2B3;
    background: #F7F8FA;
    font-size: .59rem;
}

.cx-range-cell strong {
    display: block;
    margin-top: 2px;
    color: #475467;
    font-size: .70rem;
}

.cx-stock-level {
    min-width: 160px;
}

.cx-stock-level > span {
    display: block;
    margin-top: 6px;
    color: #98A2B3;
    font-size: .62rem;
}

.cx-difference-value {
    min-width: 38px;
    padding: 6px 8px;
    display: inline-flex;
    justify-content: center;
    border-radius: 8px;
    font-size: .72rem;
    font-weight: 850;
}

.cx-difference-value.success {
    color: #047857;
    background: #ECFDF5;
}

.cx-difference-value.warning {
    color: #B45309;
    background: #FFF7E6;
}

.cx-difference-value.danger {
    color: #B42318;
    background: #FEF2F2;
}

.cx-difference-value.neutral {
    color: #667085;
    background: #F2F4F7;
}

.cx-form-footer {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid #E9EDF3;
    background: #FBFCFE;
}

.cx-form-footer .cx-security-note {
    max-width: 650px;
}

.cx-form-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    white-space: nowrap;
}

@media (max-width: 1320px) {
    .cx-filter-panel,
    .cx-filter-panel-main {
        align-items: stretch;
        flex-direction: column;
    }

    .cx-filter-panel-actions {
        justify-content: flex-start;
    }

    .cx-search-form {
        max-width: none;
    }

    .cx-inventory-workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .cx-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cx-workflow-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px 0;
    }

    .cx-workflow-step:nth-child(2)::after {
        display: none;
    }
}

@media (max-width: 760px) {
    .cx-module-page {
        gap: 14px;
    }

    .cx-module-hero {
        min-height: auto;
        padding: 20px;
        align-items: flex-start;
        flex-direction: column;
    }

    .cx-module-hero-actions {
        width: 100%;
        justify-content: stretch;
    }

    .cx-module-hero-actions .btn {
        flex: 1;
    }

    .cx-kpi-grid {
        grid-template-columns: 1fr;
    }

    .cx-kpi-card {
        min-height: 96px;
    }

    .cx-filter-panel-main {
        gap: 10px;
    }

    .cx-search-form {
        min-width: 0;
        flex-direction: column;
    }

    .cx-filter-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .cx-filter-tab {
        flex: 1 0 auto;
    }

    .cx-filter-panel-actions {
        flex-direction: column;
    }

    .cx-filter-panel-actions form,
    .cx-filter-panel-actions .btn {
        width: 100%;
    }

    .cx-rule-card {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .cx-rule-meta {
        grid-column: 1 / -1;
        padding: 10px 0 0;
        border-top: 1px solid #CFE0FC;
        border-left: 0;
        text-align: left;
    }

    .cx-data-card-header,
    .cx-inventory-table-header,
    .cx-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .cx-table-header-actions,
    .cx-form-footer-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .cx-search-control-compact {
        width: 100%;
    }

    .cx-workflow-steps {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .cx-workflow-step:not(:last-child)::after {
        left: 15px;
        top: 32px;
        right: auto;
        bottom: -14px;
        width: 1px;
        height: auto;
    }

    .cx-form-footer-actions .btn {
        width: 100%;
    }
}


/* =========================================================
   CONTRIX - COMPRAS, ÓRDENES Y CONTEXTO DEL USUARIO
   ========================================================= */

.cx-procurement-page,
.cx-purchase-orders-page {
    gap: 18px;
}

.cx-procurement-hero {
    background:
        radial-gradient(
            circle at 88% 15%,
            rgba(16, 185, 129, .16),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            #FFFFFF 0%,
            #F5F9FF 56%,
            #EDF5FF 100%
        );
}

.cx-orders-hero {
    background:
        radial-gradient(
            circle at 90% 20%,
            rgba(37, 99, 235, .15),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            #FFFFFF 0%,
            #F7F9FF 56%,
            #F0F4FF 100%
        );
}

.cx-kpi-money {
    font-size: clamp(1.05rem, 1.45vw, 1.45rem) !important;
    white-space: nowrap;
}

.cx-procurement-filter {
    align-items: center;
}

.cx-procurement-search {
    max-width: 760px;
}

.cx-status-select {
    min-width: 190px;
    max-width: 225px;
}

.cx-procurement-flow {
    min-height: 88px;
    padding: 16px 19px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    border: 1px solid #DCE5F3;
    border-radius: 14px;
    background:
        linear-gradient(
            90deg,
            #FFFFFF,
            #F8FAFD
        );
    box-shadow: 0 7px 22px rgba(30, 41, 59, .035);
}

.cx-procurement-flow-copy {
    min-width: 190px;
}

.cx-procurement-flow-copy h2 {
    margin: 0;
    color: #202939;
    font-size: .94rem;
    font-weight: 800;
}

.cx-procurement-flow-steps {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
    gap: 10px;
}

.cx-procurement-flow-steps div {
    min-width: 120px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cx-procurement-flow-steps div > span {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #FFFFFF;
    background: var(--contrix-blue);
    font-size: .65rem;
    font-weight: 850;
}

.cx-procurement-flow-steps strong {
    color: #475467;
    font-size: .68rem;
    line-height: 1.25;
}

.cx-procurement-flow-steps i {
    color: #C0C8D5;
    font-size: 1.2rem;
    font-style: normal;
}

.cx-procurement-table {
    min-width: 1120px;
}

.cx-document-cell {
    min-width: 160px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cx-document-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border: 1px solid #C9DBFC;
    border-radius: 10px;
    color: #1D4ED8;
    background: #EEF4FF;
    font-size: .67rem;
    font-weight: 900;
}

.cx-document-icon.is-green {
    color: #047857;
    border-color: #BAEBD9;
    background: #ECFDF5;
}

.cx-document-cell strong,
.cx-document-cell span {
    display: block;
}

.cx-document-cell strong {
    color: #202939;
    font-size: .76rem;
    font-weight: 800;
}

.cx-document-cell span {
    margin-top: 4px;
    color: #98A2B3;
    font-size: .63rem;
}

.cx-supplier-cell {
    min-width: 155px;
}

.cx-supplier-cell strong,
.cx-supplier-cell span {
    display: block;
}

.cx-supplier-cell strong {
    max-width: 185px;
    overflow: hidden;
    color: #344054;
    font-size: .75rem;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-supplier-cell span {
    margin-top: 4px;
    color: #98A2B3;
    font-size: .63rem;
}

.cx-date-stack {
    min-width: 150px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.cx-date-stack > span {
    padding: 7px 8px;
    border-radius: 8px;
    color: #475467;
    background: #F7F8FA;
    font-size: .65rem;
    font-weight: 700;
    white-space: nowrap;
}

.cx-date-stack small {
    display: block;
    margin-bottom: 3px;
    color: #98A2B3;
    font-size: .54rem;
    font-weight: 700;
    text-transform: uppercase;
}

.cx-date-stack .is-overdue {
    color: #B42318;
    background: #FEF2F2;
}

.cx-quantity-summary {
    min-width: 88px;
    text-align: center;
}

.cx-quantity-summary strong,
.cx-quantity-summary span,
.cx-quantity-summary small {
    display: block;
}

.cx-quantity-summary strong {
    color: #202939;
    font-size: 1rem;
    font-weight: 850;
}

.cx-quantity-summary span {
    margin-top: 1px;
    color: #667085;
    font-size: .62rem;
}

.cx-quantity-summary small {
    margin-top: 4px;
    color: #98A2B3;
    font-size: .58rem;
}

.cx-money-cell {
    min-width: 120px;
}

.cx-money-cell strong,
.cx-money-cell span {
    display: block;
}

.cx-money-cell strong {
    color: #202939;
    font-size: .78rem;
    font-weight: 850;
    white-space: nowrap;
}

.cx-money-cell span {
    margin-top: 4px;
    color: #98A2B3;
    font-size: .61rem;
}

.cx-origin-cell {
    min-width: 145px;
}

.cx-origin-cell a,
.cx-origin-cell strong,
.cx-origin-cell span,
.cx-origin-cell small {
    display: block;
}

.cx-origin-cell a,
.cx-origin-cell strong {
    color: #2563EB;
    font-size: .72rem;
    font-weight: 750;
    text-decoration: none;
}

.cx-origin-cell span,
.cx-origin-cell small {
    margin-top: 4px;
    color: #98A2B3;
    font-size: .61rem;
}

.cx-overdue-label {
    margin-top: 5px;
    display: block;
    color: #B42318;
    font-size: .58rem;
    font-weight: 750;
}

.cx-row-actions-wrap {
    min-width: 190px;
    flex-wrap: wrap;
}

.cx-order-rule-card {
    min-height: 76px;
}

/* Contexto superior: sede y usuario */
.cx-topbar-actions {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
}

.cx-account-context {
    min-height: 60px;
    display: flex;
    align-items: stretch;
    overflow: visible;
    border: 1px solid #DCE3ED;
    border-radius: 13px;
    background: #FFFFFF;
    box-shadow: 0 7px 20px rgba(30, 41, 59, .055);
}

.cx-context-segment {
    min-height: 58px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cx-context-segment + .cx-context-segment {
    border-left: 1px solid #E6EAF0;
}

.cx-branch-context {
    min-width: 280px;
    margin: 0;
}

.cx-context-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: .78rem;
    font-weight: 850;
}

.cx-context-icon-branch {
    color: #047857;
    border: 1px solid #B7EEDB;
    background: #ECFDF5;
}

.cx-context-copy,
.cx-branch-dropdown-copy {
    min-width: 0;
    flex: 1;
    margin: 0;
}

.cx-context-copy small,
.cx-context-copy strong,
.cx-branch-dropdown-copy small,
.cx-branch-dropdown-copy strong,
.cx-branch-dropdown-copy span {
    display: block;
}

.cx-context-copy small,
.cx-branch-dropdown-copy small,
.cx-user-copy small {
    margin-bottom: 2px;
    color: #D0D9E7;
    font-size: .60rem;
    font-weight: 800;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
}

.cx-context-copy strong,
.cx-branch-dropdown-copy strong {
    overflow: hidden;
    color: #FFFFFF;
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-branch-dropdown-copy span {
    margin-top: 4px;
    overflow: hidden;
    color: rgba(255,255,255,.76);
    font-size: .70rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-branch-dropdown-copy span em {
    margin-right: 8px;
    padding: 2px 7px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-style: normal;
    font-size: .62rem;
    font-weight: 800;
    color: #DCEBFF;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.14);
}

.cx-branch-dropdown {
    position: relative;
}

.cx-branch-dropdown summary {
    list-style: none;
}

.cx-branch-dropdown summary::-webkit-details-marker {
    display: none;
}

.cx-branch-dropdown-trigger,
.cx-branch-single {
    min-height: 72px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.03) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 14px 28px rgba(4, 16, 36, .14);
}

.cx-branch-dropdown-trigger {
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.cx-branch-dropdown[open] .cx-branch-dropdown-trigger,
.cx-branch-dropdown-trigger:hover {
    border-color: rgba(255,255,255,.18);
    background: linear-gradient(180deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.05) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 16px 30px rgba(4, 16, 36, .18);
}

.cx-branch-dropdown-chevron {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.10);
    transition: transform .18s ease, background .18s ease;
}

.cx-branch-dropdown-chevron svg {
    width: 16px;
    height: 16px;
}

.cx-branch-dropdown[open] .cx-branch-dropdown-chevron {
    transform: rotate(180deg);
    background: rgba(255,255,255,.14);
}

.cx-branch-dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 1050;
    padding: 10px;
    border: 1px solid #DCE3ED;
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: 0 22px 50px rgba(15, 23, 42, .22);
}

.cx-branch-dropdown-menu-head {
    padding: 6px 8px 10px;
    border-bottom: 1px solid #EEF2F7;
}

.cx-branch-dropdown-menu-head small,
.cx-branch-dropdown-item-main small {
    display: block;
    color: #98A2B3;
    font-size: .67rem;
    font-weight: 700;
}

.cx-branch-dropdown-menu-head strong,
.cx-branch-dropdown-item-main strong {
    display: block;
    color: #1F2937;
    font-size: .88rem;
    font-weight: 800;
}

.cx-branch-dropdown-list {
    max-height: 280px;
    margin-top: 8px;
    overflow: auto;
}

.cx-branch-dropdown-form + .cx-branch-dropdown-form {
    margin-top: 6px;
}

.cx-branch-dropdown-item {
    width: 100%;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #E8EDF5;
    border-radius: 14px;
    color: #111827;
    background: #FFFFFF;
    text-align: left;
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.cx-branch-dropdown-item:hover:not(:disabled) {
    border-color: #B9CCF5;
    background: #F8FBFF;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(37, 99, 235, .08);
}

.cx-branch-dropdown-item.is-active {
    border-color: #BFDBFE;
    background: linear-gradient(180deg, #F8FBFF 0%, #F1F7FF 100%);
}

.cx-branch-dropdown-item:disabled {
    cursor: default;
    opacity: 1;
}

.cx-branch-dropdown-item-main {
    min-width: 0;
    flex: 1;
}

.cx-branch-dropdown-item-main strong,
.cx-branch-dropdown-item-main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-branch-dropdown-item-state {
    padding: 6px 10px;
    flex: 0 0 auto;
    border-radius: 999px;
    font-size: .69rem;
    font-weight: 800;
    color: #2563EB;
    background: #EFF6FF;
}

.cx-branch-dropdown-item.is-active .cx-branch-dropdown-item-state {
    color: #047857;
    background: #ECFDF5;
}

.cx-user-dropdown {
    padding: 0;
}

.cx-user-button {
    min-width: 220px !important;
    min-height: 58px !important;
    padding: 7px 11px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    border: 0 !important;
    border-radius: 0 12px 12px 0 !important;
    background: transparent !important;
}

.cx-user-button:hover,
.cx-user-button:focus {
    background: #F8FAFD !important;
}

.cx-user-avatar {
    color: #1D4ED8;
    border: 1px solid #C9DBFC;
    background: #EEF4FF;
}

.cx-user-copy {
    max-width: 165px;
    min-width: 0;
    flex: 1;
}

.cx-user-copy strong,
.cx-user-copy em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-user-copy strong {
    color: #273043;
    font-size: .75rem;
    font-style: normal;
    font-weight: 800;
    line-height: 1.15;
}

.cx-user-copy em {
    margin-top: 3px;
    color: #7A8496;
    font-size: .61rem;
    font-style: normal;
    line-height: 1.1;
}

.cx-user-menu {
    width: 275px;
    padding: 8px;
    border: 1px solid #DFE5EE;
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(30, 41, 59, .17);
}

.cx-user-menu-profile {
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cx-user-menu-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    color: #1D4ED8;
    background: #EEF4FF;
    font-size: .84rem;
    font-weight: 850;
}

.cx-user-menu-profile > div {
    min-width: 0;
}

.cx-user-menu-profile strong,
.cx-user-menu-profile span,
.cx-user-menu-profile small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cx-user-menu-profile strong {
    color: #273043;
    font-size: .77rem;
}

.cx-user-menu-profile span {
    margin-top: 3px;
    color: #7A8496;
    font-size: .64rem;
}

.cx-user-menu-profile small {
    margin-top: 4px;
    color: #2563EB;
    font-size: .60rem;
    font-weight: 750;
}

@media (max-width: 1380px) {
    .cx-account-context {
        box-shadow: none;
    }

    .cx-branch-context {
        min-width: 240px;
    }

    .cx-branch-dropdown-trigger,
    .cx-branch-single {
        min-height: 66px;
        padding: 10px 12px;
    }

    .cx-branch-dropdown-copy strong {
        font-size: .95rem;
    }

    .cx-user-button {
        min-width: 180px !important;
    }

    .cx-user-copy {
        max-width: 125px;
    }
}

@media (max-width: 1160px) {
    .cx-account-context {
        border: 0;
        background: transparent;
    }

    .cx-context-segment {
        border: 1px solid #DCE3ED;
        border-radius: 11px !important;
        background: #FFFFFF;
    }

    .cx-context-segment + .cx-context-segment {
        margin-left: 8px;
        border-left: 1px solid #DCE3ED;
    }

    .cx-user-copy em {
        display: none;
    }

    .cx-user-button {
        min-width: 145px !important;
    }
}

@media (max-width: 991px) {
    .cx-account-context {
        min-height: auto;
    }

    .cx-account-context .cx-branch-context {
        display: none;
    }

    .cx-user-button {
        min-width: 58px !important;
        border-radius: 11px !important;
    }

    .cx-user-copy {
        display: none !important;
    }
}

@media (max-width: 760px) {
    .cx-procurement-flow {
        align-items: flex-start;
        flex-direction: column;
    }

    .cx-procurement-flow-steps {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .cx-procurement-flow-steps i {
        display: none;
    }

    .cx-procurement-flow-steps div {
        width: 100%;
    }
}


/* =========================================================
   CONTRIX - PANEL PRINCIPAL PROFESIONAL
   ========================================================= */

.cx-dashboard-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cx-dashboard-hero {
    min-height: 170px;
    padding: 26px 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(250px, .7fr);
    gap: 18px;
    border: 1px solid #DDE5F1;
    border-radius: 22px;
    background:
        radial-gradient(circle at 92% 18%, rgba(37, 99, 235, .12), transparent 30%),
        radial-gradient(circle at 72% 84%, rgba(16, 185, 129, .10), transparent 24%),
        linear-gradient(135deg, #FFFFFF 0%, #F7FAFF 58%, #EFF6FF 100%);
    box-shadow: 0 14px 44px rgba(30, 41, 59, .06);
}

.cx-dashboard-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.cx-dashboard-hero-copy h2 {
    margin: 0;
    color: #1E293B;
    font-size: clamp(1.6rem, 2vw, 2.05rem);
    font-weight: 900;
    line-height: 1.12;
}

.cx-dashboard-hero-copy p {
    max-width: 720px;
    margin: 0;
    color: #64748B;
    font-size: .98rem;
    line-height: 1.6;
}

.cx-dashboard-hero-actions {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cx-dashboard-hero-side {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
}

.cx-dashboard-side-card {
    min-height: 100%;
    width: 100%;
    max-width: 280px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(37, 99, 235, .14);
    border-radius: 18px;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(6px);
}

.cx-dashboard-side-card small {
    color: #2563EB;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.cx-dashboard-side-card strong {
    color: #1E293B;
    font-size: 1.12rem;
    font-weight: 900;
}

.cx-dashboard-side-card span {
    color: #64748B;
    font-size: .84rem;
    line-height: 1.45;
}

.cx-dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.cx-dashboard-kpi {
    min-height: 118px;
    padding: 18px 18px 17px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #E5EAF2;
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: 0 10px 28px rgba(30, 41, 59, .05);
}

.cx-dashboard-kpi-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 900;
}

.cx-dashboard-kpi-copy {
    min-width: 0;
}

.cx-dashboard-kpi-copy small,
.cx-dashboard-kpi-copy span,
.cx-dashboard-kpi-copy strong {
    display: block;
}

.cx-dashboard-kpi-copy small {
    margin-bottom: 4px;
    color: #94A3B8;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.cx-dashboard-kpi-copy span {
    color: #475569;
    font-size: .9rem;
    line-height: 1.25;
}

.cx-dashboard-kpi-copy strong {
    margin-top: 6px;
    color: #0F172A;
    font-size: clamp(1.4rem, 2vw, 1.8rem);
    font-weight: 900;
    line-height: 1;
    word-break: break-word;
}

.cx-dashboard-kpi.is-blue .cx-dashboard-kpi-icon {
    color: #1D4ED8;
    background: #EAF1FF;
}

.cx-dashboard-kpi.is-green .cx-dashboard-kpi-icon {
    color: #047857;
    background: #ECFDF5;
}

.cx-dashboard-kpi.is-slate .cx-dashboard-kpi-icon {
    color: #334155;
    background: #F1F5F9;
}

.cx-dashboard-overview {
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid #E3E8EF;
    border-radius: 20px;
    background: #FFFFFF;
    box-shadow: 0 10px 28px rgba(30, 41, 59, .04);
}

.cx-dashboard-overview-copy h2 {
    margin: 5px 0 6px;
    color: #1E293B;
    font-size: 1.45rem;
    font-weight: 900;
}

.cx-dashboard-overview-copy p {
    max-width: 760px;
    margin: 0;
    color: #64748B;
    line-height: 1.6;
}

.cx-dashboard-overview-pill {
    padding: 10px 14px;
    border: 1px solid #CDE6DB;
    border-radius: 999px;
    color: #047857;
    background: #ECFDF5;
    font-size: .77rem;
    font-weight: 800;
    white-space: nowrap;
}

.cx-dashboard-modules-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.cx-dashboard-module-card {
    min-height: 280px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid #E5EAF2;
    border-radius: 22px;
    background: #FFFFFF;
    color: inherit;
    text-decoration: none !important;
    box-shadow: 0 14px 38px rgba(30, 41, 59, .05);
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.cx-dashboard-module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 48px rgba(30, 41, 59, .10);
    text-decoration: none !important;
}

.cx-dashboard-module-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.cx-dashboard-module-icon {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    font-size: 1.04rem;
    font-weight: 900;
}

.cx-dashboard-module-tag {
    padding: 7px 11px;
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.cx-dashboard-module-main h3 {
    margin: 0 0 8px;
    color: #0F172A;
    font-size: 1.28rem;
    font-weight: 900;
    line-height: 1.15;
}

.cx-dashboard-module-main p {
    margin: 0;
    color: #64748B;
    line-height: 1.6;
}

.cx-dashboard-module-features {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.cx-dashboard-module-features li {
    position: relative;
    padding-left: 18px;
    color: #475569;
    font-size: .83rem;
    line-height: 1.45;
}

.cx-dashboard-module-features li::before {
    content: "";
    position: absolute;
    top: .42rem;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: .45;
}

.cx-dashboard-module-footer {
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #EDF1F6;
}

.cx-dashboard-module-status {
    font-size: .72rem;
    font-weight: 800;
}

.cx-dashboard-module-action {
    color: #2563EB;
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}

.cx-dashboard-module-card.is-blue .cx-dashboard-module-icon {
    color: #1D4ED8;
    background: #EAF1FF;
}
.cx-dashboard-module-card.is-blue .cx-dashboard-module-tag {
    color: #1D4ED8;
    background: #EFF6FF;
}
.cx-dashboard-module-card.is-blue .cx-dashboard-module-status,
.cx-dashboard-module-card.is-blue .cx-dashboard-module-features li {
    color: #1E40AF;
}
.cx-dashboard-module-card.is-blue:hover {
    border-color: #B9D1FF;
}

.cx-dashboard-module-card.is-green .cx-dashboard-module-icon {
    color: #047857;
    background: #ECFDF5;
}
.cx-dashboard-module-card.is-green .cx-dashboard-module-tag {
    color: #047857;
    background: #ECFDF5;
}
.cx-dashboard-module-card.is-green .cx-dashboard-module-status,
.cx-dashboard-module-card.is-green .cx-dashboard-module-features li {
    color: #047857;
}
.cx-dashboard-module-card.is-green:hover {
    border-color: #B7E7D2;
}

.cx-dashboard-module-card.is-slate .cx-dashboard-module-icon {
    color: #334155;
    background: #F1F5F9;
}
.cx-dashboard-module-card.is-slate .cx-dashboard-module-tag {
    color: #475569;
    background: #F8FAFC;
}
.cx-dashboard-module-card.is-slate .cx-dashboard-module-status,
.cx-dashboard-module-card.is-slate .cx-dashboard-module-features li {
    color: #475569;
}
.cx-dashboard-module-card.is-slate:hover {
    border-color: #D5DEE8;
}

@media (max-width: 1280px) {
    .cx-dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cx-dashboard-modules-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .cx-dashboard-hero {
        grid-template-columns: 1fr;
    }

    .cx-dashboard-hero-side {
        justify-content: flex-start;
    }

    .cx-dashboard-side-card {
        max-width: none;
    }

    .cx-dashboard-overview {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .cx-dashboard-kpis,
    .cx-dashboard-modules-grid {
        grid-template-columns: 1fr;
    }

    .cx-dashboard-hero,
    .cx-dashboard-overview,
    .cx-dashboard-module-card {
        padding: 18px;
        border-radius: 18px;
    }

    .cx-dashboard-module-card {
        min-height: auto;
    }

    .cx-dashboard-hero-actions {
        width: 100%;
    }

    .cx-dashboard-hero-actions .btn {
        flex: 1 1 auto;
    }

    .cx-dashboard-overview-pill {
        white-space: normal;
    }
}

/* CONTRIX - PAGOS DE COMPRAS Y CUENTAS POR PAGAR */
.cx-procurement-page .cx-kpi-card[href] { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.cx-procurement-page .cx-kpi-card[href]:hover { transform: translateY(-3px); box-shadow: 0 15px 34px rgba(30,41,59,.09); }
.cx-status-pill.danger { color: #B42318; border-color: #F3C8C8; background: #FEF2F2; }
.cx-payment-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; }
@media (max-width: 900px) { .cx-payment-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 600px) { .cx-payment-summary { grid-template-columns:1fr; } }

/* Menú modular: opciones conservadas para fases posteriores. */
.cx-nav-link.cx-nav-disabled {
    cursor: not-allowed;
    color: rgba(255, 255, 255, .42);
    background: transparent;
    opacity: .78;
    user-select: none;
}

.cx-nav-link.cx-nav-disabled:hover,
.cx-nav-link.cx-nav-disabled:focus {
    color: rgba(255, 255, 255, .42);
    background: transparent;
}

.cx-nav-pending {
    justify-self: end;
    padding: 2px 5px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    color: rgba(255, 255, 255, .48);
    font-size: .56rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cx-submenu .cx-submenu-disabled {
    min-height: 36px;
    padding: 8px 14px 8px 56px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    position: relative;
    color: rgba(255, 255, 255, .36);
    font-size: .82rem;
    font-weight: 550;
    cursor: not-allowed;
    user-select: none;
}

.cx-submenu .cx-submenu-disabled::before {
    content: "";
    position: absolute;
    left: 38px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
}

.cx-submenu .cx-submenu-disabled small {
    padding: 1px 5px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 999px;
    color: rgba(255, 255, 255, .35);
    font-size: .52rem;
    font-weight: 800;
    letter-spacing: .03em;
    text-transform: uppercase;
}

/* ========================================================================== */
/* CONTRIX Visual Refresh 2026-08 - acabado global de Tienda + ERP           */
/* ========================================================================== */

:root {
    --cxv-primary: #2563eb;
    --cxv-primary-hover: #1d4ed8;
    --cxv-primary-soft: #eff6ff;
    --cxv-success: #10b981;
    --cxv-success-soft: #ecfdf5;
    --cxv-warning: #f59e0b;
    --cxv-danger: #ef4444;
    --cxv-ink: #172033;
    --cxv-body: #334155;
    --cxv-muted: #718096;
    --cxv-border: #e2e8f0;
    --cxv-border-soft: #edf2f7;
    --cxv-canvas: #f5f7fb;
    --cxv-card: #ffffff;
    --cxv-radius-xs: 8px;
    --cxv-radius-sm: 10px;
    --cxv-radius-md: 14px;
    --cxv-radius-lg: 18px;
    --cxv-radius-xl: 22px;
    --cxv-shadow-xs: 0 1px 2px rgba(15, 23, 42, .04);
    --cxv-shadow-sm: 0 8px 22px rgba(15, 23, 42, .055);
    --cxv-shadow-md: 0 14px 36px rgba(15, 23, 42, .075);
    --cxv-ring: 0 0 0 3px rgba(37, 99, 235, .12);
}

/* Base */
html {
    scroll-behavior: smooth;
    background: var(--cxv-canvas) !important;
}

body.cx-admin-body {
    color: var(--cxv-body) !important;
    background: var(--cxv-canvas) !important;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.cx-admin-body ::selection {
    color: #fff;
    background: rgba(37, 99, 235, .9);
}

body.cx-admin-body * {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

body.cx-admin-body *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.cx-admin-body *::-webkit-scrollbar-track {
    background: transparent;
}

body.cx-admin-body *::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #cbd5e1;
    background-clip: padding-box;
}

body.cx-admin-body *::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    background-clip: padding-box;
}

/* Sidebar */
.cx-sidebar {
    background:
        radial-gradient(circle at 18% 4%, rgba(37, 99, 235, .16), transparent 29%),
        linear-gradient(180deg, #090d16 0%, #090d14 54%, #06090f 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, .045);
    box-shadow: 12px 0 34px rgba(15, 23, 42, .12) !important;
}

.cx-sidebar-header {
    min-height: 108px !important;
    padding: 20px !important;
    border-bottom-color: rgba(255, 255, 255, .055) !important;
}

.cx-brand {
    padding: 12px 14px !important;
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: 14px !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .20) !important;
}

.cx-brand img {
    height: 50px !important;
}

.cx-sidebar-scroll {
    padding: 10px 8px 22px !important;
}

.cx-nav-section {
    padding: 18px 14px 8px !important;
}

.cx-nav-section span {
    color: rgba(255, 255, 255, .42) !important;
    font-size: .66rem !important;
    letter-spacing: .12em !important;
}

.cx-nav {
    gap: 4px !important;
}

.cx-nav-link {
    min-height: 44px !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 1px solid transparent !important;
    border-left: 0 !important;
    border-radius: 10px !important;
    color: rgba(255, 255, 255, .72) !important;
    font-size: .86rem !important;
    font-weight: 650 !important;
    transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .16s ease !important;
}

.cx-nav-link:hover,
.cx-nav-link:focus-visible {
    color: #fff !important;
    border-color: rgba(255, 255, 255, .06) !important;
    background: rgba(255, 255, 255, .065) !important;
    transform: translateX(1px);
}

.cx-nav-link.active {
    color: #fff !important;
    border-color: rgba(96, 165, 250, .34) !important;
    background: linear-gradient(135deg, rgba(37, 99, 235, .98), rgba(29, 78, 216, .95)) !important;
    box-shadow: 0 8px 22px rgba(37, 99, 235, .20) !important;
}

.cx-nav-link.active::before {
    content: "";
    width: 3px;
    height: 22px;
    position: absolute;
    left: 0;
    border-radius: 0 5px 5px 0;
    background: var(--cxv-success);
}

.cx-nav-link {
    position: relative;
}

.cx-nav-icon {
    opacity: .88 !important;
}

.cx-submenu {
    margin: 2px 4px 6px !important;
    padding: 4px !important;
    border-radius: 10px;
    background: rgba(255, 255, 255, .025) !important;
}

.cx-submenu a {
    min-height: 36px !important;
    padding: 8px 12px 8px 45px !important;
    border-radius: 8px;
}

.cx-submenu a::before {
    left: 28px !important;
}

.cx-submenu a.active {
    background: rgba(37, 99, 235, .18) !important;
}

.cx-principal-scope-note {
    margin: 18px 8px !important;
    border-radius: 14px !important;
    border-color: rgba(96, 165, 250, .20) !important;
    background: linear-gradient(145deg, rgba(37, 99, 235, .10), rgba(16, 185, 129, .045)) !important;
}

.cx-sidebar-footer {
    min-height: 76px !important;
    padding: 14px 18px !important;
    background: rgba(0, 0, 0, .18) !important;
}

.cx-sidebar-footer-mark {
    width: 38px !important;
    height: 38px !important;
    border-radius: 11px !important;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}

/* Barra superior y contexto */
.cx-topbar {
    min-height: 82px !important;
    padding: 12px 26px !important;
    border-bottom-color: rgba(226, 232, 240, .92) !important;
    background: rgba(255, 255, 255, .92) !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02), 0 8px 28px rgba(15, 23, 42, .035) !important;
    backdrop-filter: blur(16px) saturate(145%) !important;
}

.cx-breadcrumb {
    margin-bottom: 5px !important;
    color: #7c879b !important;
    font-size: .67rem !important;
    font-weight: 800 !important;
    letter-spacing: .08em !important;
}

.cx-topbar h1 {
    color: var(--cxv-ink) !important;
    font-size: clamp(1.18rem, 1.5vw, 1.42rem) !important;
    font-weight: 800 !important;
    letter-spacing: -.018em;
}

.cx-account-context {
    overflow: hidden;
    border: 1px solid var(--cxv-border) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: var(--cxv-shadow-xs) !important;
}

.cx-context-segment,
.cx-branch-context {
    min-height: 58px !important;
}

.cx-context-icon,
.cx-user-avatar,
.cx-branch-pill {
    border-radius: 11px !important;
}

.cx-user-menu {
    border-radius: 14px !important;
    box-shadow: 0 20px 48px rgba(15, 23, 42, .14) !important;
}

/* Área de contenido */
.cx-content {
    min-height: calc(100vh - 82px);
    padding: 24px 28px 38px !important;
    background:
        radial-gradient(circle at 96% 0%, rgba(37, 99, 235, .035), transparent 24%),
        linear-gradient(180deg, #f8fafe 0, var(--cxv-canvas) 210px) !important;
}

/* Tipografía de contenido */
.cx-content h2,
.cx-content h3,
.cx-content h4,
.cx-content .vm-card-title,
.cx-content .card-title {
    color: var(--cxv-ink);
    letter-spacing: -.015em;
}

.cx-content h2,
.cx-content .h2 {
    font-weight: 800;
}

.cx-content h3,
.cx-content .h3,
.cx-content .vm-card-title {
    font-weight: 780;
}

.cx-content p,
.cx-content .text-muted,
.cx-content .vm-muted {
    color: var(--cxv-muted) !important;
}

/* Tarjetas, paneles y módulos */
.vm-card,
.vm-action-card,
.vm-stat-card,
.purchase-kpi-card,
.vm-product-summary-card,
.erp-hero,
.erp-panel,
.erp-stat,
.erp-module-card,
.cx-data-card,
.cx-kpi-card,
.cx-admin-card,
.cx-admin-kpi,
.cx-ind-card,
.cx-ind-kpi,
.cx-close-kpi,
.cx-close-note-card,
.cx-close-side-card,
.cx-close-save-card,
.cx-dashboard-kpi,
.cx-dashboard-module-card,
.cx-dashboard-side-card,
.cx-rule-card,
.cx-order-rule-card,
.card,
.accordion-item {
    border: 1px solid var(--cxv-border) !important;
    border-radius: var(--cxv-radius-lg) !important;
    background: var(--cxv-card) !important;
    box-shadow: var(--cxv-shadow-sm) !important;
}

.vm-card,
.erp-panel,
.cx-data-card,
.card {
    overflow: hidden;
}

.vm-action-card,
.erp-module-card,
.cx-dashboard-module-card {
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease !important;
}

.vm-action-card:hover,
.erp-module-card:hover,
.cx-dashboard-module-card:hover {
    transform: translateY(-2px) !important;
    border-color: #bfdbfe !important;
    box-shadow: var(--cxv-shadow-md) !important;
}

.erp-hero,
.cx-admin-hero,
.cx-ind-hero,
.cx-module-hero,
.cx-orders-hero,
.cx-procurement-hero,
.cx-close-hero,
.cx-dashboard-hero,
.cx-feature-hero,
.cx-recipe-hero {
    border: 1px solid #dbe7fb !important;
    border-radius: var(--cxv-radius-xl) !important;
    background:
        radial-gradient(circle at 92% 18%, rgba(16, 185, 129, .09), transparent 27%),
        linear-gradient(135deg, #ffffff 0%, #fbfdff 58%, #eef6ff 100%) !important;
    box-shadow: var(--cxv-shadow-sm) !important;
}

.erp-panel-head,
.cx-data-card-header,
.card-header {
    border-bottom: 1px solid var(--cxv-border-soft) !important;
    background: linear-gradient(180deg, #fff, #fcfdff) !important;
}

/* KPI */
.cx-kpi-grid,
.cx-admin-kpis,
.cx-ind-kpis,
.cx-close-kpis,
.cx-dashboard-kpis,
.erp-stats {
    gap: 14px !important;
}

.cx-kpi-card,
.cx-admin-kpi,
.cx-ind-kpi,
.cx-close-kpi,
.cx-dashboard-kpi,
.erp-stat,
.vm-stat-card,
.purchase-kpi-card {
    min-height: 112px;
    position: relative;
    overflow: hidden;
}

.cx-kpi-card::after,
.cx-admin-kpi::after,
.cx-ind-kpi::after,
.cx-close-kpi::after,
.cx-dashboard-kpi::after,
.erp-stat::after,
.vm-stat-card::after,
.purchase-kpi-card::after {
    content: "";
    width: 88px;
    height: 88px;
    position: absolute;
    right: -34px;
    bottom: -38px;
    border-radius: 50%;
    background: rgba(37, 99, 235, .035);
    pointer-events: none;
}

.cx-kpi-card strong,
.cx-admin-kpi strong,
.cx-ind-kpi strong,
.cx-close-kpi strong,
.cx-dashboard-kpi strong,
.erp-stat strong,
.vm-stat-card strong,
.purchase-kpi-card strong {
    color: var(--cxv-ink) !important;
    font-variant-numeric: tabular-nums;
}

.cx-kpi-icon,
.cx-dashboard-kpi-icon {
    border-radius: 12px !important;
}

/* Formularios */
.cx-content .form-label,
.cx-content label:not(.form-check-label) {
    margin-bottom: 6px;
    color: #344054;
    font-size: .82rem;
    font-weight: 720;
}

.cx-content .form-control,
.cx-content .form-select,
.cx-content .input-group-text,
.cx-content textarea.form-control {
    min-height: 42px;
    border-color: #d7deea;
    border-radius: var(--cxv-radius-sm);
    color: #243047;
    background-color: #fff;
    box-shadow: inset 0 1px 1px rgba(15, 23, 42, .015);
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.cx-content textarea.form-control {
    min-height: 96px;
}

.cx-content .form-control:hover,
.cx-content .form-select:hover {
    border-color: #bec9d9;
}

.cx-content .form-control:focus,
.cx-content .form-select:focus,
.cx-content textarea.form-control:focus {
    border-color: #60a5fa !important;
    box-shadow: var(--cxv-ring) !important;
}

.cx-content .form-control::placeholder {
    color: #98a2b3;
}

.cx-content .form-control:disabled,
.cx-content .form-select:disabled,
.cx-content .form-control[readonly] {
    color: #667085;
    background: #f8fafc;
}

.cx-content .form-check-input {
    width: 1.08rem;
    height: 1.08rem;
    border-color: #bdc7d6;
}

.cx-content .form-check-input:checked {
    border-color: var(--cxv-primary);
    background-color: var(--cxv-primary);
}

.cx-content .form-check-input:focus {
    box-shadow: var(--cxv-ring);
}

/* Botones */
.cx-content .btn,
.cx-topbar .btn,
.modal .btn {
    min-height: 40px;
    padding: .56rem .9rem;
    border-radius: 10px !important;
    font-size: .84rem;
    font-weight: 750;
    box-shadow: none;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background-color .14s ease;
}

.cx-content .btn:hover,
.cx-topbar .btn:hover,
.modal .btn:hover {
    transform: translateY(-1px);
}

.cx-content .btn:active,
.cx-topbar .btn:active,
.modal .btn:active {
    transform: translateY(0);
}

.btn-primary {
    border-color: var(--cxv-primary) !important;
    background: var(--cxv-primary) !important;
    box-shadow: 0 7px 16px rgba(37, 99, 235, .13) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    border-color: var(--cxv-primary-hover) !important;
    background: var(--cxv-primary-hover) !important;
    box-shadow: 0 9px 19px rgba(37, 99, 235, .18) !important;
}

.btn-success {
    border-color: #0ea874 !important;
    background: #0ea874 !important;
}

.btn-outline-primary {
    border-color: #a9c6fb !important;
    color: #1d4ed8 !important;
    background: #fff !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    border-color: #2563eb !important;
    color: #fff !important;
    background: #2563eb !important;
}

.btn-outline-secondary,
.btn-outline-dark {
    border-color: #d5dce7 !important;
    color: #475467 !important;
    background: #fff !important;
}

.btn-outline-secondary:hover,
.btn-outline-dark:hover {
    border-color: #c3cbd7 !important;
    color: #1f2937 !important;
    background: #f8fafc !important;
}

.btn-outline-danger {
    border-color: #fecaca !important;
    color: #dc2626 !important;
    background: #fff !important;
}

.btn-outline-danger:hover {
    border-color: #ef4444 !important;
    color: #fff !important;
    background: #ef4444 !important;
}

.btn-sm {
    min-height: 34px !important;
    padding: .4rem .72rem !important;
    border-radius: 9px !important;
}

/* Tablas */
.table-responsive,
.erp-table-wrap,
.cx-admin-table-wrap,
.cx-ind-table-wrap,
.cx-close-table-wrap,
.cx-products-table-wrap,
.cx-procurement-table {
    border-radius: 14px;
    scrollbar-gutter: stable;
}

.cx-content .table,
.cx-data-table,
.erp-table,
.cx-admin-table,
.cx-ind-table,
.cx-close-table,
.cx-products-table,
.cx-procurement-table {
    margin-bottom: 0;
    color: #344054;
    font-size: .86rem;
}

.cx-content .table > :not(caption) > * > *,
.cx-data-table th,
.cx-data-table td,
.erp-table th,
.erp-table td,
.cx-admin-table th,
.cx-admin-table td,
.cx-ind-table th,
.cx-ind-table td,
.cx-close-table th,
.cx-close-table td,
.cx-products-table th,
.cx-products-table td,
.cx-procurement-table th,
.cx-procurement-table td {
    padding: 12px 13px;
    border-bottom-color: #edf1f6;
    vertical-align: middle;
}

.cx-content .table thead th,
.cx-data-table thead th,
.erp-table thead th,
.cx-admin-table thead th,
.cx-ind-table thead th,
.cx-close-table thead th,
.cx-products-table thead th,
.cx-procurement-table thead th {
    color: #657087 !important;
    background: #f7f9fc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-size: .69rem !important;
    font-weight: 850 !important;
    letter-spacing: .045em !important;
    text-transform: uppercase;
    white-space: nowrap;
}

.cx-content .table tbody tr,
.cx-data-table tbody tr,
.erp-table tbody tr,
.cx-admin-table tbody tr,
.cx-ind-table tbody tr,
.cx-close-table tbody tr,
.cx-products-table tbody tr,
.cx-procurement-table tbody tr {
    transition: background-color .13s ease;
}

.cx-content .table tbody tr:hover,
.cx-data-table tbody tr:hover,
.erp-table tbody tr:hover,
.cx-admin-table tbody tr:hover,
.cx-ind-table tbody tr:hover,
.cx-close-table tbody tr:hover,
.cx-products-table tbody tr:hover,
.cx-procurement-table tbody tr:hover {
    background: #fafcff !important;
}

.cx-content .table tbody tr:last-child td,
.cx-data-table tbody tr:last-child td,
.erp-table tbody tr:last-child td {
    border-bottom: 0;
}

.cx-money-cell,
.text-end,
.cx-content td[data-money] {
    font-variant-numeric: tabular-nums;
}

/* Filtros, pestañas y barras de herramientas */
.cx-filter-panel,
.cx-ind-filter,
.cx-admin-filter,
.cx-close-filter,
.cx-search-form,
.erp-toolbar,
.vm-toolbar {
    border: 1px solid var(--cxv-border) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: var(--cxv-shadow-xs) !important;
}

.cx-filter-tabs,
.cx-admin-filter-grid,
.cx-ind-filter-grid,
.cx-close-filter-grid {
    gap: 8px !important;
}

.cx-filter-tab {
    border-radius: 9px !important;
    font-weight: 720 !important;
}

.cx-filter-tab.active {
    color: #fff !important;
    background: var(--cxv-primary) !important;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .14);
}

/* Estados, badges y pills */
.badge,
.vm-badge,
.erp-badge,
.cx-state-badge,
.cx-status-pill,
.cx-admin-pill,
.cx-ind-pill,
.cx-close-pill,
.cx-record-count,
.cx-product-kind,
.cx-module-status-badge,
.cx-feature-status {
    border-radius: 999px !important;
    font-size: .71rem !important;
    font-weight: 800 !important;
    letter-spacing: .01em;
}

.badge.bg-success,
.cx-state-badge.is-active,
.cx-status-pill.is-active {
    color: #047857 !important;
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
}

.badge.bg-danger {
    color: #b42318 !important;
    background: #fff1f2 !important;
    border: 1px solid #fecdd3 !important;
}

.badge.bg-warning {
    color: #a15c00 !important;
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
}

/* Alertas */
.alert,
.cx-alert {
    border-radius: 13px !important;
    border-width: 1px !important;
    box-shadow: var(--cxv-shadow-xs);
    font-size: .86rem;
}

.alert-success {
    color: #086c50 !important;
    border-color: #a7f3d0 !important;
    background: #ecfdf5 !important;
}

.alert-info {
    color: #1e4f8f !important;
    border-color: #bfdbfe !important;
    background: #eff6ff !important;
}

.alert-warning {
    color: #8a5200 !important;
    border-color: #fde68a !important;
    background: #fffbeb !important;
}

.alert-danger {
    color: #a62a2a !important;
    border-color: #fecaca !important;
    background: #fff5f5 !important;
}

.alert:empty,
.cx-alert:empty {
    display: none !important;
}

/* Modales, dropdowns y acordeones */
.modal-content {
    overflow: hidden;
    border: 1px solid var(--cxv-border) !important;
    border-radius: 18px !important;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .20) !important;
}

.modal-header,
.modal-footer {
    border-color: var(--cxv-border-soft) !important;
}

.dropdown-menu {
    border: 1px solid var(--cxv-border) !important;
    border-radius: 12px !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .13) !important;
}

.dropdown-item {
    border-radius: 8px !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--cxv-primary-soft) !important;
    color: #1d4ed8 !important;
}

.accordion-button {
    font-weight: 750;
}

.accordion-button:not(.collapsed) {
    color: #1d4ed8;
    background: #f7faff;
    box-shadow: inset 0 -1px 0 var(--cxv-border-soft);
}

/* Componentes de producto e inventario */
.cx-product-avatar,
.cx-document-icon,
.cx-empty-state-icon,
.cx-rule-icon,
.cx-file-drop-icon {
    border-radius: 12px !important;
}

.cx-product-cell strong,
.cx-document-cell strong,
.cx-origin-cell strong {
    color: var(--cxv-ink) !important;
}

.cx-stock-level,
.cx-progress-track {
    overflow: hidden;
    border-radius: 999px !important;
    background: #edf2f7 !important;
}

.cx-progress-value {
    border-radius: 999px;
}

.cx-empty-state,
.cx-recipe-empty {
    border: 1px dashed #cdd7e5 !important;
    border-radius: 14px !important;
    color: #7b8799 !important;
    background: #fbfcfe !important;
}

.cx-recipe-component {
    border: 1px solid var(--cxv-border) !important;
    border-radius: 14px !important;
    background: #fff !important;
    box-shadow: var(--cxv-shadow-xs) !important;
}

.cx-recipe-summary,
.cx-recipe-note,
.vm-note,
.cx-security-note {
    border-radius: 14px !important;
}

/* Dropzones */
.cx-file-drop {
    border: 1.5px dashed #bfd0e8 !important;
    border-radius: 16px !important;
    background: linear-gradient(180deg, #fbfdff, #f7faff) !important;
    transition: border-color .15s ease, background-color .15s ease;
}

.cx-file-drop:hover {
    border-color: #60a5fa !important;
    background: #f4f8ff !important;
}

/* Tooltips visuales / accesibilidad */
.cx-content a:not(.btn):focus-visible,
.cx-sidebar a:focus-visible,
.cx-topbar button:focus-visible,
.cx-content button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .22);
    outline-offset: 2px;
}

/* Compactación controlada para pantallas de gestión */
@media (min-width: 1200px) {
    .cx-content .row.g-3 {
        --bs-gutter-y: .9rem;
    }

    .erp-page,
    .cx-module-page,
    .cx-admin-page,
    .cx-ind-page,
    .cx-close-page,
    .cx-dashboard-page,
    .cx-feature-page,
    .cx-recipe-page,
    .cx-procurement-page,
    .cx-purchase-orders-page {
        gap: 16px !important;
    }
}

/* Responsive */
@media (max-width: 1199.98px) {
    .cx-content {
        padding: 20px !important;
    }

    .cx-topbar {
        padding-inline: 20px !important;
    }
}

@media (max-width: 991.98px) {
    .cx-sidebar {
        box-shadow: 18px 0 50px rgba(0, 0, 0, .28) !important;
    }

    .cx-content {
        padding: 18px 14px 30px !important;
    }

    .cx-topbar {
        min-height: 74px !important;
        padding: 10px 14px !important;
    }

    .cx-account-context {
        border-radius: 12px !important;
    }

    .erp-hero,
    .cx-admin-hero,
    .cx-ind-hero,
    .cx-module-hero,
    .cx-orders-hero,
    .cx-procurement-hero,
    .cx-close-hero,
    .cx-dashboard-hero,
    .cx-feature-hero,
    .cx-recipe-hero {
        border-radius: 16px !important;
    }
}

@media (max-width: 575.98px) {
    .cx-content {
        padding: 14px 10px 26px !important;
    }

    .vm-card,
    .erp-panel,
    .cx-data-card,
    .card,
    .cx-kpi-card,
    .cx-admin-kpi,
    .cx-ind-kpi,
    .cx-close-kpi,
    .cx-dashboard-kpi {
        border-radius: 14px !important;
    }

    .cx-content .btn {
        min-height: 38px;
    }

    .cx-content .form-control,
    .cx-content .form-select {
        min-height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* CORRECCIÓN CONTRIX: el menú de sesión debe poder salir del contenedor superior.
   Una regla visual posterior usaba overflow:hidden y recortaba el dropdown. */
.cx-account-context {
    overflow: visible !important;
}

.cx-user-dropdown {
    position: relative;
    z-index: 1100;
}

.cx-user-menu {
    z-index: 1200 !important;
}

/* El listado nativo de bancos debe salir completo por fuera de la tarjeta de filtros. */
.bank-history-filter-card {
    position: relative;
    z-index: 20;
    overflow: visible !important;
}

.bank-history-results {
    position: relative;
    z-index: 1;
}

.bank-history-account-select,
.bank-history-account-select option {
    color: #243047 !important;
    background-color: #fff !important;
}


/* Asignación de usuarios a bodegas */
.vm-warehouse-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.vm-warehouse-user-option {
    min-height: 64px;
    padding: 11px 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--cxv-border, #dfe5ee);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.vm-warehouse-user-option:hover {
    border-color: #bcd0fb;
    background: #f8faff;
}

.vm-warehouse-user-option span,
.vm-warehouse-user-option strong,
.vm-warehouse-user-option small {
    display: block;
}

.vm-warehouse-user-option strong {
    color: #273043;
    font-size: .82rem;
}

.vm-warehouse-user-option small {
    margin-top: 4px;
    color: #7a8496;
    font-size: .68rem;
}

.vm-warehouse-users-empty {
    grid-column: 1 / -1;
    padding: 16px;
    border: 1px dashed #d7deea;
    border-radius: 12px;
    color: #7a8496;
    background: #fafbfc;
    font-size: .78rem;
}
