:root {
  /* Surfaces — fond BLANC, cartes LAVANDE (Copperx) */
  --bg: #ffffff;
  --surface-1: #f4f5fb;
  --surface-2: #eceefa;
  --surface-3: #e2e5f6;
  --border: #ececf4;
  --border-strong: #dcdfeb;
  /* Texte — quasi-noir teinté indigo */
  --text: #14142b;
  --muted: #6b7094;
  --faint: #a0a3bd;
  /* Encre (boutons foncés éventuels) */
  --ink: #14142b;
  --ink-2: #26264a;
  /* Accent — bleu PÉRIWINKLE Copperx */
  --accent: #5b6ef5;
  --accent-2: #4a5ae0;
  --accent-soft: #eaecfe;
  --accent-ring: rgba(91, 110, 245, .22);
  /* Statuts */
  --ok: #12a150;      --ok-soft: #dcf5e6;   --ok-2: #1f9a54;   --ok-border: #bfe6c8;
  --warn: #b25e02;    --warn-soft: #fbeccf; --warn-2: #d9a300; --warn-border: #ecd6a4;
  --err: #e5484d;     --err-soft: #fce4e4;  --err-2: #cc3b40;  --err-border: #eec6c0;
  --info: #5b6ef5;    --info-soft: #eaecfe;
  --accent-border: #c7c3ff;                 /* bordure teintée périwinkle (bannières accent) */
  --overlay: rgba(20, 20, 43, .38);          /* scrim des modales (base --text) */
  /* Dégradé signature (gardé pour le login) */
  --grad: linear-gradient(101deg, #635bff 0%, #5a8cff 48%, #3ecfcb 100%);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-pill: 999px;
  /* Ombres très plates (Copperx = surtout des remplissages) */
  --shadow-card: 0 0 0 1px rgba(20, 20, 43, .02), 0 1px 2px rgba(20, 20, 43, .03);
  --shadow-1: 0 1px 3px rgba(20, 20, 43, .07);
  --shadow-2: 0 22px 52px -16px rgba(20, 20, 43, .24), 0 8px 20px rgba(20, 20, 43, .08);
  --fs-xs: 11px; --fs-sm: 12px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 22px; --fs-2xl: 30px;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-md);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.err-text { color: var(--err); }
a { color: inherit; text-decoration: none; }
/* Titres LOURDS (signature Kit) */
h1 { font-size: var(--fs-xl); font-weight: 800; margin: 0; letter-spacing: -.03em; color: var(--text); }
h2 { font-size: var(--fs-sm); font-weight: 700; margin: 0 0 var(--s3); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.mono { font-family: var(--mono); font-size: var(--fs-sm); }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); border-radius: var(--r-sm); }

.grad-bar { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: var(--grad); z-index: 200; }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; flex: none; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 14px; height: 14px; }
.icon.lg { width: 22px; height: 22px; }

.brand { display: flex; align-items: center; }
/* Le logo est un carré avec des marges blanches → object-fit:cover recadre sur le lockup. */
.brand-logo { display: block; width: 100%; height: 56px; object-fit: cover; object-position: center; }
.login-brand-logo { display: block; width: 210px; height: 66px; object-fit: cover; object-position: center; margin: 0 0 18px; }
.wordmark { display: inline-flex; align-items: center; gap: 5px; font-family: "Inter", system-ui, sans-serif; font-weight: 800; font-size: 16px; letter-spacing: -.03em; line-height: 1; }
.wm-navy { color: var(--text); }
.wm-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: var(--accent); margin-left: 5px; }
.wm-dot { width: 5px; height: 5px; border-radius: 50%; background: #3ecfcb; box-shadow: 0 0 0 2.5px rgba(62, 207, 203, .22); }

/* ---------- Carte de solde centrale (Copperx) ---------- */
.hero { position: relative; border-radius: var(--r-lg); padding: 24px 28px 40px; margin-bottom: var(--s4); background: var(--surface-1); color: var(--text); }
.bal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.bal-label { color: var(--muted); font-size: var(--fs-md); }
.bal-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--bg); border: 1px solid var(--border-strong); font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.bal-chip .led { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); display: inline-block; }
.bal-chip .led.ok { background: var(--ok); box-shadow: 0 0 6px rgba(18, 161, 80, .6); }
.bal-chip .led.warn { background: var(--warn); box-shadow: 0 0 6px rgba(178, 94, 2, .5); animation: pulse 1.4s infinite; }
.bal-chip .led.off { background: var(--faint); }
.bal-num { text-align: center; font-family: var(--mono); font-size: clamp(32px, 8vw, 52px); font-weight: 700; letter-spacing: -.01em; line-height: 1; margin: 18px 0 8px; color: var(--text); overflow-wrap: anywhere; }
.bal-num .cts { color: var(--faint); }
.bal-sub { text-align: center; color: var(--muted); font-size: var(--fs-md); }

/* Cartes d'action (Copperx) */
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); margin-bottom: var(--s5); }
.action-card { background: var(--surface-1); border-radius: var(--r-md); padding: 16px 18px 20px; cursor: pointer; transition: background .12s, transform .08s; text-align: left; display: block; min-height: 108px; position: relative; border: none; }
.action-card:hover { background: var(--surface-2); }
.action-card:active { transform: translateY(1px); }
.action-ico { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin-bottom: 42px; }
.action-ico .icon { color: #fff; }
.action-card .lbl { position: absolute; left: 18px; bottom: 18px; color: var(--accent-2); font-weight: 700; font-size: var(--fs-md); }

/* Lignes de transactions (Copperx) */
.txn-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin: var(--s5) 0 var(--s3); flex-wrap: wrap; }
.txn-head h2 { text-transform: none; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0; }
.txn-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.txn-pill { padding: 7px 14px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; border: 1px solid transparent; color: var(--muted); background: transparent; }
.txn-pill:hover { background: var(--surface-1); }
.txn-pill.active { background: var(--surface-2); color: var(--text); }
.txn-row { display: flex; align-items: center; gap: var(--s4); padding: 16px 6px; border-bottom: 1px solid var(--border); }
.txn-row:last-child { border-bottom: none; }
.txn-tag { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 8px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; }
.txn-tag .dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; }
.txn-tag .dot .icon { width: 13px; height: 13px; }
.txn-desc { flex: 1; color: var(--text); font-size: var(--fs-md); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.txn-chip { background: var(--surface-2); padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; }
.txn-by { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--accent-2); padding: 3px 9px 3px 7px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; }
.txn-by .icon { width: 12px; height: 12px; }
.txn-amt { font-family: var(--mono); font-size: var(--fs-lg); font-weight: 600; white-space: nowrap; }
.txn-amt.neg { color: var(--err); } .txn-amt.pos { color: var(--ok); }
.txn-end { text-align: center; color: var(--faint); font-size: var(--fs-sm); padding: 22px 0; }

