/* =========================================================
   CHW FACTURAS
   Design System
   ========================================================= */


:root {
    --chw-primary: #102A43;
    --chw-primary-light: #243B53;
    --chw-accent: #1D7A8C;
    --chw-background: #F7F9FC;
    --chw-surface: #FFFFFF;
    --chw-text: #243447;
    --chw-muted: #66788A;
    --chw-border: #D9E2EC;
    --chw-success: #16803C;
    --chw-warning: #B7791F;
    --chw-danger: #C53030;
    --chw-info: #1D6FA5;
    --chw-radius: 12px;
    --chw-shadow: 0 4px 18px rgba(16,42,67,.08);
}



/* =========================================================
   BASE
   ========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--chw-background);
    color: var(--chw-text);
}

/* =========================================================
   TIPOGRAFÍA Y ACCESIBILIDAD DE FOCO TECLADO
   Lectura natural (Sentence case); mayúsculas reservadas solo a etiquetas estructurales.
   ========================================================= */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="tab"]:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
    outline: 2px solid #1d4ed8 !important;
    outline-offset: 2px !important;
}

.chw-sidebar a:focus-visible,
.chw-sidebar button:focus-visible {
    outline: 2px solid #93c5fd !important;
    outline-offset: 2px !important;
}

html[data-theme="dark"] a:focus-visible,
html[data-theme="dark"] button:focus-visible,
html[data-theme="dark"] input:focus-visible,
html[data-theme="dark"] select:focus-visible,
html[data-theme="dark"] textarea:focus-visible,
html[data-theme="dark"] [role="tab"]:focus-visible {
    outline-color: #60a5fa !important;
}



/* =========================================================
   APP LAYOUT
   ========================================================= */


.chw-app-shell {
    display: flex;
    min-height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}



.chw-sidebar {
    width: 130px;
    min-width: 130px;
    background: var(--chw-primary);
    color: white;
    flex-shrink: 0;
}



.chw-main-area {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}



.chw-topbar {
    min-height: 52px;
    height: auto;
    background: white;
    border-bottom: 1px solid var(--chw-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 20px;
}



.chw-topbar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}



.chw-topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}



.chw-back-button {
    min-height: 34px;
    padding: 6px 14px;
    font-size: 13px;
    box-shadow: none;
}



.chw-topbar-logo {
    height: 38px;
}



.chw-topbar-title {
    display: flex;
    flex-direction: column;
}



    .chw-topbar-title span {
        font-weight: 600;
    }



    .chw-topbar-title small {
        color: var(--chw-muted);
    }



.chw-content {
    padding: 16px 20px;
    min-width: 0;
    max-width: 100%;
}



/* =========================================================
   NAVIGATION
   ========================================================= */


.chw-nav {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 18px 8px;
    overflow: hidden;
}



.chw-nav-brand {
    text-align: center;
    margin-bottom: 25px;
    overflow: visible;
}



.chw-nav-logo {
    width: 260px;
    max-width: none;
    transform: scale(1.3);
}



.chw-nav-subtitle {
    margin-top: 12px;
    font-size: 13px;
    opacity: .75;
}



.chw-nav-section {
    font-size: 11px;
    letter-spacing: 1px;
    opacity: .65;
    margin: 20px 10px 10px;
}



.chw-nav-section-space {
    margin-top: 35px;
}



.chw-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    padding: 10px 8px;
    border-radius: 10px;
    margin-bottom: 5px;
    font-size: 13px;
    transition: .2s;
}



    .chw-nav-item:hover {
        background: rgba(255,255,255,.10);
    }



    .chw-nav-item.active {
        background: rgba(255,255,255,.18);
    }



.chw-nav-icon {
    width: 22px;
    text-align: center;
}



.chw-nav-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.15);
    padding-top: 20px;
    text-align: center;
}



.chw-nav-footer-title {
    font-weight: 600;
}



.chw-nav-footer-text {
    font-size: 12px;
    opacity: .7;
}



/* =========================================================
   CARDS
   ========================================================= */


.chw-card {
    background: var(--chw-surface);
    border: 1px solid var(--chw-border);
    border-radius: var(--chw-radius);
    box-shadow: var(--chw-shadow);
}



/* =========================================================
   BUTTONS
   ========================================================= */


.chw-btn {
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 600;
    cursor: pointer;
}



.chw-btn-primary {
    background: var(--chw-primary);
    color: white;
}



    .chw-btn-primary:hover {
        background: var(--chw-primary-light);
    }



/* =========================================================
   TABLES
   ========================================================= */


.chw-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--chw-border);
    border-radius: 12px;
    overflow: hidden;
}



    .chw-table th {
        background: #F0F4F8;
        color: var(--chw-primary);
        font-size: 13px;
        text-transform: uppercase;
        padding: 14px;
    }



    .chw-table td {
        padding: 14px;
        border-top: 1px solid var(--chw-border);
    }



    .chw-table tr:hover {
        background: #F8FAFC;
    }



/* =========================================================
   STATUS
   ========================================================= */


.chw-status {
    display: inline-flex;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}



.chw-status-success {
    background: #DCFCE7;
    color: #166534;
}



.chw-status-warning {
    background: #FEF3C7;
    color: #92400E;
}



.chw-status-danger {
    background: #FEE2E2;
    color: #991B1B;
}



.chw-status-info {
    background: #DBEAFE;
    color: #1E40AF;
}



/* =========================================================
   BLAZOR DEFAULT
   ========================================================= */


h1:focus {
    outline: none;
}


.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}


.invalid {
    outline: 1px solid #e50000;
}


.validation-message {
    color: #e50000;
}



.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}


    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }



.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
}



/* =========================================================
   FACTURAS CHW - COMPONENTES UI
   ========================================================= */


.chw-page {
    padding: 0;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}



.chw-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--chw-border);
}



    .chw-card-header h2 {
        margin: 0;
        color: var(--chw-primary);
        font-size: 20px;
    }



    .chw-card-header p {
        margin: 6px 0 0;
        color: var(--chw-muted);
    }



.chw-card-body {
    padding: 24px;
}



.chw-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--chw-muted);
    margin-bottom: 6px;
}



.chw-subtitle {
    color: var(--chw-muted);
    font-size: 16px;
}



.chw-empty-state {
    padding: 32px;
    text-align: center;
    color: var(--chw-muted);
}



.chw-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}



.chw-btn-secondary {
    background: #E9EEF5;
    color: var(--chw-primary);
}



.chw-btn-success {
    background: var(--chw-success);
    color: white;
}



.chw-btn-danger {
    background: var(--chw-danger);
    color: white;
}



.chw-btn-warning {
    background: var(--chw-warning);
    color: white;
}



.chw-btn-outline {
    background: transparent;
    border: 1px solid var(--chw-primary);
    color: var(--chw-primary);
}



.chw-btn:hover {
    transform: translateY(-1px);
    opacity: .92;
}



.chw-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}



.chw-info-item {
    padding: 18px;
    border: 1px solid var(--chw-border);
    border-radius: 10px;
    background: #FAFCFE;
}



.chw-financial-value {
    font-size: 22px;
    color: var(--chw-primary);
}



.chw-invoice-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 24px;
}



.chw-invoice-main h1 {
    margin: 0;
    font-size: 32px;
    color: var(--chw-primary);
}



.chw-invoice-summary {
    text-align: right;
}



.chw-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--chw-primary);
    margin-bottom: 12px;
}



.chw-table-container {
    overflow-x: auto;
}



.chw-document-name {
    display: flex;
    align-items: center;
    gap: 8px;
}



/* =========================================================
   TIMELINE
   ========================================================= */


.chw-timeline {
    position: relative;
    margin-left: 12px;
}



.chw-timeline-item {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
}



.chw-timeline-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}



.chw-timeline-success {
    background: #DCFCE7;
    color: #166534;
}



.chw-timeline-current {
    background: #DBEAFE;
    color: #1E40AF;
}



.chw-timeline-danger {
    background: #FEE2E2;
    color: #991B1B;
}



.chw-timeline-pending {
    background: #E9EEF5;
    color: var(--chw-muted);
}



.chw-timeline-title {
    font-weight: 700;
    color: var(--chw-primary);
}



.chw-timeline-description {
    color: var(--chw-text);
    margin-top: 4px;
}



.chw-timeline-date {
    color: var(--chw-muted);
    font-size: 12px;
    margin-top: 4px;
}



/* =========================================================
   FACTURA RESUMEN KPI
   ========================================================= */


.chw-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}



.chw-summary-item {
    padding: 20px;
    border: 1px solid var(--chw-border);
    border-radius: 14px;
    background: #FFFFFF;
}



.chw-summary-highlight {
    background: linear-gradient( 135deg, #F7FAFC, #EDF2F7 );
}



.chw-summary-value {
    font-size: 17px;
    font-weight: 600;
    color: var(--chw-primary);
}



.chw-summary-money {
    font-size: 26px;
    font-weight: 700;
    color: var(--chw-accent);
}


/* =========================================================
   DISTRIBUCION CENTROS DE COSTO
   ========================================================= */


.chw-cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(280px,1fr));
    gap: 20px;
}



.chw-cost-card {
    border: 1px solid var(--chw-border);
    border-radius: 16px;
    padding: 20px;
    background: white;
}



.chw-cost-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}



    .chw-cost-header h3 {
        margin: 0;
        color: var(--chw-primary);
        font-size: 18px;
    }



.chw-cost-code {
    margin-top: 15px;
    color: var(--chw-muted);
}



.chw-progress {
    margin: 20px 0;
}



.chw-progress-bar {
    height: 10px;
    background: #E9EEF5;
    border-radius: 999px;
    overflow: hidden;
}



.chw-progress-value {
    height: 100%;
    background: var(--chw-accent);
    border-radius: 999px;
}



.chw-cost-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--chw-primary);
}



.chw-total-card {
    margin-top: 20px;
    padding: 20px;
    border-radius: 14px;
    background: #F7FAFC;
    border: 1px solid var(--chw-border);
    display: flex;
    justify-content: space-between;
    font-size: 18px;
}



/* =========================================================
   DOCUMENTOS FACTURA
   ========================================================= */


.chw-documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(320px,1fr));
    gap: 20px;
}



.chw-document-card {
    border: 1px solid var(--chw-border);
    border-radius: 16px;
    padding: 20px;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: .2s;
}



    .chw-document-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--chw-shadow);
    }



.chw-document-icon {
    font-size: 36px;
}



.chw-document-content h3 {
    margin: 0;
    color: var(--chw-primary);
    font-size: 17px;
    word-break: break-word;
}



.chw-document-type {
    display: inline-block;
    margin-top: 8px;
    color: var(--chw-muted);
    font-size: 13px;
}



.chw-document-info {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}



    .chw-document-info div {
        display: flex;
        justify-content: space-between;
        gap: 10px;
    }



    .chw-document-info span {
        color: var(--chw-muted);
    }



.chw-document-actions {
    margin-top: auto;
}



