/* Reports Styles */
.filters-section {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.filters-row {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
}

.form-group {
    min-width: 200px;
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.filter-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.date-inputs {
    display: flex;
    gap: 10px;
}

.actions-row {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* KPI Cards */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.kpi-card {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s;
}

.kpi-card:hover {
    transform: translateY(-5px);
}

.kpi-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.kpi-icon.primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.kpi-icon.success { background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%); }
.kpi-icon.warning { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.kpi-icon.info { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.kpi-label {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 5px;
}

.kpi-change {
    font-size: 12px;
    font-weight: 500;
}

.kpi-change.positive { color: #27ae60; }
.kpi-change.negative { color: #e74c3c; }

/* Charts Section */
.charts-section {
    margin-bottom: 30px;
}

.chart-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px;
    height: 300px;
}

.chart-container.large {
    grid-column: 1 / -1;
    height: 400px;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.chart-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

.chart-actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: none;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #6c757d;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn-icon:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Tables Section */
.tables-section {
    margin-bottom: 30px;
}

.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.table-header h3 {
    margin: 0;
    color: #2c3e50;
}

.table-scroll {
    overflow-x: auto;
}

#pedidosTable {
    width: 100%;
    border-collapse: collapse;
}

#pedidosTable th {
    background: #f8f9fa;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

#pedidosTable td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

#pedidosTable tbody tr:hover {
    background: #f8f9fa;
}

/* Status Badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    display: inline-block;
}

.status-pendiente { background: #fff3cd; color: #856404; }
.status-confirmado { background: #d1ecf1; color: #0c5460; }
.status-en_ruta { background: #d4edda; color: #155724; }
.status-entregado { background: #d4edda; color: #155724; }
.status-cancelado { background: #f8d7da; color: #721c24; }

/* Modal Styles (igual que en schedule) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
}

.modal-content.xlarge {
    width: 90%;
    max-width: 1200px;
    height: 80vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.modal-body {
    padding: 25px;
    height: calc(100% - 80px);
}

#expandedChart {
    width: 100% !important;
    height: 100% !important;
}

/* Responsive */
@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
    }
    
    .filter-group {
        flex-direction: column;
    }
    
    .form-group {
        min-width: auto;
    }
    
    .chart-row {
        grid-template-columns: 1fr;
    }
    
    .chart-container.large {
        grid-column: 1;
    }
    
    .kpi-cards {
        grid-template-columns: 1fr;
    }
    
    .actions-row {
        justify-content: center;
    }
    
    .table-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Button Styles */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #2980b9;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}