/* ============================================================
   stats.css — Styles spécifiques statistiques
   Version : 1 | Date : 2026-05-25 19:30
   Auteur  : Access-IQ / Jérôme Barbaras
============================================================ */

/* ── KPI cards ── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 2rem; }
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; }
.kpi-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.kpi-value { font-family: var(--mono); font-size: 28px; font-weight: 500; line-height: 1; }
.kpi-unit { font-size: 13px; color: var(--muted); margin-left: 4px; }
.kpi-delta { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.delta-up { color: var(--danger); }
.delta-down { color: var(--green); }
.delta-neutral { color: var(--muted); }

/* ── Section ── */
.section { margin-bottom: 2rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.section-title { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }

/* ── Card grid & chart ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1.5rem; }
.chart-wrap { position: relative; width: 100%; height: 220px; }

/* ── Device table ── */
.device-table { width: 100%; border-collapse: collapse; }
.device-table th { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); text-align: left; padding: 0 12px 10px; font-weight: 500; border-bottom: 1px solid var(--border); }
.device-table td { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.03); font-size: 13px; }
.device-table tr:last-child td { border-bottom: none; }
.device-table td:not(:first-child) { font-family: var(--mono); text-align: right; }
.bar-cell { display: flex; align-items: center; gap: 10px; }
.bar-track { flex: 1; height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 2px; transition: width 0.4s; }

/* ── Cost config ── */
.cost-config { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; padding: 1rem 1.25rem; background: var(--surface2); border-radius: 10px; border: 1px solid var(--border); }
.cost-field { display: flex; align-items: center; gap: 8px; }
.cost-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.cost-input { font-family: var(--mono); font-size: 13px; width: 80px; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-align: right; }

/* ── Heatmap placeholder ── */
.heatmap-placeholder { height: 140px; background: var(--surface2); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }

/* ── Empty state ── */
.empty { text-align: center; padding: 3rem; color: var(--muted); font-size: 13px; }
.empty-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.4; }

/* ── Date range ── */
.date-range { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.date-input { font-family: var(--mono); font-size: 12px; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); }

/* ── Résumé tableau ── */
.resume-wrap { overflow-x: auto; margin-bottom: 2rem; }
.resume-table { border-collapse: collapse; font-size: 13px; white-space: nowrap; table-layout: fixed; width: max-content; min-width: 100%; }
.resume-table th { font-size: 11px; font-weight: 500; text-align: center; padding: 8px 12px; border-bottom: 1px solid var(--border); color: var(--muted); background: var(--surface); position: sticky; top: 0; width: 90px; }
.resume-table th.col-label { text-align: left; width: 120px; }
.resume-table td { padding: 8px 10px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.03); }
.resume-table td.col-label { text-align: left; color: var(--muted); font-size: 12px; font-weight: 500; }
.resume-table tr.row-sep td { border-top: 1px solid var(--border); }
.resume-table tr.row-max td { color: var(--accent); font-weight: 500; }
.resume-table td.col-total { font-weight: 600; background: rgba(79,142,247,0.05); border-left: 1px solid var(--border); text-align: center; }
.resume-table td.col-moy   { color: var(--muted); background: rgba(255,255,255,0.02); text-align: center; }
.resume-table th.col-total, .resume-table th.col-moy { background: var(--surface2); }
.resume-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

@media (max-width: 700px) {
  .main { padding: 1rem; }
  .card-grid { grid-template-columns: 1fr; }
  .date-range { margin-left: 0; }
}
