/* ════════════════════════════════════════════════════════════════
   📊 ESTADÍSTICAS ULTRA-COMPACTAS (UNA LÍNEA)
   ════════════════════════════════════════════════════════════════ */

.modern-stats-container {
    margin-bottom: 16px; /* ✅ Muy reducido */
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px; /* ✅ Muy reducido */
}

.stats-title {
    margin: 0;
    color: #495057;
    font-weight: 600;
    font-size: 14px; /* ✅ Más pequeño */
    display: flex;
    align-items: center;
}

.stats-title i {
    color: #28a745;
    font-size: 16px; /* ✅ Más pequeño */
}

.modern-stat-card {
    background: #ffffff;
    border-radius: 8px; /* ✅ Muy reducido */
    padding: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); /* ✅ Sombra mínima */
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    border: none;
    height: 50px; /* ✅ REDUCIDO de 60px a 50px */
}

.modern-stat-card:hover {
    transform: translateY(-1px); /* ✅ Movimiento mínimo */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.stat-card-body {
    padding: 8px 12px; /* ✅ REDUCIDO padding */
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    align-items: center;
}

/* ✅ LAYOUT: Todo en una línea horizontal */
.stat-content-wrapper {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 8px; /* ✅ REDUCIDO gap */
}

.stat-icon {
    width: 30px; /* ✅ REDUCIDO de 36px a 30px */
    height: 30px;
    border-radius: 6px; /* ✅ REDUCIDO border-radius */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px; /* ✅ REDUCIDO de 16px a 14px */
    color: white;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* ✅ Colores específicos por tipo de estadística */
.stat-card--primary .stat-mini-progress {
    background: linear-gradient(90deg, #007bff, #0056b3);
}

.stat-card--success .stat-mini-progress {
    background: linear-gradient(90deg, #28a745, #1e7e34);
}

.stat-card--warning .stat-mini-progress {
    background: linear-gradient(90deg, #ffc107, #e0a800);
}

.stat-card--danger .stat-mini-progress {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.stat-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px; /* ✅ Todo en línea horizontal */
}

.stat-value {
    font-size: 20px; /* ✅ REDUCIDO de 24px a 20px */
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Inter', sans-serif;
    line-height: 1;
    margin: 0; /* ✅ Sin margen */
}

.stat-label {
    font-size: 11px; /* ✅ REDUCIDO de 13px a 11px */
    font-weight: 500; /* ✅ Menos peso */
    color: #495057;
    line-height: 1;
    margin: 0; /* ✅ Sin margen */
    white-space: nowrap; /* ✅ No cortar texto */
}

/* ❌ ELIMINAR: descripción (subtítulo) */
.stat-description {
    display: none; /* ✅ OCULTAR COMPLETAMENTE */
}

/* ✅ Barra de progreso minimalista (aún más pequeña) */
.stat-mini-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 0 0 8px 8px;
    transition: width 2s ease;
    width: 0%;
}

/* ✅ Efecto de fondo más sutil */
.modern-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px; /* ✅ Muy reducido */
    height: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    border-radius: 50%;
    transform: translate(15%, -15%);
    z-index: 1;
}

/* ════════════════════════════════════════════════════════════════
   📱 RESPONSIVE ULTRA-COMPACTO
   ════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .modern-stat-card {
        height: 45px; /* ✅ REDUCIDO */
    }
    
    .stat-card-body {
        padding: 6px 10px; /* ✅ REDUCIDO */
    }
    
    .stat-content-wrapper {
        gap: 6px; /* ✅ REDUCIDO */
    }
    
    .stat-icon {
        width: 26px; /* ✅ REDUCIDO */
        height: 26px;
        font-size: 12px; /* ✅ REDUCIDO */
    }
    
    .stat-value {
        font-size: 16px; /* ✅ REDUCIDO */
    }
    
    .stat-label {
        font-size: 10px; /* ✅ REDUCIDO */
    }
}

@media (max-width: 576px) {
    .modern-stat-card {
        height: 40px; /* ✅ REDUCIDO */
    }
    
    .stat-value {
        font-size: 14px; /* ✅ REDUCIDO */
    }
    
    .stat-label {
        font-size: 9px; /* ✅ REDUCIDO */
    }
}

/* ════════════════════════════════════════════════════════════════
   🎨 FILTROS COLAPSABLES
   ════════════════════════════════════════════════════════════════ */

.collapsible-filters-container {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* ✅ HEADER COMPACTO */
.filters-toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters-toggle-header:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #f8f9fa 100%);
}

.filters-toggle-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.filters-toggle-btn {
    border: none;
    background: transparent;
    color: #495057;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.filters-toggle-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.filters-toggle-btn.expanded .toggle-icon {
    transform: rotate(180deg);
}

.filters-toggle-btn.expanded .toggle-text::after {
    content: " Filtros";
}

.filters-toggle-btn.expanded .toggle-text {
    color: #007bff;
}

/* ✅ INDICADOR DE FILTROS ACTIVOS */
.active-filters-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: fadeInScale 0.3s ease;
}

.active-filters-count {
    background: linear-gradient(135deg, #007bff, #0056b3) !important;
    border: none;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
}

.active-filters-text {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

/* ✅ CONTENIDO COLAPSABLE */
.filters-collapsible-content {
    padding: 20px;
    background: #ffffff;
    border-top: 1px solid #f8f9fa;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.filters-collapsible-content.show {
    animation: expandDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.filters-collapsible-content.hide {
    animation: collapseUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ✅ GRID DE FILTROS ORGANIZADO */
.filters-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 20px;
    align-items: end;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin: 0;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-label i {
    color: #007bff;
    font-size: 11px;
}

/* ✅ ESTILOS DE INPUTS MEJORADOS */
.modern-search-box {
    position: relative;
}

.modern-search-input {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 35px 10px 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #ffffff;
}

.modern-search-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
    outline: none;
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    cursor: pointer;
    transition: color 0.3s ease;
}

.search-clear:hover {
    color: #dc3545;
}

.modern-select {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.modern-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
    outline: none;
}

.modern-filter-btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 10px 20px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    transition: all 0.3s ease;
}

.modern-filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* ✅ ANIMACIONES */
@keyframes expandDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 300px;
        transform: translateY(0);
    }
}

@keyframes collapseUp {
    from {
        opacity: 1;
        max-height: 300px;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        max-height: 0;
        transform: translateY(-10px);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ✅ RESPONSIVE */
@media (max-width: 768px) {
    .filters-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .filters-toggle-header {
        padding: 10px 16px;
    }
    
    .filters-collapsible-content {
        padding: 16px;
    }
}

@media (max-width: 576px) {
    .filters-toggle-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .active-filters-indicator {
        font-size: 11px;
    }
}