/* =========================================================
   FLUJO DE APROBACIÓN FACTURA
   ========================================================= */


.chw-workflow {
    position: relative;
    padding-left: 20px;
}



.chw-workflow-item {
    display: flex;
    gap: 18px;
    position: relative;
    padding-bottom: 28px;
}



    .chw-workflow-item:not(:last-child)::after {
        content: "";
        position: absolute;
        left: 17px;
        top: 38px;
        width: 2px;
        height: calc(100% - 20px);
        background: var(--chw-border);
    }



.chw-workflow-point {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    z-index: 1;
    flex-shrink: 0;
}



.chw-workflow-success {
    background: #DCFCE7;
    color: #166534;
}



.chw-workflow-current {
    background: #DBEAFE;
    color: #1E40AF;
}



.chw-workflow-danger {
    background: #FEE2E2;
    color: #991B1B;
}



.chw-workflow-neutral {
    background: #E9EEF5;
    color: var(--chw-muted);
}



.chw-workflow-content {
    flex: 1;
    border: 1px solid var(--chw-border);
    border-radius: 14px;
    padding: 16px;
    background: white;
}



.chw-workflow-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}



    .chw-workflow-header h3 {
        margin: 0;
        font-size: 17px;
        color: var(--chw-primary);
    }



    .chw-workflow-header span {
        color: var(--chw-muted);
        font-size: 12px;
    }



.chw-workflow-content p {
    margin: 10px 0;
}



.chw-workflow-user {
    font-size: 13px;
    color: var(--chw-muted);
}



/* =========================================================
   AUDITORIA DOCUMENTAL
   ========================================================= */


.chw-audit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(300px,1fr));
    gap: 20px;
}



.chw-audit-card {
    border: 1px solid var(--chw-border);
    border-radius: 16px;
    padding: 20px;
    background: white;
}



.chw-audit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}



.chw-audit-date {
    font-size: 12px;
    color: var(--chw-muted);
}



.chw-audit-document,
.chw-audit-user {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}



.chw-audit-detail {
    padding: 14px;
    border-radius: 10px;
    background: #F7FAFC;
    color: var(--chw-text);
    font-size: 14px;
}



/* =========================================================
   HOTFIX VISUAL 01
   Bandejas y normalizacion corporativa
   ========================================================= */


html,
body {
    font-family: "Nunito", "Segoe UI", Arial, sans-serif;
}


.chw-main-area,
.chw-content {
    min-width: 0;
}


.chw-page {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    padding: 0;
}


.chw-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    padding: 4px 2px 2px;
}


.chw-page-header h1 {
    margin: 2px 0 3px;
    color: #17213d;
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 800;
    letter-spacing: -.4px;
}


.chw-page-header p {
    max-width: 760px;
    margin: 0;
    color: #667085;
    font-size: 13.5px;
    line-height: 1.35;
}


.chw-page-eyebrow {
    color: #304d93;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
}


.chw-btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 8px 15px;
    font-size: 13.5px;
    line-height: 1.15;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(23, 33, 61, .07);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}


.chw-btn:hover {
    text-decoration: none;
    box-shadow: 0 9px 20px rgba(23, 33, 61, .13);
}


.chw-btn:focus-visible {
    outline: 3px solid rgba(48, 77, 147, .25);
    outline-offset: 2px;
}


.chw-btn:disabled {
    cursor: not-allowed;
    opacity: .55;
    transform: none;
    box-shadow: none;
}


.chw-btn-primary {
    background: #304d93;
}


.chw-btn-primary:hover {
    background: #253e7d;
    color: #fff;
}


.chw-btn-secondary {
    border-color: #dce3ef;
    background: #f1f4f9;
}


.chw-btn-outline {
    border-color: #b8c4d9;
    background: #fff;
    box-shadow: none;
}


.chw-btn-outline:hover {
    border-color: #304d93;
    background: #edf2ff;
    color: #253e7d;
}


.chw-btn-compact {
    min-height: 36px;
    padding: 8px 13px;
    border-radius: 10px;
    font-size: 13px;
}


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

.chw-kpi-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

@media (max-width: 991.98px) {
    .chw-kpi-grid-3 {
        grid-template-columns: 1fr !important;
    }
}


.chw-kpi-card {
    position: relative;
    min-height: 138px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 22px;
    border: 1px solid #dfe5f0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 33, 61, .06);
}


.chw-kpi-card::before {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 5px;
    background: #9aa7bd;
    content: "";
}


.chw-kpi-card-info::before {
    background: #3576b8;
}


.chw-kpi-card-success::before {
    background: #248a54;
}


.chw-kpi-card-accent::before {
    background: #304d93;
}


.chw-kpi-label {
    color: #667085;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .75px;
    text-transform: uppercase;
}


.chw-kpi-card strong {
    margin: 5px 0 1px;
    color: #17213d;
    font-size: 32px;
    line-height: 1;
}


.chw-kpi-card small {
    margin-top: 8px;
    color: #8a93a8;
    font-size: 12px;
}


.chw-table-card {
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(23, 33, 61, .07);
}


.chw-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid #dfe5f0;
    background: linear-gradient(135deg, #fff 0%, #f5f7fc 100%);
}


.chw-search-field {
    width: min(520px, 100%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid #d8e0ec;
    border-radius: 12px;
    background: #fff;
    color: #78859a;
}


.chw-search-field:focus-within {
    border-color: #304d93;
    box-shadow: 0 0 0 3px rgba(48, 77, 147, .11);
}


.chw-search-field input {
    width: 100%;
    min-height: 42px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #17213d;
    font-size: 14px;
}


.chw-search-field input::placeholder {
    color: #9aa4b6;
}


.chw-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}


.chw-select {
    min-height: 38px;
    min-width: 190px;
    border: 1px solid #d8e0ec;
    border-radius: 10px;
    padding: 0 34px 0 12px;
    background-color: #fff;
    color: #344054;
    font-size: 13.5px;
}


.chw-select:focus {
    border-color: #304d93;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(48, 77, 147, .11);
}


.chw-input {
    min-height: 38px;
    border: 1px solid #d8e0ec;
    border-radius: 10px;
    padding: 0 13px;
    background-color: #fff;
    color: #17213d;
    font-size: 13.5px;
}


.chw-input:focus {
    border-color: #304d93;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(48, 77, 147, .11);
}


.chw-input::placeholder {
    color: #9aa4b6;
}


.chw-toolbar .chw-input[type="search"] {
    flex: 1 1 280px;
    min-width: 220px;
    max-width: none;
}


.chw-document-viewer-overlay {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(23, 33, 61, .65);
}


.chw-document-viewer-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(960px, 100%);
    height: min(85vh, 100%);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 20px 48px rgba(23, 33, 61, .28);
    transition: width 0.2s ease, height 0.2s ease;
}

.chw-document-viewer-panel.is-expanded {
    width: min(1440px, 96vw) !important;
    height: min(94vh, 96%) !important;
}


.chw-document-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #dfe5f0;
    background: #f8fafc;
    flex-wrap: wrap;
}

/* Toolbar de Zoom para Visor de Documentos */
.chw-viewer-zoom-controls {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: #eef2f8;
    border: 1px solid #d5deeb;
    border-radius: 8px;
}

.chw-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    min-width: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.chw-zoom-btn:hover {
    background: #ffffff;
    color: #1e3a8a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chw-zoom-btn:active {
    background: #e2e8f0;
    transform: scale(0.96);
}

.chw-zoom-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    min-width: 50px;
    padding: 0 6px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    background: #ffffff;
    color: #1e293b;
    font-size: 12px;
    font-weight: 700;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.chw-zoom-badge:hover {
    border-color: #3b82f6;
    color: #1d4ed8;
}

/* Toolbar de Navegación de PDFs (exclusivo de la factura) */
.chw-viewer-nav-controls {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    background: #eef2f8;
    border: 1px solid #d5deeb;
    border-radius: 8px;
}

.chw-viewer-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: #ffffff;
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: all 0.15s ease;
}

.chw-viewer-nav-btn:hover:not(:disabled) {
    background: #1e3a8a;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(30, 58, 138, 0.2);
}

.chw-viewer-nav-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: #f1f5f9;
    color: #94a3b8;
    box-shadow: none;
}

.chw-viewer-nav-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    padding: 0 8px;
    border-radius: 5px;
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    user-select: none;
}

/* Botones flotantes laterales dentro del visor */
.chw-floating-nav-btn {
    position: absolute;
    top: 55%;
    transform: translateY(-50%);
    z-index: 30;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(15, 23, 42, 0.75);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: all 0.2s ease;
}

.chw-floating-nav-btn:hover {
    background: #1e3a8a;
    border-color: #3b82f6;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.chw-floating-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.chw-floating-nav-prev {
    left: 14px;
}

.chw-floating-nav-next {
    right: 14px;
}

.chw-document-viewer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}


.chw-document-viewer-frame {
    flex: 1 1 auto;
    width: 100%;
    border: 0;
    overflow: auto;
    background: #6b7280;
}


.chw-pdf-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
    min-width: 100%;
    width: fit-content;
    margin: 0 auto;
}


.chw-pdf-container .chw-pdf-page {
    box-shadow: 0 6px 24px rgba(0, 0, 0, .3);
    border-radius: 4px;
    background: #fff;
    display: block;
}


.chw-pdf-container .chw-pdf-error {
    margin-top: 40px;
    padding: 16px;
    border-radius: 10px;
    background: #fff;
    color: #b42318;
    font-weight: 600;
}


.chw-image-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}


.chw-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}


.chw-document-sin-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: #fff;
    color: #344054;
    text-align: center;
}


.chw-invoices-table {
    border: 0;
    border-radius: 0;
}


.chw-table th,
.chw-table td {
    vertical-align: middle;
}


.chw-table th {
    border-right: 1px solid #dfe5f0;
    border-bottom: 1px solid #dfe5f0;
    background: #f2f5fa;
    color: #344054;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .55px;
}


.chw-table td {
    border-top: 0;
    border-right: 1px solid #e5eaf2;
    border-bottom: 1px solid #e5eaf2;
    background: #fff;
    color: #344054;
    font-size: 13px;
}


.chw-table th:last-child,
.chw-table td:last-child {
    border-right: 0;
}


.chw-table tbody tr:last-child td {
    border-bottom: 0;
}


.chw-table tbody tr:hover td {
    background: #f8faff;
}


.chw-table-primary {
    color: #17213d;
    font-weight: 800;
}


.chw-table-secondary {
    margin-top: 3px;
    color: #8a93a8;
    font-size: 11px;
}


.chw-text-end {
    text-align: right;
}


.chw-text-center {
    text-align: center;
}


.chw-money {
    color: #17213d;
    white-space: nowrap;
}


.chw-centers-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}


.chw-count-badge {
    min-width: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 7px;
    border-radius: 999px;
    background: #edf2ff;
    color: #304d93;
    font-size: 11px;
    font-weight: 800;
}


.chw-status {
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    text-align: center;
    line-height: 1.25;
}


