/* ──────────────────────────────────────────────────────────────────────────
   Dashboard.html — thème clair
   ────────────────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
body {
    margin: 0;
    background: #f8fafc;
    color: #0f172a;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 13px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 28px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
}
.logo-icon {
    font-size: 32px;
    width: 52px; height: 52px;
    display: grid; place-items: center;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
}
header h1 {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    color: #0f172a;
}
.subtitle {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

main { 
    padding: 24px 28px 60px; 
    max-width: 1400px; 
    margin: 0 auto; }

/* ── KPIs ───────────────────────────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}
.kpi {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid;
    border-radius: 8px;
    padding: 16px 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.15s, box-shadow 0.15s;
}
.kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.08);
}
.kpi-icon { font-size: 28px; opacity: 0.85; }
.kpi-body { flex: 1; }
.kpi-value { font-size: 24px; font-weight: bold; color: #0f172a; font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi-label { font-size: 11px; text-transform: uppercase; color: #64748b; letter-spacing: 0.5px; margin-top: 3px; }
.kpi-sub   { font-size: 10px; color: #94a3b8; margin-top: 2px; }
.kpi-alert { font-size: 10px; color: #b91c1c; margin-top: 4px; font-weight: bold; }

.kpi-blue  { border-left-color: #3b82f6; }
.kpi-green { border-left-color: #10b981; }
.kpi-cyan  { border-left-color: #0891b2; }
.kpi-amber { border-left-color: #d97706; }
.kpi-red   { border-left-color: #dc2626; background: linear-gradient(90deg, #fef2f2 0%, #ffffff 50%); }

/* ── Filtres ────────────────────────────────────────────────────────────── */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.filter-label { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; margin-right: 6px; }
.pill {
    padding: 6px 14px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}
.pill:hover { border-color: #3b82f6; color: #1e40af; background: #eff6ff; }
.pill.active { background: #3b82f6; border-color: #3b82f6; color: #ffffff; }
.pill.sev-high.active { background: #dc2626; border-color: #dc2626; }
.pill.sev-med.active  { background: #ea580c; border-color: #ea580c; }
.pill.sev-low.active  { background: #2563eb; border-color: #2563eb; }

/* ── Audit cards ────────────────────────────────────────────────────────── */
.audit-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-left: 3px solid #94a3b8;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.audit-card.audit-high { border-left-color: #dc2626; }
.audit-card.audit-med  { border-left-color: #ea580c; }
.audit-card.audit-low  { border-left-color: #2563eb; }
.audit-card.audit-ok   { border-left-color: #16a34a; opacity: 0.7; }

.audit-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}
.audit-head:hover { background: #f8fafc; }
.audit-icon { font-size: 18px; }
.audit-title { flex: 1; color: #0f172a; font-weight: 500; }
.audit-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    background: #f1f5f9;
    color: #475569;
}
.audit-card.audit-high .audit-badge { background: #fee2e2; color: #991b1b; }
.audit-card.audit-med  .audit-badge { background: #ffedd5; color: #9a3412; }
.audit-card.audit-low  .audit-badge { background: #dbeafe; color: #1e40af; }
.audit-card.audit-ok   .audit-badge { background: #dcfce7; color: #166534; }

.audit-toggle { color: #94a3b8; font-size: 11px; transition: transform 0.15s; }
.audit-card.open .audit-toggle { transform: rotate(90deg); }

.audit-body {
    display: none;
    border-top: 1px solid #e2e8f0;
    max-height: 500px;
    overflow-y: auto;
    background: #fafbfc;
}
.audit-card.open .audit-body { display: block; }

.audit-item {
    padding: 8px 16px;
    border-bottom: 1px solid #eef2f7;
}
.audit-item:last-child { border-bottom: none; }
.audit-item-label {
    font-family: Consolas, monospace;
    font-size: 12px;
    color: #1e293b;
    word-break: break-all;
}
.audit-item-detail {
    font-size: 11px;
    color: #64748b;
    margin-top: 2px;
}
.audit-more {
    padding: 8px 16px;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
    background: #f1f5f9;
}

.muted { color: #94a3b8; font-style: italic; }

/* ── Scrollbars ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }