/* Neuréty — identité « Nuit focus » (voir Visuels/Charte-graphique-Neurety.pdf) */
@font-face { font-family: "DM Sans"; src: url("../fonts/DMSans.woff") format("woff"); font-weight: 100 1000; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono.woff") format("woff"); font-weight: 100 800; font-display: swap; }

:root {
  --night: #14161F; --card: #1E2130; --card-2: #2A2E42; --line: #2A2E42;
  --text: #E8EAF2; --muted: #9AA0B8; --dim: #5A6078;
  --mint: #5EEAD4; --mint-dark: #0FA88F; --coral: #FF8A7A; --amber: #FFC46B;
  --ok-bg: #1F3A3A; --soon-bg: #3D3220; --late-bg: #4A2A2A;
  --radius: 22px; --radius-s: 14px;
  --glass: rgb(30 33 48 / .62); --glass-line: rgb(255 255 255 / .08);
  --spring: cubic-bezier(.34, 1.36, .64, 1); --ease: cubic-bezier(.22, 1, .36, 1);
  --nav-h: 76px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--night); color: var(--text);
  font: 400 16px/1.45 "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
/* Fond : grille fine + halos menthe/corail, pour que le verre ait quelque chose derrière lui */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(600px 420px at 85% -5%, rgb(94 234 212 / .16), transparent 70%),
    radial-gradient(520px 380px at -10% 35%, rgb(15 168 143 / .14), transparent 70%),
    radial-gradient(360px 300px at 70% 105%, rgb(255 138 122 / .10), transparent 70%),
    linear-gradient(#191c27 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, #191c27 1px, transparent 1px) 0 0 / 48px 48px,
    var(--night);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 10px; }
.mint { color: var(--mint); } .coral { color: var(--coral); } .amber { color: var(--amber); } .muted { color: var(--muted); }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Structure ---------- */
.app { display: flex; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding: max(20px, env(safe-area-inset-top)) 18px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto; width: 100%; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.wordmark { font-weight: 700; letter-spacing: -.02em; }
.page-title { font-size: 34px; font-weight: 700; letter-spacing: -.03em; margin: 4px 0 2px; line-height: 1.1; }
.page-sub { color: var(--muted); margin: 0 0 20px; }
.eyebrow { font: 500 12px "JetBrains Mono", monospace; color: var(--mint); letter-spacing: .02em; }

/* Barre du bas (téléphone) */
.nav {
  position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; gap: 2px; padding: 7px; z-index: 20; border-radius: 999px;
  width: min(520px, calc(100% - 24px)); justify-content: space-between;
}
.nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px;
  color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 500; border-radius: 999px;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.nav a.on { color: var(--night); background: var(--mint); }
.nav a:not(.on):hover { color: var(--text); }

/* Barre latérale (ordinateur) */
@media (min-width: 980px) {
  .nav {
    left: 24px; top: 24px; bottom: 24px; transform: none; width: 220px; flex-direction: column;
    justify-content: flex-start; border-radius: 28px; padding: 18px 12px; gap: 4px;
  }
  .nav .nav-brand { display: flex !important; }
  .nav a { flex: 0; flex-direction: row; gap: 12px; font-size: 15px; padding: 11px 14px; border-radius: 16px; }
  .main { padding-left: 270px; max-width: 1080px; padding-bottom: 40px; }
  .grid-2 { grid-template-columns: 1.4fr 1fr; }
}
.nav-brand { display: none; align-items: center; gap: 9px; padding: 6px 12px 18px; font-size: 20px; }

/* ---------- Verre (Liquid Glass) ---------- */
.glass {
  background: linear-gradient(180deg, rgb(255 255 255 / .07), rgb(255 255 255 / .02)), var(--glass);
  backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-line);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .08), 0 18px 50px rgb(0 0 0 / .35);
}
.card { border-radius: var(--radius); padding: 20px; margin-bottom: 14px; position: relative; overflow: hidden; }
.card h2 { font-size: 17px; margin: 0 0 12px; display: flex; align-items: center; gap: 9px; letter-spacing: -.01em; }
.card h2 svg { color: var(--mint); }
.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
.grid-2 > .card { margin-bottom: 0; }
.stack { display: grid; gap: 14px; margin-bottom: 14px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { border-radius: 18px; padding: 14px; }
.tile .label { font-size: 12px; color: var(--muted); }
.tile .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.tile .sub { font-size: 11px; color: var(--dim); }
@media (max-width: 420px) { .tile .value { font-size: 20px; } .tile { padding: 12px; } }

/* Chiffre héros */
.hero-label { color: var(--muted); font-size: 15px; }
.hero-num { font-size: 58px; font-weight: 700; letter-spacing: -.045em; line-height: 1.05; color: var(--mint); margin: 2px 0; font-variant-numeric: tabular-nums; }
.hero-num.neg { color: var(--coral); }
.bar { height: 10px; border-radius: 10px; background: var(--card-2); overflow: hidden; margin-top: 14px; }
.bar > i { display: block; height: 100%; border-radius: 10px; background: var(--mint); transform-origin: left; animation: grow 1s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- Listes ---------- */
.list { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line);
  animation: rise .45s var(--ease) both;
}
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 500; overflow-wrap: anywhere; }
.row .meta { font-size: 13px; color: var(--muted); }
.row.done .title { color: var(--dim); text-decoration: line-through; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.row:nth-child(2) { animation-delay: .03s; } .row:nth-child(3) { animation-delay: .06s; } .row:nth-child(4) { animation-delay: .09s; } .row:nth-child(n+5) { animation-delay: .12s; }
.amount { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Pastilles d'état */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.fait, .pill.garde, .pill.peut { background: var(--ok-bg); color: var(--mint); }
.pill.bientot, .pill.attends, .pill.sans-date { background: var(--soon-bg); color: var(--amber); }
.pill.retard, .pill.resilier { background: var(--late-bg); color: var(--coral); }
.pill.plus-tard, .pill.abandonne, .pill.achete, .pill.neutre { background: var(--card-2); color: var(--muted); }

/* Case à cocher ronde */
.check {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--dim); background: transparent; flex: none;
  display: grid; place-items: center; color: transparent; transition: all .35s var(--spring);
}
.check:hover { border-color: var(--mint); }
.check.on { background: var(--mint); border-color: var(--mint); color: var(--night); transform: scale(1.06); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  padding: 12px 20px; font-weight: 700; background: var(--mint); color: var(--night);
  transition: transform .25s var(--spring), box-shadow .25s; box-shadow: 0 8px 24px rgb(94 234 212 / .18);
}
.btn:active { transform: scale(.96); }
.btn.ghost { background: var(--card-2); color: var(--text); box-shadow: none; font-weight: 600; }
.btn.danger { background: var(--late-bg); color: var(--coral); box-shadow: none; }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--card-2); color: var(--text); display: grid; place-items: center; flex: none; transition: transform .2s var(--spring); }
.icon-btn:active { transform: scale(.92); }
.icon-btn.plain { background: transparent; color: var(--muted); }
.fab {
  position: fixed; right: 20px; bottom: calc(var(--nav-h) + 26px + env(safe-area-inset-bottom)); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%; border: 0; background: var(--mint); color: var(--night);
  display: grid; place-items: center; box-shadow: 0 12px 30px rgb(94 234 212 / .35); transition: transform .25s var(--spring);
}
.fab:active { transform: scale(.92); }
@media (min-width: 980px) { .fab { bottom: 36px; right: 40px; } }
.link-btn { background: none; border: 0; color: var(--mint); font-weight: 600; padding: 6px 0; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Formulaires ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-label { font-size: 14px; color: var(--muted); font-weight: 500; }
.field-hint { font-size: 12px; color: var(--dim); }
input[type=text], input[type=number], input[type=date], input[type=search], textarea, select {
  width: 100%; background: var(--card-2); border: 1px solid transparent; border-radius: var(--radius-s);
  padding: 13px 14px; outline: none; transition: border-color .2s;
}
input:focus, textarea:focus { border-color: var(--mint); }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.8); }
.input-row { display: flex; gap: 10px; }
.input-row > * { flex: 1; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 9px 15px; border-radius: 999px; font-weight: 600; font-size: 14px; transition: all .25s var(--spring); }
.seg.on { background: var(--mint); border-color: var(--mint); color: var(--night); transform: scale(1.03); }
.seg.on.coral { background: var(--coral); border-color: var(--coral); }
.seg.on.amber { background: var(--amber); border-color: var(--amber); }

