/* ─────────────────────────────────────────────────────────────
   SEPA Plateforme — habillage
   Les couleurs et rayons se règlent ici, dans :root.
   ───────────────────────────────────────────────────────────── */
:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #1b2130;
  --ink-2: #47506a;
  --muted: #636d86;
  --line: #e5e8f0;
  --line-strong: #d2d7e3;
  --accent: #5146e5;
  --accent-hover: #4034cf;
  --accent-soft: #efeefe;
  --accent-ink: #3b30b8;
  --ok: #0c7350;
  --ok-soft: #dff5ea;
  --warn: #8f5400;
  --warn-soft: #fdf1d3;
  --bad: #c0332a;
  --bad-soft: #fde9e7;
  --off: #566076;
  --off-soft: #eceef4;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-xs: 0 1px 2px rgba(27, 33, 48, .06);
  --shadow-sm: 0 1px 2px rgba(27, 33, 48, .05), 0 2px 6px rgba(27, 33, 48, .04);
  --shadow-lg: 0 12px 32px rgba(27, 33, 48, .10), 0 2px 6px rgba(27, 33, 48, .05);
  --side-w: 244px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.2; margin: 0 0 4px; font-weight: 650; letter-spacing: -0.02em; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; letter-spacing: -0.005em; }
p { margin: 0 0 12px; }
strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
[hidden] { display: none !important; }

/* ── Marque ── */
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 700; font-size: 18px; letter-spacing: -0.03em; }
.brand:hover { color: var(--ink); text-decoration: none; }
.logo-mark { width: 26px; height: 26px; flex: none; border-radius: 8px; box-shadow: var(--shadow-xs); }

