/**
 * estilos_bi.css — Diseño Corporativo Responsivo Multiplataforma (Sin Dependencias)
 * Almacenar en: D:\apache\htdocs\a2odbc\estilos_bi.css
 */

/* CONFIGURACIÓN GLOBAL */
body { 
    font-family: 'Segoe UI', Arial, sans-serif; 
    background: #f4f6fa; 
    margin: 0; 
    padding: 15px; 
    color: #333; 
    font-size: 14px; 
}
h1 { 
    color: #1e3a5f; 
    margin: 10px 0; 
    font-size: 22px; 
    border-bottom: 2px solid #1e3a5f; 
    padding-bottom: 10px; 
    text-align: center;
}
h2 { 
    color: #2c3e50; 
    font-size: 16px; 
    margin: 20px 0 10px 0; 
    padding-bottom: 5px; 
    border-bottom: 2px solid #bdc3c7; 
}

.bi-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 12px;
    min-height: 80px;
}
.bi-header h1 {
    flex: 1;
    margin: 0;
}
.bi-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex: 0 0 auto;
    width: 300px;
    max-width: 300px;
    height: 80px;
    overflow: hidden;
}
.bi-logo {
    display: block;
    width: 300px;
    max-width: 300px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
}

.btn-primary-bi {
    padding: 8px 15px;
    background: #1e3a5f;
    color: #fff;
    border: 0;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

/* MENÚ NAVEGACIÓN FLUIDO */
.bi-menu { display: flex; flex-wrap: wrap; gap: 6px; background: #1e3a5f; padding: 10px; border-radius: 6px; margin-bottom: 20px; justify-content: center; }
.bi-menu a { color: #fff; text-decoration: none; font-size: 13px; font-weight: bold; padding: 8px 10px; border-radius: 4px; text-align: center; flex: 1 1 calc(50% - 6px); box-sizing: border-box; }
.bi-menu a:hover, .bi-menu a.active { background: #2a5285; }

/* REJILLAS AUTOMÁTICAS (VERTICALES EN CELULARES POR DEFECTO) */
.bi-top-layout { display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.kpi-block, .kpi-diario-container, .grid-tops { display: grid; grid-template-columns: 1fr; gap: 15px; }

.kpi-card { background: #fff; padding: 15px; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.04); border-left: 5px solid #2980b9; }
.kpi-card.utilidad-color { border-left-color: #27ae60; }
.kpi-card.margen-color { border-left-color: #f39c12; }
.kpi-card.cxc-color { border-left-color: #9b59b6; }
.kpi-card.diario-color { border-left-color: #16a085; }
.kpi-card.cobranza-color { border-left-color: #2c3e50; }

.kpi-title { font-size: 10px; text-transform: uppercase; color: #95a5a6; font-weight: bold; margin-bottom: 4px; }
.kpi-value { font-size: 18px; font-weight: bold; color: #2c3e50; font-family: monospace; }

/* GRÁFICO DE BARRAS NATIVO CSS */
.chart-card-native { background: #fff; padding: 15px; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.04); height: 165px; display: flex; align-items: flex-end; justify-content: space-between; position: relative; box-sizing: border-box; }
.bar-wrapper { display: flex; flex-direction: column; align-items: center; flex: 1; height: 80%; justify-content: flex-end; position: relative; }
.bar-css { width: 50%; background: #2980b9; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bar-label { font-size: 9px; color: #7f8c8d; margin-top: 4px; text-transform: uppercase; font-weight: bold; }

/* PANEL DE CONTROLES Y FORMULARIOS */
.panel-busqueda { background: #fff; padding: 15px; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.04); margin-bottom: 20px; }
.panel-busqueda form { display: flex; flex-direction: column; gap: 12px; }
.form-group { display: flex; flex-direction: column; width: 100%; }
label { font-weight: bold; margin-bottom: 4px; font-size: 12px; color: #2c3e50; }
select, input { padding: 7px 10px; font-size: 13px; border: 1px solid #ccc; border-radius: 4px; width: 100% !important; box-sizing: border-box; }
.btn-clear { background: #7f8c8d; text-decoration: none; padding: 9px; border-radius: 4px; color: #fff; font-size: 13px; font-weight: bold; text-align: center; }

/* TARJETAS DE RANKINGS */
.panel-top { background: #fff; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.04); padding: 15px; border-top: 4px solid #1e3a5f; box-sizing: border-box; }
.panel-top.monto-color { border-top-color: #27ae60; }
.panel-top.util-color { border-top-color: #f1c40f; }
.panel-top h3 { margin-top: 0; border-bottom: 1px solid #eee; padding-bottom: 6px; font-size: 13px; font-weight: bold; }

/* TABLAS INTELIGENTES CON DESPLAZAMIENTO TÁCTIL MÓVIL */
.table-responsive { width: 100%; overflow-x: auto; background: #fff; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.04); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { background: #1e3a5f; color: #fff; font-weight: bold; padding: 10px 8px; }
th a { color: #fff; text-decoration: none; display: block; }
td { padding: 8px; border-bottom: 1px solid #eee; font-family: monospace; white-space: nowrap; }
.monto { text-align: right; font-weight: bold; }
.total-row { background: #eaedd1; font-weight: bold; }

/* CONTROLES DE OCULTACIÓN PARA LA REJILLA DE TRANSACCIONES */
.col-desktop { display: none; } /* Oculto en celulares por defecto */

.paginacion-bar { display: flex; flex-direction: column; gap: 10px; align-items: center; background: #fff; padding: 12px; border-radius: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.04); margin-top: 10px; font-size: 13px; text-align: center; }
.pag-link { padding: 5px 12px; background: #ebf3f9; color: #1e3a5f; text-decoration: none; border-radius: 4px; font-weight: bold; }
.alerta-container { background: #fdf2f2; border: 1px solid #f5b7b7; border-left: 5px solid #e74c3c; border-radius: 6px; padding: 15px; margin-bottom: 25px; font-size: 13px; }
.alerta-header { font-weight: bold; color: #c0392b; margin-bottom: 5px; text-transform: uppercase; }
.alerta-item { padding: 3px 0; font-family: monospace; }

/* CxC: lectura densa sin perder datos largos */
.cxc-table-wrap {
    width: 100%;
    overflow-x: auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.cxc-table {
    min-width: 1060px;
    table-layout: fixed;
}
.cxc-table td,
.cxc-table th {
    vertical-align: top;
}
.cxc-table td {
    white-space: normal;
}
.cxc-code {
    font-family: Consolas, 'Courier New', monospace;
    white-space: nowrap;
}
.cxc-client {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: 700;
    line-height: 1.25;
}
.cxc-observaciones {
    width: 230px;
    color: #53616b;
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.35;
}
.cxc-observacion-preview,
.cxc-ver-mas div {
    overflow-wrap: anywhere;
    word-break: break-word;
}
.cxc-ver-mas {
    margin-top: 4px;
}
.cxc-ver-mas summary {
    color: #1769aa;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}
.cxc-ver-mas div {
    margin-top: 6px;
    padding: 8px;
    background: #f8fbfd;
    border: 1px solid #d9e7f2;
    border-radius: 4px;
}
.cxc-row-pending { background: #f7fbff; }
.cxc-row-partial { background: #fff8e5; }
.cxc-row-advance { background: #effaf4; }
.cxc-row-paid { background: #f7f8fa; }
.cxc-row-overdue { background: #fff1ed; }
.cxc-badge {
    display: inline-block;
    padding: 3px 7px;
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.cxc-badge-pending { background: #2477b3; }
.cxc-badge-partial { background: #c78200; }
.cxc-badge-advance { background: #20945f; }
.cxc-badge-paid { background: #7f8c8d; }
.cxc-badge-overdue { background: #cf3f2e; }
.cxc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
    color: #5e6a73;
    font-size: 12px;
}
.cxc-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cxc-legend i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.cxc-dot-pending { background: #2477b3; }
.cxc-dot-partial { background: #c78200; }
.cxc-dot-advance { background: #20945f; }
.cxc-dot-overdue { background: #cf3f2e; }
.cxc-dot-paid { background: #7f8c8d; }

.live-filter-hint {
    color: #6d7b85;
    display: block;
    font-size: 11px;
    margin-top: 4px;
}

/* =========================================================================
   🖥️ VISUALIZACIÓN DE ESCRITORIO (RESTAURADA A SU MÁXIMA SIMETRÍA ORIGINAL)
   ========================================================================= */
@media (min-width: 1024px) {
    body { padding: 25px; font-size: 14px; }
    h1 { text-align: left; font-size: 24px; }
    .bi-menu { justify-content: flex-start; }
    .bi-menu a { flex: initial; width: auto; font-size: 14px; }
    
    /* Rejilla de Mandos del Home: Lado a Lado (KPIs a la izquierda, Gráfico a la derecha) */
    .bi-top-layout { display: grid; grid-template-columns: 1fr 1.3fr; gap: 25px; }
    .kpi-block { grid-template-columns: repeat(2, 1fr); }
    
    /* Fila de 4 KPIs Diarios en horizontal */
    .kpi-diario-container { grid-template-columns: repeat(4, 1fr); gap: 15px; }
    
    /* Fila de 4 Tarjetas de Rankings superiores en Ventas en horizontal */
    .grid-tops { grid-template-columns: repeat(4, 1fr); gap: 20px; }
    
    /* Formulario en línea horizontal */
    .panel-busqueda form { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 15px; }
    .form-group { width: auto; min-width: 165px; flex: 1; }
    select, input { width: 100% !important; }
    .btn-clear { padding: 8px 15px; width: auto !important; }
    
    /* Mostrar las columnas detalladas de montos en PC */
    .col-desktop { display: table-cell; }
    .paginacion-bar { flex-direction: row; justify-content: space-between; }
}

@media (max-width: 820px) {
    .bi-logo-link { display: none; }
    .bi-header h1 { text-align: center; font-size: 20px; }
    .cxc-table { min-width: 920px; }
    .cxc-observaciones { width: 190px; }
}

/* =========================================================================
   a2dashboard rediseño 2026 - estructura base inspirada en boceto01.png
   ========================================================================= */
body.bi-app {
    background: #f6f8fb;
    color: #101828;
    font-family: 'Nunito', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 0;
}
body.bi-app * {
    box-sizing: border-box;
}
.bi-shell-header {
    background: #fff;
    border-bottom: 1px solid #dbe3ea;
    min-height: 82px;
    position: sticky;
    top: 0;
    z-index: 50;
}
.bi-header-inner {
    align-items: center;
    display: grid;
    gap: 16px;
    grid-template-columns: 250px minmax(0, 1fr) auto;
    margin: 0 auto;
    max-width: 1480px;
    min-height: 82px;
    padding: 0 24px;
    width: 100%;
}
body.bi-layout-full .bi-header-inner {
    max-width: none;
}
.bi-brand-area {
    align-items: center;
    display: flex;
    min-width: 0;
}
.bi-logo-frame {
    align-items: center;
    display: inline-flex;
    height: 80px;
    justify-content: flex-start;
    max-width: 250px;
    overflow: hidden;
    width: 250px;
}
.bi-logo {
    display: block;
    height: auto !important;
    max-height: 80px !important;
    max-width: 250px !important;
    object-fit: contain;
    width: 250px !important;
}
.bi-mobile-brand {
    color: #05799d;
    display: none;
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
}
.bi-primary-nav {
    align-items: stretch;
    display: flex;
    gap: clamp(10px, 1.6vw, 20px);
    height: 82px;
    justify-content: center;
    min-width: 0;
}
.bi-nav-item {
    align-items: stretch;
    display: inline-flex;
    position: relative;
}
.bi-nav-link {
    align-items: center;
    background: transparent;
    border-bottom: 4px solid transparent;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    color: #1d2939;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    gap: 7px;
    min-width: 0;
    padding: 0 4px;
    text-decoration: none;
    white-space: nowrap;
}
.bi-nav-link i {
    color: #05799d;
    display: none;
    font-size: 18px;
}
.bi-nav-link .bi-chevron {
    color: #667085;
    display: inline-flex;
    font-size: 16px;
}
.bi-nav-item.active .bi-nav-link,
.bi-nav-item:hover .bi-nav-link,
.bi-nav-item:focus-within .bi-nav-link {
    border-bottom-color: #0089ad;
    color: #006f91;
}
.bi-submenu {
    background: #fff;
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    box-shadow: 0 18px 38px rgba(16, 24, 40, 0.14);
    display: none;
    left: 50%;
    min-width: 230px;
    padding: 8px;
    position: absolute;
    top: 76px;
    transform: translateX(-50%);
    z-index: 40;
}
.bi-submenu::before {
    content: "";
    height: 12px;
    left: 0;
    position: absolute;
    right: 0;
    top: -12px;
}
.bi-nav-item:hover .bi-submenu,
.bi-nav-item:focus-within .bi-submenu,
.bi-nav-item.open .bi-submenu {
    display: grid;
    gap: 4px;
}
.bi-submenu a {
    border-radius: 6px;
    color: #344054;
    display: block;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 10px;
    text-decoration: none;
    white-space: nowrap;
}
.bi-submenu a.active,
.bi-submenu a:hover {
    background: #eaf7fb;
    color: #006f91;
}
.bi-submenu-group {
    display: grid;
    gap: 4px;
}
.bi-submenu-parent {
    align-items: center;
    display: flex !important;
    justify-content: space-between;
}
.bi-submenu-children {
    border-left: 2px solid #dcebf2;
    display: none;
    gap: 4px;
    margin-left: 8px;
    padding-left: 8px;
}
.bi-submenu-group.open > .bi-submenu-children {
    display: grid;
}
.bi-header-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}
.bi-config-menu {
    position: relative;
}
.bi-config-dropdown {
    background: #fff;
    border: 1px solid #dbe5ed;
    border-radius: 8px;
    box-shadow: 0 18px 38px rgba(16, 24, 40, 0.14);
    display: none;
    min-width: 210px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: 44px;
    z-index: 70;
}
.bi-config-menu.open .bi-config-dropdown,
.bi-config-menu:focus-within .bi-config-dropdown {
    display: grid;
    gap: 4px;
}
.bi-config-dropdown a {
    border-radius: 6px;
    color: #344054;
    display: block;
    font-size: 13px;
    font-weight: 700;
    height: auto;
    padding: 9px 10px;
    text-decoration: none;
    width: auto;
}
.bi-config-dropdown a.active,
.bi-config-dropdown a:hover {
    background: #eaf7fb;
    color: #006f91;
}
.bi-mobile-menu-head,
.bi-menu-backdrop {
    display: none;
}
.bi-mobile-menu-close {
    align-items: center;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
}
.a2-modal-open {
    overflow: hidden;
}
.bi-field-help {
    color: var(--a2-color-muted);
    display: block;
    font-size: 12px;
    line-height: 1.4;
    margin-top: 5px;
}
.bi-secondary-kpis {
    background: var(--a2-color-subtle);
    border: 1px solid var(--a2-color-border);
    border-radius: var(--a2-radius-md);
    margin: 14px 0 20px;
    padding: 0 16px 16px;
}
.bi-secondary-kpis summary {
    align-items: center;
    color: var(--a2-color-primary);
    cursor: pointer;
    display: flex;
    font-weight: 800;
    gap: 8px;
    min-height: 48px;
}
.bi-secondary-kpis summary::-webkit-details-marker { display: none; }
.bi-secondary-kpis[open] summary { margin-bottom: 8px; }
.bi-kpi-grid-secondary { margin: 0; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
.bi-header-actions a,
.bi-header-button,
.bi-menu-button {
    align-items: center;
    background: #fff;
    border: 1px solid #d7e0e8;
    border-radius: 8px;
    color: #172033;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    text-decoration: none;
    width: 34px;
}
.bi-header-button {
    cursor: pointer;
    padding: 0;
}
.bi-header-actions i,
.bi-header-button i,
.bi-menu-button i {
    font-size: 18px;
}
.bi-menu-toggle {
    display: none;
}
.bi-menu-button {
    display: none;
}
.bi-secondary-wrap {
    background: #fff;
    border-bottom: 1px solid #e2e8ef;
    padding: 0 28px 12px;
}
.bi-secondary-nav {
    display: flex;
    gap: 8px;
    margin: 0 auto;
    max-width: 1480px;
    overflow-x: auto;
}
.bi-secondary-nav a {
    background: #f7fafc;
    border: 1px solid #dce5ed;
    border-radius: 8px;
    color: #344054;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 13px;
    text-decoration: none;
}
.bi-secondary-nav a.active,
.bi-secondary-nav a:hover {
    background: #eaf7fb;
    border-color: #74c7dd;
    color: #006f91;
}
.bi-main {
    margin: 0;
    max-width: none;
    padding: 24px clamp(18px, 1.6vw, 32px) 38px;
    width: 100%;
}
body.bi-layout-boxed .bi-main {
    margin: 0 auto;
    max-width: 1480px;
}
body.bi-layout-full .bi-main {
    margin: 0;
    max-width: none;
}
.bi-page-head {
    align-items: flex-end;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 18px;
}
.bi-breadcrumb {
    color: #667085;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
}
.bi-breadcrumb strong {
    color: #007fa3;
}
.bi-page-title {
    color: #101828;
    font-size: 24px;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0;
}
.bi-page-subtitle {
    color: #667085;
    font-size: 13px;
    margin: 6px 0 0;
}
.bi-page-tools {
    align-items: center;
    display: flex;
    gap: 10px;
}
.bi-button {
    align-items: center;
    background: #fff;
    border: 1px solid #d6e0e8;
    border-radius: 8px;
    color: #182230;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    gap: 8px;
    min-height: 38px;
    padding: 9px 13px;
    text-decoration: none;
}
.bi-button.primary {
    background: #0089ad;
    border-color: #0089ad;
    color: #fff;
}
.bi-kpi-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin-bottom: 16px;
}
.bi-kpi-card {
    align-items: center;
    background: #fff;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
    display: grid;
    gap: 12px;
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 106px;
    padding: 16px;
}
.bi-kpi-value {
    font-size: clamp(18px, 1.35vw, 24px);
    line-height: 1.05;
    overflow-wrap: normal;
    white-space: nowrap;
}
.bi-kpi-card,
.bi-kpi-card * {
    min-width: 0;
}
.bi-data-anchor {
    scroll-margin-top: 112px;
}
.estado-cuenta-cliente {
    margin-bottom: 16px;
}
.estado-cuenta-cliente.estado-saldo-pendiente {
    border-left: 4px solid #f04438;
}
.estado-cuenta-cliente.estado-saldo-favor {
    border-left: 4px solid #12b76a;
}
.estado-cliente-meta {
    color: #667085;
    display: grid;
    font-size: 13px;
    gap: 8px 18px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin: 8px 0 14px;
}
.estado-cliente-meta .wide {
    grid-column: 1 / -1;
}
.estado-desc {
    max-width: 360px;
    white-space: normal;
}
.estado-total-row {
    background: #eef7fb;
    color: #102a43;
}
.estado-filter-panel {
    grid-template-columns: minmax(260px, 2fr) repeat(5, minmax(145px, 1fr));
}
.bi-icon-button {
    align-items: center;
    background: #fff;
    border: 1px solid #d7e2ec;
    border-radius: 8px;
    color: #102a43;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
    width: 38px;
}
.bi-icon-button:hover {
    background: #f8fbfd;
    border-color: #99cfe1;
    transform: translateY(-1px);
}
.bi-icon-button i {
    font-size: 20px;
}
.bi-icon-button.export-pdf { color: #d92d20; }
.bi-icon-button.export-xlsx { color: #087443; }
.bi-icon-button.export-csv { color: #006f91; }
.bi-check-grid {
    border: 1px solid #dce6ef;
    border-radius: 10px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin: 0;
    padding: 12px;
}
.bi-check-grid legend {
    color: #101828;
    font-size: 12px;
    font-weight: 900;
    padding: 0 6px;
}
.bi-check-grid label {
    align-items: center;
    background: #f8fbfd;
    border: 1px solid #e2ebf2;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    gap: 7px;
    min-height: 34px;
    padding: 7px 9px;
}
.bi-check-grid input {
    accent-color: #0089ad;
}
.bi-inline-check {
    align-items: center;
    background: #f8fbfd;
    border: 1px solid #dce8f0;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    gap: 8px;
    min-height: 42px;
    padding: 8px 10px;
}
.bi-inline-check input {
    accent-color: #0089ad;
    height: 16px;
    width: 16px;
}
.estado-doc-filter {
    gap: 6px;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    padding: 8px;
}
.estado-doc-filter label {
    background: #fff;
    border-color: #dce8f0;
    border-radius: 7px;
    gap: 6px;
    min-height: 30px;
    padding: 5px 8px;
}
.estado-doc-filter input[type="checkbox"] {
    flex: 0 0 auto;
    height: 15px;
    margin: 0;
    max-height: 15px;
    min-height: 15px;
    padding: 0 !important;
    width: 15px !important;
}
.estado-doc-filter span {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
}
.vendedores-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
}
.vendedores-month-chart {
    align-items: end;
    display: flex;
    gap: 12px;
    height: 300px;
    overflow-x: auto;
    padding: 34px 6px 8px;
}
.vendedores-month {
    align-items: center;
    display: grid;
    flex: 1;
    gap: 8px;
    grid-template-rows: auto 1fr auto;
    height: 100%;
    min-width: 58px;
    text-align: center;
}
.vendedores-month i {
    align-self: end;
    background: linear-gradient(180deg, #3ab7d8, #0089ad);
    border-radius: 8px 8px 2px 2px;
    display: block;
    min-height: 8px;
    width: 100%;
}
.vendedores-month span,
.vendedores-month strong {
    color: #475467;
    font-size: 11px;
    white-space: nowrap;
}
.vendedores-month strong {
    background: #f5fbff;
    border: 1px solid #cce9f3;
    border-radius: 999px;
    color: #007f9f;
    font-size: 10px;
    font-weight: 900;
    padding: 4px 6px;
}
.bi-kpi-icon {
    align-items: center;
    border-radius: 8px;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}
.bi-kpi-icon i {
    color: #fff;
    font-size: 23px;
}
.bi-kpi-card.teal .bi-kpi-icon { background: #0089ad; }
.bi-kpi-card.blue .bi-kpi-icon { background: #2f80ed; }
.bi-kpi-card.amber .bi-kpi-icon { background: #f59f00; }
.bi-kpi-card.green .bi-kpi-icon { background: #24a05a; }
.bi-kpi-card.red .bi-kpi-icon { background: #e5483f; }
.bi-kpi-card.purple .bi-kpi-icon { background: #7967c6; }
.bi-kpi-label {
    color: #101828;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 7px;
}
.bi-kpi-value {
    color: #101828;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: normal;
    white-space: nowrap;
}
.bi-kpi-note {
    color: #667085;
    font-size: 12px;
    margin-top: 7px;
}
.bi-filter-panel {
    align-items: flex-end;
    background: #fff;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    margin-bottom: 16px;
    padding: 16px;
}
.bi-filter-panel .wide {
    grid-column: span 2;
}
.bi-filter-panel label {
    color: #182230;
    font-size: 12px;
    font-weight: 800;
}
.bi-filter-panel input,
.bi-filter-panel select {
    background: #fff;
    border: 1px solid #ccd6df;
    border-radius: 8px;
    color: #101828;
    min-height: 38px;
    padding: 8px 11px;
}
.bi-card {
    background: #fff;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
    min-width: 0;
    overflow: hidden;
    padding: 18px;
}
.bi-card-title {
    color: #101828;
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 14px;
}
.bi-dashboard-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
    min-width: 0;
}
.bi-dashboard-grid > * {
    min-width: 0;
}
.bi-chart-bars {
    align-items: end;
    border-bottom: 1px solid #ccd6df;
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(12, minmax(28px, 1fr));
    min-height: 348px;
    overflow-x: auto;
    padding: 18px 6px 26px;
}
.bi-chart-month {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-rows: auto 1fr auto;
    height: 278px;
}
.bi-chart-pair {
    align-items: end;
    display: flex;
    gap: 5px;
    height: 178px;
    justify-content: center;
    margin-top: 24px;
    width: 100%;
}
.bi-bar {
    border-radius: 5px 5px 0 0;
    min-height: 2px;
    position: relative;
    width: 36%;
}
.bi-bar.sales { background: #0089ad; }
.bi-bar.cost { background: #e5483f; }
.bi-bar span {
    background: rgba(255,255,255,0.94);
    border: 1px solid #dce5ed;
    border-radius: 5px;
    color: #182230;
    font-size: 10px;
    font-weight: 800;
    left: 50%;
    padding: 2px 4px;
    position: absolute;
    top: -23px;
    transform: translateX(-50%);
    white-space: nowrap;
}
.bi-chart-total {
    background: #f8fbfd;
    border: 1px solid #e2eaf1;
    border-radius: 7px;
    color: #182230;
    display: grid;
    gap: 2px;
    justify-items: center;
    min-height: 44px;
    padding: 6px 5px;
    text-align: center;
}
.bi-chart-total strong {
    color: #006f91;
    font-size: 11px;
}
.bi-chart-total span {
    color: #667085;
    font-size: 10px;
    font-weight: 700;
}
.bi-chart-label {
    color: #667085;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
}
.bi-chart-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
}
.bi-chart-legend span {
    align-items: center;
    color: #475467;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    gap: 7px;
}
.bi-chart-legend i {
    border-radius: 3px;
    height: 12px;
    width: 12px;
}
.bi-insight-list {
    display: grid;
    gap: 10px;
}
.bi-insight {
    background: #f8fbfd;
    border: 1px solid #e2eaf1;
    border-radius: 8px;
    padding: 12px;
}
.bi-insight strong {
    color: #101828;
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
}
.bi-insight span {
    color: #667085;
    font-size: 12px;
}
.bi-management-reading .bi-card-title {
    font-size: 19px;
}
.bi-management-reading .bi-insight {
    padding: 15px;
}
.bi-management-reading .bi-insight strong {
    font-size: 15px;
}
.bi-management-reading .bi-insight span {
    display: block;
    font-size: 14px;
    line-height: 1.45;
}
.bi-empty-state {
    align-items: center;
    color: #667085;
    display: flex;
    font-size: 13px;
    font-style: italic;
    justify-content: center;
    min-height: 90px;
    text-align: center;
}
.bi-ranking-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(250px, 1fr));
    margin-top: 16px;
}
.bi-ranking-card {
    min-width: 0;
}
.bi-ranking-list {
    display: grid;
    gap: 10px;
}
.bi-ranking-row {
    min-width: 0;
}
.bi-ranking-head {
    align-items: baseline;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-width: 0;
}
.bi-ranking-head span {
    color: #182230;
    font-size: 12px;
    font-weight: 500;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}
.tabla-contenedor {
    max-width: 100%;
    overflow-x: auto !important;
}
.tabla-contenedor table {
    min-width: 820px;
}
.bi-ranking-head strong {
    color: #006f91;
    flex: 0 0 auto;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 13px;
    letter-spacing: 0;
}
.bi-sort-link {
    align-items: center;
    color: inherit;
    display: inline-flex;
    gap: 5px;
    text-decoration: none;
}
.bi-sort-link i {
    color: #0089ad;
    font-size: 14px;
}
.bi-ranking-bar {
    background: #f2f7f9;
    border-radius: 999px;
    height: 7px;
    margin-top: 5px;
    overflow: hidden;
}
.bi-ranking-bar i {
    background: linear-gradient(90deg, #9bd7e5, #c7ecd5);
    border-radius: inherit;
    display: block;
    height: 100%;
}
.bi-ranking-meta {
    color: #667085;
    font-size: 11px;
    margin-top: 3px;
}
.cxc-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.cxc-filter-panel {
    grid-template-columns: repeat(6, minmax(135px, 1fr));
}
.cxc-filter-actions > div {
    display: flex;
    gap: 8px;
}
.cxc-table-card {
    padding: 0;
}
.cxc-report-table .cxc-row-pending,
.cxc-report-table .cxc-row-partial,
.cxc-report-table .cxc-row-advance,
.cxc-report-table .cxc-row-paid,
.cxc-report-table .cxc-row-overdue {
    background: #fff;
}
.cxc-report-table .cxc-row-pending { box-shadow: inset 4px 0 0 #9dd8ea; }
.cxc-report-table .cxc-row-partial { box-shadow: inset 4px 0 0 #f6d38c; }
.cxc-report-table .cxc-row-advance { box-shadow: inset 4px 0 0 #a8ddb7; }
.cxc-report-table .cxc-row-paid { box-shadow: inset 4px 0 0 #d0d5dd; }
.cxc-report-table .cxc-row-overdue { box-shadow: inset 4px 0 0 #f2aaa3; }
.bi-data-table-wrap {
    overflow-x: auto;
    width: 100%;
}
.bi-data-table {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    min-width: 1180px;
    width: 100%;
}
.bi-data-table th {
    background: #f8fbfd;
    border-bottom: 1px solid #dce5ed;
    color: #182230;
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 12px;
    font-weight: 800;
    padding: 12px 10px;
    text-align: left;
    white-space: nowrap;
}
.bi-data-table th a {
    color: #182230;
    text-decoration: none;
}
.bi-data-table td {
    border-bottom: 1px solid #e5edf3;
    color: #182230;
    font-family: 'Segoe UI', Arial, sans-serif;
    padding: 11px 10px;
    vertical-align: top;
    white-space: normal;
}
.bi-data-table .num {
    text-align: right;
    white-space: nowrap;
}
.bi-data-table .danger {
    color: #e5483f;
    font-weight: 800;
}
.bi-empty-cell {
    color: #667085;
    font-style: italic;
    padding: 30px !important;
    text-align: center;
}
.bi-total-row td {
    background: #eef6fa;
    font-weight: 800;
}
.cxc-client-cell {
    min-width: 220px;
}
.cxc-client-code {
    color: #006f91;
    display: block;
    font-family: Consolas, 'Courier New', monospace;
    font-weight: 900;
    margin-bottom: 3px;
    white-space: nowrap;
}
.cxc-client-name {
    color: #334155;
    display: block;
    font-size: 12px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.cxc-doc {
    color: #006f91;
    font-weight: 800;
}
.cxc-saldo {
    color: #182230;
    font-weight: 800;
}
.cxc-footnote {
    color: #667085;
    font-size: 12px;
    padding: 11px 14px 14px;
}
.bi-data-table .cxc-observaciones {
    max-width: 320px;
    width: auto;
}
.bi-pagination {
    align-items: center;
    background: #fff;
    border: 1px solid #dfe7ef;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding: 12px 14px;
}
.bi-pagination div:last-child {
    align-items: center;
    display: flex;
    gap: 10px;
}
.bi-pagination a {
    background: #f7fafc;
    border: 1px solid #dce5ed;
    border-radius: 7px;
    color: #006f91;
    font-weight: 800;
    padding: 7px 10px;
    text-decoration: none;
}
.bi-placeholder {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr) 360px;
}
.bi-placeholder-visual {
    align-items: center;
    background: #f8fbfd;
    border: 1px dashed #b8c7d4;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 280px;
    overflow: hidden;
    padding: 16px;
}
.bi-placeholder-visual img {
    border-radius: 8px;
    height: auto;
    max-height: 260px;
    max-width: 100%;
    object-fit: contain;
}
.bi-placeholder-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.bi-status-badge {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 9px;
    text-transform: uppercase;
}
.bi-status-badge.info { background: #eaf7fb; color: #006f91; }
.bi-status-badge.warn { background: #fff4db; color: #946200; }
.bi-status-badge.ok { background: #e9f8ef; color: #147d44; }
.bi-status-badge.danger { background: #fff1ed; color: #b42318; }
.bi-status-badge.credit { background: #e7f7f4; color: #0f766e; }
.bi-status-badge.invoice { background: #eaf2ff; color: #175cd3; }
.bi-status-badge.payment { background: #ecfdf3; color: #067647; }
.bi-status-badge.advance { background: #f0f9ff; color: #026aa2; }
.bi-status-badge.note-credit { background: #fdf2fa; color: #c11574; }
.bi-status-badge.note-debit { background: #fff6ed; color: #b54708; }
.bi-kpi-link {
    color: inherit;
    display: contents;
    text-decoration: none;
}
.bi-kpi-card.active-filter {
    border-color: #0089ad;
    box-shadow: 0 0 0 2px rgba(0, 137, 173, .14), 0 12px 28px rgba(15, 23, 42, .08);
}
.bi-login-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}
.bi-login-card {
    background: #fff;
    border: 1px solid #dfe7ef;
    border-radius: 10px;
    box-shadow: 0 22px 70px rgba(16, 24, 40, 0.12);
    max-width: 430px;
    padding: 28px;
    width: 100%;
}
.bi-login-logo {
    display: block;
    height: auto;
    margin-bottom: 18px;
    max-height: 70px;
    max-width: 250px;
    object-fit: contain;
}
.bi-login-card h1 {
    border: 0;
    color: #101828;
    font-size: 24px;
    margin: 0 0 6px;
    padding: 0;
    text-align: left;
}
.bi-login-card p,
.bi-login-note {
    color: #667085;
    font-size: 13px;
    line-height: 1.45;
}
.bi-login-card form {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}
.bi-auth-alert,
.bi-auth-success {
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 14px;
    padding: 12px 14px;
}
.bi-auth-alert {
    background: #fff1ed;
    border: 1px solid #ffd0c7;
    color: #b42318;
}
.bi-auth-success {
    background: #e9f8ef;
    border: 1px solid #bcebd0;
    color: #147d44;
}
.bi-form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bi-form-grid button {
    justify-self: start;
}
.bi-inline-form {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    margin: 2px 4px 2px 0;
}
.bi-inline-form input {
    min-width: 145px;
}
.bi-user-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.bi-user-actions summary {
    align-items: center;
    background: #f7fafc;
    border: 1px solid #dce5ed;
    border-radius: 8px;
    color: #006f91;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    gap: 6px;
    min-height: 36px;
    padding: 8px 10px;
}
.bi-user-actions summary::marker {
    content: "";
}
.bi-danger-button {
    background: #fff1ed;
    border-color: #ffd0c7;
    color: #b42318;
}
.bi-success-button {
    background: #e9f8ef;
    border-color: #bcebd0;
    color: #147d44;
}
.bi-mini-bars {
    display: grid;
    gap: 10px;
}
.bi-mini-bar-row {
    display: grid;
    gap: 6px;
}
.bi-mini-bar-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}
.bi-mini-bar-head span {
    color: #344054;
    font-size: 12px;
    font-weight: 800;
    min-width: 0;
    overflow-wrap: anywhere;
}
.bi-mini-bar-head strong {
    color: #006f91;
    flex: 0 0 auto;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    white-space: nowrap;
}
.bi-mini-bar-track {
    background: #eef5f8;
    border-radius: 999px;
    height: 9px;
    overflow: hidden;
}
.bi-mini-bar-track i {
    background: linear-gradient(90deg, #9bd7e5, #c7ecd5);
    border-radius: inherit;
    display: block;
    height: 100%;
}
.bi-chart-card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .65fr);
}
.bi-table-title-cell {
    display: grid;
    gap: 3px;
}
.bi-table-title-cell strong {
    color: #182230;
}
.bi-table-title-cell span {
    color: #667085;
    font-size: 12px;
}
.bi-code-block {
    background: #101828;
    border-radius: 8px;
    color: #eaf7fb;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 10px;
    overflow-x: auto;
    padding: 12px;
    white-space: nowrap;
}
.bi-profile-card {
    max-width: 720px;
}

@media (max-width: 1180px) {
    .bi-header-inner {
        grid-template-columns: 210px minmax(0, 1fr) auto;
        padding: 0 18px;
    }
    .bi-logo-frame,
    .bi-logo {
        max-width: 210px !important;
        width: 210px !important;
    }
    .bi-primary-nav {
        gap: 12px;
    }
    .bi-kpi-grid {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
    .bi-dashboard-grid,
    .bi-placeholder {
        grid-template-columns: 1fr;
    }
    .bi-ranking-grid {
        grid-template-columns: repeat(2, minmax(250px, 1fr));
    }
    .cxc-filter-panel {
        grid-template-columns: repeat(3, minmax(160px, 1fr));
    }
}

@media (max-width: 900px) {
    .bi-header-inner {
        grid-template-columns: auto 1fr auto;
        min-height: 56px;
        padding: 0 14px;
    }
    .bi-logo-frame {
        display: none;
    }
    .bi-mobile-brand {
        display: inline-flex;
    }
    .bi-menu-button {
        display: inline-flex;
        grid-column: 1;
        grid-row: 1;
    }
    .bi-brand-area {
        grid-column: 2;
        justify-content: flex-start;
    }

    .bi-mobile-brand {
        max-width: calc(100vw - 190px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .bi-header-actions {
        grid-column: 3;
        gap: 6px;
    }
    .bi-layout-toggle-action,
    .bi-sync-action {
        display: none;
    }
    .bi-profile-action {
        display: none !important;
    }
    .bi-primary-nav {
        background: #fff;
        bottom: 0;
        box-shadow: 24px 0 48px rgba(15, 23, 42, 0.22);
        display: block;
        height: 100vh;
        left: 0;
        max-width: 360px;
        overflow-y: auto;
        padding: 18px;
        position: fixed;
        top: 0;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        width: min(84vw, 360px);
        z-index: 70;
    }
    .bi-menu-toggle:checked ~ .bi-primary-nav {
        transform: translateX(0);
    }
    .bi-menu-toggle:checked ~ .bi-menu-backdrop {
        background: rgba(15, 23, 42, 0.52);
        border: 0;
        display: block;
        inset: 0;
        padding: 0;
        position: fixed;
        z-index: 60;
    }
    .bi-mobile-menu-head {
        align-items: center;
        display: flex;
        justify-content: space-between;
        margin-bottom: 18px;
    }
    .bi-mobile-menu-close {
        align-items: center;
        border: 1px solid #d7e0e8;
        border-radius: 9px;
        cursor: pointer;
        display: inline-flex;
        height: 44px;
        justify-content: center;
        width: 44px;
    }
    .bi-mobile-menu-brand {
        color: #05799d;
        font-size: 22px;
        font-weight: 900;
        text-decoration: none;
    }
    .bi-nav-link {
        border: 1px solid #e2e8ef;
        border-radius: 8px;
        justify-content: flex-start;
        margin-bottom: 7px;
        min-height: 42px;
        padding: 0 10px;
        width: 100%;
    }
    .bi-nav-link i {
        display: inline-flex;
    }
    .bi-nav-item {
        display: grid;
        gap: 6px;
        margin-bottom: 8px;
    }
    .bi-nav-item.active .bi-nav-link {
        border-color: #74c7dd;
    }
    .bi-submenu {
        border: 0;
        box-shadow: none;
        display: none;
        gap: 4px;
        left: auto;
        min-width: 0;
        padding: 0 0 0 12px;
        position: static;
        top: auto;
        transform: none;
    }
    .bi-nav-item.open .bi-submenu {
        display: grid;
    }
    .bi-submenu::before {
        display: none;
    }
    .bi-submenu a {
        background: #f7fafc;
        border: 1px solid #e2e8ef;
        white-space: normal;
    }
    .bi-submenu-children {
        border-left-color: #cce4ee;
    }
    .bi-secondary-wrap {
        padding: 10px 14px;
    }
    .bi-main {
        padding: 16px 14px 28px;
    }
    .bi-page-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .bi-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .bi-filter-panel {
        grid-template-columns: 1fr;
    }
    .bi-filter-panel .wide {
        grid-column: span 1;
    }
    .bi-ranking-grid {
        grid-template-columns: 1fr;
    }
    .kpi-diario-container,
    .grid-tops {
        grid-template-columns: 1fr !important;
    }
    .cxc-filter-panel {
        grid-template-columns: 1fr;
    }
    .bi-data-table {
        min-width: 0;
    }
    .cxc-report-table thead {
        display: none;
    }
    .cxc-report-table,
    .cxc-report-table tbody,
    .cxc-report-table tr,
    .cxc-report-table td {
        display: block;
        width: 100%;
    }
    .cxc-report-table tr {
        border-bottom: 1px solid #dce5ed;
        padding: 10px 12px;
    }
    .cxc-report-table td {
        border-bottom: 0;
        display: flex;
        justify-content: space-between;
        gap: 14px;
        padding: 6px 0;
        text-align: right;
    }
    .cxc-report-table td::before {
        color: #667085;
        content: attr(data-label);
        flex: 0 0 108px;
        font-weight: 800;
        text-align: left;
    }
    .cxc-report-table td.cxc-client-cell {
        align-items: flex-start;
        display: grid;
        gap: 4px;
        grid-template-columns: 108px minmax(0, 1fr);
        text-align: left;
    }
    .cxc-report-table td.cxc-client-cell::before {
        grid-row: 1 / span 2;
    }
    .cxc-report-table td.cxc-client-cell .cxc-client-code,
    .cxc-report-table td.cxc-client-cell .cxc-client-name {
        min-width: 0;
        text-align: right;
    }
    .cxc-report-table td.cxc-observaciones {
        display: block;
        text-align: left;
    }
    .cxc-report-table td.cxc-observaciones::before {
        display: block;
        margin-bottom: 5px;
    }
    .bi-total-row {
        display: none !important;
    }
    .bi-pagination {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
    .bi-form-grid {
        grid-template-columns: 1fr;
    }
    .bi-inline-form {
        align-items: stretch;
        display: grid;
    }
}

/* Estándar reutilizable para tablas DataTable del dashboard. */
.bi-datatable-tools,
.bi-datatable-footer,
.bi-datatable-load-more {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    flex-wrap: wrap;
}

.bi-datatable-tools {
    justify-content: space-between;
}

.bi-datatable-footer {
    justify-content: space-between;
    border-top: 1px solid #eaecf0;
}

.bi-datatable-load-more {
    justify-content: center;
    border-top: 1px solid #eaecf0;
}

.bi-datatable-tools .dt-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bi-datatable-tools .dt-button,
.bi-datatable-tools .dataTables_length select,
.bi-datatable-tools .dataTables_filter input {
    border: 1px solid #d0d5dd;
    border-radius: 7px;
    background: #fff;
    color: #344054;
    min-height: 36px;
    padding: 7px 10px;
    font: inherit;
}

.bi-datatable-tools .dt-button {
    cursor: pointer;
    font-weight: 600;
}

.bi-datatable-tools .dt-button:hover {
    border-color: #0089ad;
    color: #006b86;
    background: #f0fbfd;
}

.bi-datatable-tools .dt-button .lni,
.bi-datatable-load-more .lni {
    margin-right: 5px;
}

.bi-datatable-tools .dataTables_filter,
.bi-datatable-tools .dataTables_length {
    color: #475467;
    font-size: 14px;
}

.bi-datatable-tools .dataTables_filter input {
    margin-left: 8px;
    width: min(260px, 45vw);
}

.bi-datatable .sorting,
.bi-datatable .sorting_asc,
.bi-datatable .sorting_desc {
    cursor: pointer;
}

.bi-datatable-footer .dataTables_info,
.bi-datatable-footer .dataTables_paginate {
    color: #667085;
    font-size: 13px;
}

.bi-datatable-footer .paginate_button {
    display: inline-block;
    margin-left: 3px;
    padding: 7px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    color: #344054 !important;
    cursor: pointer;
}

.bi-datatable-footer .paginate_button.current,
.bi-datatable-footer .paginate_button:hover:not(.disabled) {
    color: #fff !important;
    border-color: #0089ad;
    background: #0089ad;
}

.bi-datatable-footer .paginate_button.disabled {
    opacity: .45;
    cursor: default;
}

@media (max-width: 640px) {
    .bi-datatable-tools,
    .bi-datatable-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .bi-datatable-tools .dataTables_filter input {
        width: min(290px, 70vw);
    }
}

/* Reglas finales de consistencia visual y táctil */
.bi-kpi-value {
    overflow-wrap: normal !important;
    white-space: nowrap !important;
}
.bi-submenu-group:not(.open) > .bi-submenu-children {
    display: none !important;
}
.bi-submenu-group.open > .bi-submenu-children {
    display: grid !important;
}
.bi-chart-card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .65fr);
}
.bi-table-title-cell {
    display: grid;
    gap: 3px;
}
.bi-table-title-cell strong {
    color: #182230;
}
.bi-table-title-cell span {
    color: #667085;
    font-size: 12px;
}
@media (max-width: 900px) {
    .vendedores-grid,
    .bi-chart-card-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 520px) {
    .bi-kpi-grid {
        grid-template-columns: 1fr;
    }
    .bi-kpi-card {
        gap: 8px;
        grid-template-columns: 30px minmax(0, 1fr);
        min-height: 94px;
        padding: 10px;
    }
    .bi-kpi-icon {
        height: 28px;
        width: 28px;
    }
    .bi-kpi-icon i {
        font-size: 17px;
    }
    .bi-kpi-label {
        font-size: 10px;
    }
    .bi-kpi-value {
        font-size: 14px;
    }
    .bi-kpi-note {
        font-size: 10px;
    }
    .bi-menu-toggle:checked ~ .bi-primary-nav {
        grid-template-columns: 1fr;
    }
}

/* =========================================================================
   Ajustes visuales 2026-07-05: plantilla dashboard, menus tactiles y login
   ========================================================================= */
body.bi-app {
    background:
        radial-gradient(circle at 18% 0%, rgba(0, 137, 173, 0.06), transparent 28%),
        linear-gradient(180deg, #f7f9fd 0%, #eef3f8 100%);
    color: #142033;
    font-family: "Nunito", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

html,
body.bi-app {
    overflow-x: hidden;
}

.bi-shell-header {
    box-shadow: 0 4px 18px rgba(16, 24, 40, 0.04);
}

.bi-logo-frame {
    max-width: 300px;
    width: min(300px, 100%);
}

.bi-logo {
    height: auto !important;
    max-height: 76px !important;
    max-width: 300px !important;
    width: auto !important;
}

.bi-header-inner {
    grid-template-columns: minmax(230px, 300px) minmax(0, 1fr) auto;
}

.bi-nav-item:hover .bi-submenu,
.bi-nav-item:focus-within .bi-submenu {
    display: none;
}

.bi-nav-item.open .bi-submenu {
    display: grid;
    gap: 4px;
}

.bi-submenu-parent {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #344054;
    cursor: pointer;
    display: flex !important;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    justify-content: space-between;
    min-height: 38px;
    padding: 9px 10px;
    text-align: left;
    width: 100%;
}

.bi-submenu-parent:hover,
.bi-submenu-parent.active,
.bi-submenu-group.open > .bi-submenu-parent {
    background: #eaf7fb;
    color: #006f91;
}

.bi-submenu-parent i {
    color: #667085;
    transition: transform 160ms ease;
}

.bi-submenu-group.open > .bi-submenu-parent i {
    transform: rotate(90deg);
}

.bi-submenu-children {
    display: none;
}

.bi-submenu-group.open > .bi-submenu-children {
    display: grid;
}

.bi-header-actions .bi-config-dropdown {
    min-width: 230px;
    top: 46px;
}

.bi-header-actions .bi-config-dropdown a {
    align-items: center;
    display: flex;
    font-size: 13px;
    height: auto;
    justify-content: flex-start;
    line-height: 1.25;
    min-height: 38px;
    padding: 10px 12px;
    white-space: nowrap;
    width: 100%;
}

.bi-main {
    padding-left: clamp(20px, 2.2vw, 38px);
    padding-right: clamp(20px, 2.2vw, 38px);
}

body.bi-layout-boxed .bi-main,
body.bi-layout-boxed .bi-header-inner {
    max-width: 1540px;
}

.bi-page-title {
    font-size: clamp(22px, 2.1vw, 30px);
    font-weight: 900;
}

.bi-page-title::after {
    background: linear-gradient(90deg, #183b63, rgba(24, 59, 99, 0));
    border-radius: 999px;
    content: "";
    display: block;
    height: 3px;
    margin-top: 10px;
    max-width: 520px;
    width: 100%;
}

.bi-card,
.bi-kpi-card,
.bi-filter-panel {
    border-color: #dfe8f1;
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(16, 24, 40, 0.06);
}

.bi-card-title {
    align-items: center;
    display: flex;
    gap: 8px;
    font-size: 17px;
    letter-spacing: 0;
}

.bi-kpi-card {
    min-height: 118px;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.bi-kpi-card:hover {
    box-shadow: 0 16px 42px rgba(16, 24, 40, 0.09);
    transform: translateY(-1px);
}

.bi-kpi-label {
    font-size: 13px;
}

.bi-kpi-value {
    font-family: "Consolas", "SFMono-Regular", monospace;
    font-size: clamp(18px, 1.55vw, 24px);
    letter-spacing: 0;
}

.bi-kpi-note {
    line-height: 1.35;
}

.bi-template-grid {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.75fr);
}

.bi-template-stack {
    display: grid;
    gap: 18px;
}

.bi-template-card {
    background: #fff;
    border: 1px solid #dfe8f1;
    border-radius: 14px;
    box-shadow: 0 12px 34px rgba(16, 24, 40, 0.06);
    overflow: hidden;
    padding: 18px;
}

.bi-card-toolbar {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.bi-card-toolbar h2 {
    border: 0;
    color: #101828;
    font-size: 17px;
    font-weight: 900;
    margin: 0;
    padding: 0;
}

.bi-soft-stat {
    background: #f8fbfd;
    border: 1px solid #e4edf4;
    border-radius: 12px;
    display: grid;
    gap: 2px;
    padding: 12px;
}

.bi-soft-stat strong {
    color: #006f91;
    font-size: 16px;
}

.bi-soft-stat span {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.bi-metric-row {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.bi-mini-progress {
    background: #edf5f9;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.bi-mini-progress i {
    background: linear-gradient(90deg, #4fb7d1, #9ee0bb);
    border-radius: inherit;
    display: block;
    height: 100%;
}

.bi-chart-bars {
    gap: clamp(10px, 1.2vw, 18px);
    min-height: 388px;
    padding-top: 24px;
}

.bi-chart-month {
    height: 314px;
}

.bi-chart-pair {
    height: 198px;
    margin-top: 34px;
}

.bi-chart-total {
    background: #f8fbfd;
    border-color: #dbe8f0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.bi-bar.sales {
    background: linear-gradient(180deg, #00a1c4 0%, #0084a4 100%);
}

.bi-bar.cost {
    background: linear-gradient(180deg, #ff7d73 0%, #e5483f 100%);
}

.bi-ranking-card {
    border-radius: 14px;
}

.bi-ranking-head span {
    font-weight: 700;
}

.bi-ranking-bar {
    background: #f3f7fb;
    height: 9px;
}

.bi-ranking-card:nth-child(1) .bi-ranking-bar i {
    background: linear-gradient(90deg, #a6dcf3, #d5eef9);
}

.bi-ranking-card:nth-child(2) .bi-ranking-bar i {
    background: linear-gradient(90deg, #b7e7c8, #e1f5d4);
}

.bi-ranking-card:nth-child(3) .bi-ranking-bar i {
    background: linear-gradient(90deg, #ffdca7, #fff0cf);
}

.bi-ranking-card:nth-child(4) .bi-ranking-bar i {
    background: linear-gradient(90deg, #c9c2f4, #e7e4fb);
}

.bi-login-card {
    text-align: center;
}

.bi-login-logo {
    margin: 0 auto 18px;
}

.bi-login-card h1,
.bi-login-card p {
    text-align: center;
}

.bi-login-card .bi-button {
    justify-content: center;
    width: 100%;
}

.bi-login-note {
    display: none;
}

.bi-user-actions {
    display: grid;
    gap: 8px;
    min-width: 300px;
}

.bi-user-actions details {
    background: #f8fbfd;
    border: 1px solid #e2eaf1;
    border-radius: 8px;
    padding: 8px;
}

.bi-user-actions summary {
    cursor: pointer;
    font-weight: 800;
}

.bi-user-actions form {
    margin-top: 8px;
}

.bi-inline-check {
    align-items: center;
    display: inline-flex;
    gap: 6px;
    margin: 0;
}

.bi-inline-check input {
    width: auto !important;
}

.bi-danger-button {
    border-color: #ffd0c7;
    color: #b42318;
}

.bi-success-button {
    border-color: #bcebd0;
    color: #147d44;
}

.price-filter-panel {
    grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(150px, 1fr));
}

.price-list-card {
    margin-top: 16px;
    padding: 0;
}

.price-list-toolbar {
    padding: 18px 18px 0;
}

.price-list-toolbar h2 {
    align-items: center;
    display: flex;
    gap: 8px;
}

.price-data-table {
    min-width: 1120px;
}

.price-mobile-list {
    display: none;
}

.stock-ok {
    color: #14804a;
}

.stock-empty {
    color: #b42318;
}

.price-mobile-card {
    background: #fff;
    border: 1px solid #d8e3ed;
    border-radius: 12px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
    display: grid;
    gap: 12px;
    padding: 14px;
}

.price-mobile-head {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.price-mobile-head strong {
    color: #007f9f;
    display: block;
    font-size: 15px;
}

.price-mobile-head span {
    color: #172033;
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 3px;
}

.price-mobile-head em {
    background: #f5fbff;
    border: 1px solid #cce9f3;
    border-radius: 999px;
    flex: 0 0 auto;
    font-style: normal;
    font-weight: 800;
    padding: 6px 10px;
}

.price-mobile-metrics {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.price-mobile-metrics div {
    background: #f8fbfd;
    border: 1px solid #e2edf4;
    border-radius: 10px;
    min-width: 0;
    padding: 9px;
}

.price-mobile-metrics span {
    color: #667085;
    display: block;
    font-size: 11px;
    font-weight: 700;
}

.price-mobile-metrics strong {
    color: #101828;
    display: block;
    font-size: 14px;
    margin-top: 4px;
    white-space: nowrap;
}

.price-mobile-deps {
    color: #475467;
    font-size: 12px;
    line-height: 1.45;
}
.price-dep-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.price-dep-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    gap: 4px;
    padding: 5px 8px;
}
.price-dep-badge strong {
    font-weight: 900;
}
.price-dep-empty {
    color: #98a2b3;
    font-weight: 700;
}
.dep-color-0 { background: #eaf7fb; color: #006f91; }
.dep-color-1 { background: #e9f8ef; color: #147d44; }
.dep-color-2 { background: #fff4db; color: #946200; }
.dep-color-3 { background: #f3f0ff; color: #6941c6; }
.dep-color-4 { background: #fdf2fa; color: #c11574; }
.dep-color-5 { background: #eef4ff; color: #3538cd; }

.ventas-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ventas-filter-panel {
    grid-template-columns: repeat(6, minmax(150px, 1fr));
}

.ventas-ranking-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.ventas-table-card {
    padding: 0;
}

.ventas-table-toolbar {
    padding: 16px 18px 0;
}

.ventas-table-toolbar h2 {
    align-items: center;
    border: 0;
    color: #101828;
    display: flex;
    font-size: 17px;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.ventas-data-table {
    min-width: 1060px;
}

.ventas-client-name {
    color: #334155;
    display: block;
    font-weight: 700;
    max-width: 260px;
    overflow-wrap: anywhere;
}

.ventas-row-return td {
    background: #fffafa;
}

.bi-runtime-note {
    color: #667085;
    font-size: 12px;
    margin-top: 18px;
    text-align: right;
}

@media (max-width: 1180px) {
    .bi-template-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .bi-logo-frame,
    .bi-logo {
        display: none;
    }

    .bi-header-actions .bi-sync-action,
    .bi-header-actions .bi-profile-action {
        display: none;
    }

    .bi-primary-nav {
        max-width: 420px;
        padding: 22px 20px 92px;
        visibility: hidden;
        width: min(86vw, 420px);
    }

    .bi-menu-toggle:checked ~ .bi-primary-nav {
        visibility: visible;
    }

    .bi-nav-item:hover .bi-submenu,
    .bi-nav-item:focus-within .bi-submenu {
        display: none;
    }

    .bi-nav-item.open .bi-submenu {
        display: grid;
    }

    .bi-submenu-parent {
        background: #f7fafc;
        border: 1px solid #e2e8ef;
        border-radius: 8px;
        font-size: 15px;
        min-height: 46px;
        padding: 10px 14px;
    }

    .bi-submenu-group.open > .bi-submenu-children {
        display: grid;
        gap: 7px;
    }

    .bi-page-head {
        gap: 14px;
    }

    .bi-page-tools {
        align-items: stretch;
        flex-wrap: wrap;
        width: 100%;
    }

    .bi-page-tools .bi-button {
        justify-content: center;
    }

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

    .bi-kpi-card {
        grid-template-columns: 48px minmax(0, 1fr);
        min-height: 116px;
        padding: 16px;
    }

    .bi-kpi-icon {
        height: 42px;
        width: 42px;
    }

    .bi-kpi-icon i {
        font-size: 24px;
    }

    .bi-kpi-label {
        font-size: 13px;
    }

    .bi-kpi-value {
        font-size: 22px;
    }

    .bi-main {
        padding-left: 14px;
        padding-right: 14px;
    }

    .bi-template-card {
        border-radius: 12px;
        padding: 14px;
    }

    .bi-chart-bars {
        grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)) !important;
        min-height: 360px;
        overflow-x: auto;
    }

    .bi-chart-month {
        min-width: 92px;
    }

    .bi-filter-panel {
        gap: 12px;
    }

    .ventas-filter-panel {
        grid-template-columns: 1fr;
    }

    .ventas-ranking-grid {
        grid-template-columns: 1fr;
    }

    .ventas-data-table {
        min-width: 920px;
    }

    .price-filter-panel {
        grid-template-columns: 1fr;
    }
    .estado-filter-panel {
        grid-template-columns: 1fr;
    }
    .estado-cuenta-table thead {
        display: none;
    }
    .estado-cuenta-table,
    .estado-cuenta-table tbody,
    .estado-cuenta-table tr,
    .estado-cuenta-table td {
        display: block;
        width: 100%;
    }
    .estado-cuenta-table tr {
        border-bottom: 1px solid #dce5ed;
        padding: 10px 12px;
    }
    .estado-cuenta-table td {
        border-bottom: 0;
        display: flex;
        gap: 14px;
        justify-content: space-between;
        padding: 6px 0;
        text-align: right;
    }
    .estado-cuenta-table td::before {
        color: #667085;
        content: attr(data-label);
        flex: 0 0 112px;
        font-weight: 800;
        text-align: left;
    }
    .estado-cuenta-table td.estado-desc {
        display: block;
        max-width: none;
        text-align: left;
    }
    .estado-cuenta-table td.estado-desc::before {
        display: block;
        margin-bottom: 5px;
    }
    .estado-total-row {
        display: none !important;
    }

    .price-table-wrap {
        display: none;
    }

    .price-mobile-list {
        display: grid;
        gap: 12px;
        padding: 16px;
    }

    .bi-user-actions {
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .bi-header-inner {
        padding: 0 12px;
    }

    .bi-header-actions a,
    .bi-header-button,
    .bi-menu-button {
        height: 44px;
        width: 44px;
    }

    .bi-primary-nav {
        width: min(88vw, 390px);
    }

    .bi-page-title {
        font-size: 26px;
        line-height: 1.15;
    }

    .bi-kpi-card {
        gap: 14px;
        grid-template-columns: 50px minmax(0, 1fr);
        min-height: 122px;
        padding: 18px;
    }

    .bi-kpi-icon {
        height: 44px;
        width: 44px;
    }

    .bi-kpi-value {
        font-size: 23px;
    }

    .bi-filter-panel,
    .bi-card,
    .bi-template-card {
        border-radius: 12px;
    }

    .price-mobile-metrics {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 900px) {
    .bi-header-inner {
        grid-template-columns: 48px minmax(0, 1fr) auto !important;
    }

    .bi-brand-area {
        grid-column: 2;
        min-width: 0;
    }

    .bi-mobile-brand {
        max-width: calc(100vw - 190px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}