/* ---------- Login (split-screen : visuel + panneau formulaire) ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
/* Visuel : dépose web/login-hero.jpg (image sous licence) — sinon le dégradé de marque s'affiche. */
.login-visual { position: relative; overflow: hidden; background: url('/login-hero.png') center top / cover no-repeat, var(--grad); }
.login-fx { display: none; } /* visuel photo présent → on masque les effets SVG (sinon ça surcharge) */
.login-visual::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(17, 18, 26, .05) 0%, rgba(17, 18, 26, .58) 100%); }
.login-visual-tag { position: absolute; left: 46px; right: 46px; bottom: 44px; z-index: 2; color: #fff; }
.lv-eyebrow { text-transform: uppercase; letter-spacing: .15em; font-size: 12px; font-weight: 700; opacity: .85; margin-bottom: 12px; }
.lv-title { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.12; text-shadow: 0 2px 20px rgba(0, 0, 0, .25); }
.login-panel { display: flex; flex-direction: column; padding: 28px 48px; min-height: 100vh; background: var(--bg); }
.login-logo { align-self: flex-start; }
.login-wrap { flex: 1; display: grid; place-items: center; padding: 24px 0; }
.login-footer { align-self: center; color: var(--faint); font-size: var(--fs-sm); }
@media (max-width: 900px) { .login { grid-template-columns: 1fr; } .login-visual { display: none; } }
.login-card { background: transparent; border: none; border-radius: 0; padding: 0; width: 360px; max-width: 100%; box-shadow: none; }
.login-title { font-size: 34px; font-weight: 800; letter-spacing: -.04em; margin: 0; color: var(--text); }
.login-help { margin: 10px 0 26px; color: var(--muted); font-size: var(--fs-md); line-height: 1.55; }
.login-label { display: block; font-size: var(--fs-sm); font-weight: 700; color: var(--text); margin: 16px 0 7px; }
.login-field { position: relative; }
.login-field input {
  width: 100%; background: #f5f4f1; border: 1.5px solid transparent; border-radius: 11px;
  padding: 15px 16px; font-size: var(--fs-md); color: var(--text); box-shadow: none; transition: background .12s, border-color .12s, box-shadow .12s;
}
.login-field input::placeholder { color: #a8a69f; }
.login-field input:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.login-field.with-toggle input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); background: transparent; border: none; box-shadow: none; color: var(--faint); padding: 8px; border-radius: 8px; }
.pw-toggle:hover { background: transparent; color: var(--muted); }
.login-err { min-height: 1.1em; margin: 14px 0 0; font-size: var(--fs-sm); }
.login-submit { width: 100%; justify-content: center; margin-top: 22px; padding: 15px; font-size: var(--fs-md); font-weight: 700; border-radius: 11px; background: var(--grad); box-shadow: 0 12px 26px -12px rgba(99, 91, 255, .6); }
.login-submit:hover { background: var(--grad); filter: brightness(1.05); }

/* ---- Formulaire style GoFundMe : carte + champs à label intégré + bouton pilule ---- */
.gf-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-2); padding: 40px 40px 34px; width: 420px; max-width: 100%; }
.gf-card .login-title { font-size: 30px; margin: 0 0 6px; }
.gf-card .login-err { min-height: 0; margin: 6px 0 18px; color: var(--err); font-weight: 700; font-size: var(--fs-md); }
.gf-card .login-err:empty { display: none; }
.gf-field { position: relative; border: 1.5px solid var(--border-strong); border-radius: 11px; padding: 9px 15px 8px; margin-bottom: 14px; transition: border-color .12s, box-shadow .12s; }
.gf-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.gf-label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin: 0 0 1px; }
.gf-field input { border: none; background: transparent; padding: 0; font-size: 15px; width: 100%; box-shadow: none; color: var(--text); }
.gf-field input:focus { border: none; box-shadow: none; }
.gf-field:has(.pw-toggle) input { padding-right: 32px; }
.gf-field .pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.gf-forgot { display: inline-block; margin: 2px 0 20px; font-weight: 700; font-size: var(--fs-md); color: var(--text); cursor: pointer; }
.gf-forgot:hover { color: var(--accent); }
.gf-submit { width: 100%; margin-top: 4px; border-radius: 999px; padding: 15px; font-size: var(--fs-md); font-weight: 700; background: var(--grad); box-shadow: 0 12px 26px -12px rgba(99, 91, 255, .55); }
.gf-submit:hover { background: var(--grad); filter: brightness(1.05); }

