/* ============================================================================
   REPORTES.CSS - Estilos para módulo de reportes
   ============================================================================ */

/* Filtros */
.report-filters-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 180px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.filter-select,
.filter-input {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #00853F;
    box-shadow: 0 0 0 3px rgba(0, 133, 63, 0.1);
}

/* Tabs de Reportes */
.report-tabs {
    display: flex;
    gap: 5px;
    background: #f8fafc;
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 25px;
    overflow-x: auto;
}

.report-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.report-tab:hover {
    background: white;
    color: #00853F;
}

.report-tab.active {
    background: white;
    color: #00853F;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.report-tab i {
    font-size: 16px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    min-width: 0;
}

.kpi-detail-button {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: #f8fafc;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.kpi-detail-button:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.kpi-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.kpi-icon.blue { background: linear-gradient(135deg, #3b82f6, #1e40af); }
.kpi-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.kpi-icon.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.kpi-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.kpi-icon.purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.kpi-icon.teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }

.kpi-content {
    flex: 1;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    margin-bottom: 5px;
}

.kpi-label {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
}

.kpi-change {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.kpi-change.positive {
    color: #10b981;
}

.kpi-change.negative {
    color: #ef4444;
}

.kpi-change.neutral {
    color: #64748b;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chart-card.span-2 {
    grid-column: span 2;
}

.chart-header {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-title i {
    color: #00853F;
}

.chart-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.btn-icon:hover {
    background: #f8fafc;
    border-color: #00853F;
    color: #00853F;
}

.chart-body {
    padding: 20px;
}

.chart-body canvas {
    max-height: 350px;
}

/* Alert Cards */
.alert-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.alert-card {
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    color: white;
}

.alert-card.critical {
    background: linear-gradient(135deg, #dc2626, #991b1b);
}

.alert-card.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.alert-card.info {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
}

.alert-card.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.alert-icon {
    font-size: 36px;
    opacity: 0.9;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.9;
    margin-bottom: 5px;
}

.alert-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
}

.alert-description {
    font-size: 13px;
    opacity: 0.9;
}

/* Stats Cards Inline */
.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card-inline {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Data Table */
.table-wrapper {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-badge.success {
    background: #dcfce7;
    color: #16a34a;
}

.status-badge.warning {
    background: #fef3c7;
    color: #f59e0b;
}

.status-badge.danger {
    background: #fee2e2;
    color: #dc2626;
}

.status-badge.info {
    background: #dbeafe;
    color: #2563eb;
}

.status-badge.blocked {
    background: #f3e8ff;
    color: #9333ea;
}

/* Responsive */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-card.span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .kpi-grid,
    .alert-cards-grid,
    .stats-grid-4 {
        grid-template-columns: 1fr;
    }
}