.chw-status-paid {
    border-color: #b8e6d0;
    background: #e7f8ef;
    color: #146b3b;
}


.chw-status-accent {
    border-color: #c9d4f1;
    background: #edf2ff;
    color: #304d93;
}


.chw-status-purple {
    border-color: #ddd0f1;
    background: #f4effb;
    color: #6d3f92;
}


.chw-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 20px;
    border-top: 1px solid #dfe5f0;
    background: #fafbfc;
    color: #7c879a;
    font-size: 11px;
}


.chw-empty-state {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


.chw-empty-state strong {
    margin-top: 12px;
    color: #17213d;
    font-size: 16px;
}


.chw-empty-state p {
    max-width: 480px;
    margin: 6px 0 0;
    color: #8a93a8;
}


.chw-empty-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: #edf2ff;
    color: #304d93;
    font-size: 28px;
}


.chw-loading-state {
    gap: 4px;
}


.chw-spinner {
    width: 34px;
    height: 34px;
    margin-bottom: 8px;
    border: 3px solid #dce3ef;
    border-top-color: #304d93;
    border-radius: 50%;
    animation: chw-spin .8s linear infinite;
}


@keyframes chw-spin {
    to {
        transform: rotate(360deg);
    }
}


.chw-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 17px 19px;
    border: 1px solid;
    border-radius: 16px;
}


.chw-alert > div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}


.chw-alert-danger {
    border-color: #f0c4c4;
    background: #fff5f5;
    color: #9f2d2d;
}


/* Normaliza las vistas que aun utilizan componentes Bootstrap. */
.chw-content > .container,
.chw-content > .container-fluid {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto !important;
    padding-right: 0;
    padding-left: 0;
}


.chw-content .card.shadow-sm {
    overflow: hidden;
    border: 1px solid #dfe5f0;
    border-radius: 20px;
    box-shadow: 0 10px 28px rgba(23, 33, 61, .07) !important;
}


.chw-content .card-header {
    padding: 22px 24px;
    border-bottom: 1px solid #dfe5f0;
    background: linear-gradient(135deg, #fff 0%, #f2f5fc 100%);
    color: #17213d;
}


.chw-content .card-header h3,
.chw-content .card-header h4 {
    color: #17213d;
    font-weight: 800;
}


.chw-content .card-body {
    padding: 24px;
}


.chw-content .table-responsive {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #0d6efd #f1f3f5;
    border: 1px solid #dfe5f0;
    border-radius: 14px;
}

.chw-content .table-responsive::-webkit-scrollbar {
    height: 8px;
}

.chw-content .table-responsive::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.chw-content .table-responsive::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 4px;
}

.chw-content .table-responsive::-webkit-scrollbar-thumb:hover {
    background: #0b5ed7;
}

/* Tablas de Pagos y Tesorería: scroll interno sin forzar anchuras desmesuradas */
.pagos-tabla {
    min-width: 1080px;
}

.tesoreria-tabla {
    min-width: 960px;
}

.pagos-tabla th,
.tesoreria-tabla th {
    white-space: nowrap;
}


.chw-content .table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}


.chw-content .table thead th {
    border-right: 1px solid #dfe5f0;
    border-bottom: 1px solid #dfe5f0;
    background: #f2f5fa;
    color: #344054;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .45px;
    text-transform: uppercase;
    vertical-align: middle;
}


.chw-content .table tbody td {
    border-right: 1px solid #e5eaf2;
    border-bottom: 1px solid #e5eaf2;
    background-color: #fff;
    color: #344054;
    vertical-align: middle;
}


.chw-content .table th:last-child,
.chw-content .table td:last-child {
    border-right: 0;
}


.chw-content .table tbody tr:last-child td {
    border-bottom: 0;
}


.chw-content .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-bg-type: #fbfcfe;
}


.chw-content .table-hover > tbody > tr:hover > * {
    --bs-table-bg-state: #f3f6fc;
}


.chw-content .btn {
    min-height: 38px;
    border-radius: 10px;
    padding: 7px 14px;
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(23, 33, 61, .06);
}


.chw-content .btn-sm {
    min-height: 32px;
    padding: 5px 11px;
    border-radius: 8px;
    font-size: 12px;
}


.chw-content .btn-primary {
    border-color: #304d93;
    background: #304d93;
}


.chw-content .btn-primary:hover {
    border-color: #253e7d;
    background: #253e7d;
}


.chw-content .btn-secondary {
    border-color: #d8e0ec;
    background: #edf1f6;
    color: #344054;
}


.chw-content .form-control,
.chw-content .form-select {
    min-height: 38px;
    border-color: #d8e0ec;
    border-radius: 10px;
    color: #17213d;
    font-size: 14px;
    box-sizing: border-box !important;
    max-width: 100% !important;
}

.chw-content .form-control-sm,
.chw-content .form-select-sm {
    min-height: 32px;
    border-radius: 8px;
    font-size: 13px;
    box-sizing: border-box !important;
    max-width: 100% !important;
}

.chw-content .form-control:focus,
.chw-content .form-select:focus {
    border-color: #304d93;
    box-shadow: 0 0 0 3px rgba(48, 77, 147, .11);
}


.chw-content .form-label {
    color: #344054;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}


/* =========================================================
   PATRÓN REUTILIZABLE DE FORMULARIOS (BIFROST CHW)
   ========================================================= */

.chw-form-section {
    padding: 16px 18px;
    border: 1px solid #dfe5f0;
    border-radius: 14px;
    background: #ffffff;
}

.chw-form-section-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eef2f7;
}

.chw-form-step-badge {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #102A43;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    margin-top: 1px;
}

.chw-form-section-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #17213d;
}

.chw-form-section-desc {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: #667085;
}

.chw-field-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.35;
    color: #667085;
}

html[data-theme="dark"] .chw-form-section {
    background: #1e293b;
    border-color: #334155;
}

html[data-theme="dark"] .chw-form-section-header {
    border-bottom-color: #334155;
}

html[data-theme="dark"] .chw-form-step-badge {
    background: #2563eb;
}

html[data-theme="dark"] .chw-form-section-title {
    color: #f1f5f9;
}

html[data-theme="dark"] .chw-form-section-desc,
html[data-theme="dark"] .chw-field-hint {
    color: #94a3b8;
}


.chw-content .alert {
    border-radius: 13px;
}


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

    .chw-toolbar-actions {
        justify-content: flex-end;
    }
}


@media (max-width: 767.98px) {
    .chw-content {
        padding: 20px 16px;
    }

    .chw-page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .chw-page-header .chw-btn {
        width: 100%;
    }

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

    .chw-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .chw-content .card-body {
        padding: 18px;
    }
}


/*
 * Patrón reutilizable de barras de búsqueda y filtro para bandejas en Teams:
 * garantiza ancho legible al buscador sin truncamiento y envuelve limpio en pantallas angostas.
 */
.chw-toolbar {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 12px;
}

.chw-toolbar-actions {
    flex-wrap: wrap;
    flex-shrink: 0;
}

.chw-filtro-fila {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

.chw-filtro-fila > .chw-filtro-buscador {
    flex: 1 1 240px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.chw-filtro-fila > .chw-filtro-selector {
    flex: 0 1 240px !important;
    width: 100% !important;
    max-width: 240px !important;
    min-width: 140px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Barra de control para Facturas Importadas DIAN */
.compras-importadas-toolbar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
}

/* Utilidades Flexbox globales */
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

/* Alineación transversal (Align Items) */
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-stretch { align-items: stretch !important; }
.align-items-baseline { align-items: baseline !important; }
.align-self-center { align-self: center !important; }
.align-self-start { align-self: flex-start !important; }
.align-self-end { align-self: flex-end !important; }

/* Alineación longitudinal (Justify Content) */
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }
.justify-content-evenly { justify-content: space-evenly !important; }

/* Separación (Gap) */
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 16px !important; }
.gap-4 { gap: 24px !important; }

/* Tabla bandeja compras */
.compras-bandeja-tabla {
    width: 100%;
}

.compras-tabla-scroll,
.aprobaciones-tabla-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #0d6efd #f1f3f5;
    padding-bottom: 6px;
}

.compras-tabla-scroll::-webkit-scrollbar,
.aprobaciones-tabla-scroll::-webkit-scrollbar {
    height: 8px;
}

.compras-tabla-scroll::-webkit-scrollbar-track,
.aprobaciones-tabla-scroll::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.compras-tabla-scroll::-webkit-scrollbar-thumb,
.aprobaciones-tabla-scroll::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 4px;
}

.compras-tabla-scroll::-webkit-scrollbar-thumb:hover,
.aprobaciones-tabla-scroll::-webkit-scrollbar-thumb:hover {
    background: #0b5ed7;
}

.compras-tabla {
    min-width: 1180px;
    width: 100%;
    margin-bottom: 0;
}

.aprobaciones-tabla {
    min-width: 920px;
    width: 100%;
    margin-bottom: 0;
}

.compras-tabla th,
.aprobaciones-tabla th {
    white-space: nowrap;
    color: #68738a;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 12px 14px;
}

.compras-tabla td,
.aprobaciones-tabla td {
    padding: 12px 14px;
    vertical-align: middle;
}

.compras-tabla-scroll.dragging,
.compras-importadas-scroll.dragging,
.aprobaciones-tabla-scroll.dragging {
    cursor: grabbing;
    cursor: -webkit-grabbing;
    user-select: none;
}

/* Tabla importaciones Excel */
.compras-importadas-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #0d6efd #f1f3f5;
    padding-bottom: 6px;
}

.compras-importadas-scroll::-webkit-scrollbar {
    height: 8px;
}

.compras-importadas-scroll::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.compras-importadas-scroll::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 4px;
}

.compras-importadas-scroll::-webkit-scrollbar-thumb:hover {
    background: #0b5ed7;
}

.compras-importadas-tabla {
    min-width: 1600px;
    white-space: nowrap;
}

/* =========================================================
   RESALTE Y SELECCIÓN DE FILAS EN TODAS LAS TABLAS DE LA APP
   ========================================================= */

/* Cursor pointer y transición suave en todas las filas de tablas */
table tbody > tr {
    cursor: pointer;
    transition: opacity 0.2s ease, background-color 0.15s ease, filter 0.2s ease;
}

/* Fila seleccionada: resaltada con fondo azul claro y borde indicador */
table tbody > tr.chw-row-selected,
table tbody > tr.table-active,
table tbody > tr.selected-row {
    opacity: 1 !important;
    filter: none !important;
    background-color: #dbeafe !important;
    box-shadow: inset 4px 0 0 #1d4ed8 !important;
    position: relative;
    z-index: 2;
}

table tbody > tr.chw-row-selected > td,
table tbody > tr.chw-row-selected > th,
table tbody > tr.table-active > td,
table tbody > tr.table-active > th,
table tbody > tr.selected-row > td,
table tbody > tr.selected-row > th {
    background-color: #dbeafe !important;
    color: #0f172a !important;
}

