/* ==========================================================================
   Hanami — design system
   Nuit violette, sakura rose, néon turquoise,
   titres condensés au dégradé « glacier », pétales qui tombent.
   ========================================================================== */


:root {
  --night-950: #0a0618;
  --night-900: #100a24;
  --night-800: #171032;
  --night-700: #211746;
  --night-600: #2d2059;
  --night-500: #3d2c75;

  --violet: #8a6cf0;
  --violet-soft: #b6a2ff;
  --sakura: #f08ad8;
  --sakura-deep: #c95bb8;
  --neon: #4fe8cc;
  --neon-deep: #1fb79d;
  --ice-1: #f3f9ff;
  --ice-2: #cfe3f2;
  --ice-3: #93b7d3;
  --gold: #ffd36b;

  --text: #ece6ff;
  --text-muted: #ab9fcc;
  --text-dim: #7a6d9f;

  --ok: #4ff0a8;
  --warn: #ffd36b;
  --bad: #ff5f84;

  /* Séries des graphiques (validées sur la surface #171032). */
  --income: #16a58c;
  --expense: #c95bb8;
  --c0: #8460d2;
  --c1: #b88c19;
  --c2: #1f74bf;
  --c3: #db6143;
  --c4: #009d89;
  --c5: #b12b6e;
  --c6: #77a43f;
  --c7: #9154b9;

  --line: rgba(182, 162, 255, 0.14);
  --line-strong: rgba(182, 162, 255, 0.3);
  --panel: rgba(23, 16, 50, 0.72);
  --panel-solid: #171032;
  --panel-2: rgba(33, 23, 70, 0.6);
  --hover: rgba(182, 162, 255, 0.07);

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(5, 2, 15, 0.5);

  --font-display: 'Bebas Neue', 'Oswald', Impact, sans-serif;
  --font-label: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --side-w: 248px;
  --ease-out: cubic-bezier(0.2, 0.9, 0.3, 1);
  --ease-spring: cubic-bezier(0.3, 1.5, 0.5, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--night-900);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: var(--neon); text-decoration: none; }
a:hover { color: var(--ice-1); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
::selection { background: var(--sakura-deep); color: #fff; }
.ico { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 26px; height: 26px; }

/* ------------------------------------------------------------------ scène */

.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 6% 0%, rgba(240, 138, 216, 0.2), transparent 70%),
    radial-gradient(ellipse 45% 40% at 100% 25%, rgba(79, 232, 204, 0.1), transparent 70%),
    radial-gradient(ellipse 80% 60% at 50% 115%, rgba(138, 108, 240, 0.26), transparent 70%),
    linear-gradient(180deg, var(--night-800), var(--night-950));
}
.scene .moon {
  position: absolute;
  bottom: 10%;
  right: 7%;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff6fd, #f6d8f0 40%, #c9a6e8 75%);
  opacity: 0.1;
  filter: blur(1px);
  box-shadow: 0 0 120px 40px rgba(240, 138, 216, 0.18);
}
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 40%, transparent 35%, rgba(8, 4, 20, 0.7) 100%);
}
.sakura-corner {
  position: absolute;
  width: min(30vw, 320px);
  opacity: 0.8;
  filter: drop-shadow(0 6px 18px rgba(240, 138, 216, 0.25));
  animation: sway 9s ease-in-out infinite alternate;
  transform-origin: 0 0;
}
.sakura-corner.tr { top: -30px; right: -40px; transform: scaleX(-1); animation-name: sway-flip; transform-origin: 50% 0; }
.sakura-corner.bl { bottom: -50px; left: calc(var(--side-w) - 60px); transform: rotate(180deg) scaleX(-1); animation: none; opacity: 0.45; }
@keyframes sway { from { transform: rotate(-1.2deg); } to { transform: rotate(1.4deg); } }
@keyframes sway-flip { from { transform: scaleX(-1) rotate(-1.2deg); } to { transform: scaleX(-1) rotate(1.4deg); } }

.petal {
  position: absolute;
  top: -5vh;
  left: var(--x, 50%);
  width: var(--s, 12px);
  height: calc(var(--s, 12px) * 0.75);
  background: linear-gradient(135deg, #ffc4ee, var(--sakura));
  border-radius: 80% 0 80% 0;
  opacity: 0.65;
  animation: petal-fall var(--d, 14s) linear var(--delay, 0s) infinite;
  will-change: transform;
}
@keyframes petal-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(calc(var(--drift, 60px) * -1), 55vh, 0) rotate(220deg); }
  100% { transform: translate3d(var(--drift, 60px), 110vh, 0) rotate(480deg); opacity: 0; }
}
body.calm .petal, body.calm .sakura-corner { animation: none; }
body.calm .petal { display: none; }

@media (prefers-reduced-motion: reduce) {
  .petal { display: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ----------------------------------------------------------------- shell */

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, rgba(10, 6, 24, 0.86), rgba(10, 6, 24, 0.6));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
  z-index: 30;
}

.logo { display: inline-flex; gap: 10px; align-items: center; margin: 0 8px 4px; color: var(--ice-1); }
.logo .mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--violet), var(--sakura-deep));
  box-shadow: 0 6px 20px rgba(201, 91, 184, 0.4), inset 0 1px rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}
.logo .mark svg { width: 24px; height: 24px; transition: transform 0.6s var(--ease-spring); }
.logo:hover .mark svg { transform: rotate(72deg); }
.logo .word {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0.06em;
  padding-top: 3px;
  background: linear-gradient(180deg, var(--ice-1) 10%, var(--ice-2) 55%, var(--ice-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo:hover { color: var(--ice-1); }
.logo-sub { margin: 0 8px 18px; font-family: var(--font-label); font-size: 12px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--text-dim); }

.nav { display: grid; gap: 3px; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: var(--ice-1); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--ice-1); background: linear-gradient(90deg, rgba(138, 108, 240, 0.22), rgba(201, 91, 184, 0.08)); }
.nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sakura);
  box-shadow: 0 0 14px var(--sakura);
}
.nav a[aria-current="page"] .ico { color: var(--sakura); }
.side-add { margin: 12px 0 4px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.me-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(10, 6, 24, 0.4);
}
.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--sakura-deep));
  font-family: var(--font-display);
  font-size: 19px;
  color: #fff;
  flex-shrink: 0;
}
.me-chip .who { min-width: 0; flex: 1; line-height: 1.2; }
.me-chip .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-chip .who small { color: var(--text-dim); font-size: 12px; }

.main { min-width: 0; }
.view { width: min(1320px, 100%); margin: 0 auto; padding: clamp(20px, 3.5vw, 40px) clamp(16px, 3.5vw, 40px) 80px; }
.view.enter > * { animation: rise 0.5s var(--ease-out) both; }
.view.enter > *:nth-child(2) { animation-delay: 0.05s; }
.view.enter > *:nth-child(3) { animation-delay: 0.1s; }
.view.enter > *:nth-child(4) { animation-delay: 0.15s; }
.view.enter > *:nth-child(n + 5) { animation-delay: 0.2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.topbar, .tabbar { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sakura-corner.bl { display: none; }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(180deg, rgba(10, 6, 24, 0.92), rgba(10, 6, 24, 0.72));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .logo { margin: 0; }
  .topbar .logo .mark { width: 30px; height: 30px; border-radius: 9px; }
  .topbar .logo .mark svg { width: 20px; height: 20px; }
  .topbar .logo .word { font-size: 27px; }
  .tabbar {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 6px;
    border-radius: 20px;
    background: rgba(16, 10, 36, 0.92);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 6px 0;
    border-radius: 14px;
    color: var(--text-dim);
    font-family: var(--font-label);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .tabbar a[aria-current="page"] { color: var(--ice-1); }
  .tabbar a[aria-current="page"] .ico { color: var(--sakura); filter: drop-shadow(0 0 8px var(--sakura)); }
  .tabbar .fab {
    justify-self: center;
    width: 52px;
    height: 52px;
    margin-top: -26px;
    border: none;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--violet), var(--sakura-deep));
    box-shadow: 0 10px 28px rgba(201, 91, 184, 0.5), inset 0 1px rgba(255, 255, 255, 0.25);
  }
  .view { padding-bottom: 120px; }
}