/* ---- Formulaire style Relume : labels au-dessus, champs remplis, bouton noir ---- */
.rl-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-2); padding: 40px; width: 440px; max-width: 100%; }
.rl-card .login-title { font-size: 32px; margin: 0 0 26px; font-weight: 800; }
.rl-field { margin-bottom: 18px; }
.rl-field > .rl-label { display: block; margin-bottom: 7px; }
.rl-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.rl-label-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.rl-forgot { font-size: 13px; color: var(--muted); text-decoration: underline; cursor: pointer; font-weight: 500; }
.rl-forgot:hover { color: var(--accent); }
.rl-field input, .rl-input-wrap input { width: 100%; background: var(--surface-2); border: 1.5px solid transparent; border-radius: 10px; padding: 13px 15px; font-size: 15px; color: var(--text); box-shadow: none; transition: background .12s, border-color .12s, box-shadow .12s; }
.rl-field input::placeholder, .rl-input-wrap input::placeholder { color: var(--faint); }
.rl-field input:focus, .rl-input-wrap input:focus { background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.rl-input-wrap { position: relative; }
.rl-input-wrap input { padding-right: 44px; }
.rl-input-wrap .pw-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.rl-submit { width: 100%; margin-top: 8px; border-radius: 10px; padding: 15px; font-size: var(--fs-md); font-weight: 700; background: var(--ink); box-shadow: none; }
.rl-submit:hover { background: var(--ink-2); filter: none; }
.rl-err { min-height: 0; margin: 14px 0 0; color: var(--err); font-weight: 600; font-size: var(--fs-md); }
.rl-err:empty { display: none; }
.rl-divider { border-top: 1px solid var(--border); margin: 22px 0 20px; }
.rl-signup { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rl-signup > span { font-size: var(--fs-sm); color: var(--text); font-weight: 500; }
.rl-wa-btn { display: inline-flex; align-items: center; gap: 7px; background: #25d366; color: #fff; padding: 10px 15px; border-radius: 10px; font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; }
.rl-wa-btn:hover { background: #1eb457; }
.rl-wa-btn .icon { stroke-width: 2; }
@media (max-width: 480px) { .login { padding: 20px; } .login-card { padding: 32px 24px; } }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--bg); border-right: 1px solid var(--border); padding: var(--s4) var(--s3); display: flex; flex-direction: column; gap: 1px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: var(--s2) var(--s2) var(--s5); }
.nav-group-label { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: var(--s4) var(--s2) var(--s1); font-weight: 700; }
.sidebar nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar nav a { display: flex; align-items: center; gap: var(--s3); padding: 9px 11px; border-radius: 10px; color: var(--muted); cursor: pointer; user-select: none; font-weight: 600; transition: background .12s, color .12s; }
.sidebar nav a:hover { background: var(--surface-1); color: var(--text); }
.sidebar nav a.active { background: transparent; color: var(--accent); font-weight: 700; box-shadow: none; }
.sidebar nav a.active:hover { background: var(--accent-soft); }
.sidebar nav a.active .icon { color: var(--accent); }
.sidebar nav a .icon { color: inherit; }
.sidebar .foot { margin-top: auto; padding-top: var(--s3); border-top: 1px solid var(--border); }
.logout { width: 100%; background: var(--surface-1); border: 1px solid var(--border); color: var(--muted); box-shadow: var(--shadow-1); display: flex; align-items: center; justify-content: center; gap: var(--s2); }
.logout:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Topbar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s5) var(--s3); background: var(--bg); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-size: var(--fs-sm); font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--faint); }
.topbar .right { display: flex; align-items: center; gap: var(--s3); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; border: 1px solid var(--border); background: var(--surface-1); box-shadow: var(--shadow-1); color: var(--muted); }
.pill .led { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.ok { color: var(--ok); border-color: var(--ok-border); background: var(--ok-soft); } .pill.ok .led { background: var(--ok-2); box-shadow: 0 0 7px var(--ok-2); }
.pill.warn { color: var(--warn); border-color: var(--warn-border); background: var(--warn-soft); } .pill.warn .led { background: var(--warn-2); box-shadow: 0 0 7px var(--warn-2); animation: pulse 1.4s infinite; }
.pill.off { color: var(--muted); }
/* Pastille de solde beIN (topbar) : pièce accent + montant monospace */
.bal-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 13px 4px 4px; border-radius: var(--r-pill); background: var(--bg); border: 1px solid var(--border-strong); box-shadow: var(--shadow-1); white-space: nowrap; }
.bal-pill .bal-coin { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; flex: none; box-shadow: 0 2px 6px -1px var(--accent-ring); }
.bal-pill .bal-coin .icon { width: 14px; height: 14px; color: #fff; }
.bal-pill-num { font-family: var(--mono); font-weight: 700; font-size: var(--fs-md); color: var(--text); letter-spacing: -.01em; }
.bal-pill-cur { font-size: 10px; font-weight: 700; color: var(--muted); letter-spacing: .05em; }
/* Solde figé (session hors ligne) : grisé ; solde bas : ambre (rappel visuel permanent). */
.bal-pill.stale { opacity: .55; }
.bal-pill.stale .bal-coin { background: var(--faint); box-shadow: none; }
.bal-pill.low { border-color: var(--warn-border); background: var(--warn-soft); }
.bal-pill.low .bal-coin { background: var(--warn-2); box-shadow: none; }
.bal-pill.low .bal-pill-num { color: var(--warn); }

/* Sélecteur de période compact (carte de solde) */
.bal-range { width: auto; background: var(--bg); border: 1px solid var(--border-strong); color: var(--text); font-weight: 600; font-size: var(--fs-sm); padding: 7px 12px; border-radius: var(--r-pill); box-shadow: var(--shadow-1); }
.bal-range:focus { background: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

/* ---------- Sélecteur de plage de dates (analytics) ---------- */
.daterange { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.dr-nav { background: var(--bg); border: 1px solid var(--border-strong); color: var(--muted); width: 34px; height: 38px; padding: 0; border-radius: 10px; font-size: 18px; line-height: 1; display: grid; place-items: center; box-shadow: var(--shadow-1); }
.dr-nav:hover { background: var(--surface-1); color: var(--text); }
.dr-trigger { background: var(--bg); border: 1px solid var(--border-strong); color: var(--text); font-weight: 600; padding: 0 14px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; gap: 9px; box-shadow: var(--shadow-1); }
.dr-trigger:hover { background: var(--surface-1); }
.dr-trigger .icon { color: var(--accent); }
.dr-trigger .dr-caret { color: var(--faint); font-size: 13px; margin-top: -2px; }

.dr-pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; background: var(--bg); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-2); display: flex; overflow: hidden; max-width: calc(100vw - 32px); }
.dr-presets { width: 168px; flex: none; border-right: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 2px; background: var(--surface-1); }
.dr-preset { text-align: left; background: transparent; color: var(--text); font-weight: 600; font-size: var(--fs-md); padding: 11px 14px; border-radius: 9px; box-shadow: none; }
.dr-preset:hover { background: var(--surface-2); }
.dr-preset.active, .dr-preset.active:hover { background: var(--accent); color: #fff; }

.dr-cals { position: relative; padding: 14px 16px 12px; display: flex; flex-direction: column; }
.dr-mnav { position: absolute; top: 13px; background: transparent; border: none; box-shadow: none; color: var(--muted); font-size: 20px; width: 30px; height: 30px; padding: 0; border-radius: 8px; display: grid; place-items: center; z-index: 1; }
.dr-mnav#drMPrev { left: 14px; } .dr-mnav#drMNext { right: 14px; }
.dr-mnav:hover { background: var(--surface-1); color: var(--text); }
.dr-months { display: flex; gap: 26px; }
.dr-mtitle { text-align: center; font-weight: 700; font-size: var(--fs-md); color: var(--text); margin: 0 0 12px; text-transform: capitalize; }
.dr-wd { display: grid; grid-template-columns: repeat(7, 34px); margin-bottom: 4px; }
.dr-wd span { text-align: center; font-size: 11px; font-weight: 600; color: var(--faint); }
.dr-grid { display: grid; grid-template-columns: repeat(7, 34px); }
.dr-day { display: grid; place-items: center; gap: 0; position: relative; height: 34px; width: 34px; padding: 0; background: transparent; border: none; box-shadow: none; color: var(--text); font-size: var(--fs-sm); font-weight: 500; font-variant-numeric: tabular-nums; border-radius: 0; }
.dr-day span { position: relative; z-index: 1; }
.dr-day.other { color: var(--faint); }
.dr-day.future { color: var(--faint); opacity: .5; cursor: not-allowed; }
.dr-day:not(.sel):not(.in):not(.future):hover::before { content: ""; position: absolute; inset: 2px; border-radius: 9px; background: var(--surface-2); z-index: 0; }
.dr-day.in { background: var(--accent-soft); }
.dr-day.start { border-radius: 10px 0 0 10px; }
.dr-day.end { border-radius: 0 10px 10px 0; }
.dr-day.start.end { border-radius: 10px; }
.dr-day.sel { color: #fff; font-weight: 700; }
.dr-day.sel::before { content: ""; position: absolute; inset: 1px; border-radius: 9px; background: var(--accent); z-index: 0; }

.dr-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.dr-foot-label { color: var(--muted); font-size: var(--fs-md); font-weight: 600; }
.dr-foot-btns { display: flex; gap: 8px; }
@media (max-width: 760px) {
  .dr-pop { flex-direction: column; right: auto; left: 0; overflow: auto; max-height: 80vh; }
  .dr-presets { width: auto; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--border); }
  .dr-months { flex-direction: column; gap: 18px; }
}
.who-chip { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.who-chip .av { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); box-shadow: 0 2px 6px -1px var(--accent-ring); }

.content { padding: 0 var(--s5) var(--s5); }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s4); gap: var(--s3); }
.view-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.035em; }
.view-head .sub { color: var(--muted); font-size: var(--fs-md); margin-top: 4px; }

