:root {
  --bg: #f2f0fa;
  --panel: #ffffff;
  --ink: #1e1a3c;
  --muted: #6b6890;
  --line: #dcd8ee;
  --accent: #f0507a;
  --accent-soft: #fbd3de;
  --teal: #2bb3a3;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15122b; --panel: #1e1a3c; --ink: #f1eefc; --muted: #a39fc7;
    --line: #34305c; --accent: #ff6f93; --accent-soft: #4a2a45; --teal: #45d0bf;
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--ink);
  font: 16px/1.5 ui-rounded, "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
main { max-width: 1040px; margin: 0 auto; padding: 24px 20px 64px; }
h1 { font-size: 1.4rem; margin: 0; }
h2 { font-size: 1rem; margin: 0 0 16px; font-weight: 650; }
.muted { color: var(--muted); }
.note { font-size: .9rem; margin: 16px 0 0; }

.top { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: .9rem; }

button {
  font: inherit; font-weight: 600; cursor: pointer;
  background: var(--ink); color: var(--bg); border: 0; border-radius: 10px; padding: 8px 14px;
}
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Chiffre du jour : l'élément mémorable de la page */
.hero { display: flex; flex-wrap: wrap; gap: 32px 56px; align-items: flex-end; padding: 8px 0 32px; }
.big { display: flex; flex-direction: column; }
.big-num { font-size: clamp(4.5rem, 16vw, 8.5rem); line-height: .9; font-weight: 800; letter-spacing: -.04em; color: var(--accent); font-variant-numeric: tabular-nums; }
.big-label { color: var(--muted); margin-top: 8px; }

.figures { display: flex; gap: 40px; margin: 0; flex-wrap: wrap; }
.figures div { display: flex; flex-direction: column-reverse; }
.figures dt { color: var(--muted); font-size: .9rem; }
.figures dd { margin: 0; font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.figures.small { gap: 28px; }
.figures.small dd { font-size: 1.6rem; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.grid .panel { margin-bottom: 0; }
.grid { margin-bottom: 20px; }

/* Graphique : barres par jour */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 8px; }
.col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.col .bar { width: 100%; background: var(--accent-soft); border-radius: 4px 4px 0 0; min-height: 2px; }
.col.today .bar { background: var(--accent); }
.col .tick { position: absolute; bottom: -22px; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.chart { margin-bottom: 28px; }

/* Listes à barres horizontales */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.bars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .val { font-variant-numeric: tabular-nums; font-weight: 650; }
.bars .track { grid-column: 1 / -1; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--teal); border-radius: 3px; }

.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
td code { font: .85rem ui-monospace, Menlo, Consolas, monospace; }
tbody tr:last-child td { border-bottom: 0; }

.login { max-width: 360px; margin: 18vh auto 0; padding: 0 20px; display: grid; gap: 12px; }
.login input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.error { color: var(--accent); min-height: 1.4em; margin: 0; }
[hidden] { display: none !important; }