/* Fila seleccionada con estado de alerta o vencimiento mantiene tinte de peligro con borde */
table tbody > tr.chw-row-selected.table-danger,
table tbody > tr.table-active.table-danger {
    background-color: #fee2e2 !important;
    box-shadow: inset 4px 0 0 #dc2626 !important;
}

table tbody > tr.chw-row-selected.table-danger > td,
table tbody > tr.table-active.table-danger > td {
    background-color: #fee2e2 !important;
    color: #7f1d1d !important;
}

/* Cuando una tabla tiene una fila seleccionada, opacar todas las demás filas */
table.chw-has-selected:not([data-multiselect]):not(.compras-tabla):not(.pagos-tabla) tbody > tr:not(.chw-row-selected):not(.table-active):not(.selected-row),
table:not([data-multiselect]):not(.compras-tabla):not(.pagos-tabla):has(tbody > tr.chw-row-selected) tbody > tr:not(.chw-row-selected):not(.table-active):not(.selected-row),
table:not([data-multiselect]):not(.compras-tabla):not(.pagos-tabla):has(tbody > tr.table-active) tbody > tr:not(.chw-row-selected):not(.table-active):not(.selected-row),
table:not([data-multiselect]):not(.compras-tabla):not(.pagos-tabla):has(tbody > tr.selected-row) tbody > tr:not(.chw-row-selected):not(.table-active):not(.selected-row) {
    opacity: 0.35 !important;
    filter: grayscale(15%);
}

/* Tablas multiseleccion (Compras, Pagos, o con data-multiselect): nunca opacar filas no seleccionadas */
table.compras-tabla tbody > tr,
table.pagos-tabla tbody > tr,
table[data-multiselect] tbody > tr {
    opacity: 1 !important;
    filter: none !important;
}

table.compras-tabla tbody > tr.chw-row-selected,
table.pagos-tabla tbody > tr.chw-row-selected,
table[data-multiselect] tbody > tr.chw-row-selected {
    background-color: #dbeafe !important;
    box-shadow: inset 4px 0 0 #1d4ed8 !important;
}

table.compras-tabla tbody > tr.chw-row-selected > td,
table.pagos-tabla tbody > tr.chw-row-selected > td,
table[data-multiselect] tbody > tr.chw-row-selected > td {
    background-color: #dbeafe !important;
    color: #0f172a !important;
}

/* Al pasar el mouse por una fila opacada, aumentar visibilidad */
table.chw-has-selected tbody > tr:not(.chw-row-selected):not(.table-active):not(.selected-row):hover,
table:has(tbody > tr.chw-row-selected) tbody > tr:not(.chw-row-selected):not(.table-active):not(.selected-row):hover,
table:has(tbody > tr.table-active) tbody > tr:not(.chw-row-selected):not(.table-active):not(.selected-row):hover,
table:has(tbody > tr.selected-row) tbody > tr:not(.chw-row-selected):not(.table-active):not(.selected-row):hover {
    opacity: 0.85 !important;
    filter: none !important;
    background-color: #f1f5f9;
}

#blazor-error-ui {
    background: #fff3cd;
    color: #664d03;
    border-top: 2px solid #ffecb5;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
    display: none;
    left: 0;
    padding: 0.75rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
    font-size: 14px;
    align-items: center;
    justify-content: space-between;
}

#blazor-error-ui .reload {
    margin-left: 1rem;
    color: #0d6efd;
    text-decoration: underline;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    margin-left: auto;
    padding: 0 0.5rem;
    font-size: 16px;
    color: #664d03;
}

/* =========================================================
   MODALES FLOTANTES / VENTANAS EMERGENTES GLOBALES
   ========================================================= */

.modal.show,
.modal.d-block,
.chw-modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 2000 !important;
    background-color: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

.modal-dialog,
.chw-modal-dialog {
    width: 100% !important;
    max-width: 560px !important;
    margin: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal-dialog.modal-xl,
.chw-modal-dialog.modal-xl,
.modal-dialog.modal-wide,
.modal-xl {
    max-width: 1200px !important;
    width: 95vw !important;
}

.modal-dialog.modal-lg,
.chw-modal-dialog.modal-lg,
.modal-lg {
    max-width: 920px !important;
    width: 92vw !important;
}

.modal-content,
.chw-modal-content {
    width: 100% !important;
    max-height: calc(100vh - 48px) !important;
    background: #ffffff !important;
    border-radius: 18px !important;
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.35) !important;
    border: 1px solid #e2e8f0 !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    animation: chwModalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.modal-header,
.chw-modal-header {
    padding: 20px 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.chw-modal-title {
    margin: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    color: #1e293b !important;
}

.modal-body,
.chw-modal-body {
    padding: 20px 24px !important;
}

.modal-footer,
.chw-modal-footer {
    padding: 16px 24px !important;
    border-top: 1px solid #e2e8f0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    background: #fafafa !important;
    border-bottom-left-radius: 18px !important;
    border-bottom-right-radius: 18px !important;
}

.btn-close,
.chw-modal-btn-close {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    border: 0 !important;
    background: #f1f5f9 url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2364748b'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.414 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/12px auto no-repeat !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.15s, transform 0.1s !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
}

.btn-close:hover,
.chw-modal-btn-close:hover {
    background-color: #e2e8f0 !important;
    transform: scale(1.05) !important;
}

.chw-modal-info-card {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 16px !important;
}

.chw-modal-info-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-bottom: 8px !important;
    margin-bottom: 8px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    gap: 12px !important;
}

.chw-modal-info-label {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    color: #64748b !important;
    letter-spacing: 0.5px !important;
}

.chw-modal-info-value {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    text-align: right !important;
}

.chw-modal-info-value-lg {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
}

.chw-modal-info-valor {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #16803c !important;
}

@keyframes chwModalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* =========================================================
   MODO MANTENIMIENTO SELECTIVO
   ========================================================= */

.chw-maintenance-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #0b1329 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
    padding: 20px !important;
    overflow: hidden !important;
}

.chw-maintenance-box {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
}

.chw-maintenance-img {
    max-width: 100% !important;
    max-height: 90vh !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
}