/* ---------- Cards / sections (style Kit : gros titre + filet) ---------- */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5) 28px; box-shadow: var(--shadow-card); }
.card + .card { margin-top: var(--s4); }
.card.form { max-width: 680px; }
.card-title { display: flex; align-items: center; gap: var(--s2); font-weight: 800; font-size: var(--fs-lg); letter-spacing: -.02em; color: var(--text); margin: 0 0 var(--s4); padding-bottom: var(--s3); border-bottom: 1px solid var(--border); }
.card-title .icon { color: var(--accent); }

/* ---------- Stat cards (KPI éditorial : carte blanche, filet = structure, chiffre en avant) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); }
.stat-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px 18px; display: flex; flex-direction: column; box-shadow: var(--shadow-card); transition: border-color .12s, box-shadow .12s, transform .12s; }
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { border-color: var(--border-strong); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; margin-bottom: 14px; }
.stat-label { font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.stat-ico { width: 24px; height: 24px; border-radius: 7px; background: var(--surface-1); color: var(--faint); display: grid; place-items: center; flex: none; }
.stat-ico .icon { width: 13px; height: 13px; }
.stat-ico.ok { background: var(--ok-soft); color: var(--ok); }
.stat-ico.warn { background: var(--warn-soft); color: var(--warn); }
.stat-ico.err { background: var(--err-soft); color: var(--err); }
.stat-ico.info { background: var(--accent-soft); color: var(--accent); }
.stat-num { font-size: 30px; font-weight: 600; line-height: 1.05; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-sub { font-size: var(--fs-sm); color: var(--faint); margin-top: 6px; }

/* ---------- Statut système (dashboard) ---------- */
.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 6px 28px; }
.sys-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.sys-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--faint); }
.sys-dot.ok { background: var(--ok); box-shadow: 0 0 6px var(--ok-2); }
.sys-dot.warn { background: var(--warn-2); box-shadow: 0 0 6px var(--warn-2); animation: pulse 1.4s infinite; }
.sys-dot.off { background: var(--faint); }
.sys-dot.muted { background: var(--border-strong); }
.sys-k { color: var(--muted); font-weight: 600; font-size: var(--fs-md); }
.sys-v { margin-left: auto; color: var(--text); font-weight: 600; font-size: var(--fs-md); }