/* ------------------------------------------------------------- en-têtes */

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 26px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--neon);
  margin-bottom: 4px;
}
.eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; opacity: 0.6; }
.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.01em;
  font-size: clamp(44px, 6.5vw, 78px);
  background: linear-gradient(180deg, var(--ice-1) 10%, var(--ice-2) 55%, var(--ice-3) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 30px rgba(147, 183, 211, 0.16));
}
.display .accent { background: linear-gradient(180deg, #ffd6f4, var(--sakura) 60%, var(--sakura-deep)); -webkit-background-clip: text; background-clip: text; }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.lead { margin: 8px 0 0; color: var(--text-muted); max-width: 60ch; }

/* ------------------------------------------------------------- panneaux */

.grid { display: grid; gap: 18px; }
.grid-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-dash { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }
@media (max-width: 1180px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-4, .span-5 { grid-column: span 6; }
  .span-7, .span-8 { grid-column: span 12; }
}
@media (max-width: 760px) {
  .grid-dash > * { grid-column: 1 / -1 !important; }
  .grid { gap: 14px; }
}
@media (max-width: 420px) { .grid-kpi { gap: 10px; } }

.panel {
  position: relative;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(16px, 2.2vw, 22px);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; min-height: 32px; }
.panel-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.panel-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--sakura);
  box-shadow: 0 0 12px var(--sakura);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.panel-link { font-family: var(--font-label); font-weight: 600; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 4px; }

/* ------------------------------------------------------------------ KPI */

.kpi { overflow: hidden; }
.kpi::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow, rgba(138, 108, 240, 0.25)), transparent 70%);
  pointer-events: none;
}
.kpi .label { font-family: var(--font-label); font-weight: 600; font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.kpi .label .ico { color: var(--tint, var(--violet-soft)); }
.kpi .value { font-family: var(--font-display); font-size: clamp(32px, 3.4vw, 44px); line-height: 1.05; margin-top: 6px; color: var(--ice-1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .value small { font-size: 0.55em; color: var(--text-muted); margin-left: 2px; }
.kpi .sub { font-size: 13px; color: var(--text-dim); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.delta { font-weight: 700; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: rgba(182, 162, 255, 0.1); color: var(--text-muted); }
.delta.good { background: rgba(79, 240, 168, 0.12); color: var(--ok); }
.delta.bad { background: rgba(255, 95, 132, 0.12); color: #ff9db4; }
@media (max-width: 420px) { .kpi { padding: 14px; } .kpi .label { font-size: 11px; letter-spacing: 0.14em; } }

/* --------------------------------------------------------------- boutons */

.btn {
  --b-bg: rgba(182, 162, 255, 0.08);
  --b-border: var(--line-strong);
  --b-color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  min-height: 40px;
  border-radius: 11px;
  border: 1px solid var(--b-border);
  background: var(--b-bg);
  color: var(--b-color);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s, filter 0.2s;
  user-select: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); border-color: var(--violet-soft); color: var(--b-color); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary {
  --b-bg: linear-gradient(135deg, var(--violet), var(--sakura-deep));
  --b-border: transparent;
  --b-color: #fff;
  box-shadow: 0 8px 26px rgba(201, 91, 184, 0.32), inset 0 1px rgba(255, 255, 255, 0.2);
}
.btn-primary:hover { filter: brightness(1.1); border-color: transparent; box-shadow: 0 10px 34px rgba(201, 91, 184, 0.5), inset 0 1px rgba(255, 255, 255, 0.2); }
.btn-neon { --b-bg: rgba(79, 232, 204, 0.08); --b-border: rgba(79, 232, 204, 0.5); --b-color: var(--neon); }
.btn-neon:hover { border-color: var(--neon); box-shadow: 0 0 24px -4px var(--neon); }
.btn-danger { --b-bg: rgba(255, 95, 132, 0.08); --b-border: rgba(255, 95, 132, 0.45); --b-color: #ffc2d0; }
.btn-danger:hover { border-color: var(--bad); box-shadow: 0 0 24px -4px var(--bad); }
.btn-ghost { --b-bg: transparent; --b-border: transparent; --b-color: var(--text-muted); }
.btn-ghost:hover { --b-color: var(--text); background: var(--hover); border-color: transparent; }
.btn-sm { min-height: 32px; padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; min-height: 36px; height: 36px; padding: 0; border-radius: 10px; }
.btn-icon.sm { width: 30px; min-height: 30px; height: 30px; border-radius: 8px; }

/* -------------------------------------------------------------- champs */

.input, .select, .textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  background: rgba(10, 6, 24, 0.55);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--neon); box-shadow: 0 0 0 3px rgba(79, 232, 204, 0.14); }
.input.money { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.02em; padding-top: 6px; padding-bottom: 4px; }
.select {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.select option { background: var(--night-800); color: var(--text); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.8); cursor: pointer; }
.label { display: block; font-family: var(--font-label); font-weight: 600; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.field { margin-bottom: 14px; min-width: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.fields > .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--text-muted); }
.check input { accent-color: var(--sakura); width: 18px; height: 18px; }
.hint { font-size: 13px; color: var(--text-dim); margin-top: 6px; }

.search { position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.search .input { padding-left: 40px; }

.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 12px; background: rgba(10, 6, 24, 0.55); border: 1px solid var(--line); width: 100%; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.segmented input:checked + span { background: var(--seg, rgba(138, 108, 240, 0.25)); color: var(--ice-1); }
.segmented input:focus-visible + span { outline: 2px solid var(--neon); }
.segmented .seg-expense { --seg: rgba(201, 91, 184, 0.3); }
.segmented .seg-income { --seg: rgba(22, 165, 140, 0.32); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches label { position: relative; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); cursor: pointer; border: 2px solid transparent; transition: transform 0.15s; }
.swatches input:checked + span { border-color: var(--ice-1); box-shadow: 0 0 0 3px var(--night-800), 0 0 16px var(--c); transform: scale(1.08); }
.swatches input:focus-visible + span { outline: 2px solid var(--neon); outline-offset: 3px; }

.emoji-pick { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.emoji-pick button { width: 34px; height: 34px; border-radius: 9px; border: 1px solid transparent; background: rgba(10, 6, 24, 0.4); font-size: 18px; line-height: 1; transition: transform 0.12s, border-color 0.12s; }
.emoji-pick button:hover { transform: scale(1.12); border-color: var(--line-strong); }

/* ---------------------------------------------------------------- chips */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-family: var(--font-label);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
button.chip:hover { color: var(--text); border-color: var(--violet-soft); }
.chip[aria-pressed="true"] { background: rgba(138, 108, 240, 0.22); border-color: var(--violet); color: var(--ice-1); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--violet)); }
.chip.xs { padding: 2px 9px; font-size: 11px; }
.status-actif { --c: var(--neon); color: var(--neon); border-color: rgba(79, 232, 204, 0.4); }
.status-idee { --c: var(--gold); color: var(--gold); border-color: rgba(255, 211, 107, 0.35); }
.status-pause { --c: var(--text-dim); }
.status-termine { --c: var(--sakura); color: var(--sakura); border-color: rgba(240, 138, 216, 0.35); }

/* -------------------------------------------------------------- onglets */

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(10, 6, 24, 0.5); border: 1px solid var(--line); width: fit-content; max-width: 100%; overflow-x: auto; margin-bottom: 18px; }
.tabs a { padding: 8px 16px; border-radius: 10px; font-family: var(--font-label); font-weight: 700; font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-selected="true"] { background: linear-gradient(135deg, rgba(138, 108, 240, 0.35), rgba(201, 91, 184, 0.22)); color: var(--ice-1); }
.tabs .count { font-size: 12px; padding: 0 7px; border-radius: 999px; background: rgba(182, 162, 255, 0.14); }

/* ------------------------------------------------------- mois (switch) */

.month-switch { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(10, 6, 24, 0.5); border: 1px solid var(--line); }
.month-switch .lbl { min-width: 150px; text-align: center; font-family: var(--font-display); font-size: 24px; letter-spacing: 0.04em; color: var(--ice-1); padding-top: 2px; }

/* ----------------------------------------------------- barres de progrès */

.bar { position: relative; height: 8px; border-radius: 999px; background: rgba(182, 162, 255, 0.1); overflow: hidden; }
.bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p, 0%);
  border-radius: inherit;
  background: var(--c, linear-gradient(90deg, var(--violet), var(--sakura)));
  transform-origin: left;
  animation: grow-x 0.9s var(--ease-out) both;
}
.bar.over > i { background: linear-gradient(90deg, var(--sakura-deep), var(--bad)); }
.bar.thin { height: 5px; }
@keyframes grow-x { from { transform: scaleX(0); } }

.ring { --p: 0; --c: var(--sakura); position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(182, 162, 255, 0.12); }
.ring .fill { stroke: var(--c); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p)); animation: ring-in 1.1s var(--ease-out) both; filter: drop-shadow(0 0 6px var(--c)); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 18px; color: var(--ice-1); }
@keyframes ring-in { from { stroke-dashoffset: 100; } }