/* ── Barre latérale (connecté) ── */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px 14px; display: flex; flex-direction: column; z-index: 5; }
.side .brand { padding: 2px 8px 0; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 22px 8px 8px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .side-foot a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.nav a:hover, .side-foot a:hover { background: var(--bg); color: var(--ink); text-decoration: none; }
.nav a.on, .side-foot a.on { background: var(--accent-soft); color: var(--accent-ink); }
.nav a.side-switch { margin-top: 12px; border: 1px solid var(--line); background: var(--surface, #fff); color: var(--accent-ink); font-weight: 600; }
.nav a.side-switch:hover { border-color: var(--accent); background: var(--accent-soft); }
.ico { width: 16px; height: 16px; flex: none; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.side-foot form { padding: 2px 8px 0 34px; }
.linklike { background: none; border: 0; padding: 0; color: var(--muted); cursor: pointer; font: inherit; font-size: 13px; }
.linklike:hover { color: var(--ink); text-decoration: underline; }
body.with-side .shell { margin-left: var(--side-w); }

/* ── En-tête (visiteur) ── */
.topbar { background: rgba(255, 255, 255, .86); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.who { display: flex; align-items: center; gap: 16px; font-weight: 500; }
.who a:not(.btn) { color: var(--ink-2); }

.devbar { background: var(--warn-soft); color: var(--warn); font-size: 13px; text-align: center; padding: 6px 12px; border-bottom: 1px solid #f0dca8; }

main { max-width: 1120px; margin: 0 auto; padding: 32px 32px 72px; }
main.narrow { max-width: 520px; padding-top: 48px; }
main.checkout { max-width: 1040px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--ink-2); }

/* ── Cartes ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { margin: 0; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: #fbfbfd; }
.card-foot p:last-child { margin-bottom: 0; }
main.narrow > .card { padding: 30px; box-shadow: var(--shadow-lg); }
main.narrow > .card > h1 { margin-bottom: 6px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }

/* ── Indicateurs ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.stat .label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 25px; font-weight: 650; letter-spacing: -0.025em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .value.mono { font-size: 18px; letter-spacing: 0; padding: 5px 0 4px; }
.stat .hint { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.main { background: linear-gradient(150deg, #5d52ea, #4034cf); border-color: #4034cf; color: #fff; }
.stat.main .label, .stat.main .hint { color: rgba(255, 255, 255, .78); }
.stat.main a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

/* ── Tableaux ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 9px 20px; border-bottom: 1px solid var(--line); background: #fbfbfd; white-space: nowrap; }
td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafaff; }
td.amount, th.amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline-block; margin-left: 6px; }
td.actions form.inline { display: inline-flex; }
.empty { padding: 34px 20px; color: var(--muted); text-align: center; }
.neg { color: var(--bad); }
.pos { color: var(--ok); }

/* ── Pastilles ── */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; line-height: 1.5; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-wait { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-off { background: var(--off-soft); color: var(--off); }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--ink-2); background: #fbfbfd; white-space: nowrap; }

/* ── Formulaires ── */
label { display: block; font-weight: 550; font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.field { margin-bottom: 15px; }
.field .help { font-size: 12.5px; color: var(--muted); margin-top: 5px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select {
  width: 100%; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; color: var(--ink); background: #fff;
  box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s;
}
input::placeholder { color: #a3abbd; }
input:focus, select:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(81, 70, 229, .18); }
input.iban { font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 13.5px; margin: 0; color: var(--ink-2); }
.check input { margin-top: 2px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
fieldset { border: 0; padding: 0; margin: 0 0 6px; min-width: 0; }
legend { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0; margin: 20px 0 12px; font-weight: 600; }
fieldset:first-of-type legend { margin-top: 4px; }

.btn { display: inline-block; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, .14); transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; text-decoration: none; }
.btn:focus-visible { outline: 0; box-shadow: 0 0 0 3px rgba(81, 70, 229, .3); }
.btn.block { display: block; width: 100%; text-align: center; padding: 11px 16px; font-size: 15px; }
.btn.lg { padding: 11px 18px; font-size: 15px; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-xs); }
.btn.ghost:hover { background: #fafafd; border-color: #bfc6d6; color: var(--ink); }
.btn.danger { background: #fff; color: var(--bad); border-color: #ebc1bd; box-shadow: var(--shadow-xs); }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); border-color: #e2a9a4; }
.btn.sm { padding: 4px 10px; font-size: 13px; font-weight: 550; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline select, .inline input { width: auto; padding: 4px 8px; }

/* ── Messages ── */
.flash { padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid; font-weight: 500; }
.flash-success { background: var(--ok-soft); border-color: #b5e3cd; color: var(--ok); }
.flash-error { background: var(--bad-soft); border-color: #f2c4c0; color: var(--bad); }
.note { background: var(--accent-soft); border: 1px solid #dcd9fb; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; color: var(--ink-2); margin-bottom: 14px; overflow-wrap: anywhere; }
.note.warn { background: var(--warn-soft); border-color: #f0dca8; color: #6a3f00; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--bg); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }
.copybox { display: flex; gap: 8px; align-items: center; }
.copybox code { flex: 1; padding: 5px 9px; overflow-x: auto; white-space: nowrap; border-radius: 6px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
pre.mail { white-space: pre-wrap; font-family: inherit; margin: 6px 0 0; color: var(--ink-2); font-size: 13.5px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
dl.kv.spaced { margin: 16px 0 20px; }
.mt { margin-top: 16px; margin-bottom: 0; }
.spaced-top { margin-top: 18px; }

/* ── Page de mandat (deux volets) ── */
.checkout-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: start; padding-top: 16px; }
.checkout-summary { position: sticky; top: 92px; padding-top: 8px; }
.checkout-summary .from { color: var(--muted); font-weight: 600; font-size: 13px; }
.checkout-summary .what { font-size: 20px; font-weight: 600; margin: 6px 0 14px; letter-spacing: -0.01em; }
.checkout-summary .price { font-size: 40px; font-weight: 680; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.checkout-summary .price span { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.summary-lines { margin: 28px 0 18px; border-top: 1px solid var(--line); }
.summary-lines > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary-lines dt { color: var(--ink-2); }
.summary-lines dd { margin: 0; font-weight: 550; }
.summary-note { color: var(--muted); font-size: 13px; }
.summary-foot { color: var(--muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.checkout-form .card { padding: 28px; box-shadow: var(--shadow-lg); margin-bottom: 0; }
.checkout-form h2 { font-size: 17px; margin-bottom: 16px; }
/* Adresses proposées pendant la saisie */
.field.has-suggest { position: relative; }
.suggest { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: 0 12px 28px rgba(27, 33, 48, .14); }
.suggest [role=option] { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 8px 10px; border-radius: 6px; font-size: 14px; line-height: 1.35; cursor: pointer; }
.suggest [role=option] strong { font-weight: 600; }
.suggest [role=option] span { color: var(--muted); font-size: 13px; }
.suggest [role=option][aria-selected=true] { background: var(--bg); }
.suggest-by { padding: 6px 10px 4px; color: var(--muted); font-size: 11.5px; text-align: right; }

/* Page Développeurs : onglets test / réel et marche à suivre */
.dev-modes { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.dev-modes p { margin: 0; max-width: 68ch; }
.dev-steps { margin: 4px 0 14px; padding-left: 20px; display: grid; gap: 10px; max-width: 76ch; }
.dev-brief { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.brief-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; max-height: 420px; overflow: auto; margin: 10px 0 0; }
/* Page de paiement ouverte par le site d'un marchand */
.pay .topbar-inner { max-width: 1040px; }
.pay-merchant { display: flex; align-items: center; gap: 10px; font-size: 15px; min-width: 0; }
.pay-merchant .brand-logo { max-height: 30px; margin: 0; }
.pay-by { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.pay-by .brand { font-size: 14px; color: var(--ink); }
.pay-by .brand svg { width: 18px; height: 18px; }
.test-ibans { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: -4px; }
@media (max-width: 560px) { .pay-by { font-size: 0; gap: 0; } .pay-by .brand { font-size: 14px; } }
.mandate-text { font-size: 12.5px; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin: 16px 0; line-height: 1.55; }

/* ── Accueil ── */
.hero { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 48px; align-items: center; padding: 40px 0 28px; }
.eyebrow { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: 4px 10px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: 44px; line-height: 1.08; margin-bottom: 16px; letter-spacing: -0.035em; font-weight: 700; }
.hero p { font-size: 17px; color: var(--ink-2); max-width: 520px; }
.hero .inline { margin-top: 24px; }
.hero-visual { position: relative; padding: 28px; border-radius: 20px; background: radial-gradient(120% 120% at 100% 0%, #e2dffd 0%, #eef1ff 45%, #f6f7fb 100%); }
.mock { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; }
.mock-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.mock-total { font-size: 20px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mock-row { display: grid; grid-template-columns: 8px 1fr auto 76px; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.mock-row:last-child { border-bottom: 0; }
.mock-row > :last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot.ok { background: #25b47e; }
.dot.wait { background: #e3a008; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 20px; }
.step { margin-bottom: 0; }
.step .n { font-family: var(--mono); color: var(--accent); font-weight: 700; font-size: 12.5px; margin-bottom: 8px; }

/* ── Petits écrans ── */
@media (max-width: 900px) {
  .side { position: static; width: auto; flex-direction: row; align-items: center; gap: 8px; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .side-label { display: none; }
  .nav { flex-direction: row; flex: 1; }
  .nav a { white-space: nowrap; }
  .nav a .ico { display: none; }
  .nav a.side-switch { margin-top: 0; margin-left: 6px; }
  .side-foot { margin: 0; border: 0; padding: 0; flex-direction: row; align-items: center; }
  .side-foot a { display: none; }
  .side-foot form { padding: 0 4px; white-space: nowrap; }
  body.with-side .shell { margin-left: 0; }
  main { padding: 22px 16px 56px; }
  .checkout-grid, .hero { grid-template-columns: 1fr; gap: 26px; }
  .checkout-summary { position: static; }
  .checkout-summary .price { font-size: 32px; }
  .hero h1 { font-size: 32px; }
}
@media (max-width: 640px) {
  .row, .row.three { grid-template-columns: 1fr; }
  th, td { padding: 10px 12px; }
  main.narrow > .card, .checkout-form .card { padding: 20px; }
}
td a { white-space: nowrap; font-weight: 500; }

/* ── Connexions aux prestataires ── */
.conn { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: start; }
.conn h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.conn .actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.conn .actions form { display: flex; gap: 8px; align-items: center; }
.conn .actions input[type=password], .conn .actions input[type=text] { width: 260px; }
.statement { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 11px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); background: #fbfbfd; font-family: var(--mono); font-size: 12.5px; }
.statement small { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) { .conn { grid-template-columns: 1fr; } .conn .actions { align-items: stretch; } .conn .actions input[type=password] { width: 100%; } }

/* ── Migration de mandats ── */
.dropzone { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 22px; margin-bottom: 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: #fbfbfd; cursor: pointer; font-weight: 400; }
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input[type=file] { margin-top: 8px; font: inherit; }
progress.bar { width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: var(--off-soft); appearance: none; -webkit-appearance: none; display: block; }
progress.bar::-webkit-progress-bar { background: var(--off-soft); border-radius: 999px; }
progress.bar::-webkit-progress-value { background: linear-gradient(90deg, #6f64f6, #4034cf); border-radius: 999px; transition: width .4s; }
progress.bar::-moz-progress-bar { background: #5146e5; border-radius: 999px; }

/* ── Produits ── */
.product-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.product-head h2 { font-size: 17px; margin-bottom: 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.product-head p { margin: 0; }
.product-price { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.product-price span { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.product-meta { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; color: var(--ink-2); font-size: 13px; margin: 14px 0; }
.product.is-off { opacity: .72; }
.summary-desc { color: var(--ink-2); margin: -6px 0 16px; }

/* ── Blocs « Modifier » repliables ── */
details.edit > summary { cursor: pointer; color: var(--accent); font-weight: 550; font-size: 13px; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.edit > summary::-webkit-details-marker { display: none; }
details.edit > summary::before { content: "›"; display: inline-block; transition: transform .12s; font-size: 15px; }
details.edit[open] > summary::before { transform: rotate(90deg); }
details.edit > form, details.edit > p { margin-top: 14px; }
details.edit label { font-weight: 550; }
details.edit label input, details.edit label select { margin-top: 6px; font-weight: 400; }
details.card.edit { padding: 14px 20px; }
details.card.edit > summary { font-size: 14px; }
.product details.edit { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
tr.edit-row td { padding-top: 0; padding-bottom: 12px; background: transparent !important; }
tr:has(+ tr.edit-row) td { border-bottom: 0; }
.row.four { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
[data-plan].is-locked input, [data-plan].is-locked select { background: var(--bg); color: var(--ink-2); }
@media (max-width: 640px) { .row.four { grid-template-columns: 1fr; } .product-head { flex-direction: column; } .product-price { text-align: left; } }

/* ── Recherche et pagination ── */
.search { display: flex; gap: 8px; margin-bottom: 14px; }
.search input { flex: 1; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: #fbfbfd; flex-wrap: wrap; }

/* ── Développeurs et protection ── */
.reveal { border-color: #c9c5fb; background: var(--accent-soft); }
.reveal .copybox code { background: #fff; font-size: 13px; }
.card-head form.inline input[type=text] { width: 300px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; margin-top: 12px; }

/* ── Pied de page des pages publiques ── */
.mini-foot { max-width: 1120px; margin: 0 auto; padding: 24px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13px; }
.mini-foot a, .mini-foot button { color: var(--muted); }
.mini-foot button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* ── Bandeau cookies ── */
.consent { position: fixed; z-index: 100; left: 50%; bottom: 18px; width: min(900px, calc(100vw - 32px)); margin-left: calc(min(900px, 100vw - 32px) / -2); background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(20, 24, 39, .22); padding: 16px 20px; font-size: 14px; line-height: 1.5; animation: consentIn .5s cubic-bezier(.2, .9, .2, 1) both; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; align-items: center; }
.consent h4, .consent p, .consent-cats { grid-column: 1; }
.consent-actions { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
@keyframes consentIn { from { opacity: 0; transform: translateY(24px) scale(.97); } }
.consent h4 { margin: 0; font-size: 15px; }
.consent p { margin: 0; color: var(--ink-2); }
.consent-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.consent-actions .btn { text-align: center; padding: 9px 10px; }
.consent-more { grid-column: 1 / -1; background: none; border: 0; font: inherit; font-size: 13px; color: var(--ink-2); text-decoration: underline; cursor: pointer; padding: 6px; }
.consent-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 0; }
.consent-cat { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.consent-cat b { font-size: 14px; } .consent-cat small { grid-column: 1; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.consent-cat .switch { grid-row: 1 / span 2; grid-column: 2; }
.switch { position: relative; width: 40px; height: 23px; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 23px; background: var(--line-strong); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform .2s; }
.switch input:checked + i { background: var(--accent); } .switch input:checked + i::after { transform: translateX(17px); }
.switch input:disabled { cursor: not-allowed; } .switch input:disabled + i { opacity: .55; }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(81, 70, 229, .3); }

@media (max-width: 760px) { .consent { grid-template-columns: 1fr; left: 10px; right: 10px; bottom: 10px; width: auto; margin-left: 0; gap: 10px; } .consent-actions { grid-column: 1; grid-row: auto; } .consent-cats { grid-template-columns: 1fr; } }

/* ── Reversements (administration) ── */
.payout-do { display: flex; gap: 6px; margin-bottom: 6px; }
.payout-send { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
td.payout-actions { width: 300px; min-width: 260px; white-space: normal; }
td.payout-actions .payout-do input { min-width: 0; flex: 1; width: 120px; }
.connector code { overflow-wrap: anywhere; white-space: normal; }
.payout-err { color: var(--bad); font-size: 13px; max-width: 340px; margin-top: 4px; }
.connectors { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0; }
.connector { padding: 16px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.connector h3 { margin: 0 0 6px; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.connector p { margin: 6px 0 10px; font-size: 13px; color: var(--muted); }
.payout-do input { min-width: 150px; }

/* ── Tableau de bord ── */
.dash-today { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 18px; margin-bottom: 26px; }
.dash-today .card { margin-bottom: 0; }
.dash-side { padding: 6px 0; display: grid; align-content: space-between; }
.side-stat { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 13px 20px; border-bottom: 1px solid var(--line); color: var(--ink); align-items: baseline; }
.side-stat:last-child { border-bottom: 0; }
a.side-stat:hover { background: #fafafd; text-decoration: none; color: var(--ink); }
.side-stat span { color: var(--ink-2); font-size: 13px; }
.side-stat strong { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.side-stat small { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; }
.dash-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 6px; }
.dash-bar h2 { margin: 0; font-size: 17px; }
.dash-bar h2 .muted { font-weight: 500; font-size: 14px; margin-left: 6px; }
.dash-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dash-filters select, .dash-filters input[type=date] { width: auto; padding: 5px 8px; font-size: 13px; }
.dash-date { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); margin: 0; font-weight: 500; }
.seg { display: inline-flex; background: #eceef4; border-radius: 9px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg a { padding: 4px 10px; border-radius: 7px; font-size: 13px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.seg a:hover { color: var(--ink); text-decoration: none; }
.seg a.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-xs); }
.dash-note { margin-bottom: 14px; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 18px; margin-bottom: 18px; }
.metric { margin-bottom: 0; padding: 18px 20px 14px; display: grid; gap: 8px; }
.metric-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.metric-title { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.metric-head > div:first-child { flex: none; }
.metric-value { font-size: 26px; font-weight: 680; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.25; white-space: nowrap; }
.metric-side { display: grid; justify-items: end; gap: 3px; text-align: right; min-width: 0; line-height: 1.3; }
.metric-side .small { font-size: 12px; }
.metric-side strong { font-variant-numeric: tabular-nums; }
.metric-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 18px; }
.delta { font-size: 12.5px; font-weight: 650; padding: 2px 7px; border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { background: var(--ok-soft); color: var(--ok); }
.delta.down { background: var(--bad-soft); color: var(--bad); }
.delta.flat { background: var(--off-soft); color: var(--off); }
.chart { position: relative; height: 150px; touch-action: pan-y; }
.chart.tall { height: 190px; }
.chart svg { display: block; }
.chart-tip { position: absolute; z-index: 3; pointer-events: none; background: #171c2b; color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: var(--shadow-lg); white-space: nowrap; display: grid; gap: 3px; }
.chart-tip-head { color: #aeb6cc; font-size: 11.5px; text-transform: capitalize; }
.chart-tip > div:not(.chart-tip-head) { display: flex; justify-content: space-between; gap: 14px; }
.chart-tip strong { font-variant-numeric: tabular-nums; }
.chart-tip .k::before { content: ""; display: inline-block; width: 10px; height: 2px; margin-right: 6px; vertical-align: middle; background: #8f86ff; }
.chart-tip .k.prev::before { background: repeating-linear-gradient(90deg, #aeb6cc 0 3px, transparent 3px 5px); }
.legend { display: inline-flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 2px; display: inline-block; background: var(--accent); }
.lg.prev { background: repeating-linear-gradient(90deg, #7a849c 0 4px, transparent 4px 7px); }
.dash-table summary { list-style: none; cursor: pointer; padding: 13px 20px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.dash-table summary::-webkit-details-marker { display: none; }
.dash-table[open] summary { border-bottom: 1px solid var(--line); }
.dash-table .table-wrap { max-height: 420px; overflow: auto; }
@media (max-width: 900px) { .dash-today { grid-template-columns: minmax(0, 1fr); } .dash-filters { width: 100%; } .metric, .dash-now { min-width: 0; } }

/* ── Actions en masse (clients) ── */
.bulk { padding: 0; }
.bulk summary { list-style: none; cursor: pointer; padding: 14px 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.bulk summary::-webkit-details-marker { display: none; }
.bulk summary::before { content: "+"; font-weight: 700; color: var(--accent); width: 12px; }
.bulk[open] summary::before { content: "−"; }
.bulk[open] summary { border-bottom: 1px solid var(--line); }
.bulk-body { padding: 18px 20px 6px; }
th.pick, td.pick { width: 34px; padding-right: 0; }
td.pick input, th.pick input { width: 16px; height: 16px; accent-color: var(--accent); }

.subform { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 4px; margin: 0 0 16px; }
.bars-list { display: grid; gap: 9px; padding: 16px 20px; }
.bars-list div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 13.5px; }
.bars-list span.k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars-list strong { font-variant-numeric: tabular-nums; }
.bars-list progress { grid-column: 1 / -1; width: 100%; height: 6px; border: 0; border-radius: 6px; overflow: hidden; background: var(--off-soft); appearance: none; -webkit-appearance: none; }
.bars-list progress::-webkit-progress-bar { background: var(--off-soft); }
.bars-list progress::-webkit-progress-value { background: var(--accent); border-radius: 6px; }
.bars-list progress::-moz-progress-bar { background: var(--accent); }

/* ── Dossier de vérification (KYC) ── */
.card-title-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.card-title-row h2 { margin: 0; }
.save-bar { margin-bottom: 22px; }
.kyc-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 14px 0; }
.kyc-doc { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 8px; align-content: start; }
.kyc-doc p { margin: 0; }
.kyc-doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.kyc-upload { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.kyc-upload input[type=file] { flex: 1; min-width: 0; font-size: 13px; padding: 5px; }
.kyc-checks { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 7px; font-size: 13.5px; }
.kyc-checks li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: start; line-height: 1.45; }
.kyc-checks .badge { justify-self: start; }
.ocr-text summary { cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 600; margin-top: 8px; }
.ocr-text pre { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; max-height: 320px; overflow: auto; margin: 8px 0 0; }
.note.ok { background: var(--ok-soft); border-color: #bfe6d3; color: var(--ok); }
.note.bad { background: var(--bad-soft); border-color: #f2c4c0; color: var(--bad); }
.small-value { font-size: 17px !important; }
.crumb { margin: 0 0 4px; font-size: 13px; }
.field textarea { width: 100%; font: inherit; font-size: 14px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--ink); resize: vertical; min-height: 76px; line-height: 1.5; }
.field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(81, 70, 229, .16); }

/* ── Clés et comptes ── */
.keys-kind { margin: 30px 0 4px; font-size: 17px; }
.keys-intro { margin: 0 0 14px; }
.keys-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.keys-head h2 { margin: 0; }
.keys-state { float: right; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.keys-state.set { color: var(--ok); }
.keys-clear { margin-top: 6px; font-size: 13px; font-weight: 400; }
.keys-save { position: sticky; bottom: 0; display: flex; align-items: center; gap: 14px; padding: 14px 0; margin-top: 18px; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.field textarea[name=REVOLUT_PRIVATE_KEY] { font-family: var(--mono); font-size: 12px; }

/* ── Radar ── */
.radar-intro { padding: 18px 20px 6px; }
.radar-intro > p:first-child { max-width: 860px; margin-top: 0; }
.radar-stats { margin: 16px 0; }
.radar-price { margin: 8px 0 0; }
.radar-rules { display: grid; gap: 14px; padding: 14px 16px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 10px; }
.radar-rules .radar-on { font-weight: 600; margin: 0; }
.radar-fields { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.radar-fields label { display: grid; gap: 5px; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 0; }
.radar-fields input[type=number] { width: 150px; padding: 6px 9px; }
.radar-sub { border-top: 1px solid var(--line); }
.radar-list { list-style: none; margin: 0; padding: 0; }
.radar-item { padding: 14px 20px; border-top: 1px solid var(--line); }
.radar-item:first-child { border-top: 0; }
.radar-top { display: flex; align-items: center; gap: 12px; }
.radar-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.radar-top strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.radar-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--muted); margin-top: 3px; }
.radar-why { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); max-width: 760px; }
.radar-neg { color: var(--bad); } .radar-pos { color: var(--ok); }

/* ── Tableaux compacts du tableau de bord : tout tient dans la carte, les noms longs sont abrégés ── */
.table-fit { table-layout: fixed; width: 100%; }
.table-fit th, .table-fit td { padding-left: 10px; padding-right: 10px; }
.table-fit th:first-child, .table-fit td:first-child { padding-left: 20px; }
.table-fit th:last-child, .table-fit td:last-child { padding-right: 20px; }
.table-fit th.c-date { width: 88px; } .table-fit th.c-amount { width: 104px; }
.table-fit .clip-sub { margin-top: 3px; line-height: 1; }
.table-fit td.clip { overflow: hidden; }
/* Le nom du client passe à la ligne s'il est long : il reste lisible en entier. */
.table-fit td.clip > a { display: block; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.table-fit td.clip > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Options payantes ── */
.addons { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.addon { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.addon.on { border-color: #b5e3cd; }
.addon-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.addon-head h2 { margin: 0; }
.addon p { margin: 0; color: var(--ink-2); font-size: 14.5px; flex: 1; }
.addon-price { display: flex; flex-direction: column; gap: 2px; }
.brand-logo { max-width: 180px; max-height: 64px; display: block; margin-bottom: 14px; }
.fc-chart { width: 100%; height: auto; color: var(--ink); }
input[type=color] { width: 56px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
.keys-test { margin: 4px 0 24px; }
.keys-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); column-gap: 22px; align-items: start; }
.field .help.keys-suggest { color: var(--warn); }

/* ── Sécurité du compte ── */
.code-input { font-family: var(--mono); font-size: 22px; letter-spacing: .3em; text-align: center; }
.qr { width: 196px; margin: 12px 0 8px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; } .qr svg { display: block; width: 100%; height: auto; }
.steps-list { padding-left: 20px; margin: 14px 0; } .steps-list li { margin: 10px 0; line-height: 1.6; }
.codes { list-style: none; padding: 14px 16px; margin: 14px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--bg); font-family: var(--mono); font-size: 15px; }
details.plain summary { cursor: pointer; color: var(--muted); font-size: 14px; margin-bottom: 10px; }

/* Lecture : pas de mot seul sur la dernière ligne d'un paragraphe (navigateurs qui le gèrent). */
p, li, dd, figcaption { text-wrap: pretty; }

/* ── Menu déroulant (Exporter) ── */
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; } details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: ''; width: 7px; height: 7px; margin-left: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); display: inline-block; }
details.menu[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(330px, calc(100vw - 32px)); padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-lg); }
.menu-panel > p { margin: 2px 6px 10px; }
.menu-panel > a { display: grid; gap: 1px; padding: 9px 10px; border-radius: 8px; color: var(--ink); }
.menu-panel > a:hover { background: var(--bg); text-decoration: none; }
@media (max-width: 640px) {
  .page-head { position: relative; }
  .page-head details.menu { position: static; }
  .page-head .menu-panel { left: 0; right: 0; top: calc(100% + 6px); width: auto; }
}
/* Titres sur plusieurs lignes : lignes de longueur voisine, pas de mot isolé à la fin. */
h1, h2, h3 { text-wrap: balance; }

/* ── Réclamations ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.claim-reasons { display: grid; gap: 10px; margin: 6px 0 18px; }
.claim-reasons .check { font-size: 14.5px; color: var(--ink); padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.claim-reasons .check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.claim-quote { margin: 12px 0 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink); white-space: pre-line; }
.claim-right { margin: 18px 0 0; }
.claim-item { padding: 18px 20px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.claim-item:first-child { border-top: 0; }
.claim-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.claim-head strong { font-size: 15px; }
.claim-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.claim-actions form.claim-refuse { flex: 1; min-width: 260px; display: grid; gap: 8px; }
.claim-actions textarea { width: 100%; font: inherit; font-size: 13.5px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); resize: vertical; min-height: 60px; }
.mail-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 18px; }
.mail-model { margin: 0; }
.mail-frame { display: block; width: 100%; height: 620px; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg); }
@media (max-width: 520px) { .mail-models { grid-template-columns: 1fr; } }
#reglages .field { margin-top: 18px; }

.transfer-due { border: 0; padding: 0; margin: 12px 0 6px; display: grid; gap: 8px; }
.transfer-due legend { font-weight: 600; font-size: 13.5px; color: var(--ink); padding: 0; margin-bottom: 6px; }

.tranche-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 16px; margin: 10px 0 4px; }

/* Calendrier : grille du mois, détail du jour à côté ; relevé */
.t-ok { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.t-info { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.t-bad { --tone: var(--bad); --tone-soft: var(--bad-soft); }
.t-warn { --tone: #c27a00; --tone-soft: var(--warn-soft); }
.t-off { --tone: var(--off); --tone-soft: var(--off-soft); }
.t-plan { --tone: #8a93a8; --tone-soft: transparent; }
.t-in { --tone: var(--ok); --tone-soft: transparent; }
.calx-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.calx-title { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.calx-title::first-letter { text-transform: uppercase; }
.calx-nav { display: flex; gap: 6px; align-items: center; }
.calx-nav .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; }
.calx-nav .arrow { width: 36px; padding: 0 0 2px; font-size: 20px; line-height: 1; }
.calx-nav .btn[aria-current] { color: var(--muted); }
.calx-waiting { margin: 0 0 14px; color: var(--ink-2); }
.calx-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; margin-bottom: 18px; }
.calx-month { margin: 0; container-type: inline-size; }
.calx-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calx-head { border-bottom: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.calx-head > div { padding: 10px 12px 8px; text-align: right; }
.calx-head .wd-short { display: none; }
.calx-cell { display: flex; flex-direction: column; gap: 4px; min-height: 116px; padding: 6px 6px 8px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.calx-week > .calx-cell:first-child { border-left: 0; }
.calx-grid > .calx-week:first-child > .calx-cell { border-top: 0; }
.calx-cell.out { background: #fafbfd; }
a.calx-cell:hover { background: #fafafd; color: inherit; text-decoration: none; }
a.calx-cell:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
a.calx-cell.sel { background: var(--accent-soft); }
.calx-num { align-self: flex-end; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.calx-cell.weekend .calx-num { color: var(--muted); }
.calx-cell.today .calx-num { background: var(--accent); color: #fff; }
.calx-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.calx-chip { display: flex; align-items: center; gap: 4px; font-size: 11.5px; line-height: 1.4; padding: 2px 5px; border-radius: 5px; background: var(--tone-soft); color: var(--ink); min-width: 0; }
.calx-chip.t-plan, .calx-chip.t-in { box-shadow: inset 0 0 0 1px var(--line-strong); }
.calx-chip > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calx-chip b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.calx-chip i, .calx-dots i, .calx-legend i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); }
.calx-chip.t-plan i, .calx-dots i.t-plan, .calx-legend .t-plan i, .calx-chip.t-in i, .calx-dots i.t-in, .calx-legend .t-in i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--tone); }
.calx-more { font-size: 11.5px; color: var(--muted); padding: 0 6px; }
.calx-dots { display: none; justify-content: center; gap: 3px; min-height: 7px; }
.calx-legend { list-style: none; margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.calx-legend li { display: inline-flex; align-items: center; gap: 6px; }
.calx-side { position: sticky; top: 18px; min-width: 0; scroll-margin-top: 18px; }
.calx-day { margin: 0; }
.calx-day-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.calx-day-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.015em; }
.calx-day-head h2::first-letter { text-transform: uppercase; }
.calx-none { margin: 10px 0 0; }
.calx-events { list-style: none; margin: 0; padding: 0; }
.calx-events li { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.calx-events li:first-child { border-top: 0; }
.calx-events li::before { content: ""; align-self: stretch; min-height: 34px; border-radius: 2px; background: var(--tone); }
.calx-events li.t-plan::before { background: repeating-linear-gradient(to bottom, var(--tone) 0 4px, transparent 4px 7px); }
.calx-events li > div { display: flex; flex-direction: column; min-width: 0; }
.calx-events strong { font-weight: 600; }
.calx-amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calx-projected { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0 0; margin-top: 2px; border-top: 1px solid var(--line-strong); font-variant-numeric: tabular-nums; }
.calx-projected span { color: var(--ink-2); }
.calx-move { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; }
.calx-move summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--accent-ink); }
.calx-move form { display: grid; gap: 10px; margin-top: 12px; }
.calx-move .field { margin: 0; }
.calx-links { margin: 12px 0 0; }
.cal-title { text-transform: capitalize; }
.cal-move { display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(2, minmax(140px, 1fr)) auto; gap: 12px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); }
.cal-move .field { margin: 0; }
.month-statement { width: 100%; max-width: 560px; border-collapse: collapse; }
.month-statement th { text-align: left; font-size: inherit; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink-2); padding: 9px 0; background: none; border: 0; white-space: normal; }
.month-statement td { text-align: right; font-variant-numeric: tabular-nums; padding: 9px 0 9px 16px; border: 0; white-space: nowrap; }
.month-statement tr { border-top: 1px solid var(--line); }
.month-statement tr:first-child { border-top: 0; }
.month-statement tbody tr:hover td { background: none; }
.month-statement tr.total th, .month-statement tr.total td { font-weight: 700; color: var(--ink); }
@media (max-width: 1600px) {
  .calx-body { grid-template-columns: 1fr; }
  .calx-side { position: static; }
}
@media (max-width: 820px) {
  .cal-move { grid-template-columns: 1fr; }
}
/* Grille étroite (téléphone, petite fenêtre) : cases compactes, un point par type d'événement, le détail du jour dessous. */
@container (max-width: 640px) {
  .calx-head > div { text-align: center; padding: 8px 0 6px; }
  .calx-head .wd-long { display: none; }
  .calx-head .wd-short { display: inline; }
  .calx-cell { min-height: 58px; padding: 6px 0 7px; border-left: 0; align-items: center; gap: 5px; }
  .calx-cell.out { background: transparent; }
  a.calx-cell.sel, a.calx-cell:hover { background: transparent; }
  .calx-num { align-self: center; min-width: 34px; height: 34px; border-radius: 17px; font-size: 16px; font-weight: 500; }
  .calx-cell.today .calx-num { background: transparent; color: var(--accent); font-weight: 700; }
  .calx-cell.sel .calx-num { background: var(--ink); color: #fff; font-weight: 600; }
  .calx-cell.today.sel .calx-num { background: var(--accent); color: #fff; }
  .calx-chips { display: none; }
  .calx-dots { display: flex; }
}
@media (max-width: 720px) { .calx-title { font-size: 26px; } }
}

/* Équipe : lien d'invitation à copier */
tr.invite-pending > td { border-bottom: 0; padding-bottom: 6px; }
tr.invite-line > td { padding-top: 0; white-space: normal; }
tr.invite-line:hover > td { background: none; }
.invite-row { display: flex; gap: 6px; margin-top: 4px; }
.invite-row input { flex: 1; min-width: 0; font-size: 12.5px; padding: 6px 8px; }
.invite-note { padding: 12px 16px; margin: 0; border-top: 1px solid var(--line); }
.team-layout > .card:first-child { max-width: 560px; }
.team-layout tr.invite-line label { display: block; }
.invite-mail { margin: 6px 0 0; }
.invite-mail.bad { color: var(--bad); }

/* Clients : classement par situation */
.situations { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 14px; }
.situations .btn span { margin-left: 4px; font-variant-numeric: tabular-nums; opacity: 0.7; font-weight: 500; }
.situations-sep { width: 1px; height: 22px; background: var(--line-strong); margin: 0 4px; }
td.pick input:disabled { opacity: 0.35; cursor: not-allowed; }
/* À représenter : modifier une ligne, journal des changements */
.retry-lines { list-style: none; margin: 0 0 6px; padding: 0; border-top: 1px solid var(--line); }
.retry-lines > li { border-bottom: 1px solid var(--line); }
.retry-lines summary { display: grid; grid-template-columns: 1.3fr 1fr 0.8fr 1fr auto; gap: 14px; align-items: center; padding: 11px 0; cursor: pointer; list-style: none; }
.retry-lines summary::-webkit-details-marker { display: none; }
.retry-lines summary > span:not(.btn) { display: flex; flex-direction: column; min-width: 0; font-variant-numeric: tabular-nums; }
.retry-lines details[open] .retry-edit { background: var(--accent-soft); }
.retry-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding: 6px 0 16px; }
.retry-panel form { display: grid; gap: 10px; align-content: start; }
.retry-panel .field, .retry-panel p { margin: 0; }
.retry-panel form + form { padding-left: 22px; border-left: 1px solid var(--line); }
.retry-changes { list-style: none; margin: 0; padding: 0; }
.retry-changes li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }
.retry-changes li:first-child { border-top: 0; }
.retry-changes li > div { display: flex; flex-direction: column; min-width: 0; }
.steps-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 6px; }
@media (max-width: 720px) {
  .retry-lines summary { grid-template-columns: 1fr 1fr; }
  .retry-lines summary .retry-edit { grid-column: 1 / -1; justify-self: start; }
  .retry-panel { grid-template-columns: 1fr; }
  .retry-panel form + form { padding-left: 0; border-left: 0; padding-top: 16px; border-top: 1px solid var(--line); }
  .retry-changes li { flex-direction: column; align-items: flex-start; }
}
.retry-panel form .btn { justify-self: start; }
.steps-list li { margin: 0; }

/* Exports */
.export-panel { display: grid; gap: 10px; text-align: left; }
.export-panel p { margin: 0; }
.export-panel .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.export-panel .field { margin: 0; }
.menu-panel > p.export-sep { margin: 10px 6px 4px; padding-top: 10px; border-top: 1px solid var(--line); }
.menu-panel > p .inline-link { display: inline; padding: 0; color: var(--accent-ink); }

/* Mode test consulté depuis le site, et signalement de données simulées dans le compte réel */
.mode-bar, .mode-note { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid; }
.mode-bar { background: var(--warn-soft); border-color: #e8c98a; color: #5c3b00; }
.mode-note { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.mode-bar form, .side-mode { margin: 0; }
.side-mode { padding: 6px 12px; }
.side-mode .linklike { font-size: 13px; color: var(--muted); }