/* ---------- Aide "comment ça marche" (opérations) ---------- */
.ops-help { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.ops-help-in { display: flex; flex-direction: column; gap: 14px; }
.ohl-item { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-md); line-height: 1.55; color: var(--muted); }
.ohl-item b { color: var(--text); }
.ohl-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; margin-top: 1px; }

/* ---------- Cartes « Mes comptes beIN » (multi-comptes) ---------- */
.dealer-card + .dealer-card { margin-top: 16px; }
.dealer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 720px) { .dealer-grid { grid-template-columns: 1fr; } }
.dealer-bal { background: var(--surface-1); border-radius: var(--r-md); padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; }
.dealer-bal-num { font-family: var(--mono); font-size: 26px; font-weight: 700; letter-spacing: -.02em; color: var(--text); margin: 4px 0; }
.dealer-bal-num span { font-family: var(--font, inherit); font-size: var(--fs-md); font-weight: 400; color: var(--muted); }

/* ---------- Inputs / boutons ---------- */
.row { display: flex; gap: var(--s2); flex-wrap: wrap; }
.row + .row { margin-top: var(--s3); }
/* Champs REMPLIS, sans bordure (style Quizlet) — mêmes codes que le login validé */
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  background: var(--surface-1); border: 1.5px solid transparent; color: var(--text);
  padding: 15px 16px; border-radius: 12px; font-size: var(--fs-lg); outline: none; width: 100%; font-family: inherit;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: var(--muted); font-weight: 500; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):focus, select:focus, textarea:focus {
  background: var(--bg); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input[type=file] {
  padding: 13px 15px; color: var(--muted); background: var(--surface-1);
  border: 1.5px dashed var(--border-strong); border-radius: 12px; width: 100%; font-family: inherit; cursor: pointer;
}
/* Cases à cocher PLEINES : carré accent + coche blanche (style Quizlet) */
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 22px; height: 22px; flex: none; margin: 0;
  border-radius: 6px; border: 2px solid var(--border-strong); background: var(--bg); cursor: pointer;
  position: relative; padding: 0; transition: background .12s, border-color .12s, box-shadow .12s; vertical-align: middle;
}
input[type=checkbox]:hover { border-color: var(--accent); }
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
input[type=checkbox]:focus-visible { box-shadow: 0 0 0 4px var(--accent-ring); }
label { display: block; color: var(--text); font-size: var(--fs-md); margin: 18px 0 8px; font-weight: 600; }
.card label:first-of-type { margin-top: 0; }
.field { flex: 1; min-width: 160px; }