/* Panneau du bas */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; background: rgb(8 9 14 / 0); display: flex; align-items: flex-end; justify-content: center; transition: background .3s; }
.sheet-wrap.in { background: rgb(8 9 14 / .6); }
.sheet {
  width: min(560px, 100%); max-height: 92vh; overflow: auto; border-radius: 28px 28px 0 0; padding: 18px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .45s var(--spring); background-color: #1b1e2b;
}
.sheet-wrap.in .sheet { transform: none; }
@media (min-width: 700px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 28px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 8px; }
.sheet-actions .btn { flex: 1; }

/* Divers */
.toast {
  position: fixed; left: 50%; top: max(16px, env(safe-area-inset-top)); transform: translate(-50%, -30px); opacity: 0; z-index: 60;
  background: var(--card); border: 1px solid var(--glass-line); padding: 12px 18px; border-radius: 999px; font-weight: 600;
  transition: all .45s var(--spring); box-shadow: 0 12px 30px rgb(0 0 0 / .4);
}
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.burst-dot { position: fixed; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: var(--mint); z-index: 70; pointer-events: none; animation: burst .7s var(--ease) forwards; }
.burst-dot.coral { background: var(--coral); }
@keyframes burst { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.empty { text-align: center; color: var(--muted); padding: 22px 8px; }
.empty p { margin: 0 0 12px; }
.banner { display: flex; gap: 12px; align-items: center; border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; background: var(--soon-bg); color: var(--amber); }
.banner .grow { flex: 1; }
.banner.info { background: var(--ok-bg); color: var(--mint); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 10px; }
.section-head h3 { margin: 0; font-size: 15px; color: var(--muted); font-weight: 600; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 16px; }
.priority-input { font-size: 20px; font-weight: 700; text-align: center; background: var(--card-2); border-radius: 16px; padding: 18px 14px; border: 1px dashed transparent; }
.priority-input::placeholder { color: var(--dim); font-weight: 500; }
.letter { white-space: pre-wrap; background: var(--card-2); border-radius: 16px; padding: 16px; font-size: 15px; line-height: 1.55; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* Démarrage guidé */
.onb { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 18px; }
.onb-card { width: min(520px, 100%); border-radius: 30px; padding: 28px 24px; }
.onb-steps { display: flex; gap: 6px; margin-bottom: 22px; }
.onb-steps i { flex: 1; height: 5px; border-radius: 5px; background: var(--card-2); transition: background .4s; }
.onb-steps i.on { background: var(--mint); }
.onb h1 { font-size: 30px; letter-spacing: -.03em; margin: 8px 0 6px; line-height: 1.1; }
.sub-grid { display: grid; gap: 8px; }
.sub-row { display: flex; align-items: center; gap: 10px; background: var(--card-2); border-radius: 14px; padding: 8px 10px 8px 14px; }
.sub-row .grow { flex: 1; font-weight: 500; }
.sub-row input { width: 92px; padding: 9px 10px; text-align: right; background: var(--night); }

/* Compléments des écrans */
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.row-btn { background: none; border: 0; padding: 0; text-align: left; color: inherit; text-decoration: none; cursor: pointer; }
a.row-btn, button.row.row-btn { display: flex; width: 100%; padding: 12px 2px; }
.row-btn.grow { align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; }
.report-link { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; }
.report-link .grow { flex: 1; display: flex; flex-direction: column; }
.report-link .meta { font-size: 13px; color: var(--muted); }
.report-ico { width: 42px; height: 42px; border-radius: 14px; background: var(--ok-bg); color: var(--mint); display: grid; place-items: center; flex: none; }
.segmented.small .seg { padding: 6px 12px; font-size: 13px; }
.sub-line { flex-wrap: wrap; }
.sub-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sub-q { font-size: 12px; color: var(--dim); }
@media (max-width: 520px) { .sub-line .row-btn.grow { flex-basis: 100%; } .sub-actions { width: 100%; justify-content: space-between; } }
.wish-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.row.wish { align-items: flex-start; }
.quick-idea { display: flex; gap: 10px; align-items: center; padding: 10px 10px 10px 12px; }
.quick-idea input { background: transparent; padding: 10px 4px; }
.chips .seg { flex: none; }
a.banner { text-decoration: none; }
.onb-logo { margin-bottom: 6px; }
.onb-actions { display: grid; gap: 10px; margin-top: 22px; }
.about .brand { margin-bottom: 4px; }
.about-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; }
.about-links a { color: var(--mint); text-decoration: none; }
.nav .nav-desk { display: none; }
@media (min-width: 980px) { .nav .nav-desk { display: flex; } .nav .nav-mobile { display: none; } .topbar .brand-mobile { display: none; } }
.app.is-bilan .main { max-width: 1100px; }
.app.is-bilan .fab { display: none; }
.main.settled .row, .main.settled .bar > i { animation: none; }
a.btn, a.link-btn, a.icon-btn { text-decoration: none; }
.legal-doc h2 { font-size: 17px; margin: 22px 0 6px; }
.legal-doc h2:first-child { margin-top: 0; }
.legal-doc p { margin: 0 0 12px; color: var(--text); line-height: 1.6; }
.legal-doc .encadre { background: var(--card-2); border-left: 3px solid var(--mint); border-radius: 0 14px 14px 0; padding: 12px 14px; }
.legal-doc .todo { background: var(--soon-bg); color: var(--amber); border-radius: 8px; padding: 1px 6px; font-weight: 600; }
.legal-doc a { color: var(--mint); }
.boot { min-height: 100vh; display: grid; place-items: center; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
