/* ===============================================
   PUNTOS NET - DASHBOARD EJECUTIVO CSS
   Estilos para el dashboard ejecutivo mensual
   =============================================== */

.dashboard-executive {
    padding: 0;
    background: var(--background, #f5f7fa);
}

/* ========== HEADER ========== */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary-dark, #30586B) 0%, var(--primary-medium, #407C94) 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(48, 88, 107, 0.15);
}

.dashboard-header h1 {
    font-size: 1.75rem;
    margin: 0 0 0.25rem 0;
    font-weight: 700;
}

.dashboard-header h1 i {
    margin-right: 0.5rem;
    color: var(--primary-light, #6DA6C1);
}

.dashboard-header .subtitle {
    margin: 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.period-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.period-selector label {
    margin: 0;
    font-weight: 500;
    font-size: 0.9rem;
}

.period-selector select {
    background: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.period-selector select:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========== KPI GRID PRINCIPAL (4 columnas) ========== */
.kpi-grid-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.kpi-main-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-main-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.kpi-main-card.blue {
    border-left-color: var(--primary-medium, #407C94);
}

.kpi-main-card.blue .kpi-main-icon {
    background: linear-gradient(135deg, var(--primary-medium, #407C94), var(--primary-light, #6DA6C1));
}

.kpi-main-card.red {
    border-left-color: #dc3545;
}

.kpi-main-card.red .kpi-main-icon {
    background: linear-gradient(135deg, #dc3545, #ff6b7a);
}

.kpi-main-card.green {
    border-left-color: #10b981;
}

.kpi-main-card.green .kpi-main-icon {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.kpi-main-card.purple {
    border-left-color: #8b5cf6;
}

.kpi-main-card.purple .kpi-main-icon {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

.kpi-main-icon {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.15;
    font-size: 2.5rem;
}

.kpi-main-content {
    position: relative;
    z-index: 1;
}

.kpi-main-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.kpi-main-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.kpi-main-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid #e9ecef;
    margin-top: 0.75rem;
}

.kpi-sub-label {
    font-size: 0.8rem;
    color: #6c757d;
}

.kpi-sub-value {
    font-size: 1rem;
    font-weight: 600;
}

.kpi-sub-value.success {
    color: #10b981;
}

.kpi-sub-value.danger {
    color: #dc3545;
}

.kpi-progress-mini {
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0.75rem;
    position: relative;
}

.kpi-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease, background-color 0.3s ease;
}

.kpi-progress-fill.success {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.kpi-progress-fill.danger {
    background: linear-gradient(90deg, #dc3545, #ff6b7a);
}

.kpi-percentage {
    font-size: 0.85rem;
    font-weight: 600;
    color: #6c757d;
    margin-top: 0.5rem;
    text-align: right;
}

.kpi-main-subtext {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.5rem;
    font-style: italic;
}

/* ========== DASHBOARD GRID 2 COLUMNAS ========== */
.dashboard-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.dashboard-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ========== CARDS ========== */
.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.dashboard-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(to right, #f8f9fa, white);
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark, #30586B);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header h3 i {
    color: var(--primary-medium, #407C94);
}

.card-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #e9ecef;
    color: #495057;
}

.card-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.card-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

.card-badge.alert {
    background: #dc3545;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.card-body {
    padding: 1.5rem;
}

/* ========== ALERTAS ========== */
.alertas-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alerta-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid;
    background: white;
}

.alerta-item.danger {
    border-left-color: #dc3545;
    background: #fef2f2;
}

.alerta-item.warning {
    border-left-color: #ffc107;
    background: #fffbeb;
}

.alerta-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.alerta-item.danger .alerta-icon {
    background: #fee2e2;
    color: #dc3545;
}

.alerta-item.warning .alerta-icon {
    background: #fef3c7;
    color: #d97706;
}

.alerta-content {
    flex: 1;
}

.alerta-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.alerta-item.danger .alerta-title {
    color: #991b1b;
}

.alerta-item.warning .alerta-title {
    color: #92400e;
}

.alerta-message {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
}

/* ========== PENDIENTES ========== */
.pendientes-summary {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.pendientes-monto {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pendientes-monto .label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
}

.pendientes-monto .value {
    font-size: 1.5rem;
    font-weight: 700;
}

.pendientes-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pendiente-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s;
}

.pendiente-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.pendiente-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.pendiente-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pendiente-folio {
    font-weight: 600;
    color: var(--primary-dark, #30586B);
    font-size: 0.9rem;
}

.pendiente-proyecto {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
    padding-left: 0.25rem;
}

.pendiente-monto {
    font-weight: 700;
    font-size: 1rem;
}

.pendiente-more {
    text-align: center;
    padding: 0.5rem;
    color: #6c757d;
    font-size: 0.85rem;
    font-style: italic;
}

/* ========== TARJETAS KPI NUEVAS (OPCIÓN 3) ========== */
.kpi-amount {
    text-align: center;
    padding: 1.5rem 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid #e9ecef;
}

.kpi-amount.success {
    border-color: #10b981;
    background: linear-gradient(135deg, #d1fae5 0%, #ffffff 100%);
}

.kpi-amount.danger {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fee2e2 0%, #ffffff 100%);
}

.kpi-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.kpi-amount.success .kpi-value {
    color: #065f46;
}

.kpi-amount.danger .kpi-value {
    color: #991b1b;
}

.kpi-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-status {
    margin-bottom: 1.5rem;
}

.kpi-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #495057;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.2s;
}

.status-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.status-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.status-text {
    flex: 1;
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.status-item strong {
    font-size: 0.9rem;
    color: #2c3e50;
    font-weight: 700;
}

/* ========== ALERTAS KPI ========== */
.kpi-alert {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border-left: 4px solid;
    align-items: flex-start;
}

.kpi-alert.alert-success {
    background: #d1fae5;
    border-left-color: #10b981;
}

.kpi-alert.alert-warning {
    background: #fef3c7;
    border-left-color: #f59e0b;
}

.kpi-alert.alert-danger {
    background: #fee2e2;
    border-left-color: #dc3545;
}

.kpi-alert i {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.kpi-alert.alert-success i {
    color: #065f46;
}

.kpi-alert.alert-warning i {
    color: #92400e;
}

.kpi-alert.alert-danger i {
    color: #991b1b;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.kpi-alert.alert-success .alert-title {
    color: #065f46;
}

.kpi-alert.alert-warning .alert-title {
    color: #92400e;
}

.kpi-alert.alert-danger .alert-title {
    color: #991b1b;
}

.alert-message {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.5;
    font-weight: 500;
}

/* ========== TOP CONSUMO ========== */
.top-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.top-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.top-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.top-rank.danger {
    background: #fee2e2;
    color: #dc3545;
}

.top-rank.warning {
    background: #fef3c7;
    color: #f59e0b;
}

.top-rank.success {
    background: #d1fae5;
    color: #10b981;
}

.top-content {
    flex: 1;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.top-nombre {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

.top-porcentaje {
    font-weight: 700;
    font-size: 1rem;
}

.top-porcentaje.danger {
    color: #dc3545;
}

.top-porcentaje.warning {
    color: #f59e0b;
}

.top-porcentaje.success {
    color: #10b981;
}

.top-progress {
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.top-progress-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.6s ease;
}

.top-progress-bar.danger {
    background: linear-gradient(90deg, #dc3545, #ff6b7a);
}

.top-progress-bar.warning {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.top-progress-bar.success {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.top-detalles {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #6c757d;
}

/* ========== ESTADOS VACÍOS ========== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    color: var(--primary-light, #6DA6C1);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

.empty-state-small {
    text-align: center;
    padding: 2rem 1rem;
    color: #adb5bd;
    font-size: 0.9rem;
    font-style: italic;
}

.info-message {
    background: #d1ecf1;
    border-left: 4px solid #0c5460;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.info-message i {
    color: #0c5460;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.info-message p {
    margin: 0;
    font-size: 0.85rem;
    color: #0c5460;
    line-height: 1.4;
}

.info-message strong {
    color: #084298;
    font-weight: 700;
}

/* ========== BADGES ========== */
.badge {
    padding: 0.35rem 0.65rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1400px) {
    .kpi-grid-main {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .dashboard-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-left, .header-right {
        width: 100%;
    }
    
    .period-selector {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .kpi-grid-main {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .kpi-main-value {
        font-size: 1.75rem;
    }
    
    .period-selector {
        flex-wrap: wrap;
    }
    
    .kpi-value {
        font-size: 1.75rem;
    }
}

/* ========== ANIMACIONES ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dashboard-card,
.kpi-main-card {
    animation: fadeIn 0.4s ease-out;
}

.dashboard-card:nth-child(1) { animation-delay: 0.05s; }
.dashboard-card:nth-child(2) { animation-delay: 0.1s; }
.dashboard-card:nth-child(3) { animation-delay: 0.15s; }
.dashboard-card:nth-child(4) { animation-delay: 0.2s; }