/* ---------------------------------------------------------------- listes */

.list { display: grid; }
.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 12px;
  transition: background 0.15s;
  min-width: 0;
}
.row-item + .row-item { border-top: 1px solid var(--line); }
.row-item:hover { background: var(--hover); }
.row-item.clickable { cursor: pointer; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .meta { font-size: 13px; color: var(--text-dim); display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.meta > span, .meta > a { display: inline-flex; align-items: center; gap: 4px; }
.badge-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 19px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--c, var(--violet)) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--c, var(--violet)) 45%, transparent);
}
.badge-ico.lg { width: 52px; height: 52px; font-size: 26px; border-radius: 15px; }
.amount { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.02em; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); }
.amount.income { color: #7ff3d6; }
.amount.income::before { content: "+ "; }
.amount.off-budget { color: var(--text-dim); }
.amount.expense::before { content: "− "; }
.day-head { font-variant-numeric: tabular-nums; font-family: var(--font-label); font-weight: 700; font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); padding: 16px 8px 6px; display: flex; justify-content: space-between; }
.day-head:first-child { padding-top: 0; }

.empty { text-align: center; padding: 28px 12px; color: var(--text-dim); }
.empty .big { font-size: 34px; margin-bottom: 6px; filter: drop-shadow(0 0 14px rgba(240, 138, 216, 0.4)); }
.empty p { margin: 4px 0 14px; }

/* ----------------------------------------------------------- enveloppes */

.envelope { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 12px 8px; border-radius: 12px; cursor: pointer; transition: background 0.15s; }
.envelope:hover { background: var(--hover); }
.envelope + .envelope { border-top: 1px solid var(--line); }
.envelope .badge-ico { grid-row: span 2; }
.envelope .name { font-weight: 600; }
.envelope .nums { font-size: 13px; color: var(--text-muted); text-align: right; white-space: nowrap; }
.envelope .nums b { color: var(--text); font-weight: 600; }
.envelope .bar { grid-column: 2 / -1; }
.envelope .left { grid-column: 2 / -1; font-size: 12px; color: var(--text-dim); }
.envelope .left.over { color: #ff9db4; }

/* --------------------------------------------------------------- objectifs */

.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.goal { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); }
.goal .grow { flex: 1; min-width: 0; }
.goal h3 { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.goal .sum { font-family: var(--font-display); font-size: 24px; color: var(--ice-1); }
.goal .sum small { font-size: 16px; color: var(--text-dim); }
.goal .actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

/* -------------------------------------------------------------- projets */

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.project-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--text);
  transition: transform 0.25s var(--ease-out), border-color 0.2s, box-shadow 0.25s;
  overflow: hidden;
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--c), transparent);
}
.project-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 55%, transparent); color: var(--text); box-shadow: 0 24px 60px rgba(5, 2, 15, 0.6), 0 0 40px -16px var(--c); }
.project-card .top { display: flex; gap: 12px; align-items: flex-start; }
.project-card h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1; letter-spacing: 0.02em; color: var(--ice-1); }
.project-card p { margin: 0; color: var(--text-muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.project-card .stats { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-dim); margin-top: auto; }
.project-card .stats b { color: var(--text); font-weight: 600; }
.mini-project { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; padding: 10px 8px; border-radius: 12px; color: var(--text); }
.mini-project:hover { background: var(--hover); color: var(--text); }
.mini-project .badge-ico { grid-row: span 2; }
.mini-project .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; min-width: 0; }
.mini-project .top span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-project .top .pct { color: var(--text-muted); font-weight: 500; font-size: 13px; }

