/* ═══════════════════════════════════════════════════════════════════════════════
   SUIVI KM - DASHBOARD STYLES
   ═══════════════════════════════════════════════════════════════════════════════ */

.suivi-km-container {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.suivi-km-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.suivi-km-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.suivi-km-month-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.suivi-km-month-selector input[type="month"] {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    color: #334155;
}

/* ═══ Tabs ═══ */
.suivi-km-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
    overflow-x: auto;
}

.suivi-km-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.suivi-km-tab:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.5);
}

.suivi-km-tab.active {
    background: white;
    color: #6366f1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ═══ KPI Cards ═══ */
.suivi-km-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.suivi-km-kpi {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.suivi-km-kpi .kpi-label {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.suivi-km-kpi .kpi-value {
    font-size: 28px;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
}

.suivi-km-kpi .kpi-value.positive { color: #10b981; }
.suivi-km-kpi .kpi-value.negative { color: #ef4444; }
.suivi-km-kpi .kpi-value.warning { color: #f59e0b; }
.suivi-km-kpi .kpi-value.indigo { color: #6366f1; }

.suivi-km-kpi .kpi-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ═══ Chart ═══ */
.suivi-km-chart-container {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.suivi-km-chart-container h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.suivi-km-chart-container canvas {
    max-height: 300px;
}

/* ═══ Table ═══ */
.suivi-km-table-container {
    background: white;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.suivi-km-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.suivi-km-table thead th {
    background: #f8fafc;
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
}

.suivi-km-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}

.suivi-km-table tbody tr:hover {
    background: #f8fafc;
}

.suivi-km-table .td-name {
    font-weight: 600;
    color: #1e293b;
}

.suivi-km-table .td-num {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.suivi-km-table .td-ecart.positive { color: #10b981; font-weight: 600; }
.suivi-km-table .td-ecart.negative { color: #ef4444; font-weight: 600; }
.suivi-km-table .td-ecart.warning { color: #f59e0b; font-weight: 600; }

/* ═══ Progress bar ═══ */
.revision-bar {
    width: 100%;
    max-width: 120px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.revision-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

.revision-bar-fill.ok { background: #10b981; }
.revision-bar-fill.warning { background: #f59e0b; }
.revision-bar-fill.danger { background: #ef4444; }

/* ═══ Fiabilite score ═══ */
.fiabilite-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.fiabilite-badge.excellent { background: #d1fae5; color: #065f46; }
.fiabilite-badge.bon { background: #dbeafe; color: #1e40af; }
.fiabilite-badge.moyen { background: #fef3c7; color: #92400e; }
.fiabilite-badge.faible { background: #fee2e2; color: #991b1b; }

/* ═══ Alertes ═══ */
.suivi-km-alertes {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alerte-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid;
}

.alerte-card.critique {
    background: #fef2f2;
    border-color: #fecaca;
}

.alerte-card.warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.alerte-card.info {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.alerte-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.alerte-dot.critique { background: #ef4444; }
.alerte-dot.warning { background: #f59e0b; }
.alerte-dot.info { background: #3b82f6; }

.alerte-content {
    flex: 1;
}

.alerte-message {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    margin-bottom: 4px;
}

.alerte-detail {
    font-size: 12px;
    color: #64748b;
}

.alerte-meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

/* ═══ Empty state ═══ */
.suivi-km-empty {
    text-align: center;
    padding: 48px 20px;
    color: #94a3b8;
}

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

.suivi-km-empty .empty-title {
    font-size: 18px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 8px;
}

/* ═══ Responsive ═══ */
@media (max-width: 768px) {
    .suivi-km-container { padding: 12px; }
    .suivi-km-kpis { grid-template-columns: repeat(2, 1fr); }
    .suivi-km-kpi .kpi-value { font-size: 22px; }
    .suivi-km-table { font-size: 12px; }
    .suivi-km-table thead th, .suivi-km-table tbody td { padding: 8px 10px; }
}