.chw-maintenance-banner {
    background: linear-gradient(90deg, #b7791f 0%, #d69e2e 100%) !important;
    color: #ffffff !important;
    padding: 10px 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    box-shadow: 0 2px 8px rgba(183, 121, 31, 0.25) !important;
    z-index: 100 !important;
    letter-spacing: 0.5px !important;
    border-bottom: 2px solid #975a16 !important;
}

.chw-maintenance-banner-icon {
    font-size: 18px !important;
}




/* =========================================================================
   BIFROST CHW - SPLASH LOADER OVERLAY
   ========================================================================= */
.bifrost-splash-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background-color: #030712;
    overflow: hidden;
    opacity: 1;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

.bifrost-splash-container.bifrost-fade-out {
    opacity: 0;
    pointer-events: none;
}

.bifrost-splash-iframe {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
    display: block;
}


/* =========================================================================
   CONTRASTE DE BOTONES, MODO "VER COMO" Y TEMA DÍA / NOCHE
   ========================================================================= */

/* --- 1. CORRECCIÓN DE CONTRASTE EN BOTONES AZULES Y ACCIONES --- */
.btn-primary,
.chw-content .btn-primary,
button.btn-primary,
a.btn-primary {
    background: #1e40af !important;
    background-color: #1e40af !important;
    border-color: #1d4ed8 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

.btn-primary span,
.btn-primary strong,
.chw-content .btn-primary span,
.chw-content .btn-primary strong {
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.chw-content .btn-primary:hover,
.chw-content .btn-primary:focus,
.chw-content .btn-primary:active {
    background: #1d4ed8 !important;
    background-color: #1d4ed8 !important;
    border-color: #1e3a8a !important;
    color: #ffffff !important;
}

.btn-primary:disabled,
.chw-content .btn-primary:disabled {
    background: #64748b !important;
    background-color: #64748b !important;
    border-color: #64748b !important;
    color: #f1f5f9 !important;
    opacity: 0.65 !important;
}

.btn-success,
.chw-content .btn-success {
    background-color: #15803d !important;
    border-color: #166534 !important;
    color: #ffffff !important;
}

.btn-success span,
.chw-content .btn-success span {
    color: #ffffff !important;
}

.btn-danger,
.chw-content .btn-danger {
    background-color: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.btn-danger span,
.chw-content .btn-danger span {
    color: #ffffff !important;
}

.btn-outline-primary,
.chw-content .btn-outline-primary {
    color: #1d4ed8 !important;
    border-color: #2563eb !important;
    background-color: #eff6ff !important;
    font-weight: 700 !important;
}

.btn-outline-primary:hover,
.chw-content .btn-outline-primary:hover {
    background-color: #1e40af !important;
    border-color: #1e40af !important;
    color: #ffffff !important;
}

.btn-light,
.chw-content .btn-light {
    background-color: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
    font-weight: 700 !important;
}

.btn-light:hover,
.chw-content .btn-light:hover {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
}

/* --- 2. BOTONES DE TOPBAR: TEMA Y VER COMO --- */
.chw-btn-theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--chw-border);
    background: var(--chw-surface);
    color: var(--chw-text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chw-btn-theme-toggle:hover {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.08);
}

.chw-btn-impersonar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid #2563eb;
    background: #eff6ff;
    color: #1e40af;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chw-btn-impersonar:hover {
    background: #1e40af;
    color: #ffffff;
}

.chw-btn-impersonar-active {
    background: #f59e0b !important;
    border-color: #d97706 !important;
    color: #1e293b !important;
}

/* --- 3. BANNER Y MODAL DE IMPERSONACIÓN ("VER COMO") --- */
.chw-impersonation-banner {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    color: #1e293b;
    padding: 10px 24px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 2px solid #d97706;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.25);
    z-index: 95;
}

.chw-btn-cambiar-impersonar {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid #b45309 !important;
    color: #1e293b !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    padding: 5px 12px !important;
}

.chw-btn-cambiar-impersonar:hover {
    background: #ffffff !important;
}

.chw-btn-salir-impersonar {
    background: #1e293b !important;
    border: 1px solid #0f172a !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    padding: 5px 12px !important;
}

.chw-btn-salir-impersonar:hover {
    background: #0f172a !important;
}

.chw-impersonar-modal {
    border-radius: 16px;
    overflow: hidden;
}

.chw-impersonar-modal-header {
    background: linear-gradient(135deg, #102a43 0%, #1e40af 100%);
    color: #ffffff;
    padding: 16px 24px;
    border-bottom: none;
}

.chw-impersonar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1e40af;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    flex-shrink: 0;
}

.chw-role-badge {
    background: #e2e8f0;
    color: #334155;
    font-size: 11px;
    font-weight: 700;
}

.chw-impersonar-item-active {
    background-color: #eff6ff !important;
    border-left: 4px solid #2563eb !important;
}

/* --- 4. MODO NOCHE (DARK THEME) --- */
html[data-theme="dark"],
body[data-theme="dark"] {
    --chw-primary: #f1f5f9;
    --chw-primary-light: #cbd5e1;
    --chw-accent: #38bdf8;
    --chw-background: #0b1120;
    --chw-surface: #1e293b;
    --chw-text: #f1f5f9;
    --chw-muted: #94a3b8;
    --chw-border: #334155;
    --chw-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    background-color: #0b1120 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .chw-topbar {
    background: #1e293b !important;
    border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .chw-topbar-title span {
    color: #f8fafc !important;
}

html[data-theme="dark"] .chw-topbar-user {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .chw-back-button {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .chw-btn-theme-toggle {
    background: #0f172a !important;
    border-color: #475569 !important;
    color: #fbbf24 !important;
}

html[data-theme="dark"] .chw-btn-impersonar {
    background: #1e3a8a !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .chw-card,
html[data-theme="dark"] .card {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .bg-white {
    background-color: #1e293b !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .modal-footer.bg-light,
html[data-theme="dark"] .card-body.bg-light {
    background-color: #0f172a !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .text-dark {
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .text-muted {
    color: #94a3b8 !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 {
    color: #f8fafc !important;
}

html[data-theme="dark"] .table {
    --bs-table-bg: #1e293b;
    --bs-table-color: #f1f5f9;
    --bs-table-border-color: #334155;
    --bs-table-hover-bg: #26354a;
    --bs-table-hover-color: #ffffff;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .table-light th,
html[data-theme="dark"] .table-light {
    background-color: #0f172a !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}

html[data-theme="dark"] .table td,
html[data-theme="dark"] .table th {
    border-color: #334155 !important;
    color: #e2e8f0 !important;
}

html[data-theme="dark"] .table tbody tr:hover td {
    background-color: #26354a !important;
}

html[data-theme="dark"] .chw-row-selected td {
    background-color: rgba(37, 99, 235, 0.28) !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] input.form-control,
html[data-theme="dark"] select.form-select,
html[data-theme="dark"] textarea.form-control {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .form-control::placeholder {
    color: #64748b !important;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    background-color: #0f172a !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
}

html[data-theme="dark"] .modal-content {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: #334155 !important;
}

html[data-theme="dark"] .list-group-item {
    background-color: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

html[data-theme="dark"] .list-group-item:hover {
    background-color: #26354a !important;
}

html[data-theme="dark"] .chw-impersonar-item-active {
    background-color: rgba(37, 99, 235, 0.22) !important;
    border-left: 4px solid #3b82f6 !important;
}

html[data-theme="dark"] .btn-light,
html[data-theme="dark"] .chw-content .btn-light,
html[data-theme="dark"] .btn-secondary,
html[data-theme="dark"] .chw-content .btn-secondary {
    background-color: #334155 !important;
    border-color: #475569 !important;
    color: #f8fafc !important;
}

html[data-theme="dark"] .btn-light:hover,
html[data-theme="dark"] .chw-content .btn-light:hover,
html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .chw-content .btn-secondary:hover {
    background-color: #475569 !important;
    border-color: #64748b !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-outline-primary,
html[data-theme="dark"] .chw-content .btn-outline-primary {
    background-color: rgba(37, 99, 235, 0.15) !important;
    border-color: #3b82f6 !important;
    color: #60a5fa !important;
}

html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .chw-content .btn-outline-primary:hover {
    background-color: #2563eb !important;
    border-color: #3b82f6 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .btn-outline-secondary,
html[data-theme="dark"] .chw-content .btn-outline-secondary {
    background-color: transparent !important;
    border-color: #475569 !important;
    color: #cbd5e1 !important;
}

html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .chw-content .btn-outline-secondary:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .badge.bg-light {
    background-color: #334155 !important;
    color: #f1f5f9 !important;
    border: 1px solid #475569 !important;
}

html[data-theme="dark"] .alert-light {
    background-color: #0f172a !important;
    border-color: #334155 !important;
    color: #cbd5e1 !important;
}

/* =========================================================
   BOTONES DE ACCIÓN SIMÉTRICOS EN TABLAS (BIFROST)
   Todos los botones en columnas de acción tienen dimensiones
   exactamente simétricas (mismo ancho y mismo alto),
   manteniendo su identidad cromática por tipo de acción.
   ========================================================= */

.chw-tabla-acciones,
.contabilidad-acciones,
.tabla-acciones {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    margin: 0 auto !important;
    padding: 2px 0 !important;
}

.chw-tabla-acciones > div,
.contabilidad-acciones > div,
.tabla-acciones > div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 138px !important;
    max-width: 138px !important;
    box-sizing: border-box !important;
}

/* Columna de acciones simétrica */
th.chw-col-acciones,
td.chw-col-acciones {
    width: 154px !important;
    min-width: 154px !important;
    max-width: 170px !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding-left: 6px !important;
    padding-right: 6px !important;
}

/* Reglas estrictas para TODOS los botones de acción en tablas */
.chw-tabla-acciones .btn,
.chw-tabla-acciones a.btn,
.contabilidad-acciones .btn,
.contabilidad-acciones a.btn,
.tabla-acciones .btn,
.tabla-acciones a.btn {
    width: 138px !important;
    min-width: 138px !important;
    max-width: 138px !important;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    padding: 0 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1 !important;
    margin: 0 !important;
    border-width: 1.5px !important;
    border-style: solid !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
    text-decoration: none !important;
}

/* Identidad Cromática de Botones en Tablas - Modo Día */

/* 1. Ver detalle / Outline neutro o azul */
.chw-tabla-acciones .btn-outline-primary,
.contabilidad-acciones .btn-outline-primary,
.tabla-acciones .btn-outline-primary {
    background-color: #ffffff !important;
    color: #1d4ed8 !important;
    border-color: #2563eb !important;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08) !important;
}
.chw-tabla-acciones .btn-outline-primary:hover,
.contabilidad-acciones .btn-outline-primary:hover,
.tabla-acciones .btn-outline-primary:hover {
    background-color: #eff6ff !important;
    color: #1e40af !important;
    border-color: #1d4ed8 !important;
}

.chw-tabla-acciones .btn-outline-secondary,
.contabilidad-acciones .btn-outline-secondary,
.tabla-acciones .btn-outline-secondary {
    background-color: #ffffff !important;
    color: #334155 !important;
    border-color: #94a3b8 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}
.chw-tabla-acciones .btn-outline-secondary:hover,
.contabilidad-acciones .btn-outline-secondary:hover,
.tabla-acciones .btn-outline-secondary:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    border-color: #64748b !important;
}

/* 2. Aprobar / Registrar Pago (Verde Sólido) */
.chw-tabla-acciones .btn-success,
.contabilidad-acciones .btn-success,
.tabla-acciones .btn-success {
    background-color: #15803d !important;
    color: #ffffff !important;
    border-color: #15803d !important;
    box-shadow: 0 1px 2px rgba(21, 128, 61, 0.2) !important;
}
.chw-tabla-acciones .btn-success:hover,
.contabilidad-acciones .btn-success:hover,
.tabla-acciones .btn-success:hover {
    background-color: #166534 !important;
    border-color: #166534 !important;
    color: #ffffff !important;
}

/* 3. Contabilizar / Precontabilizar (Azul Primario Sólido) */
.chw-tabla-acciones .btn-primary,
.contabilidad-acciones .btn-primary,
.tabla-acciones .btn-primary {
    background-color: #1e40af !important;
    color: #ffffff !important;
    border-color: #1e40af !important;
    box-shadow: 0 1px 2px rgba(30, 64, 175, 0.2) !important;
}
.chw-tabla-acciones .btn-primary:hover,
.contabilidad-acciones .btn-primary:hover,
.tabla-acciones .btn-primary:hover {
    background-color: #1e3a8a !important;
    border-color: #1e3a8a !important;
    color: #ffffff !important;
}

/* 4. Devolver / Rechazar a compras (Ámbar/Naranja Alerta) */
.chw-tabla-acciones .btn-warning,
.contabilidad-acciones .btn-warning,
.tabla-acciones .btn-warning {
    background-color: #d97706 !important;
    color: #ffffff !important;
    border-color: #d97706 !important;
    box-shadow: 0 1px 2px rgba(217, 119, 6, 0.2) !important;
}
.chw-tabla-acciones .btn-warning:hover,
.contabilidad-acciones .btn-warning:hover,
.tabla-acciones .btn-warning:hover {
    background-color: #b45309 !important;
    border-color: #b45309 !important;
    color: #ffffff !important;
}

.chw-tabla-acciones .btn-outline-warning,
.contabilidad-acciones .btn-outline-warning,
.tabla-acciones .btn-outline-warning {
    background-color: #fffbeb !important;
    color: #92400e !important;
    border-color: #d97706 !important;
    box-shadow: 0 1px 2px rgba(217, 119, 6, 0.08) !important;
}
.chw-tabla-acciones .btn-outline-warning:hover,
.contabilidad-acciones .btn-outline-warning:hover,
.tabla-acciones .btn-outline-warning:hover {
    background-color: #fef3c7 !important;
    color: #78350f !important;
    border-color: #b45309 !important;
}

/* 5. Peligro / Rechazo / Error (Rojo) */
.chw-tabla-acciones .btn-danger,
.contabilidad-acciones .btn-danger,
.tabla-acciones .btn-danger {
    background-color: #dc2626 !important;
    color: #ffffff !important;
    border-color: #dc2626 !important;
    box-shadow: 0 1px 2px rgba(220, 38, 38, 0.2) !important;
}
.chw-tabla-acciones .btn-danger:hover,
.contabilidad-acciones .btn-danger:hover,
.tabla-acciones .btn-danger:hover {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.chw-tabla-acciones .btn-outline-danger,
.contabilidad-acciones .btn-outline-danger,
.tabla-acciones .btn-outline-danger {
    background-color: #fef2f2 !important;
    color: #b91c1c !important;
    border-color: #ef4444 !important;
}

/* Identidad Cromática en Modo Noche (Dark Mode) */
html[data-theme="dark"] .chw-tabla-acciones .btn-outline-primary,
html[data-theme="dark"] .contabilidad-acciones .btn-outline-primary,
html[data-theme="dark"] .tabla-acciones .btn-outline-primary {
    background-color: rgba(37, 99, 235, 0.15) !important;
    color: #93c5fd !important;
    border-color: #3b82f6 !important;
}
html[data-theme="dark"] .chw-tabla-acciones .btn-outline-primary:hover,
html[data-theme="dark"] .contabilidad-acciones .btn-outline-primary:hover,
html[data-theme="dark"] .tabla-acciones .btn-outline-primary:hover {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .chw-tabla-acciones .btn-outline-secondary,
html[data-theme="dark"] .contabilidad-acciones .btn-outline-secondary,
html[data-theme="dark"] .tabla-acciones .btn-outline-secondary {
    background-color: rgba(148, 163, 184, 0.1) !important;
    color: #cbd5e1 !important;
    border-color: #475569 !important;
}
html[data-theme="dark"] .chw-tabla-acciones .btn-outline-secondary:hover,
html[data-theme="dark"] .contabilidad-acciones .btn-outline-secondary:hover,
html[data-theme="dark"] .tabla-acciones .btn-outline-secondary:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .chw-tabla-acciones .btn-success,
html[data-theme="dark"] .contabilidad-acciones .btn-success,
html[data-theme="dark"] .tabla-acciones .btn-success {
    background-color: #16a34a !important;
    border-color: #16a34a !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .chw-tabla-acciones .btn-success:hover,
html[data-theme="dark"] .contabilidad-acciones .btn-success:hover,
html[data-theme="dark"] .tabla-acciones .btn-success:hover {
    background-color: #22c55e !important;
    border-color: #22c55e !important;
}

html[data-theme="dark"] .chw-tabla-acciones .btn-primary,
html[data-theme="dark"] .contabilidad-acciones .btn-primary,
html[data-theme="dark"] .tabla-acciones .btn-primary {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .chw-tabla-acciones .btn-primary:hover,
html[data-theme="dark"] .contabilidad-acciones .btn-primary:hover,
html[data-theme="dark"] .tabla-acciones .btn-primary:hover {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

html[data-theme="dark"] .chw-tabla-acciones .btn-warning,
html[data-theme="dark"] .contabilidad-acciones .btn-warning,
html[data-theme="dark"] .tabla-acciones .btn-warning {
    background-color: #d97706 !important;
    border-color: #f59e0b !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .chw-tabla-acciones .btn-warning:hover,
html[data-theme="dark"] .contabilidad-acciones .btn-warning:hover,
html[data-theme="dark"] .tabla-acciones .btn-warning:hover {
    background-color: #f59e0b !important;
    border-color: #fbbf24 !important;
}

html[data-theme="dark"] .chw-tabla-acciones .btn-outline-warning,
html[data-theme="dark"] .contabilidad-acciones .btn-outline-warning,
html[data-theme="dark"] .tabla-acciones .btn-outline-warning {
    background-color: rgba(217, 119, 6, 0.15) !important;
    color: #fcd34d !important;
    border-color: #f59e0b !important;
}
html[data-theme="dark"] .chw-tabla-acciones .btn-outline-warning:hover,
html[data-theme="dark"] .contabilidad-acciones .btn-outline-warning:hover,
html[data-theme="dark"] .tabla-acciones .btn-outline-warning:hover {
    background-color: #d97706 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .chw-tabla-acciones .btn-danger,
html[data-theme="dark"] .contabilidad-acciones .btn-danger,
html[data-theme="dark"] .tabla-acciones .btn-danger {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .chw-tabla-acciones .btn-danger:hover,
html[data-theme="dark"] .contabilidad-acciones .btn-danger:hover,
html[data-theme="dark"] .tabla-acciones .btn-danger:hover {
    background-color: #ef4444 !important;
    border-color: #ef4444 !important;
}

/* =========================================================
   BOTONES UIVERSE - FACTURAS IMPORTADAS EXCEL
   ========================================================= */

/* 1. Botón Enviar (From Uiverse.io by adamgiebl) */
.btn-uiverse-enviar {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  background: royalblue;
  color: white;
  padding: 0.5em 0.9em 0.5em 0.8em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(65, 105, 225, 0.25);
  text-decoration: none;
  line-height: 1.2;
}

.btn-uiverse-enviar .svg-wrapper-1 {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-uiverse-enviar span {
  display: block;
  margin-left: 0.4em;
  transition: all 0.3s ease-in-out;
}

.btn-uiverse-enviar svg {
  display: block;
  transform-origin: center center;
  transition: transform 0.3s ease-in-out;
}

.btn-uiverse-enviar:not(:disabled):hover .svg-wrapper {
  animation: fly-1 0.6s ease-in-out infinite alternate;
}

.btn-uiverse-enviar:not(:disabled):hover svg {
  transform: translateX(1.1em) rotate(45deg) scale(1.1);
}

.btn-uiverse-enviar:not(:disabled):hover span {
  transform: translateX(4.2em);
}

.btn-uiverse-enviar:active {
  transform: scale(0.95);
}

.btn-uiverse-enviar:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(40%);
}

@keyframes fly-1 {
  from {
    transform: translateY(0.1em);
  }

  to {
    transform: translateY(-0.1em);
  }
}

/* 2. Botón Adjuntar (From Uiverse.io by vinodjangid07) */
.btn-uiverse-adjuntar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: rgb(20, 20, 20);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0px 0px 0px 3px rgba(180, 160, 255, 0.25);
  cursor: pointer;
  transition-duration: 0.3s;
  overflow: hidden;
  position: relative;
  text-decoration: none;
  margin: 0;
  vertical-align: middle;
}

.btn-uiverse-adjuntar.archivo-cargado {
  background-color: #166534;
  box-shadow: 0px 0px 0px 3px rgba(34, 197, 94, 0.35);
  border-color: rgba(34, 197, 94, 0.4);
}

.btn-uiverse-adjuntar .svgIcon {
  width: 14px;
  height: 14px;
  transition-duration: 0.3s;
}

.btn-uiverse-adjuntar .svgIcon path {
  fill: white;
}

.btn-uiverse-adjuntar:hover {
  width: 120px;
  border-radius: 50px;
  transition-duration: 0.3s;
  background-color: rgb(181, 160, 255);
  align-items: center;
  color: #1a1a1a;
  box-shadow: 0px 0px 10px rgba(181, 160, 255, 0.6);
}

.btn-uiverse-adjuntar.archivo-cargado:hover {
  background-color: #22c55e;
  box-shadow: 0px 0px 10px rgba(34, 197, 94, 0.6);
}

.btn-uiverse-adjuntar:hover .svgIcon {
  transform: translateY(-200%);
}

.btn-uiverse-adjuntar::before {
  position: absolute;
  bottom: -20px;
  content: "Adjuntar";
  color: #141414;
  font-size: 0px;
  font-weight: 700;
  white-space: nowrap;
}

.btn-uiverse-adjuntar.archivo-cargado::before {
  color: #ffffff;
}

.btn-uiverse-adjuntar:hover::before {
  font-size: 13px;
  opacity: 1;
  bottom: unset;
  transition-duration: 0.3s;
}

/* =========================================================
   TARJETA FACTURAS DIAN (MÓDULO FACTURAS)
   ========================================================= */
.chw-dian-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #dfe5f0;
    border-left: 6px solid #17213d;
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: 0 4px 18px rgba(23, 33, 61, 0.05);
}

.chw-dian-card-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.chw-dian-meta {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 220px;
}

.chw-dian-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chw-dian-icon {
    font-size: 28px;
    line-height: 1;
}

.chw-dian-title {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #17213d;
    letter-spacing: -0.3px;
    line-height: 1.1;
}

.chw-dian-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 6px;
    background: #eef2f7;
    color: #475569;
    border: 1px solid #dbe2ea;
    margin-top: 2px;
}

.chw-dian-selector-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chw-dian-selector-group .chw-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    margin: 0;
}

.chw-dian-input {
    max-width: 175px;
    height: 38px;
    font-weight: 600;
    font-size: 14px;
    border-radius: 10px;
}

.chw-dian-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6px 24px;
    border-left: 2px dashed #e2e8f0;
    border-right: 2px dashed #e2e8f0;
    min-width: 240px;
}

.chw-dian-hero-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
}

.chw-dian-hero-value {
    font-size: 42px;
    font-weight: 800;
    color: #17213d;
    line-height: 1;
    margin: 4px 0 2px;
}

.chw-dian-hero-unit {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
}

.chw-dian-hero-sub {
    font-size: 12px;
    color: #64748b;
}

.chw-dian-breakdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 540px;
}

.chw-dian-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 7px 14px;
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.chw-dian-pill strong {
    color: #0f172a;
    font-weight: 700;
}

.chw-dian-pill-money {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.chw-dian-pill-money strong {
    color: #166534;
}

.chw-dian-pill-status {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.chw-dian-pill-status strong {
    color: #1e40af;
}

@media (max-width: 991.98px) {
    .chw-dian-hero {
        border-left: none;
        border-right: none;
        padding: 8px 0;
    }
}

/* Soporte Dark Mode */
html[data-theme="dark"] .chw-dian-card {
    background: #1e293b;
    border-color: #334155;
    border-left-color: #3b82f6;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .chw-dian-title {
    color: #f1f5f9;
}

html[data-theme="dark"] .chw-dian-badge {
    background: #0f172a;
    border-color: #334155;
    color: #94a3b8;
}

html[data-theme="dark"] .chw-dian-hero {
    border-color: #334155;
}

html[data-theme="dark"] .chw-dian-hero-value {
    color: #60a5fa;
}

html[data-theme="dark"] .chw-dian-pill {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

html[data-theme="dark"] .chw-dian-pill strong {
    color: #f8fafc;
}

html[data-theme="dark"] .chw-dian-pill-money {
    background: #064e3b;
    border-color: #059669;
    color: #6ee7b7;
}

html[data-theme="dark"] .chw-dian-pill-money strong {
    color: #a7f3d0;
}

html[data-theme="dark"] .chw-dian-pill-status {
    background: #1e3a8a;
    border-color: #2563eb;
    color: #93c5fd;
}

html[data-theme="dark"] .chw-dian-pill-status strong {
    color: #bfdbfe;
}




/* =========================================================
   BARRA DE PESTAÑAS ESTILO CHROMIUM (BIFROST CHW)
   ========================================================= */

.chw-chrome-tabbar-wrapper {
    background: #e9eef5;
    border-bottom: 1px solid var(--chw-border);
    position: relative;
    z-index: 10;
}

.chw-chrome-tabbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 6px 16px 0 16px;
    gap: 8px;
    min-height: 40px;
}

.chw-chrome-tabs-strip {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    min-width: 0;
}

.chw-chrome-tabs-strip::-webkit-scrollbar {
    display: none;
}

/* PESTAÑA CHROMIUM INDIVIDUAL */
.chw-chrome-tab {
    display: flex;
    align-items: center;
    position: relative;
    height: 35px;
    min-width: 120px;
    max-width: 190px;
    padding: 0 14px;
    border-radius: 9px 9px 0 0;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

/* Pestaña Inactiva */
.chw-chrome-tab.chw-tab-inactive {
    background: transparent;
    color: #475569;
}

.chw-chrome-tab.chw-tab-inactive:hover {
    background: rgba(255, 255, 255, 0.65);
    color: #0f172a;
}

/* Divisor entre pestañas inactivas */
.chw-chrome-tab.chw-tab-inactive::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 9px;
    bottom: 9px;
    width: 1px;
    background: #cbd5e1;
}

/* Pestaña Activa */
.chw-chrome-tab.chw-tab-active {
    background: var(--chw-background, #F7F9FC);
    color: #0f172a;
    box-shadow: 0 -2px 8px rgba(16, 42, 67, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-left: 1px solid var(--chw-border);
    border-right: 1px solid var(--chw-border);
    border-bottom: 1px solid var(--chw-background, #F7F9FC);
    margin-bottom: -1px;
    z-index: 2;
}

.chw-chrome-tab-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%);
    border-radius: 9px 9px 0 0;
}

/* Pestaña Pinned (Inicio) */
.chw-chrome-tab.chw-tab-pinned {
    min-width: 95px;
    max-width: 110px;
    font-weight: 800;
}

.chw-chrome-tab-content {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    overflow: hidden;
}

.chw-chrome-tab-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.chw-chrome-tab-emoji {
    font-size: 13px;
    flex-shrink: 0;
    line-height: 1;
}

.chw-chrome-tab-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Botón cerrar pestaña */
.chw-chrome-tab-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 4px;
    flex-shrink: 0;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    padding: 0;
}

.chw-chrome-tab-close:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
    transform: scale(1.1);
}

/* Acciones a la derecha */
.chw-chrome-tabbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    flex-shrink: 0;
}

.chw-chrome-action-btn {
    border: 1px solid var(--chw-border);
    background: var(--chw-surface);
    color: var(--chw-text);
    font-size: 10px;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.chw-chrome-action-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #b91c1c;
}

.chw-chrome-counter {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 12px;
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    letter-spacing: 0.5px;
}

.chw-chrome-counter.chw-chrome-counter-limit {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

/* Banner de auto-cierre / alerta de límite */
.chw-chrome-alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: #f0fdf4;
    border-top: 1px solid #bbf7d0;
    font-size: 11px;
    font-weight: 700;
    color: #166534;
    animation: fadeIn 0.2s ease-in-out;
}

.chw-chrome-alert-dismiss {
    background: transparent;
    border: none;
    color: #166534;
    font-weight: 800;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.chw-chrome-alert-dismiss:hover {
    background: rgba(0,0,0,0.06);
}

/* MODO NOCHE (DARK THEME) PARA PESTAÑAS CHROMIUM */
html[data-theme="dark"] .chw-chrome-tabbar-wrapper {
    background: #0f172a;
    border-bottom-color: #334155;
}

html[data-theme="dark"] .chw-chrome-tab.chw-tab-inactive {
    color: #94a3b8;
}

html[data-theme="dark"] .chw-chrome-tab.chw-tab-inactive:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
}

html[data-theme="dark"] .chw-chrome-tab.chw-tab-inactive::after {
    background: #334155;
}

html[data-theme="dark"] .chw-chrome-tab.chw-tab-active {
    background: #0b1120;
    color: #f8fafc;
    border-color: #334155;
    border-bottom-color: #0b1120;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .chw-chrome-tab-close {
    color: #94a3b8;
}

html[data-theme="dark"] .chw-chrome-tab-close:hover {
    background: #dc2626 !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .chw-chrome-action-btn {
    background: #1e293b;
    border-color: #475569;
    color: #cbd5e1;
}

html[data-theme="dark"] .chw-chrome-action-btn:hover {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fecaca;
}

html[data-theme="dark"] .chw-chrome-counter {
    background: #1e293b;
    color: #60a5fa;
    border-color: #3b82f6;
}

html[data-theme="dark"] .chw-chrome-counter.chw-chrome-counter-limit {
    background: #451a03;
    color: #fcd34d;
    border-color: #b45309;
}

html[data-theme="dark"] .chw-chrome-alert-banner {
    background: #064e3b;
    border-top-color: #047857;
    color: #a7f3d0;
}

html[data-theme="dark"] .chw-chrome-alert-dismiss {
    color: #a7f3d0;
}

/* ============================================================== */
/* BOTONES ESTILO BUTTON-63 (CHAPMAN WILCHES SYSTEM)              */
/* ============================================================== */
.btn-chw-63,
.btn:not(tbody .btn):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):not(.btn-close):not(.btn-link):not(.form-check-input),
.chw-btn:not(tbody .chw-btn):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):not(.btn-close),
a.chw-btn,
a.btn:not(tbody a):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 0;
    border-radius: 8px;
    box-sizing: border-box;
    color: #ffffff !important;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.2;
    min-height: 38px;
    padding: 8px 16px;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    vertical-align: middle;
}

.btn-chw-63:active,
.btn-chw-63:hover,
.btn:not(tbody .btn):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):not(.btn-close):not(.btn-link):hover,
.chw-btn:not(tbody .chw-btn):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):not(.btn-close):hover,
a.chw-btn:hover,
a.btn:not(tbody a):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover {
    outline: 0;
    color: #ffffff !important;
    text-decoration: none;
}

.btn-chw-63:hover,
.btn:not(tbody .btn):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):not(.btn-close):not(.btn-link):hover,
.chw-btn:not(tbody .chw-btn):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):not(.btn-close):hover,
a.chw-btn:hover,
a.btn:not(tbody a):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.btn-chw-63:active,
.btn:not(tbody .btn):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):not(.btn-close):not(.btn-link):active,
.chw-btn:not(tbody .chw-btn):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):not(.btn-close):active,
a.chw-btn:active,
a.btn:not(tbody a):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):active {
    transform: translateY(0);
    filter: brightness(0.96);
}

.btn-chw-63:disabled,
.btn-chw-63[disabled],
.btn:disabled,
.btn[disabled],
.chw-btn:disabled,
.chw-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    filter: grayscale(30%);
    box-shadow: none !important;
}

/* 1. Azul Corporativo Chapman Wilches (Primary / Crear Paquete / Nueva Factura) */
.btn-chw-63-primary,
.btn-primary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.chw-btn-primary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *) {
    background-image: linear-gradient(144deg, #102a43, #1e40af 50%, #0284c7) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 16px -4px rgba(30, 64, 175, 0.45);
}
.btn-chw-63-primary:hover,
.btn-primary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.chw-btn-primary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover {
    box-shadow: 0 8px 20px -3px rgba(30, 64, 175, 0.55);
    color: #ffffff !important;
}

/* 2. Ámbar / Nota Crédito F-N (Warning / Accent) */
.btn-chw-63-fn,
.btn-chw-63-warning,
.btn-warning:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.btn-outline-warning:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.chw-btn-warning:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *) {
    background-image: linear-gradient(144deg, #92400e, #d97706 50%, #f59e0b) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 16px -4px rgba(217, 119, 6, 0.45);
}
.btn-chw-63-fn:hover,
.btn-chw-63-warning:hover,
.btn-warning:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.btn-outline-warning:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.chw-btn-warning:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover {
    box-shadow: 0 8px 20px -3px rgba(217, 119, 6, 0.55);
    color: #ffffff !important;
}

/* 3. Celeste / Importar Excel / Informaciones */
.btn-chw-63-excel,
.btn-chw-63-info,
.btn-info:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.btn-outline-info:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.chw-btn-info:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *) {
    background-image: linear-gradient(144deg, #0369a1, #0284c7 50%, #38bdf8) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 16px -4px rgba(2, 132, 199, 0.4);
}
.btn-chw-63-excel:hover,
.btn-chw-63-info:hover,
.btn-info:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.btn-outline-info:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.chw-btn-info:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover {
    box-shadow: 0 8px 20px -3px rgba(2, 132, 199, 0.5);
    color: #ffffff !important;
}

/* 4. Pizarra / Neutral / Acciones Secundarias / Cancelar */
.btn-chw-63-neutral,
.btn-chw-63-secondary,
.btn-secondary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.btn-outline-secondary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.chw-btn-secondary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.chw-btn-outline:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *) {
    background-image: linear-gradient(144deg, #1e293b, #334155 50%, #64748b) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 16px -4px rgba(51, 65, 85, 0.35);
}
.btn-chw-63-neutral:hover,
.btn-chw-63-secondary:hover,
.btn-secondary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.btn-outline-secondary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.chw-btn-secondary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.chw-btn-outline:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover {
    box-shadow: 0 8px 20px -3px rgba(51, 65, 85, 0.45);
    color: #ffffff !important;
}

/* Outline Primario y botones claros (sin fondo blanco con letra blanca) */
.btn-outline-primary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
a.btn-outline-primary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.btn.bg-white:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
a.btn.bg-white:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *) {
    background-image: linear-gradient(144deg, #102a43, #1e40af 50%, #0284c7) !important;
    background-color: #1e40af !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: 0 6px 16px -4px rgba(30, 64, 175, 0.45);
}
.btn-outline-primary span {
    color: inherit !important;
}
.btn-outline-primary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
a.btn-outline-primary:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover {
    background-image: linear-gradient(144deg, #102a43, #1e40af 50%, #0284c7) !important;
    background-color: #1e40af !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 8px 20px -3px rgba(30, 64, 175, 0.55);
}
.btn-light:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *) {
    background-image: linear-gradient(144deg, #1e293b, #334155 50%, #64748b) !important;
    background-color: #334155 !important;
    color: #ffffff !important;
    border: none !important;
}
tbody .btn-light,
.chw-tabla-acciones .btn-light {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

/* 5. Oro Cálido / Anticipos */
.btn-chw-63-anticipos {
    background-image: linear-gradient(144deg, #78350f, #b45309 50%, #d97706) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 16px -4px rgba(180, 83, 9, 0.4);
}
.btn-chw-63-anticipos:hover {
    box-shadow: 0 8px 20px -3px rgba(180, 83, 9, 0.5);
    color: #ffffff !important;
}

/* 6. Carmesí / Devoluciones / Alertas (Danger) */
.btn-chw-63-danger,
.btn-danger:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.btn-outline-danger:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.chw-btn-danger:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *) {
    background-image: linear-gradient(144deg, #991b1b, #dc2626 50%, #ef4444) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 16px -4px rgba(220, 38, 38, 0.45);
}
.btn-chw-63-danger:hover,
.btn-danger:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.btn-outline-danger:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.chw-btn-danger:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover {
    box-shadow: 0 8px 20px -3px rgba(220, 38, 38, 0.55);
    color: #ffffff !important;
}

/* 7. Verde Éxito / Contabilizar / Aprobaciones (Success) */
.btn-chw-63-success,
.btn-success:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.btn-outline-success:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *),
.chw-btn-success:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *) {
    background-image: linear-gradient(144deg, #065f46, #059669 50%, #10b981) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 6px 16px -4px rgba(5, 150, 105, 0.45);
}
.btn-chw-63-success:hover,
.btn-success:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.btn-outline-success:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover,
.chw-btn-success:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):hover {
    box-shadow: 0 8px 20px -3px rgba(5, 150, 105, 0.55);
    color: #ffffff !important;
}

/* 8. Variantes de Tamaño */
.btn-chw-63-sm,
.btn-sm:not(tbody *):not(.chw-tabla-acciones *):not(.contabilidad-acciones *):not(.tabla-acciones *):not(.btn-link):not(.btn-close) {
    min-height: 32px;
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 6px;
    gap: 5px;
}

/* 9. BOTONES DE FLECHA COMPACTOS CUADRADOS (32 × 32 px) PARA TODAS LAS TABLAS DE LA APP */
.btn-chw-arrow,
.chw-table-scroll-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 32px !important;
    width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    padding: 0 !important;
    font-size: 13px !important;
    line-height: 1 !important;
    border-radius: 6px !important;
    background-image: linear-gradient(144deg, #1e293b, #334155 50%, #64748b) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px -2px rgba(51, 65, 85, 0.35) !important;
    cursor: pointer !important;
    border: 0 !important;
    flex-shrink: 0 !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
    user-select: none !important;
}
.btn-chw-arrow:hover,
.chw-table-scroll-btn:hover {
    box-shadow: 0 6px 14px -2px rgba(51, 65, 85, 0.5) !important;
    transform: translateY(-1px) !important;
    filter: brightness(1.1) !important;
    color: #ffffff !important;
}
.btn-chw-arrow:active,
.chw-table-scroll-btn:active {
    transform: translateY(0) !important;
    filter: brightness(0.95) !important;
}

/* 10. BLINDAJE DE TABLAS: CELDAS Y FILAS NUNCA SE DEFORMAN NI ENGORDAN */
table tbody .btn,
table tbody .chw-btn,
.chw-tabla-acciones .btn,
.contabilidad-acciones .btn,
.tabla-acciones .btn,
.chw-tabla-fila-acciones .btn,
td .btn,
td .chw-btn {
    min-height: 28px !important;
    height: auto !important;
    padding: 3px 8px !important;
    font-size: 12px !important;
    box-shadow: none !important;
    transform: none !important;
    border-radius: 4px !important;
    line-height: 1.2 !important;
}

/* Botón de cerrar modales / alertas nativo sin deformarse */
.btn-close {
    width: 0.8em !important;
    height: 0.8em !important;
    min-height: auto !important;
    padding: 0.25em !important;
    box-shadow: none !important;
    background-image: none;
    border-radius: 0.25rem !important;
}

/* Enlaces tipo botón sin engordar */
.btn-link {
    min-height: auto !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    text-decoration: underline !important;
    border: 0 !important;
}

/* 11. Estilo Pestañas de Colas de Trabajo */
.btn-chw-63-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 13px;
    font-weight: 700;
    min-height: 38px;
    padding: 7px 16px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
    border: 1px solid transparent;
}
.btn-chw-63-tab-inactive {
    background: #f8fafc;
    color: #334155 !important;
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}
.btn-chw-63-tab-inactive:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a !important;
    transform: translateY(-1px);
}

/* ============================================================== */
/* CONTENEDOR Y BARRA DE FILTROS COMPRAS (SIN DESBORDAMIENTO)     */
/* ============================================================== */
.chw-compras-card-header {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chw-compras-header-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.chw-compras-header-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
}

.chw-compras-filter-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-top: 10px !important;
    overflow: hidden !important;
}

.chw-compras-filter-search {
    flex: 1 1 240px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.chw-compras-filter-search input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.chw-compras-filter-select {
    flex: 1 1 260px !important;
    max-width: 100% !important;
    min-width: 180px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.chw-compras-select,
.chw-compras-filter-select select,
.chw-filtro-selector select {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* ============================================================== */
/* ESTILOS GLOBALES SEGUROS PARA SELECT Y FORM-SELECT              */
/* Asegura alineación nativa correcta y evita desplazamiento       */
/* u opciones corridas en Chromium/Edge/Teams bajo zoom.          */
/* ============================================================== */
select.form-select,
.form-select {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: 38px !important;
    line-height: 1.5 !important;
    font-size: 14px !important;
}

select option {
    direction: ltr !important;
    text-align: left !important;
    padding: 6px 10px !important;
}

html[data-theme="dark"] select.form-select option,
html[data-theme="dark"] .form-select option {
    color: #f8fafc;
    background-color: #1e293b;
}

/* ============================================================== */
/* BARRA TIPO SELECTOR DE CENTRO DE COSTO (ALTO CONTRASTE Y PROMINENCIA) */
/* ============================================================== */
.chw-selector-box {
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.chw-selector-bar {
    width: 100%;
    min-height: 54px;
    padding: 10px 16px;
    border-radius: 10px;
    user-select: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Estado Vacío (Llamado a la acción de alta visibilidad) */
.chw-selector-bar.is-empty {
    border: 2.5px solid #2563eb !important;
    background: linear-gradient(180deg, #f0f7ff 0%, #e0f2fe 100%) !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.chw-selector-bar.is-empty:hover {
    border-color: #1d4ed8 !important;
    background: linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.28);
    transform: translateY(-1px);
}

/* Estado Seleccionado (Confirmación clara verde) */
.chw-selector-bar.is-selected {
    border: 2.5px solid #16a34a !important;
    background: linear-gradient(180deg, #f0fdf4 0%, #dcfce7 100%) !important;
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.chw-selector-bar.is-selected:hover {
    border-color: #15803d !important;
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.24);
}

/* Chips / Tags internos del selector */
.chw-selector-tag {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.chw-selector-prompt {
    animation: chwPulseGlow 2.5s infinite;
}

@keyframes chwPulseGlow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.chw-custom-dropdown-panel {
    background-color: #ffffff !important;
    border: 2px solid #2563eb !important;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.25) !important;
}

.chw-dropdown-item {
    background-color: #ffffff;
    color: #1e293b;
    padding: 10px 14px;
}

.chw-dropdown-item:hover {
    background-color: #f1f5f9;
}

.chw-dropdown-item.active-cc {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
}

html[data-theme="dark"] .chw-selector-box {
    background: #0f172a;
    border-color: #334155;
}

html[data-theme="dark"] .chw-selector-bar.is-empty {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25);
}

html[data-theme="dark"] .chw-selector-bar.is-selected {
    background: linear-gradient(180deg, #064e3b 0%, #022c22 100%) !important;
    border-color: #4ade80 !important;
    box-shadow: 0 4px 14px rgba(74, 222, 128, 0.25);
}

html[data-theme="dark"] .chw-custom-dropdown-panel {
    background-color: #1e293b !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .chw-dropdown-item {
    background-color: #1e293b;
    color: #f8fafc;
}

html[data-theme="dark"] .chw-dropdown-item:hover {
    background-color: #334155;
}

html[data-theme="dark"] .chw-dropdown-item.active-cc {
    background-color: #1e3a5f !important;
    color: #93c5fd !important;
}

@media (max-width: 768px) {
    .chw-compras-filter-bar,
    .chw-filtro-fila {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .chw-compras-filter-search,
    .chw-compras-filter-select,
    .chw-filtro-buscador,
    .chw-filtro-selector {
        flex: 1 1 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* ============================================================== */
/* BOTONES DE MEDIO DE PAGO EN PAGOS (FONDO OSCURO + LETRA BLANCA)*/
/* ============================================================== */
.btn-chw-medio-pago {
    display: inline-flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    background-image: linear-gradient(144deg, #0f172a, #1e293b 50%, #334155) !important;
    background-color: #1e293b !important;
    color: #ffffff !important;
    border: 1px solid #475569 !important;
    border-radius: 10px !important;
    padding: 10px 14px !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.35) !important;
    cursor: pointer !important;
    min-height: auto !important;
    height: auto !important;
    text-align: left !important;
    user-select: none !important;
    text-decoration: none !important;
}

.btn-chw-medio-pago:hover {
    background-image: linear-gradient(144deg, #1e293b, #334155 50%, #475569) !important;
    border-color: #94a3b8 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.45) !important;
    color: #ffffff !important;
}

.btn-chw-medio-pago:active {
    transform: translateY(0) !important;
}

.btn-chw-medio-pago-active {
    background-image: linear-gradient(144deg, #102a43, #1e40af 50%, #0284c7) !important;
    border: 2px solid #38bdf8 !important;
    box-shadow: 0 6px 20px rgba(30, 64, 175, 0.55) !important;
    transform: translateY(-1px) !important;
}

.text-emerald {
    color: #34d399 !important;
}

/* ============================================================== */
/* TARJETAS EJECUTIVAS DE APROBACIONES (DISEÑO MODERNO)          */
/* ============================================================== */
.chw-aprobaciones-tab-card {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: block !important;
    width: 100% !important;
    padding: 18px 20px !important;
    border-radius: 12px !important;
    border: 1.5px solid #cbd5e1 !important;
    background: #ffffff !important;
    box-shadow: 0 4px 14px rgba(16, 42, 67, 0.05) !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
    user-select: none !important;
    text-align: left !important;
    position: relative !important;
    overflow: hidden !important;
}

.chw-aprobaciones-tab-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 22px rgba(16, 42, 67, 0.1) !important;
    border-color: #94a3b8 !important;
}

.chw-aprobaciones-tab-card.active-cc {
    border-color: #1e40af !important;
    background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%) !important;
    box-shadow: 0 8px 24px rgba(30, 64, 175, 0.16) !important;
}

.chw-aprobaciones-tab-card.active-fin {
    border-color: #059669 !important;
    background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%) !important;
    box-shadow: 0 8px 24px rgba(5, 150, 105, 0.16) !important;
}

.chw-tab-card-title {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 4px !important;
}

.chw-tab-card-num {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    background: #1e40af !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

.chw-tab-card-num.chw-num-success {
    background: #059669 !important;
}

.chw-tab-card-desc {
    font-size: 12.5px !important;
    color: #64748b !important;
    line-height: 1.35 !important;
}

.chw-tab-card-footer {
    border-top: 1px solid rgba(226, 232, 240, 0.8) !important;
}

/* ============================================================== */
/* PUNTICO ROJO DE NOTIFICACIÓN DE NUEVAS FACTURAS EN MENÚ       */
/* ============================================================== */
.chw-nav-icon-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.chw-nav-badge-dot {
    position: absolute;
    top: -2px;
    right: -3px;
    width: 9px;
    height: 9px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 1.5px solid #0f172a;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.9);
    animation: chwDotPulse 1.8s infinite cubic-bezier(0.4, 0, 0.6, 1);
    pointer-events: none;
    z-index: 5;
}

@keyframes chwDotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.25);
        opacity: 0.85;
    }
}

/* ============================================================== */
/* BOTÓN ESTÉTICO PARA SOPORTES DE TRANSACCIONES                 */
/* ============================================================== */
.chw-soporte-btn-group {
    display: inline-flex;
    align-items: stretch;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chw-soporte-btn-group:hover {
    border-color: #304d93;
    box-shadow: 0 2px 6px rgba(48, 77, 147, 0.14);
}

.chw-soporte-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 0;
    background: transparent;
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    line-height: 1.3;
    transition: background 0.15s ease, color 0.15s ease;
}

.chw-soporte-btn:hover {
    background: #f1f5ff;
    color: #1e3a8a;
}

.chw-soporte-btn-icon {
    flex-shrink: 0;
    color: #304d93;
}

.chw-soporte-btn-label {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chw-soporte-btn-tag {
    padding: 1px 6px;
    border-radius: 5px;
    background: #e0e7ff;
    color: #1e3a8a;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.chw-soporte-btn-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border: 0;
    border-left: 1px solid #e2e8f0;
    background: #fff5f5;
    color: #dc2626;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.chw-soporte-btn-del:hover {
    background: #dc2626;
    color: #ffffff;
}


