:root {
    --primary-color: #00d4aa;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --card-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
    --border-radius: 0.5rem;
}

* {
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
}

/* Header */
.top-header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 2rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin: 0;
}

.breadcrumb-item {
    color: var(--secondary-color);
}

.breadcrumb-item.active {
    color: var(--dark-color);
}

.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    background: #f8f9fa;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
}

.header-icons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--primary-color);
    color: white;
}

.badge-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Content Area */
.content-area {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.page-subtitle {
    color: var(--secondary-color);
    margin: 0.5rem 0 0 0;
    font-size: 0.95rem;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Responsive para stats-grid */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-title {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin: 0;
    font-weight: 500;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* Data Table */
.data-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.data-card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.data-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.table {
    margin: 0;
}

.table thead th {
    background: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 1rem;
    border-color: #e9ecef;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Tabla Pivotada - Estilos adicionales */
.table-bordered {
    border-collapse: separate;
    border-spacing: 0;
}

.table-bordered thead th {
    border-bottom: 2px solid #fff;
}

.table-bordered tbody td {
    border-right: 1px solid #e9ecef;
}

.sticky-col {
    position: sticky;
    left: 0;
    z-index: 5;
}

tbody tr:hover .sticky-col {
    background-color: #e9ecef !important;
}

/* Pagination */
.pagination {
    margin: 1.5rem 0 0 0;
    justify-content: center;
}

.page-link {
    color: var(--primary-color);
    border-color: #e9ecef;
    padding: 0.5rem 0.75rem;
}

.page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    .content-area {
        padding: 1rem;
    }

    .search-box {
        width: 150px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header-right {
        gap: 0.5rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .top-header {
        padding: 1rem;
        flex-wrap: wrap;
    }
}

/* Print Styles */
@media print {
    .top-header,
    .pagination,
    .data-card-header .btn-group {
        display: none !important;
    }

    .data-card {
        box-shadow: none;
        border: 1px solid #000;
    }

    .table {
        font-size: 0.875rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ESTILOS PARA MODAL DE AVANCE DE VENDEDORES ===== */

/* Modal personalizado */
.modal-xl {
    max-width: 95%;
}

.modal-header {
    border-bottom: 2px solid #19335a;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

/* Cards de resumen */
.card {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

/* Tabla de avance */
#tablaAvanceVendedores {
    font-size: 0.9rem;
}

#tablaAvanceVendedores thead th {
    background-color: #19335a !important;
    color: white !important;
    border: none;
    font-weight: 600;
    padding: 1rem 0.75rem;
    text-align: center;
    vertical-align: middle;
}

#tablaAvanceVendedores tbody td {
    padding: 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f4;
}

/* Estados de filas - Colores minimalistas */
.table-success-minimal {
    background-color: rgba(40, 167, 69, 0.05) !important;
    border-left: 3px solid #28a745 !important;
}

.table-warning-minimal {
    background-color: rgba(255, 193, 7, 0.05) !important;
    border-left: 3px solid #ffc107 !important;
}

.table-secondary-minimal {
    background-color: rgba(108, 117, 125, 0.05) !important;
    border-left: 3px solid #6c757d !important;
}

/* Hover effects */
#tablaAvanceVendedores tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* Iconos de estado */
.bi-check-circle-fill {
    font-size: 1.1rem;
}

.bi-clock-fill {
    font-size: 1.1rem;
}

.bi-dash-circle-fill {
    font-size: 1.1rem;
}

/* Colores de texto para porcentajes */
.text-success.fw-bold {
    font-size: 1.1rem;
}

.text-warning.fw-bold {
    font-size: 1.1rem;
}

.text-danger.fw-bold {
    font-size: 1.1rem;
}

/* Botones del modal */
.modal-footer .btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.modal-footer .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}

/* Loading spinner personalizado */
.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* Responsive para el modal */
@media (max-width: 768px) {
    .modal-xl {
        max-width: 100%;
        margin: 0.5rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    #tablaAvanceVendedores {
        font-size: 0.8rem;
    }
    
    #tablaAvanceVendedores thead th,
    #tablaAvanceVendedores tbody td {
        padding: 0.5rem 0.25rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 0.75rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

#tablaAvanceVendedores tbody tr {
    animation: fadeIn 0.3s ease-out;
}

/* Estilos para el botón principal */
.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 0.25rem 0.5rem rgba(25, 51, 90, 0.2);
}

.btn-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(25, 51, 90, 0.3);
}

/* Estilos para el título del modal */
.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Estilos para el mensaje de error */
.alert-danger {
    border-left: 4px solid #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

/* Estilos para el estado de carga */
#loadingAvance {
    background-color: rgba(248, 249, 250, 0.8);
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* Estilos para filtros */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-select {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.form-select:focus {
    border-color: #19335a;
    box-shadow: 0 0 0 0.2rem rgba(25, 51, 90, 0.25);
}

/* Estilos para la tabla sin striping */
#tablaAvanceVendedores {
    border-collapse: separate;
    border-spacing: 0;
}

#tablaAvanceVendedores tbody tr {
    border-bottom: 1px solid #f1f3f4;
}

#tablaAvanceVendedores tbody tr:last-child {
    border-bottom: none;
}

/* ===== ESTILOS PARA CODIFICACIÓN DE COLORES DE VENTAS ===== */

/* Colores para valores de venta de clientes */
.value-col-green {
    background-color: #d4edda !important;
    color: #155724 !important;
    font-weight: 600 !important;
}

.value-col-yellow {
    background-color: #fff3cd !important;
    color: #856404 !important;
    font-weight: 600 !important;
}

.value-col-red {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    font-weight: 600 !important;
}

/* Colores para valores de venta de categorías */
.value-col-category-red {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    font-weight: 500 !important;
}

/* Estilos más específicos para asegurar que se apliquen */
tr.cliente-header td.value-col-green,
tr.cliente-header td.value-col-yellow,
tr.cliente-header td.value-col-red {
    background-color: inherit !important;
    color: inherit !important;
}

.categoria-row td.value-col-category-red {
    background-color: inherit !important;
    color: inherit !important;
}

/* Hover effects para celdas con color */
.value-col-green:hover,
.value-col-yellow:hover,
.value-col-red:hover,
.value-col-category-red:hover {
    opacity: 0.8;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* ===== ESTILOS PARA MEJORAR DISTRIBUCIÓN VISUAL ===== */

/* Mejoras para los KPIs principales */
.kpi-card {
    border-radius: 1rem;
    overflow: visible;
    transition: all 0.3s ease;
    position: relative;
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Estilos para las tarjetas de venta/meta */
.kpi-metric-card {
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.kpi-metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Mejoras para el gráfico circular */
.circular-progress {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 140px;
    min-width: 140px;
}

.circular-progress svg {
    max-width: 100%;
    max-height: 100%;
    overflow: visible;
}

/* Responsive mejorado para KPIs */
@media (max-width: 768px) {
    .kpi-card .card-body {
        padding: 1.5rem;
    }
    
    .kpi-card h3 {
        font-size: 1.2rem;
    }
    
    .kpi-card p {
        font-size: 0.9rem;
    }
    
    .kpi-metric-card .card-body {
        padding: 1rem;
    }
    
    .kpi-metric-card div[style*="font-size: 1.2rem"] {
        font-size: 1rem !important;
    }
    
    /* En móviles, cambiar a distribución vertical */
    .kpi-card .row.align-items-center {
        flex-direction: column;
    }
    
    .kpi-card .col-md-6:first-child {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    /* Asegurar que los gráficos circulares tengan espacio suficiente en móviles */
    .circular-progress {
        min-height: 120px;
        min-width: 120px;
        margin: 0 auto;
    }
}

/* Estilos para 3 KPIs en una fila */
@media (min-width: 992px) {
    .kpi-card .card-body {
        padding: 1.5rem;
    }
    
    .kpi-card h3 {
        font-size: 1.2rem;
    }
    
    .kpi-card p {
        font-size: 0.9rem;
    }
    
    .kpi-metric-card .card-body {
        padding: 0.75rem;
    }
    
    .kpi-metric-card div[style*="font-size: 1.2rem"] {
        font-size: 1rem !important;
    }
    
    .kpi-metric-card div[style*="font-size: 0.8rem"] {
        font-size: 0.7rem !important;
    }
    
    /* Asegurar que los gráficos circulares tengan espacio suficiente */
    .circular-progress {
        min-height: 140px;
        min-width: 140px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .circular-progress svg {
        width: 140px !important;
        height: 140px !important;
        max-width: 100%;
        max-height: 100%;
    }
    
    .circular-progress svg circle {
        r: 60 !important;
    }
    
    .circular-progress div[style*="font-size: 2.2rem"] {
        font-size: 2rem !important;
    }
    
    .circular-progress div[style*="font-size: 2.5rem"] {
        font-size: 2.2rem !important;
    }
}

@media (max-width: 576px) {
    .kpi-card .card-body {
        padding: 1rem;
    }
    
    .kpi-card h3 {
        font-size: 1.1rem;
    }
    
    .kpi-card p {
        font-size: 0.85rem;
    }
    
    .kpi-metric-card div[style*="font-size: 1.2rem"] {
        font-size: 0.9rem !important;
    }
    
    .kpi-metric-card div[style*="font-size: 0.8rem"] {
        font-size: 0.7rem !important;
    }
    
    /* Ajustar el tamaño del gráfico circular en móviles */
    .circular-progress {
        min-height: 120px;
        min-width: 120px;
        margin: 0 auto;
    }
    
    .circular-progress svg {
        width: 120px !important;
        height: 120px !important;
        max-width: 100%;
        max-height: 100%;
    }
    
    .circular-progress svg circle {
        r: 50 !important;
    }
    
    .circular-progress div[style*="font-size: 2.2rem"] {
        font-size: 1.8rem !important;
    }
    
    .circular-progress div[style*="font-size: 2.5rem"] {
        font-size: 2rem !important;
    }
}

/* ===== ESTILOS PARA TOOLTIP DE DETALLE DE VENTA ===== */

/* Tooltip personalizado para el detalle de venta */
.tooltip-detalle-venta {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0;
    max-width: 300px;
    font-family: 'Inter', sans-serif;
}

.tooltip-header {
    background: linear-gradient(135deg, #19335a 0%, #2c5282 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.tooltip-body {
    padding: 1rem;
}

.tooltip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.tooltip-item:last-child {
    border-bottom: none;
}

.tooltip-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.tooltip-value {
    font-size: 0.9rem;
    color: #19335a;
    font-weight: 600;
    text-align: right;
}

.tooltip-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0.5rem 0;
}

.tooltip-total {
    background: #f8f9fa;
    border-radius: 0.25rem;
    padding: 0.75rem 0.5rem !important;
    margin-top: 0.5rem;
    border: 1px solid #e9ecef;
}

.tooltip-total .tooltip-label {
    color: #19335a;
    font-weight: 600;
}

.tooltip-total .tooltip-value {
    color: #19335a;
    font-weight: 700;
    font-size: 1rem;
}

/* Estilo para el elemento que activa el tooltip */
.venta-actual-tooltip {
    cursor: help;
    position: relative;
    display: inline-block;
    transition: all 0.2s ease;
}

.venta-actual-tooltip:hover {
    color: #19335a !important;
    text-decoration: underline;
}

/* Personalización del tooltip de Bootstrap */
.tooltip-inner {
    background: white;
    color: #19335a;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0;
    max-width: 300px;
    text-align: left;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #e9ecef;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #e9ecef;
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #e9ecef;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #e9ecef;
}

/* Animación para el tooltip */
.tooltip {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tooltip.show {
    opacity: 1;
}

/* Responsive para tooltips */
@media (max-width: 768px) {
    .tooltip-detalle-venta {
        max-width: 250px;
    }
    
    .tooltip-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .tooltip-body {
        padding: 0.75rem;
    }
    
    .tooltip-item {
        padding: 0.375rem 0;
    }
    
    .tooltip-label {
        font-size: 0.8rem;
    }
    
    .tooltip-value {
        font-size: 0.85rem;
    }
    
    .tooltip-total {
        padding: 0.5rem 0.375rem !important;
    }
}

/* ===== ESTILOS PARA FILTROS MUTUAMENTE EXCLUYENTES ===== */

/* Estilos para los filtros globales */
.filter-container {
    position: relative;
    display: flex;
    gap: 1rem;
    align-items: end;
}

.filter-group {
    position: relative;
    min-width: 200px;
}

.filter-group .form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.filter-group .form-label i {
    color: #6c757d;
    font-size: 1rem;
}

/* Estilos para indicar exclusión mutua */
.filter-group.mutually-exclusive .form-label::after {
    content: "🔒";
    font-size: 0.75rem;
    margin-left: 0.25rem;
    opacity: 0.7;
}

.filter-group .form-select {
    border: 2px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background-color: #fff;
    position: relative;
}

.filter-group .form-select:focus {
    border-color: #19335a;
    box-shadow: 0 0 0 0.2rem rgba(25, 51, 90, 0.25);
    outline: none;
}

/* Estilos cuando un filtro está activo */
.filter-group.active .form-select {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.05);
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.filter-group.active .form-label {
    color: #28a745;
    font-weight: 700;
}

.filter-group.active .form-label i {
    color: #28a745;
}

/* Estilos cuando el filtro opuesto está activo (deshabilitado visualmente) */
.filter-group.disabled .form-select {
    border-color: #dee2e6;
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.filter-group.disabled .form-label {
    color: #6c757d;
    opacity: 0.7;
}

.filter-group.disabled .form-label i {
    color: #6c757d;
}

/* Animación de transición entre estados */
.filter-group .form-select {
    transition: all 0.3s ease;
}

.filter-group .form-label {
    transition: all 0.3s ease;
}

/* Indicador visual de exclusión mutua */
.filter-container::before {
    content: "Solo uno a la vez";
    position: absolute;
    top: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #19335a;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.filter-container:hover::before {
    opacity: 1;
}

/* Responsive para filtros */
@media (max-width: 768px) {
    .filter-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-container::before {
        top: -1rem;
        font-size: 0.7rem;
        padding: 0.2rem 0.5rem;
    }
}

@media (max-width: 576px) {
    .filter-group .form-label {
        font-size: 0.8rem;
    }
    
    .filter-group .form-select {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
}

/* ========================================
   ESTILOS PARA INFORMACIÓN DEL USUARIO EN DROPDOWN
   ======================================== */

.user-info-dropdown {
    padding: 0.5rem 0;
    min-width: 200px;
}

.user-info-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: #495057;
}

.user-info-item i {
    width: 1rem;
    text-align: center;
}

.user-info-item span {
    font-weight: 500;
}

.user-info-item .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
}

/* ========================================
   ESTILOS PARA INFORMACIÓN DEL USUARIO EN HEADER (LEGACY - NO USAR)
   ======================================== */

.user-info-header {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.user-info-header:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.user-avatar-small {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
}

.user-details-small {
    flex: 1;
}

.user-detail-small {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: #495057;
    background: rgba(248, 249, 250, 0.8);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #e9ecef;
    margin-right: 0.25rem;
}

.user-detail-small i {
    font-size: 0.7rem;
}

.user-detail-small strong {
    font-weight: 600;
    margin-left: 0.25rem;
}

.badge-sm {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.75rem;
}

/* Responsive para información del usuario en header */
@media (max-width: 768px) {
    .user-info-header {
        padding: 0.4rem 0.6rem;
    }
    
    .user-details-small .d-flex {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }
    
    .user-detail-small {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    .user-avatar-small {
        width: 1.8rem;
        height: 1.8rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .user-info-header {
        padding: 0.3rem 0.5rem;
    }
    
    .user-detail-small {
        font-size: 0.7rem;
        padding: 0.15rem 0.3rem;
    }
    
    .badge-sm {
        font-size: 0.6rem;
        padding: 0.15rem 0.3rem;
    }
}

/* ========================================
   ESTILOS PARA INFORMACIÓN DEL USUARIO (LEGACY - NO USAR)
   ======================================== */

.user-info-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.user-info-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 50%;
    color: white;
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.user-details {
    flex: 1;
}

.user-detail-item {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
    font-size: 0.9rem;
}

.user-detail-item i {
    width: 1rem;
    text-align: center;
}

.user-detail-item .text-muted {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 50px;
}

.user-detail-item strong {
    font-weight: 600;
}

/* Badges para indicadores de filtros */
.user-info-card .badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.user-info-card .badge.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%) !important;
    color: white !important;
}

.user-info-card .badge.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    color: #212529 !important;
}

/* Responsive para información del usuario */
@media (max-width: 768px) {
    .user-info-card {
        padding: 0.75rem 1rem;
    }
    
    .user-info-card .d-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .user-avatar {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.5rem;
    }
    
    .user-details .d-flex {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .user-detail-item {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .user-info-card {
        padding: 0.5rem 0.75rem;
    }
    
    .user-detail-item {
        font-size: 0.8rem;
    }
    
    .user-detail-item .text-muted {
        font-size: 0.75rem;
        min-width: 40px;
    }
    
    .user-info-card .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}

/* ===== ESTILOS MODERNOS PARA BOTONES - UI/UX OPTIMIZADO ===== */

/* Botones de acción principales (Expandir, Colapsar, Excel) */
.btn-action-modern {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    color: #495057;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-action-modern:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.btn-action-modern:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Botón Expandir Todo */
.btn-expand-modern {
    background: #d1edff;
    border-color: #b3d9ff;
    color: #0c5460;
}

.btn-expand-modern:hover {
    background: #b3d9ff;
    border-color: #80c7ff;
    color: #0a4a54;
}

/* Botón Colapsar Todo */
.btn-collapse-modern {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.btn-collapse-modern:hover {
    background: #ffeaa7;
    border-color: #ffd43b;
    color: #664d03;
}

/* Botón Excel */
.btn-excel-modern {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.btn-excel-modern:hover {
    background: #c3e6cb;
    border-color: #a3d9a4;
    color: #0f5132;
}

/* Botones de filtro de estado de recurrencia */
.btn-filter-modern {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.5rem 0.875rem;
    transition: all 0.2s ease;
    min-width: 100px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    background: #f8f9fa;
    color: #6c757d;
}

.btn-filter-modern:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Botón Todos */
.btn-filter-todos {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.btn-filter-todos:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.btn-filter-todos.active {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
    box-shadow: 0 2px 4px rgba(25, 101, 192, 0.2);
}

/* Botón Recurrente */
.btn-filter-recurrente {
    background: #d1edff;
    border-color: #b3d9ff;
    color: #0c5460;
}

.btn-filter-recurrente:hover {
    background: #b3d9ff;
    border-color: #80c7ff;
    color: #0a4a54;
}

.btn-filter-recurrente.active {
    background: #c8e6c9;
    border-color: #a5d6a7;
    color: #2e7d32;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

/* Botón A Ganar */
.btn-filter-ganar {
    background: #ffebee;
    border-color: #ffcdd2;
    color: #c62828;
}

.btn-filter-ganar:hover {
    background: #ffcdd2;
    border-color: #ef9a9a;
    color: #b71c1c;
}

.btn-filter-ganar.active {
    background: #ffcdd2;
    border-color: #ef9a9a;
    color: #b71c1c;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.2);
}

/* Botón Potencial */
.btn-filter-potencial {
    background: #fff8e1;
    border-color: #ffecb3;
    color: #f57c00;
}

.btn-filter-potencial:hover {
    background: #ffecb3;
    border-color: #ffd54f;
    color: #ef6c00;
}

.btn-filter-potencial.active {
    background: #ffecb3;
    border-color: #ffd54f;
    color: #ef6c00;
    box-shadow: 0 2px 4px rgba(255, 152, 0, 0.2);
}

/* Botón Rec. Perdida */
.btn-filter-perdida {
    background: #f5f5f5;
    border-color: #e0e0e0;
    color: #757575;
}

.btn-filter-perdida:hover {
    background: #e0e0e0;
    border-color: #bdbdbd;
    color: #616161;
}

.btn-filter-perdida.active {
    background: #e0e0e0;
    border-color: #bdbdbd;
    color: #616161;
    box-shadow: 0 2px 4px rgba(117, 117, 117, 0.2);
}

/* Efectos de focus para accesibilidad */
.btn-action-modern:focus,
.btn-filter-modern:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Responsive para botones */
@media (max-width: 768px) {
    .btn-action-modern {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .btn-filter-modern {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
        min-width: 90px;
    }
}

@media (max-width: 576px) {
    .btn-action-modern {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .btn-filter-modern {
        padding: 0.375rem 0.625rem;
        font-size: 0.7rem;
        min-width: 80px;
    }
}

/* ===== ESTILOS PARA TOOLTIP DE DESGLOSE DE VENTA ===== */

/* Estilo para el elemento que activa el tooltip */
.tooltip-trigger {
    cursor: help;
    position: relative;
    display: inline-block;
    transition: all 0.2s ease;
}

.tooltip-trigger:hover {
    color: #19335a !important;
    text-decoration: underline;
}

/* Personalización del tooltip de Bootstrap */
.tooltip-inner {
    background: white;
    color: #19335a;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0;
    max-width: 300px;
    text-align: left;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #e9ecef;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    border-bottom-color: #e9ecef;
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
    border-left-color: #e9ecef;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #e9ecef;
}

/* Contenido del tooltip */
.tooltip-content {
    padding: 0;
}

.tooltip-header {
    background: linear-gradient(135deg, #19335a 0%, #2c5282 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
}

.tooltip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #f1f3f4;
}

.tooltip-item:last-child {
    border-bottom: none;
}

.tooltip-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.tooltip-value {
    font-size: 0.9rem;
    color: #19335a;
    font-weight: 600;
    text-align: right;
}

/* Animación para el tooltip */
.tooltip {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tooltip.show {
    opacity: 1;
}

/* Responsive para tooltips */
@media (max-width: 768px) {
    .tooltip-inner {
        max-width: 250px;
    }
    
    .tooltip-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .tooltip-item {
        padding: 0.375rem 0.75rem;
    }
    
    .tooltip-label {
        font-size: 0.8rem;
    }
    
    .tooltip-value {
        font-size: 0.85rem;
    }
}

/* ===== ESTILOS PARA OVERLAY DE CARGA ===== */

/* Overlay de carga de pantalla completa */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.show {
    display: flex;
}

/* Contenedor del spinner */
.loading-spinner-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem 3rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Spinner animado */
.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Texto del spinner */
.loading-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    text-align: center;
}

.loading-subtext {
    font-size: 0.9rem;
    color: var(--secondary-color);
    text-align: center;
    margin-top: -0.5rem;
}

/* Responsive para el overlay de carga */
@media (max-width: 768px) {
    .loading-spinner-container {
        padding: 1.5rem 2rem;
        gap: 1rem;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
        border-width: 4px;
    }
    
    .loading-text {
        font-size: 1rem;
    }
    
    .loading-subtext {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .loading-spinner-container {
        padding: 1rem 1.5rem;
    }
    
    .loading-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .loading-text {
        font-size: 0.9rem;
    }
    
    .loading-subtext {
        font-size: 0.8rem;
    }
}

/* ========================================
   ESTILOS PARA GEMINI AI
   ======================================== */

/* Botón de Gemini con efecto hover */
.btn-gemini {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-gemini:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: white;
}

.btn-gemini:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn-gemini i {
    font-size: 1rem;
}

/* Modal de Gemini - animación de entrada */
#geminiModal .modal-dialog {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilo para el contenido de sugerencias */
#geminiSugerencias {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    font-size: 0.95rem;
}

/* Efecto de brillo en el header del modal */
#geminiModal .modal-header {
    position: relative;
    overflow: hidden;
}

#geminiModal .modal-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Badge de recurrencia animado */
#geminiRecurrenciaBadge {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Spinner de carga personalizado */
#geminiLoader .spinner-border {
    border-width: 4px;
}

/* Mejora visual para el botón de copiar */
#geminiCopyBtn {
    transition: all 0.3s ease;
}

#geminiCopyBtn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Responsive para el modal de Gemini */
@media (max-width: 768px) {
    #geminiModal .modal-dialog {
        margin: 0.5rem;
    }
    
    #geminiModal .modal-body {
        padding: 1rem !important;
    }
    
    #geminiSugerencias {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .btn-gemini {
        font-size: 0.75rem;
        padding: 0.3rem 0.6rem;
    }
}

@media (max-width: 576px) {
    #geminiModal .modal-header h5 {
        font-size: 1.1rem !important;
    }
    
    #geminiSugerencias {
        font-size: 0.85rem;
        line-height: 1.6;
    }
}

/* Efecto de pulso en el icono de estrellas */
.btn-gemini i.bi-stars {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Desactivar el pulso al hacer hover */
.btn-gemini:hover i.bi-stars {
    animation: none;
}

/* ===== ESTILOS PARA ICONOS DE BLOQUEO DE CLIENTES ===== */

/* Icono rojo para clientes bloqueados (BLOQUEADO = 1) */
.cliente-bloqueado-icon-rojo {
    color: #dc3545;
    font-size: 0.9rem;
    margin-right: 0.4rem;
    cursor: help;
}

/* Icono verde para clientes habilitados (BLOQUEADO = 0) */
.cliente-bloqueado-icon-verde {
    color: #28a745;
    font-size: 0.9rem;
    margin-right: 0.4rem;
    cursor: help;
}

/* Responsive para los iconos de bloqueo */
@media (max-width: 768px) {
    .cliente-bloqueado-icon-rojo,
    .cliente-bloqueado-icon-verde {
        font-size: 0.8rem;
        margin-right: 0.3rem;
    }
}

@media (max-width: 576px) {
    .cliente-bloqueado-icon-rojo,
    .cliente-bloqueado-icon-verde {
        font-size: 0.75rem;
        margin-right: 0.25rem;
    }
}

/* ===== ESTILOS PARA FILTROS DE BLOQUEO ===== */

/* Botón Habilitados */
.btn-filter-bloqueo-habilitados {
    background: #d1edff;
    border-color: #b3d9ff;
    color: #0c5460;
}

.btn-filter-bloqueo-habilitados:hover {
    background: #b3d9ff;
    border-color: #80c7ff;
    color: #0a4a54;
}

.btn-filter-bloqueo-habilitados.active {
    background: #c8e6c9;
    border-color: #a5d6a7;
    color: #2e7d32;
    box-shadow: 0 2px 4px rgba(76, 175, 80, 0.2);
}

/* Botón Bloqueados */
.btn-filter-bloqueo-bloqueados {
    background: #ffebee;
    border-color: #ffcdd2;
    color: #c62828;
}

.btn-filter-bloqueo-bloqueados:hover {
    background: #ffcdd2;
    border-color: #ef9a9a;
    color: #b71c1c;
}

.btn-filter-bloqueo-bloqueados.active {
    background: #ffcdd2;
    border-color: #ef9a9a;
    color: #b71c1c;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.2);
}

/* Botón Todos para bloqueo */
.btn-filter-bloqueo-todos {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.btn-filter-bloqueo-todos:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #495057;
}

.btn-filter-bloqueo-todos.active {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
    box-shadow: 0 2px 4px rgba(25, 101, 192, 0.2);
}