/* Boutons : primaire PÉRIWINKLE (Copperx) ; secondaire = fond lavande */
button, .btn {
  background: var(--accent); color: #fff; border: none; padding: 10px 18px; border-radius: 12px;
  font-size: var(--fs-md); font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s2);
  font-family: inherit; white-space: nowrap; transition: background .12s, transform .06s, box-shadow .12s;
}
button:hover, .btn:hover { background: var(--accent-2); }
button:active, .btn:active { transform: translateY(1px); }
.btn.ghost, button.ghost { background: var(--surface-1); border: 1px solid var(--border-strong); color: var(--text); }
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); }
.btn.danger, button.danger { background: var(--err); }
.btn.danger:hover, button.danger:hover { background: var(--err-2); }
.btn.small, button.small { padding: 7px 13px; font-size: var(--fs-sm); }
.btn.block { width: 100%; justify-content: center; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { background: var(--surface-1); border: 1px solid var(--border-strong); color: var(--muted); padding: 7px; border-radius: 10px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.spinner { width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
.btn.ghost .spinner, .center-load .spinner, .icon-btn .spinner { border-color: var(--border-strong); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
.center-load { display: flex; align-items: center; gap: var(--s2); justify-content: center; color: var(--muted); padding: var(--s5); }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: var(--fs-md); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
th { color: var(--muted); font-weight: 700; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-expand td { background: var(--surface-2); }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); }
.kv-grid .k, .check-grid .k { font-size: var(--fs-xs); color: var(--faint); margin-bottom: 3px; font-weight: 600; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .01em; }
.badge .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.badge .led { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.pending { background: var(--surface-3); color: var(--muted); }
.badge.pending .led { animation: pulse 1.2s infinite; }
.badge.danger { background: var(--err); color: #fff; }

/* ---------- Flux opérations ---------- */
.pkg-group { margin-top: var(--s4); }
.pkg-group h3 { font-size: var(--fs-md); color: var(--text); margin: 0 0 var(--s2); font-weight: 700; }
.pkg { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border: 1px solid var(--border); border-radius: 11px; margin-bottom: var(--s2); background: var(--surface-1); transition: border-color .12s, box-shadow .12s; }
.pkg:hover { border-color: var(--border-strong); box-shadow: var(--shadow-1); }
.pkg .pname { font-weight: 600; }
.pkg .right { display: flex; align-items: center; gap: var(--s3); }
.pkg .price { font-family: var(--mono); color: var(--accent); font-weight: 700; }

.confirm-card { border: 1px solid var(--warn-border); }
.callout { border-radius: 11px; padding: var(--s3) var(--s4); display: flex; gap: var(--s2); align-items: flex-start; font-size: var(--fs-sm); }
.callout .icon { margin-top: 1px; flex: none; }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout.err { background: var(--err-soft); color: var(--err); }
.callout.ok { background: var(--ok-soft); color: var(--ok); }
.callout.info { background: var(--info-soft); color: var(--info); }
.big-price { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.03em; color: var(--text); }

.result-card { border-radius: var(--r-md); border: 1px solid var(--border); padding: var(--s5) 28px; background: var(--surface-1); box-shadow: var(--shadow-card); }
.result-card.ok { border-color: var(--ok-border); background: linear-gradient(180deg, var(--ok-soft), var(--surface-1) 55%); }
.result-card.err { border-color: var(--err-border); }
.result-card.danger { border-color: var(--err); background: linear-gradient(180deg, var(--err-soft), var(--surface-1) 60%); }

.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s4); }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: var(--s5); right: var(--s5); display: flex; flex-direction: column; gap: var(--s2); z-index: 100; max-width: 360px; }
.toast { background: var(--surface-1); border: 1px solid var(--border-strong); border-left: 3px solid var(--ink); border-radius: 11px; padding: 12px 15px; font-size: var(--fs-sm); color: var(--text); box-shadow: var(--shadow-2); display: flex; gap: var(--s2); align-items: flex-start; animation: toast-in .2s ease; cursor: pointer; font-weight: 500; }
.toast.ok { border-left-color: var(--ok-2); } .toast.err { border-left-color: var(--err); } .toast.warn { border-left-color: var(--warn-2); }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: var(--overlay); display: grid; place-items: center; z-index: 80; backdrop-filter: blur(3px); }
.modal { background: var(--bg); border: 1px solid var(--border); border-radius: 24px; padding: 34px; width: 440px; box-shadow: var(--shadow-2); }
.modal label:first-of-type { margin-top: 0; }
.modal h2 { color: var(--text); text-transform: none; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.modal .modal-actions { display: flex; gap: var(--s2); justify-content: flex-end; margin-top: var(--s4); }

.empty-state { text-align: center; color: var(--muted); padding: var(--s6) var(--s4); display: flex; flex-direction: column; align-items: center; gap: var(--s2); }
.empty-state .icon { width: 30px; height: 30px; color: var(--faint); }

.key-banner { font-family: inherit; font-size: var(--fs-sm); word-break: break-all; border-color: var(--accent-border); background: var(--accent-soft); color: var(--text); }

.toolbar { display: flex; gap: var(--s2); margin-bottom: var(--s4); flex-wrap: wrap; }
.toolbar input { flex: 1; min-width: 200px; }
.toolbar select { width: auto; min-width: 140px; }
.card[style*="padding:0"] { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; width: 250px; box-shadow: var(--shadow-2); background: var(--surface-1); }
  .app.nav-open .sidebar { transform: none; }
  .content { padding: 0 var(--s4) var(--s4); }
  .topbar { padding: var(--s4); }
  .hero { padding: 20px 18px 32px; }
  .row .field { min-width: 100%; }
  /* Transactions : la description passe sous le tag + montant sur petit écran */
  .txn-row { flex-wrap: wrap; row-gap: 6px; }
  .txn-amt { margin-left: auto; }
  .txn-desc { order: 3; flex-basis: 100%; }
}
.menu-btn { display: none; }
@media (max-width: 820px) { .menu-btn { display: inline-flex; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* --- Notifications Telegram (Réglages) --- */
.tg-status { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); margin-bottom: 14px; }
.tg-status .led { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.tg-status .led.ok { background: var(--ok); box-shadow: 0 0 6px rgba(18, 161, 80, .55); }
.tg-note { margin-bottom: 14px; line-height: 1.55; }
.tg-prefs .check { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; line-height: 1.45; cursor: pointer; }
.tg-prefs .check input[type="checkbox"] { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; cursor: pointer; }
.tg-linkbox { margin-top: 14px; padding: 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface-1); }
.tg-linkbox code { background: var(--bg); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; font-size: var(--fs-sm); }
.tg-wait { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--muted); font-size: var(--fs-sm); }
