/* ═══════════════════════════════════════════════════════════════════════════════
   MODULE CARBURANT - STYLES
   Analyse consommation flotte - Vannes Express
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════
   HEADER ACTIONS
   ═══════════════════════════════════════════════════════════════════════════════ */

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.header-actions .form-select {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    min-width: 140px;
}

.header-actions .form-select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   KPIs CARBURANT
   ═══════════════════════════════════════════════════════════════════════════════ */

.carburant-kpis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .carburant-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .carburant-kpis {
        grid-template-columns: 1fr;
    }
}

.carburant-kpis .kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.carburant-kpis .kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f5a623, #d97706);
}

.carburant-kpis .kpi-card:nth-child(1)::before {
    background: linear-gradient(90deg, #f5a623, #d97706);
}

.carburant-kpis .kpi-card:nth-child(2)::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.carburant-kpis .kpi-card:nth-child(3)::before {
    background: linear-gradient(90deg, #3b82f6, #2563eb);
}

.carburant-kpis .kpi-card:nth-child(4)::before {
    background: linear-gradient(90deg, #8b5cf6, #7c3aed);
}

.carburant-kpis .kpi-card.warning::before {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.carburant-kpis .kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.carburant-kpis .kpi-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.carburant-kpis .kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.carburant-kpis .kpi-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TABS NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════════ */

.carburant-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.tab-btn.active .tab-badge {
    background: rgba(255, 255, 255, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   TABLE ROWS
   ═══════════════════════════════════════════════════════════════════════════════ */

.table tbody tr.row-danger {
    background: rgba(239, 68, 68, 0.08);
}

.table tbody tr.row-danger:hover {
    background: rgba(239, 68, 68, 0.15);
}

.table tbody tr.row-warning {
    background: rgba(245, 158, 11, 0.08);
}

.table tbody tr.row-warning:hover {
    background: rgba(245, 158, 11, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════════════════════ */

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.badge-secondary {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* Badges de rang */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
}

.rank-badge.rank-gold {
    background: linear-gradient(135deg, #f5a623, #d97706);
    color: white;
}

/* Badges d'ecart */
.ecart-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.ecart-badge.ok {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.ecart-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.ecart-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════════════ */

.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state p {
    margin: 8px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   MODAL IMPORT
   ═══════════════════════════════════════════════════════════════════════════════ */

.import-zone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    background: var(--bg-tertiary);
}

.import-zone.drag-over {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.import-zone .import-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.import-zone p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.import-zone .text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* Preview */
#import-preview {
    margin-top: 20px;
}

#import-preview h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.preview-info {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.preview-info strong {
    color: var(--accent-blue);
    font-weight: 700;
}

.preview-table {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.preview-table .table {
    font-size: 12px;
    margin: 0;
}

.preview-table .table td {
    padding: 8px 10px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-table .header-row {
    background: var(--bg-tertiary);
    font-weight: 600;
}

/* Import result */
.import-success {
    padding: 20px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
}

.import-success h4 {
    margin: 0 0 16px 0;
    color: var(--accent-green);
    font-size: 16px;
}

.import-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.import-stats .stat {
    font-size: 14px;
    color: var(--text-secondary);
}

.import-stats .stat-value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 18px;
    margin-right: 6px;
}

.import-alertes {
    padding-top: 12px;
    border-top: 1px solid rgba(16, 185, 129, 0.3);
}

.import-alertes strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.import-alertes ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 13px;
}

.import-alertes li {
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════════
   CLASSEMENT CONSOMMATION
   ═══════════════════════════════════════════════════════════════════════════════ */

.ranking-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.ranking-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.ranking-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.ranking-card.ranking-best::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.ranking-card.ranking-worst::before {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.ranking-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.ranking-header .ranking-icon {
    font-size: 24px;
}

.ranking-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    transition: transform 0.2s ease;
}

.ranking-item:hover {
    transform: translateX(4px);
}

.ranking-item .rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    color: white;
}

.ranking-item .rank.rank-1 {
    background: linear-gradient(135deg, #fbbf24, #d97706);
}

.ranking-item .rank.rank-2 {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
}

.ranking-item .rank.rank-3 {
    background: linear-gradient(135deg, #d97706, #92400e);
}

.ranking-item .rank.rank-alert {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.ranking-item .ranking-vehicle {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.ranking-item .ranking-value {
    font-weight: 700;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 20px;
}

.ranking-item .ranking-value.best {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.ranking-item .ranking-value.worst {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
    .ranking-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions .form-select,
    .header-actions .btn {
        width: 100%;
    }

    .carburant-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 8px;
        margin-bottom: 16px;
    }

    .tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .import-zone {
        padding: 24px;
    }

    .import-stats {
        flex-direction: column;
        gap: 12px;
    }
}