/* ---------------------------------------------------------------- kanban */

.project-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.project-hero .badge-ico.lg { width: 72px; height: 72px; font-size: 38px; border-radius: 20px; box-shadow: 0 0 40px -10px var(--c); }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 900px) { .board { grid-template-columns: 1fr; } }
.column { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 180px; transition: border-color 0.2s, background 0.2s; }
.column.drop { border-color: var(--neon); background: rgba(79, 232, 204, 0.06); }
.column .panel-head { margin-bottom: 4px; }
.column .count { font-family: var(--font-display); font-size: 22px; color: var(--text-dim); }
.col-todo .panel-title::before { background: var(--violet-soft); box-shadow: 0 0 12px var(--violet-soft); }
.col-doing .panel-title::before { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.col-done .panel-title::before { background: var(--neon); box-shadow: 0 0 12px var(--neon); }
.task {
  position: relative;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(33, 23, 70, 0.78);
  border: 1px solid var(--line);
  cursor: grab;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.2s, opacity 0.2s;
}
.task:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.task.dragging { opacity: 0.4; }
.task .grow { flex: 1; min-width: 0; }
.task .t { font-weight: 500; word-break: break-word; }
.task.done .t { color: var(--text-dim); text-decoration: line-through; text-decoration-color: rgba(240, 138, 216, 0.6); }
.task .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 4px; font-size: 12px; color: var(--text-dim); }
.task .meta .late { color: #ff9db4; }
.prio { display: inline-flex; gap: 2px; }
.prio i { width: 4px; height: 10px; border-radius: 2px; background: rgba(182, 162, 255, 0.2); }
.prio.p1 i:nth-child(-n + 2), .prio.p2 i { background: var(--gold); }
.prio.p2 i { background: var(--sakura); }
.tick {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 7px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  display: grid;
  place-items: center;
  color: transparent;
  padding: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease-spring);
}
.tick:hover { border-color: var(--neon); }
.tick.on { background: var(--neon-deep); border-color: var(--neon); color: #06231d; }
.tick.on .ico { animation: pop 0.35s var(--ease-spring); }
@keyframes pop { from { transform: scale(0.2); } }
.task-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s; }
.task:hover .task-actions, .task:focus-within .task-actions { opacity: 1; }
@media (hover: none) { .task-actions { opacity: 1; } }
.quick-add { display: flex; gap: 6px; }
.quick-add .input { min-height: 36px; padding: 6px 10px; background: rgba(10, 6, 24, 0.35); border-style: dashed; }

/* ---------------------------------------------------------------- notes */

.notes { columns: 4 260px; column-gap: 16px; }
.note {
  break-inside: avoid;
  margin-bottom: 16px;
  padding: 16px 16px 12px;
  cursor: pointer;
  transition: transform 0.2s var(--ease-out), border-color 0.2s;
  border-top: 3px solid var(--c);
  display: block;
  width: 100%;
}
.note:hover { transform: translateY(-3px) rotate(-0.3deg); border-color: color-mix(in srgb, var(--c) 60%, transparent); border-top-color: var(--c); }
.note h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; color: var(--ice-1); display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.note h3 .ico { color: var(--sakura); }
.note .body { white-space: pre-wrap; word-break: break-word; color: var(--text-muted); font-size: 14px; max-height: 280px; overflow: hidden; }
.note .items { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.note .items li { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.note .items li .tick { width: 18px; height: 18px; border-radius: 6px; }
.note .items li.done span { color: var(--text-dim); text-decoration: line-through; }
.note .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.note-mini { display: block; padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--c); color: var(--text); }
.note-mini:hover { color: var(--text); border-color: var(--line-strong); border-left-color: var(--c); }
.note-mini b { display: block; margin-bottom: 2px; }
.note-mini span { font-size: 13px; color: var(--text-dim); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.notes-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; }

.check-editor { display: grid; gap: 6px; }
.check-editor .line { display: flex; gap: 8px; align-items: center; }
.check-editor .input { min-height: 36px; padding: 6px 10px; }

/* --------------------------------------------------------------- charts */

.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: rgba(182, 162, 255, 0.1); stroke-width: 1; }
.chart .axis-label { fill: var(--text-dim); font-family: var(--font-label); font-size: 12px; letter-spacing: 0.06em; }
.chart .axis-label.now { fill: var(--ice-1); font-weight: 700; }
.chart .bar-rect { transform-box: fill-box; transform-origin: bottom; animation: grow-y 0.8s var(--ease-out) both; transition: opacity 0.15s; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: rgba(182, 162, 255, 0.05); }
.chart .group:hover ~ .group .bar-rect, .chart:has(.group:hover) .group:not(:hover) .bar-rect { opacity: 0.55; }
@keyframes grow-y { from { transform: scaleY(0); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.donut-wrap { display: grid; grid-template-columns: minmax(150px, 190px) 1fr; gap: 20px; align-items: center; }
@media (max-width: 480px) { .donut-wrap { grid-template-columns: 1fr; justify-items: center; } .donut-wrap .donut-legend { width: 100%; } }
.donut { position: relative; width: 100%; max-width: 190px; }
.donut svg { width: 100%; height: auto; transform: rotate(-90deg); overflow: visible; }
.donut .seg { fill: none; stroke-width: 15; transition: stroke-width 0.2s, opacity 0.2s; animation: donut-in 1s var(--ease-out) both; }
.donut:has(.seg:hover) .seg:not(:hover) { opacity: 0.45; }
.donut .seg:hover { stroke-width: 18; }
@keyframes donut-in { from { stroke-dasharray: 0 400; } }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.donut .center b { display: block; font-family: var(--font-display); font-size: 28px; line-height: 1; color: var(--ice-1); }
.donut .center small { font-family: var(--font-label); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }
.donut-legend { display: grid; gap: 2px; min-width: 0; }
.donut-legend div { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 10px; align-items: center; font-size: 14px; padding: 3px 0; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.donut-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.donut-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-legend em { font-style: normal; color: var(--text-dim); font-size: 12px; width: 36px; text-align: right; }
.line-path { fill: none; stroke: var(--expense); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(201, 91, 184, 0.6)); stroke-dasharray: 2000; animation: draw 1.4s var(--ease-out) both; }
@keyframes draw { from { stroke-dashoffset: 2000; } }
.line-area { fill: url(#area-grad); animation: fade 1.2s ease both; }
@keyframes fade { from { opacity: 0; } }
.budget-line { stroke: var(--ice-3); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: 0.7; }
.budget-tag { fill: var(--ice-2); font-family: var(--font-label); font-size: 12px; letter-spacing: 0.08em; }
.cross { stroke: var(--ice-2); stroke-width: 1; opacity: 0; }
.cross-dot { fill: var(--expense); stroke: var(--night-800); stroke-width: 2; opacity: 0; }
.chart.hovering .cross { opacity: 0.4; }
.chart.hovering .cross-dot { opacity: 1; }

.tip {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(16, 10, 36, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  max-width: 240px;
  transform: translate(-50%, calc(-100% - 12px));
  opacity: 0;
  transition: opacity 0.12s;
}
.tip.show { opacity: 1; }
.tip b { font-weight: 700; }
.tip .k { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.tip .k i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

/* ---------------------------------------------------------------- modal */

dialog.modal {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(170deg, var(--night-700), var(--night-800) 60%);
  color: var(--text);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), 0 0 80px -30px rgba(240, 138, 216, 0.4);
  overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in 0.28s var(--ease-spring); }
dialog.modal::backdrop { background: rgba(6, 3, 16, 0.7); backdrop-filter: blur(4px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } }
.modal form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 30px; letter-spacing: 0.03em; color: var(--ice-1); line-height: 1; padding-top: 3px; }
.modal-body { padding: 18px 20px 4px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-foot .spacer { margin-right: auto; }
.form-error { color: #ffb3c5; background: rgba(255, 95, 132, 0.1); border: 1px solid rgba(255, 95, 132, 0.3); padding: 8px 12px; border-radius: 10px; margin-bottom: 14px; font-size: 14px; }

.menu-pop { position: fixed; z-index: 150; min-width: 220px; padding: 6px; border-radius: 14px; background: var(--panel-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow); display: grid; gap: 2px; animation: modal-in 0.2s var(--ease-out); }
.menu-pop button { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: none; border-radius: 9px; background: none; text-align: left; font-weight: 500; }
.menu-pop button:hover { background: var(--hover); }
.menu-pop .e { font-size: 18px; width: 22px; text-align: center; }

/* ---------------------------------------------------------------- toast */

.toast-zone { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 300; pointer-events: none; justify-items: center; }
@media (max-width: 900px) { .toast-zone { bottom: 100px; } }
.toast { display: flex; gap: 10px; align-items: center; padding: 10px 16px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-weight: 600; animation: toast 2.8s ease forwards; }
.toast.err { border-color: rgba(255, 95, 132, 0.5); color: #ffc2d0; }
@keyframes toast { 0% { opacity: 0; transform: translateY(10px); } 8%, 86% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-6px); } }

/* --------------------------------------------------------------- auth */

.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); text-align: center; animation: rise 0.7s var(--ease-out) both; }
.auth-card .display { font-size: clamp(64px, 16vw, 104px); }
.tagline { margin: 4px 0 26px; font-family: var(--font-display); font-size: 18px; letter-spacing: 0.42em; color: var(--ice-2); opacity: 0.85; }
.auth-card .panel { text-align: left; }
.auth-card .btn-block { margin-top: 6px; }

/* ------------------------------------------------------------- divers */

.stack { display: grid; gap: 18px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spread { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .search { flex: 1; min-width: 200px; }
.pill-num { font-family: var(--font-display); font-size: 20px; color: var(--ice-1); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 18px; align-items: start; }
.kbd { font-family: var(--font-label); font-size: 12px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--text-dim); }
.loading { display: grid; place-items: center; min-height: 50vh; }
.loader { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(182, 162, 255, 0.15); border-top-color: var(--sakura); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------- v2 : ajouts */

.toast.long { animation-duration: 8s; }
.toast-action {
  margin-left: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(79, 232, 204, 0.5);
  background: rgba(79, 232, 204, 0.12);
  color: var(--neon);
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: auto;
}
.toast-action:hover { background: rgba(79, 232, 204, 0.22); }
.row-item.upcoming { opacity: 0.8; }
.row-item.upcoming .amount { color: var(--text-muted); }
.row-item.inactive { opacity: 0.5; }
.row-item.forecast { cursor: help; }
.stat-table { display: grid; gap: 4px; }
.stat-row { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; }
.stat-row:hover { background: var(--hover); }
.stat-row .grow { flex: 1; min-width: 0; display: grid; gap: 6px; }
.stat-row .meta { font-size: 13px; color: var(--text-dim); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.dropzone {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 36px 20px;
  border: 2px dashed var(--line-strong);
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dropzone:hover, .dropzone.over { border-color: var(--neon); background: rgba(79, 232, 204, 0.05); }
.dropzone .big { font-size: 38px; }
.import-map { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 640px) { .import-map { grid-template-columns: 1fr 1fr; } }
.import-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.table-wrap { overflow: auto; max-height: 340px; border-radius: 12px; border: 1px solid var(--line); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { position: sticky; top: 0; background: var(--night-800); font-family: var(--font-label); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); }
.table tr:last-child td { border-bottom: none; }
.table .amount { font-size: 17px; }
.table tr.dup td { opacity: 0.45; }

/* palette Ctrl + K */
dialog.palette { width: min(640px, calc(100vw - 24px)); margin-top: 12vh; max-height: 70vh; }
dialog.palette[open] { display: flex; flex-direction: column; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); color: var(--text-dim); }
.palette-input input { flex: 1; min-width: 0; background: none; border: none; outline: none; font-size: 18px; color: var(--text); }
.palette-results { overflow-y: auto; padding: 8px; }
.palette-group { padding: 10px 10px 4px; font-family: var(--font-label); font-size: 12px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: none; border-radius: 10px; background: none; text-align: left; }
.palette-item.on, .palette-item:hover { background: linear-gradient(90deg, rgba(138, 108, 240, 0.25), rgba(201, 91, 184, 0.1)); }
.palette-item .e { font-size: 18px; width: 26px; text-align: center; }
.palette-item .grow { flex: 1; min-width: 0; display: grid; }
.palette-item b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item small { color: var(--text-dim); font-size: 12px; }
.palette-item .r { font-family: var(--font-display); font-size: 18px; color: var(--text-muted); white-space: nowrap; }
.search-trigger { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; margin-bottom: 10px; border-radius: 11px; border: 1px solid var(--line); background: rgba(10, 6, 24, 0.45); color: var(--text-dim); font-size: 14px; }
.search-trigger:hover { border-color: var(--line-strong); color: var(--text-muted); }
.search-trigger .kbd { margin-left: auto; }

/* calendrier */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { margin-bottom: 6px; }
.cal-head div { text-align: center; font-family: var(--font-label); font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-dim); }
.cal-cell {
  position: relative;
  min-height: 86px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(10, 6, 24, 0.35);
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.cal-cell:hover { border-color: var(--line-strong); background: var(--hover); }
.cal-cell.out { border: none; background: none; }
.cal-cell.past .n { color: var(--text-dim); }
.cal-cell .n { font-family: var(--font-display); font-size: 22px; line-height: 1; color: var(--ice-1); }
.cal-cell.today { border-color: var(--sakura); box-shadow: 0 0 22px -8px var(--sakura); }
.cal-cell.today .n { color: var(--sakura); }
.cal-cell.sel { background: linear-gradient(160deg, rgba(138, 108, 240, 0.28), rgba(201, 91, 184, 0.12)); border-color: var(--violet); }
.cal-cell .dots { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.cal-cell .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.cal-cell .dots i.done { opacity: 0.35; }
.cal-cell .dots em { font-style: normal; font-size: 11px; color: var(--text-dim); }
.cal-cell .spent { margin-top: auto; font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 54px; padding: 5px; border-radius: 9px; }
  .cal-cell .n { font-size: 17px; }
  .cal-cell .spent { display: none; }
  .cal-cell .dots i { width: 6px; height: 6px; }
}
.task { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.task.lifted { opacity: 1; transform: scale(1.03) rotate(-1deg); border-color: var(--sakura); box-shadow: 0 18px 40px rgba(5, 2, 15, 0.7), 0 0 30px -10px var(--sakura); }
.task .meta .ok { color: var(--ok); }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 8px; }
.md h3, .md h4, .md h5 { margin: 10px 0 6px; font-family: var(--font-label); letter-spacing: 0.06em; color: var(--ice-2); font-size: 16px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 20px; }
.md ul.md-check { list-style: none; padding-left: 0; }
.md li.done { color: var(--text-dim); text-decoration: line-through; }
.md code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 0.88em; padding: 1px 5px; border-radius: 5px; background: rgba(10, 6, 24, 0.6); color: var(--neon); }
.md pre { margin: 0 0 8px; padding: 10px; border-radius: 10px; background: rgba(10, 6, 24, 0.6); overflow-x: auto; }
.md pre code { padding: 0; background: none; color: var(--ice-2); }
.md blockquote { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--sakura); color: var(--text-muted); }
.md hr { border: none; border-top: 1px solid var(--line); margin: 10px 0; }
.note .body.md { white-space: normal; }
.input.otp { font-family: var(--font-display); font-size: 30px; letter-spacing: 0.3em; text-align: center; }
.qr { width: min(230px, 70vw); margin: 10px auto; padding: 10px; border-radius: 14px; background: #fff; box-shadow: 0 0 40px -10px var(--sakura); }
.qr svg { width: 100%; height: auto; }
.steps { margin: 0 0 8px; padding-left: 20px; color: var(--text-muted); }
.steps li { margin-bottom: 4px; }
code.secret { font-size: 13px; color: var(--neon); word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 10px 0 12px; }
.codes code { padding: 8px; border-radius: 8px; background: rgba(10, 6, 24, 0.6); text-align: center; font-size: 16px; letter-spacing: 0.08em; color: var(--ice-1); }
.log .row-item.bad .title { color: #ffb3c5; }
.log .row-item { padding: 8px; }
label.btn { cursor: pointer; }

/* comptes */
.accounts-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 18px; }
.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.account-card { display: grid; gap: 8px; overflow: hidden; }
.account-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--c), transparent); }
.account-card .top { display: flex; gap: 12px; align-items: center; }
.account-card .top .grow { flex: 1; min-width: 0; }
.account-card .badge-ico { --c: inherit; }
.account-card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card .kind { font-size: 12px; color: var(--text-dim); font-family: var(--font-label); letter-spacing: 0.12em; text-transform: uppercase; }
.account-card .balance { font-family: var(--font-display); font-size: 34px; line-height: 1.05; color: var(--ice-1); font-variant-numeric: tabular-nums; }
.account-card.negative .balance { color: #ff9db4; }
.account-card .flows { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.account-card .flows .in { color: #7ff3d6; }
.account-card .flows .out { color: var(--sakura); }
.accounts-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.mini-account { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }
.mini-account:hover { border-color: var(--line-strong); color: var(--text); }
.mini-account .grow { min-width: 0; flex: 1; }
.mini-account b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1.1; }
.mini-account small { color: var(--text-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.row-item.transfer .amount { color: var(--violet-soft); }

@media (max-width: 640px) {
  .page-head .head-actions { width: 100%; }
  .page-head .month-switch { width: 100%; justify-content: space-between; }
  .page-head .month-switch .lbl { min-width: 0; font-size: 21px; }
  .page-head .head-actions > .btn { flex: 1 1 0; min-width: 0; padding: 8px 6px; font-size: 13px; gap: 4px; letter-spacing: 0.04em; }
  .ring .fill { filter: none; }
}

/* pointage */
.clear-btn { flex-shrink: 0; width: 26px; height: 26px; margin-left: 4px; border-radius: 50%; border: 1.5px dashed var(--line-strong); background: none; color: transparent; display: grid; place-items: center; padding: 0; transition: background 0.2s, border-color 0.2s, color 0.2s; }
.clear-btn:hover { border-color: var(--neon); color: var(--text-dim); }
.clear-btn.on { border-style: solid; border-color: var(--neon); background: rgba(79, 232, 204, 0.16); color: var(--neon); }
.cleared-line { font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; color: var(--text-muted); }
.cleared-line .ok { color: var(--ok); }

/* conseils */
.advice-list { display: grid; gap: 10px; }
.advice-list.compact { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.advice { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); border-left: 3px solid var(--lvl, var(--violet)); }
.advice.lvl-warn { --lvl: var(--gold); }
.advice.lvl-tip { --lvl: var(--violet-soft); }
.advice.lvl-good { --lvl: var(--ok); }
.advice .emoji { font-size: 24px; line-height: 1; margin-top: 2px; }
.advice .grow { flex: 1; min-width: 0; }
.advice .title { font-weight: 600; color: var(--ice-1); margin-bottom: 4px; }
.advice p { margin: 0 0 6px; color: var(--text-muted); font-size: 14px; }
.advice-group { margin: 18px 0 10px; font-family: var(--font-label); font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-dim); }

/* import de relevé PDF */
.statement-card { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--panel-2); margin-bottom: 16px; }
.statement-card .title { font-weight: 600; color: var(--ice-1); }
.statement-card .meta { font-size: 13px; color: var(--text-dim); }
.statement-balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 12px; }
.statement-balances small { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); font-family: var(--font-label); }
.statement-balances b { font-family: var(--font-display); font-weight: 400; font-size: 22px; color: var(--ice-1); }
.statement-balances b.in { color: #7ff3d6; }
.statement-balances b.out { color: var(--sakura); }
.check-ok { color: var(--ok); background: rgba(79, 240, 168, 0.08); border: 1px solid rgba(79, 240, 168, 0.3); padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.self-block { padding: 12px 14px; border-radius: 12px; border: 1px dashed var(--violet-soft); margin-bottom: 14px; background: rgba(138, 108, 240, 0.06); }
.self-block .title { font-weight: 600; }

/* Virements entre mes comptes repérés sur deux relevés */
.internal-banner { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; border-color: rgba(127, 243, 214, 0.35); flex-wrap: wrap; }
.internal-list { display: grid; gap: 6px; margin-top: 12px; max-height: 300px; overflow: auto; }
.internal-item { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); font-size: 13px; color: var(--ink, inherit); }
.internal-item .dim { grid-column: 1; font-size: 12px; }
.internal-item b { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
