/* FM Gestion v2 — charte filmmariage.fr */
:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --surface-2: #FAF9F7;
  --ink: #1E1F24;
  --ink-2: #3D3F45;
  --muted: #5F6168;
  --line: #E6E4DF;
  --line-2: #EEECE7;
  --hover: #F2F0EB;
  --accent: #D9434E;
  --accent-ink: #B8323D;
  --accent-soft: #FCEBEC;
  --red: #A3222D;     --red-bg: #FDE8E8;
  --amber: #7A4A00;   --amber-bg: #FFF1DB;
  --blue: #1F4FA3;    --blue-bg: #E3EEFF;
  --green: #1C6B47;   --green-bg: #DFF3EA;
  --gray: #4A4C53;    --gray-bg: #EFEDE8;
  --radius: 14px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font); }
a { color: var(--accent-ink); }
a:hover { color: #8E2530; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tone-green { color: var(--green); }
.tone-red { color: var(--red); }
.ic { flex: none; }

/* ---------- Structure ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 264px; flex: none; background: var(--surface); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.sidebar-top { padding: 24px 20px 8px; display: flex; align-items: center; justify-content: space-between; }
.brand img { display: block; width: 196px; height: auto; }
.sidebar .menu-toggle { display: none; }
.sidebar-body { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px 12px; overflow-y: auto; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-title { margin: 20px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--gray); text-decoration: none; font-size: 14px; font-weight: 500; min-height: 44px; }
.nav-link:hover { background: var(--hover); color: var(--ink); }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-link.is-soon { color: #8A8C92; cursor: default; }
.nav-link.is-soon:hover { background: none; color: #8A8C92; }
.nav-link em { margin-left: auto; font-style: normal; font-size: 10.5px; font-weight: 600; background: var(--gray-bg); color: var(--muted); padding: 2px 7px; border-radius: 99px; }
.old-link { margin-top: 18px; font-size: 13px; }
.userbox { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 14px 12px 6px; border-top: 1px solid var(--line-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex: none; }
.userbox-text { display: flex; flex-direction: column; min-width: 0; }
.userbox-text strong { font-size: 14px; }
.userbox-text form { margin: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font-size: 12.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--ink); }

.main { flex: 1; min-width: 0; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; max-width: 1560px; }

/* ---------- Éléments ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid #E2E0DA; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn-block { width: 100%; }
.btn.is-disabled { opacity: .45; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid #E2E0DA; background: var(--surface); color: var(--gray); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; list-style: none; }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { background: var(--hover); color: var(--ink); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.card.pad { padding: 20px 22px; }
.card-title { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.card-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.3; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-relance { background: var(--red-bg); color: var(--red); }
.badge-refuse { background: #EDEBE6; color: #6B6760; }
.badge-attente { background: var(--amber-bg); color: var(--amber); }
.badge-signe { background: var(--blue-bg); color: var(--blue); }
.badge-regle { background: var(--green-bg); color: var(--green); }
.badge-neutre { background: var(--gray-bg); color: var(--gray); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-relance { background: var(--red); } .dot-attente { background: #C27A00; } .dot-signe { background: var(--blue); } .dot-regle { background: var(--green); } .dot-refuse { background: #9A958C; }
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; white-space: nowrap; text-decoration: none; }
.tag-soon { background: var(--accent); color: #fff; }
.tag-warn { background: var(--amber-bg); color: var(--amber); }
.tag-neutral { background: var(--gray-bg); color: var(--gray); }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
.pill-ok { background: var(--green-bg); color: var(--green); }
.pill-wait { background: var(--gray-bg); color: var(--gray); }
.bar { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue); border-radius: 99px; min-width: 0; }
.bar > span.is-full { background: var(--green); }
.bar-lg { height: 8px; margin: 6px 0; }

.flash { padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; transition: opacity .4s; }
.flash-success { background: var(--green-bg); color: var(--green); }
.flash-error { background: var(--red-bg); color: var(--red); }
.flash.is-hiding { opacity: 0; }

/* ---------- En-tête de page ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.page-head-text { flex: 1 1 240px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; font-size: 14px; }
.search { flex: 0 1 340px; margin: 0; }
.search-box { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid #E2E0DA; border-radius: 12px; padding: 0 14px; height: 44px; color: var(--muted); }
.search-box:focus-within { border-color: var(--accent); }
.search-box input { border: 0; outline: 0; flex: 1; min-width: 0; background: transparent; font-size: 14px; color: var(--ink); }

/* ---------- Indicateurs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 21px; font-weight: 700; margin-top: 4px; }
.kpi-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Filtres ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid #E2E0DA; background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: 13px; font-weight: 500; }
.chip:hover { border-color: #C9C6BE; color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .n { font-size: 12px; opacity: .75; }
.selects { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.select { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.select select { height: 38px; border: 1px solid #E2E0DA; border-radius: 10px; background: var(--surface); padding: 0 30px 0 10px; font-size: 13px; font-weight: 500; color: var(--ink); }

/* ---------- Liste clients ---------- */
.list { overflow: visible; }
.list-head, .crow { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.35fr) minmax(0, 1.6fr) minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 1.35fr) 124px; gap: 16px; align-items: center; padding: 14px 20px; }
.list-head { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-radius: 16px 16px 0 0; padding-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.crow { border-top: 1px solid var(--line-2); }
.list-head + .crow, .list-head + .empty + .crow { border-top: 0; }
.crow:hover { background: #FBFAF8; }
.crow:last-child { border-radius: 0 0 16px 16px; }
.c-name { display: flex; flex-direction: column; min-width: 0; }
.name-link { font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: none; }
.name-link:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.c-date { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; font-weight: 500; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tags:empty { display: none; }
.c-lieu { display: flex; gap: 6px; align-items: flex-start; font-size: 13.5px; min-width: 0; }
.c-lieu .ic { margin-top: 3px; color: var(--muted); }
.c-lieu span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.c-formule { font-size: 13px; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pay-line { display: flex; justify-content: space-between; gap: 6px; font-size: 12.5px; margin-bottom: 6px; white-space: nowrap; }
.c-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { padding: 40px 20px; text-align: center; }
.empty p { margin: 4px 0; }

/* Menu documents */
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(30, 31, 36, .12); padding: 6px; display: flex; flex-direction: column; }
.menu-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 6px; }
.menu-pop a { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; }
.menu-pop a:hover { background: var(--hover); }

/* ---------- Fiche client ---------- */
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; align-self: flex-start; }
.back-link:hover { color: var(--ink); }
.client-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.client-head h1 { font-size: 26px; font-weight: 700; margin: 2px 0 10px; }
.client-head p { margin: 0; }
.client-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.meta-item { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.client-head-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.client-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.client-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.dl > div { min-width: 0; }
.dl .span-2 { grid-column: span 2; }
.dl dt { font-size: 12.5px; color: var(--muted); }
.dl dd { margin: 2px 0 0; font-weight: 600; font-size: 14.5px; }
.dl-compact { margin-top: 16px; }
.break { overflow-wrap: anywhere; }
.pay-box { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.pay-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.pay-row > span:first-child { color: var(--muted); }
.pay-val { font-weight: 600; white-space: nowrap; }
.pay-total { padding-top: 8px; border-top: 1px solid var(--line); }
.checks { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.check.is-on { color: var(--ink); }
.check-box { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #C9C6BE; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.check.is-on .check-box { background: var(--green); border-color: var(--green); color: #fff; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 12px; }
.doc { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.doc:hover { border-color: var(--accent); color: var(--accent-ink); }
.notes, .files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.note { padding: 12px 0; border-top: 1px solid var(--line-2); }
.note:first-child { border-top: 0; padding-top: 0; }
.note-body { margin-top: 4px; font-size: 14px; overflow-wrap: anywhere; }
.files li { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.files li:first-child { border-top: 0; padding-top: 0; }
.file-link { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; text-decoration: none; overflow-wrap: anywhere; }

/* ---------- Connexion ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 36px 32px; box-shadow: 0 20px 50px rgba(30, 31, 36, .06); }
.login-logo { display: block; width: 240px; height: auto; margin-bottom: 26px; }
.login-card h1 { font-size: 22px; font-weight: 700; }
.login-card > p { margin: 6px 0 22px; font-size: 14px; }
.form-stack { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; }
.field input { height: 46px; border: 1px solid #D9D6CF; border-radius: 12px; padding: 0 14px; font-size: 15px; font-weight: 400; background: var(--surface); }
.field input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Tablette ---------- */
@media (max-width: 1180px) {
  .list-head { display: none; }
  .crow { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "name date actions" "lieu statut pay" "formule statut pay"; row-gap: 8px; }
  .crow:first-of-type { border-top: 0; }
  .c-name { grid-area: name; } .c-date { grid-area: date; } .c-actions { grid-area: actions; }
  .c-lieu { grid-area: lieu; } .c-formule { grid-area: formule; } .c-statut { grid-area: statut; } .c-pay { grid-area: pay; }
  .client-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 30; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-top { padding: 12px 16px; }
  .brand img { width: 160px; }
  .sidebar .menu-toggle { display: inline-flex; width: 44px; height: 44px; }
  .sidebar-body { display: none; padding: 0 12px 16px; max-height: calc(100vh - 70px); }
  .sidebar.is-open .sidebar-body { display: flex; }
  .main { padding: 18px 16px 40px; gap: 16px; }
  .page-head h1, .client-head h1 { font-size: 22px; }
  .page-head { gap: 12px; }
  .page-head-text { flex: 1 1 0; min-width: 0; }
  .search { flex: 1 1 100%; order: 3; }
  .page-head .btn { width: 44px; padding: 0; }
  .page-head .btn .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi-label { font-size: 12px; }
  .kpi-value { font-size: 17px; margin-top: 2px; }
  .kpi-sub { display: none; }
  .kpi:first-child .kpi-sub { display: block; }
  .filters { flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .chip { flex: none; }
  .selects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .select { flex-direction: column; align-items: stretch; gap: 4px; font-size: 12px; min-width: 0; }
  .select select { width: 100%; min-width: 0; padding-right: 22px; }
  .list { background: transparent; border: 0; display: flex; flex-direction: column; gap: 10px; }
  .crow { background: var(--surface); border: 1px solid var(--line) !important; border-radius: 16px !important; padding: 14px 16px;
          grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name actions" "date date" "lieu lieu" "statut statut" "pay pay"; }
  .c-formule { display: none; }
  .c-date { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .client-head { align-items: flex-start; }
  .client-head-actions { width: 100%; }
  .client-head-actions .btn { flex: 1; }
  .dl { grid-template-columns: minmax(0, 1fr); }
  .dl .span-2 { grid-column: auto; }
  .card.pad { padding: 16px; }
}

/* =================== Étapes 2 à 5 =================== */
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.clamp-2 { margin: 2px 0 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.narrow { max-width: 760px; }
.sub-title { font-size: 12px; font-weight: 700; color: var(--muted); margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .06em; }
.flash-warn { background: var(--amber-bg); color: var(--amber); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.flash-warn a { color: var(--amber); font-weight: 600; }

/* Formulaires */
.input { width: 100%; min-height: 44px; border: 1px solid #D9D6CF; border-radius: 12px; padding: 0 12px; font-size: 14.5px; background: var(--surface); color: var(--ink); }
textarea.input { padding: 10px 12px; line-height: 1.5; resize: vertical; }
select.input { padding-right: 30px; }
.input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.input-sm { min-height: 38px; font-size: 13.5px; border-radius: 10px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field .muted a { color: var(--muted); }
.field em { color: var(--accent); font-style: normal; }
.field small { font-weight: 400; }
.span-2 { grid-column: span 2; }
.form-grid { display: flex; flex-direction: column; gap: 16px; max-width: 980px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.form-stack .form-actions { margin-top: 4px; }
.calc { display: flex; gap: 12px; }
.calc > div { flex: 1; background: var(--surface-2); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; }
.calc strong { font-size: 17px; }
.prefill summary { cursor: pointer; list-style: none; }
.prefill summary::-webkit-details-marker { display: none; }
.prefill[open] summary { margin-bottom: 12px; }
.prefill .btn { margin-top: 10px; }
.extra-lines { margin-top: 14px; }
.extra-lines summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent-ink); margin-bottom: 10px; }
.extra-lines .fields { margin-bottom: 10px; }
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border: 1px solid #E2E0DA; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 500; background: var(--surface); }
.seg label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: #fff; }
.seg input { accent-color: var(--accent); }
.seg-wrap label { flex: 1 1 260px; }

/* Boutons supplémentaires */
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #33353C; color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #861B25; color: #fff; }
.btn-danger-outline { color: var(--red); border-color: #F0C5C8; }
.btn-danger-outline:hover { background: var(--red-bg); color: var(--red); }
.btn[disabled], .icon-btn[disabled] { opacity: .45; cursor: not-allowed; }
.link-btn.danger { color: var(--red); }
.icon-btn.is-done { background: var(--green-bg); color: var(--green); border-color: var(--green-bg); }

/* Fiche client */
.badge-select { appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; padding: 6px 30px 6px 12px; font: 600 12.5px var(--font); cursor: pointer; min-height: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.status-form { margin: 0; }
.toggle-form { margin: 0; }
.checks { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
button.check { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; color: var(--muted); min-height: 44px; }
button.check:hover { background: var(--hover); }
button.check:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.check.is-on { color: var(--ink); }
.check-label { display: flex; flex-direction: column; }
.check-label small { font-size: 11.5px; }
.note-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; margin-bottom: 14px; }
.note-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.note-actions { display: flex; gap: 12px; align-items: center; }
.note-actions form { margin: 0; }
.note .note-form { margin: 8px 0 0; }
.link-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.link-row form { margin: 0; }
.link-lang { font-size: 11px; font-weight: 700; background: var(--gray-bg); color: var(--gray); padding: 3px 7px; border-radius: 6px; flex: none; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 13.5px; }
.mini-list li:first-child { border-top: 0; }
.mini-list a { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; text-decoration: none; }
.mini-list .mini-total { font-weight: 700; border-top: 1.5px solid var(--ink); }
.dropzone { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1.5px dashed #D2CFC7; border-radius: 12px; cursor: pointer; margin-bottom: 14px; color: var(--ink-2); position: relative; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); background: #FFF8F5; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-meta { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.file-meta form { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.danger-zone { border-color: #F3D6D8; }

/* Dialogues */
.dialog { border: 0; border-radius: 18px; padding: 24px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(30, 31, 36, .25); color: var(--ink); }
.dialog::backdrop { background: rgba(30, 31, 36, .45); }
.dialog h2 { font-size: 19px; }
.dialog p { margin: 0; }

/* Listes simples (factures, formules, recettes…) */
.list-simple { overflow: hidden; }
.list-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 18px 20px 6px; }
.list-title .card-title { margin: 0; }
.srow, .rrow { display: flex; align-items: center; gap: 14px; padding: 13px 20px; border-top: 1px solid var(--line-2); }
.list-title + .srow, .list-title + .rrow, .list-title + .empty + .srow { border-top: 0; }
.srow:hover, .rrow:hover { background: #FBFAF8; }
.srow-main, .rrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.srow-actions { display: flex; gap: 6px; align-items: center; }
.srow-actions form { margin: 0; }
.inv-num { font-weight: 700; font-size: 13px; background: var(--blue-bg); color: var(--blue); padding: 4px 9px; border-radius: 8px; white-space: nowrap; }
.inv-num.is-avoir { background: var(--red-bg); color: var(--red); }
.date-chip { display: flex; flex-direction: column; align-items: center; width: 52px; flex: none; line-height: 1.1; }
.date-chip strong { font-size: 19px; }
.date-chip span { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.rrow-date { font-weight: 700; font-size: 13px; width: 44px; flex: none; }
.rrow-amount { white-space: nowrap; }
.rrow-edit { padding: 14px 20px; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.totals { padding: 14px 20px; border-top: 1.5px solid var(--ink); display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; gap: 12px; }
.totals-main { font-size: 16px; font-weight: 700; color: var(--green); }

/* Réglages */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab { padding: 9px 14px; border-radius: 10px; text-decoration: none; color: var(--gray); font-size: 13.5px; font-weight: 600; min-height: 40px; display: inline-flex; align-items: center; }
.tab:hover { background: var(--hover); color: var(--ink); }
.tab.is-on { background: var(--ink); color: #fff; }
.edit-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; }
.edit-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.edit-list li:first-child { border-top: 0; }
.edit-list li > form { margin: 0; }
.inline-form { display: flex; gap: 8px; align-items: center; flex: 1; margin: 0; }
.usage { width: 80px; text-align: right; flex: none; }
.add-row { padding-top: 12px; border-top: 1px solid var(--line); }

/* Mise en page à deux colonnes */
.split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.split-side { display: flex; flex-direction: column; gap: 20px; }
aside.split-side { min-width: 0; }

/* Graphique en barres */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 6px; }
.chart-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); min-width: 0; }
.chart-bar { width: 100%; max-width: 34px; background: var(--blue-bg); border-radius: 6px 6px 2px 2px; transition: background .2s; }
.chart-col:hover .chart-bar { background: #BFD4F7; }
.chart-col.is-on .chart-bar { background: var(--blue); }
.chart-val { font-size: 10.5px; font-weight: 600; color: var(--ink-2); min-height: 14px; }
.chart-lbl { font-size: 11px; }
.chart-col.is-on .chart-lbl { color: var(--ink); font-weight: 700; }

/* À faire */
.todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.todo li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.todo li:first-child { border-top: 0; }
.todo-ic { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.tone-bg-red { background: var(--red-bg); color: var(--red); }
.tone-bg-amber { background: var(--amber-bg); color: var(--amber); }
.tone-bg-blue { background: var(--blue-bg); color: var(--blue); }
.todo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.todo-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .client-grid { display: flex; flex-direction: column; }
  .client-col { display: contents; }
  .client-col > section { order: 9; }
  #mariage { order: 1; } #paiement { order: 2; } #suivi { order: 3; } #documents { order: 4; } #notes { order: 5; }
  .danger-zone { order: 10 !important; }
}
@media (max-width: 860px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .srow, .rrow { flex-wrap: wrap; padding: 12px 16px; gap: 8px 12px; }
  .srow-main, .rrow-main { flex-basis: calc(100% - 120px); }
  .list-title { padding: 16px 16px 4px; }
  .chart { height: 150px; gap: 4px; }
  .chart-val { display: none; }
  .usage { display: none; }
  .form-actions .btn { flex: 1; }
  .dialog { padding: 18px; }
  .calc { flex-direction: column; }
  .page-head .selects { order: 4; }
}

.consent-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; background: var(--amber-bg); color: var(--amber); padding: 10px 12px; border-radius: 10px; }
.consent-row input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--accent); }

.pay-sub > span:first-child { padding-left: 12px; border-left: 2px solid var(--line); }
.inline-del { display: inline; margin: 0 0 0 6px; }
.icon-btn-xs { width: 28px; height: 28px; border-radius: 8px; vertical-align: middle; }
.seg-pay label { flex: 1 1 auto; justify-content: center; }

/* =================== Calendrier =================== */
:root { --rose: #A3223F; --rose-bg: #FBD9E1; --rose-line: #F2A7B8; --sky: #1B5E8C; --sky-bg: #D7EEFC; --sky-line: #9CCDEF; }
.cal-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot-officiel { background: #E85C7E; } .dot-option { background: #6BB8EA; } .dot-nv { background: #fff; border: 1.5px dashed #9A9CA2; }
.tag-cal-officiel { background: var(--rose-bg); color: var(--rose); }
.tag-cal-option { background: var(--sky-bg); color: var(--sky); }
.cal-choice { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.cal-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border-radius: 12px; border: 1.5px solid #E2E0DA; background: var(--surface); font: 600 13.5px var(--font); cursor: pointer; color: var(--ink-2); }
.cal-btn .cal-dot { width: 10px; height: 10px; }
.cal-option .cal-dot { background: #6BB8EA; } .cal-officiel .cal-dot { background: #E85C7E; }
.cal-option:hover { border-color: var(--sky-line); } .cal-officiel:hover { border-color: var(--rose-line); }
.cal-option.is-on { background: var(--sky-bg); border-color: var(--sky-line); color: var(--sky); }
.cal-officiel.is-on { background: var(--rose-bg); border-color: var(--rose-line); color: var(--rose); }

.agenda { display: flex; flex-direction: column; gap: 14px; }
.agenda-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.agenda-title { font-size: 20px; font-weight: 700; min-width: 170px; }
.agenda-nav { display: flex; gap: 6px; align-items: center; }
.flip .ic { transform: rotate(180deg); }
.cal-legend { list-style: none; margin: 0 0 0 auto; padding: 0; display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }
.cal-legend li { display: inline-flex; align-items: center; gap: 6px; }
.cal-months { display: flex; gap: 4px; align-items: center; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cal-month { flex: 1 0 58px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border-radius: 10px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600; min-height: 44px; }
.cal-month:hover { background: var(--hover); color: var(--ink); }
.cal-month.is-on { background: var(--ink); color: #fff; }
.cal-month-dots { display: flex; gap: 3px; min-height: 16px; }
.cal-month-dots b { font-size: 10.5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.n-officiel { background: var(--rose-bg); color: var(--rose); } .n-option { background: var(--sky-bg); color: var(--sky); } .n-nv { background: var(--gray-bg); color: var(--gray); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--line); gap: 1px; }
.cal-dow { background: var(--surface-2); text-align: center; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 8px 0; }
.cal-dow.is-we { color: var(--ink-2); }
.cal-cell { background: var(--surface); min-height: 96px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-cell.is-we { background: #FCFBF9; }
.cal-cell.is-out { background: var(--surface-2); }
.cal-cell.is-past .cal-day { color: #A5A7AD; }
.cal-day { font-size: 12.5px; font-weight: 600; color: var(--ink-2); width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-cell.is-today .cal-day { background: var(--accent); color: #fff; }
.cal-ev { display: block; padding: 5px 7px; border-radius: 8px; font-size: 12px; font-weight: 600; text-decoration: none; line-height: 1.25; border-left: 3px solid transparent; min-width: 0; }
.cal-ev-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-officiel { background: var(--rose-bg); color: var(--rose); border-left-color: #E85C7E; }
.ev-option { background: var(--sky-bg); color: var(--sky); border-left-color: #6BB8EA; }
.ev-nv { background: var(--surface); color: var(--gray); border: 1.5px dashed #C9C6BE; border-left-width: 1.5px; }
.cal-ev:hover { filter: brightness(.97); text-decoration: underline; text-underline-offset: 2px; }
.cal-cell.is-multi { box-shadow: inset 0 0 0 2px #F5C26B; }
.cal-list { display: none; list-style: none; margin: 0; padding: 0; }
.cal-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); }
.cal-list li:first-child { border-top: 0; }
.cal-empty { margin: 0; }
@media (max-width: 860px) {
  .cal-legend { margin-left: 0; width: 100%; }
  .agenda-title { min-width: 0; flex: 1; font-size: 18px; }
  .cal-cell { min-height: 54px; padding: 4px 3px; align-items: center; }
  .cal-day { width: 22px; height: 22px; font-size: 12px; }
  .cal-ev { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; }
  .cal-ev-name { display: none; }
  .ev-officiel { background: #E85C7E; } .ev-option { background: #6BB8EA; } .ev-nv { background: #fff; border: 1.5px dashed #9A9CA2; }
  .cal-cell { flex-direction: column; flex-wrap: wrap; justify-content: flex-start; }
  .cal-dow { font-size: 10px; letter-spacing: 0; }
  .cal-list { display: flex; flex-direction: column; }
}

/* ===== E-mails (même système qu'EE Gestion) ===== */
.check-inline { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; margin: 6px 0; }
.check-inline input { width: 18px; height: 18px; accent-color: var(--accent); }
.mail-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; margin: 14px 0 18px; }
.mail-body { font-family: var(--font); font-size: 14px; line-height: 1.55; resize: vertical; }
.mail-preview { position: sticky; top: 16px; overflow: hidden; }
.mail-preview .list-title { padding: 14px 18px 0; }
.mail-preview iframe { width: 100%; height: 78vh; min-height: 520px; border: 0; border-top: 1px solid var(--line); margin-top: 10px; background: #fff; }
.send-when { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 14px 0 0; }
.send-when legend { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 6px; }
.send-when .check-inline { display: block; line-height: 2.5; }
.send-when .check-inline input[type=radio], .send-when .check-inline input[type=checkbox] { vertical-align: middle; margin-right: 6px; }
.send-when .check-inline .input { display: inline-block; vertical-align: middle; }
.ton-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border: 0; padding: 0; margin: 0 0 14px; }
.ton-pick label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 13.5px; font-weight: 600; background: var(--surface); }
.ton-pick label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.to-sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.to-sugg .chip { font-size: 12.5px; }
.linklike { background: none; border: 0; padding: 0; margin: 4px 0 0; color: var(--accent-ink); text-decoration: underline; font: inherit; font-size: 12.5px; cursor: pointer; align-self: flex-start; }
.sig-box { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; margin-top: 4px; overflow-x: auto; }
.lib-pick { margin: 10px 0 0; } .lib-pick summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.doc-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 8px; }
.doc-pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); }
.doc-pick:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.doc-pick input { accent-color: var(--accent); width: 18px; height: 18px; }
.doc-pick-txt { display: flex; flex-direction: column; min-width: 0; }
.doc-pick-txt strong, .doc-pick-txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 980px) { .mail-split { grid-template-columns: 1fr; } .mail-preview { position: static; } .mail-preview iframe { height: 620px; } }
@media (max-width: 760px) { .pr-row .srow-actions { width: 100%; justify-content: flex-start; } }

/* ===== Correspondance (e-mails Gmail) ===== */
.cr-section { margin-top: 18px; }
.cr-list { display: flex; flex-direction: column; border-top: 1px solid var(--line, #E8E6E1); }
.cr-msg { border-bottom: 1px solid var(--line-2, #F0EEEA); }
.cr-msg > summary { list-style: none; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 11px 4px; cursor: pointer; }
.cr-msg > summary::-webkit-details-marker { display: none; }
.cr-msg > summary:hover { background: #FBFAF8; }
.cr-dir { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.cr-recu .cr-dir { background: #E8F1FD; color: #2C5FB3; }
.cr-envoye .cr-dir { background: #E9F6EE; color: #23794A; }
.cr-main { display: flex; flex-direction: column; min-width: 0; }
.cr-main strong, .cr-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-meta { white-space: nowrap; }
.cr-body { padding: 4px 6px 14px 40px; }
.cr-head { margin: 0 0 8px; overflow-wrap: anywhere; }
.cr-text { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; background: #FBFAF8; border-radius: 10px; padding: 12px 14px; }
.cr-quote { margin-top: 8px; }
.cr-quote summary { cursor: pointer; color: var(--muted, #6B6E76); }
.cr-pj { margin: 8px 0 0; }
@media (max-width: 760px) {
  .cr-msg > summary { grid-template-columns: 26px minmax(0, 1fr); }
  .cr-meta { grid-column: 2; }
  .cr-body { padding-left: 4px; }
}

/* =====================================================================
   Thème 2026 « studio » — v8
   Fond blanc / lavande, violet profond, titres Playfair Display, texte Inter,
   surligneur ambré, cartes arrondies et ombres douces.
   ===================================================================== */
:root {
  --bg: #FBF9FF;
  --surface: #FFFFFF;
  --surface-2: #F7F3FF;
  --ink: #1A1A1A;
  --ink-2: #3A3A42;
  --muted: #6A6A75;
  --line: #ECE6F7;
  --line-2: #F2EDFA;
  --hover: #F5F0FF;
  --accent: #693DB5;
  --accent-ink: #55309A;
  --accent-soft: #F1EAFE;
  --accent-2: #C5B3E6;
  --surligneur: #FFB84D;
  --red: #C0392B;     --red-bg: #FDECEA;
  --amber: #A35F00;   --amber-bg: #FFF4E6;
  --blue: #3B5BDB;    --blue-bg: #EEF2FF;
  --green: #1E8E50;   --green-bg: #E8F5E9;
  --gray: #4A4A4A;    --gray-bg: #F2F0F6;
  --radius: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --titre: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --ombre: 0 1px 2px rgba(48, 22, 98, .04), 0 8px 24px rgba(48, 22, 98, .06);
  --ombre-forte: 0 18px 50px rgba(48, 22, 98, .14);
}
body { background: radial-gradient(1200px 520px at 85% -120px, #F3EDFF 0%, rgba(243, 237, 255, 0) 70%) no-repeat, var(--bg); color: var(--ink); font-size: 15px; }
a { color: var(--accent); }
a:hover { color: var(--accent-ink); }
::selection { background: #E7DCFB; }

/* Titres : serif élégante + surligneur */
.page-head h1, .client-head h1, .login-card h1 { font-family: var(--titre); font-weight: 800; letter-spacing: -.005em; font-size: 32px; line-height: 1.15; }
.page-head h1 { display: inline; background: linear-gradient(transparent 64%, rgba(255, 184, 77, .45) 64%, rgba(255, 184, 77, .45) 92%, transparent 92%); -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 .08em; }
.page-head p { margin-top: 8px; color: var(--muted); }
.card-title { font-family: var(--titre); font-size: 19px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
.sub-title, .nav-title, .menu-title, .list-head { letter-spacing: .08em; }
.kpi-value { font-family: var(--titre); font-size: 26px; font-weight: 700; letter-spacing: -.01em; }

/* Barre latérale */
.sidebar { background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-right: 1px solid var(--line); }
.nav-title { color: #9A93AE; }
.nav-link { color: var(--ink-2); border-radius: 12px; position: relative; }
.nav-link .ic { color: #8E86A6; }
.nav-link:hover { background: var(--hover); color: var(--ink); }
.nav-link:hover .ic { color: var(--accent); }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-link.is-active .ic { color: var(--accent); }
.nav-link.is-active::before { content: ''; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nav-link em { background: var(--accent); color: #fff; }
.userbox { border-top-color: var(--line); }
.avatar { background: linear-gradient(135deg, #8A5CD6, #693DB5); box-shadow: 0 4px 12px rgba(105, 61, 181, .3); }

/* Boutons */
.btn { height: 44px; border-radius: 10px; border: 1px solid #DCD5EA; background: var(--surface); color: var(--ink); font-weight: 600; transition: background .15s, border-color .15s, box-shadow .15s, transform .15s; }
.btn:hover { background: var(--hover); border-color: #CBBFE4; color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(105, 61, 181, .28); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; box-shadow: 0 8px 22px rgba(105, 61, 181, .34); transform: translateY(-1px); }
.btn-sm { border-radius: 9px; }
.icon-btn { border-color: #DCD5EA; border-radius: 10px; }
.icon-btn:hover { background: var(--hover); color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Cartes et blocs */
.card, .kpi { border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--ombre); }
.card.pad { padding: 22px 24px; }
.kpi { padding: 18px 20px; }
.kpi:nth-child(4n+1) { background: linear-gradient(180deg, #F7F2FF 0%, #FFFFFF 70%); }
.kpi-label { color: var(--muted); }
.menu-pop { border-radius: 16px; box-shadow: var(--ombre-forte); border-color: var(--line); }
.pay-box, .calc > div { background: var(--surface-2); border-radius: 14px; }
.flash { border-radius: 14px; box-shadow: var(--ombre); }

/* Badges pastel */
.badge { padding: 4px 11px; font-weight: 600; }
.badge-relance { background: var(--red-bg); color: var(--red); }
.badge-refuse { background: #F1EEF5; color: #6F6A7A; }
.badge-attente { background: var(--amber-bg); color: var(--amber); }
.badge-signe { background: var(--accent-soft); color: var(--accent); }
.badge-regle { background: var(--green-bg); color: var(--green); }
.badge-neutre { background: var(--gray-bg); color: var(--gray); }
.tag-soon { background: var(--accent); }
.bar { background: #EEE8F8; }
.bar > span { background: linear-gradient(90deg, #8A5CD6, #693DB5); }
.bar > span.is-full { background: var(--green); }

/* Filtres, champs, recherche */
.chip { border-color: #DCD5EA; }
.chip:hover { border-color: var(--accent-2); color: var(--accent); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(105, 61, 181, .25); }
.search-box, .select select, .input, .field input { border-color: #DCD5EA; border-radius: 10px; }
.search-box:focus-within, .input:focus, .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(105, 61, 181, .12); }
.check.is-on .check-box { background: var(--accent); border-color: var(--accent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); }

/* Listes */
.list-head { background: var(--surface-2); color: #8A82A0; border-bottom-color: var(--line); border-radius: 20px 20px 0 0; }
.crow { border-top-color: var(--line-2); }
.crow:hover { background: #FCFAFF; }
.crow:last-child { border-radius: 0 0 20px 20px; }
.name-link:hover { color: var(--accent); }
.doc:hover { border-color: var(--accent); color: var(--accent); background: var(--hover); }

/* Connexion */
.login-page { background: radial-gradient(900px 500px at 80% 0%, #EFE6FF 0%, rgba(239, 230, 255, 0) 70%), radial-gradient(700px 400px at 0% 100%, #FFF1DC 0%, rgba(255, 241, 220, 0) 70%), var(--bg); }
.login-card { border-radius: 24px; border-color: var(--line); box-shadow: var(--ombre-forte); }
.login-card h1 { font-size: 28px; }

@media (max-width: 860px) {
  .page-head h1, .client-head h1 { font-size: 24px; }
  .kpi-value { font-size: 20px; }
  .crow { border-radius: 18px !important; box-shadow: var(--ombre); }
  .nav-link.is-active::before { display: none; }
}
/* Sélections actives : violet au lieu du noir */
.seg label:has(input:checked), .ton-pick label:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab.is-on, .cal-month.is-on { background: var(--accent); color: #fff; box-shadow: 0 4px 12px rgba(105, 61, 181, .25); }
.btn-dark { background: #2A2340; border-color: #2A2340; }

/* Clients : solde restant + réservation confirmée (contrat signé et acompte reçu) mise en valeur */
.pay-reste { margin-top: 6px; font-size: 12.5px; color: var(--red); white-space: nowrap; }
.pay-reste strong { font-weight: 700; }
.pay-reste.is-solde { color: var(--green); font-weight: 600; }
.crow.is-reserve { background: linear-gradient(100deg, #5B2FA6 0%, #693DB5 55%, #7A4FC4 100%); color: #fff; border-top-color: transparent; position: relative; }
.crow.is-reserve + .crow { border-top-color: transparent; }
.crow.is-reserve:hover { background: linear-gradient(100deg, #52299A 0%, #5F35AA 55%, #7046BA 100%); }
.crow.is-reserve .name-link, .crow.is-reserve .name-link:hover { color: #fff; }
.crow.is-reserve .muted, .crow.is-reserve .c-lieu .ic { color: rgba(255, 255, 255, .78); }
.crow.is-reserve .c-formule { color: rgba(255, 255, 255, .92); }
.crow.is-reserve .badge { background: rgba(255, 255, 255, .18); color: #fff; }
.crow.is-reserve .tag { background: rgba(255, 255, 255, .2); color: #fff; }
.crow.is-reserve .tag-soon { background: var(--surligneur); color: #3A2400; }
.crow.is-reserve .bar { background: rgba(255, 255, 255, .25); }
.crow.is-reserve .bar > span { background: #fff; }
.crow.is-reserve .bar > span.is-full { background: #9BE7B4; }
.crow.is-reserve .pay-reste { color: #FFD9A0; }
.crow.is-reserve .pay-reste.is-solde { color: #B9F3CB; }
.crow.is-reserve .icon-btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff; }
.crow.is-reserve .icon-btn:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.crow.is-reserve .menu-pop, .crow.is-reserve .menu-pop a { color: var(--ink); }
.crow.is-reserve a:focus-visible, .crow.is-reserve .icon-btn:focus-visible { outline-color: #fff; }
@media (max-width: 860px) { .crow.is-reserve { border-color: transparent !important; box-shadow: 0 10px 26px rgba(105, 61, 181, .3); } }

/* ---------- Liste des clients aérée : une carte par client ---------- */
.card.list { background: transparent; border: 0; box-shadow: none; display: flex; flex-direction: column; gap: 14px; }
.card.list .list-head { background: transparent; border: 0; padding-bottom: 0; border-radius: 0; }
.card.list .crow { background: var(--surface); border: 1px solid var(--line) !important; border-radius: 20px !important; box-shadow: var(--ombre); padding: 18px 22px 14px; row-gap: 12px; }
.card.list .crow:hover { background: #FDFBFF; box-shadow: 0 2px 4px rgba(48, 22, 98, .05), 0 12px 30px rgba(48, 22, 98, .09); }
.card.list .crow.is-reserve { border-color: transparent !important; box-shadow: 0 12px 30px rgba(105, 61, 181, .28); }
.card.list .crow.is-reserve:hover { background: linear-gradient(100deg, #52299A 0%, #5F35AA 55%, #7046BA 100%); }
.card.list .empty { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }

/* ---------- Parcours client (frise repliable sous chaque ligne) ---------- */
.crow > .pc { grid-column: 1 / -1; margin: 2px -8px 0; }
.pc-sum { list-style: none; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-size: 13px; color: var(--ink-2); background: var(--surface-2); user-select: none; }
.pc-sum::-webkit-details-marker { display: none; }
.pc-sum:hover { background: var(--hover); }
.pc-count { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; min-width: 36px; }
.pc-dots { display: inline-flex; gap: 4px; flex: none; }
.pc-dots i { width: 9px; height: 9px; border-radius: 50%; background: #DCD5EA; }
.pc-dots i.is-fait { background: var(--green); }
.pc-dots i.is-go { background: var(--accent); box-shadow: 0 0 0 3px rgba(105, 61, 181, .18); }
.pc-dots i.is-retard { background: var(--red); box-shadow: 0 0 0 3px rgba(192, 57, 43, .18); }
.pc-dots i.is-pl { background: var(--blue); }
.pc-next { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-next.is-go { color: var(--accent); font-weight: 600; }
.pc-next.is-retard { color: var(--red); font-weight: 600; }
.pc-tog { display: inline-flex; color: var(--muted); transition: transform .2s; }
.pc[open] .pc-tog { transform: rotate(180deg); }
.pc-list { list-style: none; margin: 10px 0 2px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; counter-reset: none; }
.pc-st { position: relative; display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.pc-st:hover { border-color: var(--accent-2); box-shadow: 0 6px 16px rgba(48, 22, 98, .08); transform: translateY(-1px); }
.pc-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 10px; color: inherit; text-decoration: none; }
.pc-ic { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 12px/1 var(--font); background: #EEE8F8; color: #7A7290; }
.pc-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pc-txt strong { font-size: 13px; font-weight: 600; }
.pc-txt small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-val { margin: 0; display: flex; }
.pc-val button { width: 30px; border: 0; border-left: 1px solid var(--line-2); background: transparent; color: #A39CB8; border-radius: 0 14px 14px 0; cursor: pointer; font-size: 14px; opacity: 0; transition: opacity .15s, background .15s; }
.pc-st:hover .pc-val button, .pc-val button:focus-visible { opacity: 1; }
.pc-val button:hover { background: var(--green-bg); color: var(--green); }
.pc-st.is-fait { background: var(--green-bg); border-color: #BFE3C9; }
.pc-st.is-fait .pc-ic { background: var(--green); color: #fff; }
.pc-st.is-fait .pc-txt small { color: var(--green); }
.pc-st.is-fait .pc-val button:hover { background: #fff; color: var(--muted); }
.pc-st.is-go { border: 2px solid var(--accent); background: #FBF8FF; }
.pc-st.is-go .pc-ic { background: var(--accent); color: #fff; }
.pc-st.is-go .pc-txt small { color: var(--accent); font-weight: 600; }
.pc-st.is-retard { border: 2px solid var(--red); background: #FFF7F6; }
.pc-st.is-retard .pc-ic { background: var(--red); color: #fff; }
.pc-st.is-retard .pc-txt small { color: var(--red); font-weight: 600; }
.pc-st.is-pl { background: var(--blue-bg); border-color: #CCD7FF; }
.pc-st.is-pl .pc-ic { background: var(--blue); color: #fff; }
.pc-st.is-pl .pc-txt small { color: var(--blue); }
/* Sur une ligne violette (réservation confirmée), la frise reste lisible sur fond clair */
.crow.is-reserve .pc-sum { background: rgba(255, 255, 255, .14); color: #fff; }
.crow.is-reserve .pc-sum:hover { background: rgba(255, 255, 255, .22); }
.crow.is-reserve .pc-count, .crow.is-reserve .pc-next.is-go, .crow.is-reserve .pc-tog { color: #fff; }
.crow.is-reserve .pc-next.is-retard { color: #FFD1CB; }
.crow.is-reserve .pc-dots i { background: rgba(255, 255, 255, .35); }
.crow.is-reserve .pc-dots i.is-fait { background: #9BE7B4; }
.crow.is-reserve .pc-dots i.is-go { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .25); }
.crow.is-reserve .pc-dots i.is-retard { background: #FF8A7A; }
.crow.is-reserve .pc-list { background: var(--surface); border-radius: 16px; padding: 10px; }
.crow.is-reserve .pc-st, .crow.is-reserve .pc-link { color: var(--ink); }
.crow.is-reserve .pc-txt small { color: var(--muted); }
.crow.is-reserve .pc-st.is-fait .pc-txt small { color: var(--green); }
.crow.is-reserve .pc-st.is-go .pc-txt small { color: var(--accent); }
.crow.is-reserve .pc-st.is-retard .pc-txt small { color: var(--red); }

@media (max-width: 1180px) {
  .card.list .crow { padding: 16px 18px 12px; }
}
@media (max-width: 860px) {
  .card.list { gap: 12px; }
  .crow > .pc { margin: 4px -4px 0; }
  .pc-sum { flex-wrap: wrap; gap: 6px 10px; padding: 9px 10px; }
  .pc-dots { order: 3; width: 100%; justify-content: space-between; }
  .pc-dots i { width: 8px; height: 8px; }
  .pc-next { white-space: normal; }
  /* Frise verticale : une étape par ligne, reliées par un trait */
  .pc-list { grid-template-columns: 1fr; gap: 6px; position: relative; padding-left: 2px; }
  .pc-st { border-radius: 12px; }
  .pc-val button { opacity: 1; width: 44px; border-radius: 0 12px 12px 0; }
  .pc-link { padding: 10px 6px 10px 10px; min-height: 48px; }
  .pc-txt small { white-space: normal; }
}
.card.list .crow.is-reserve { background: linear-gradient(100deg, #5B2FA6 0%, #693DB5 55%, #7A4FC4 100%); }
.pc-txt small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 1300px) { .pc-list { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
/* Parcours sur la fiche client */
.pc-fiche { padding: 10px 12px; }
.pc-fiche > .pc { margin: 0; }
.pc-fiche .pc-sum { background: transparent; padding: 6px 4px; font-size: 13.5px; }
.pc-fiche .pc-sum:hover { background: var(--hover); }
.pc-fiche .pc-list { margin-top: 8px; }
@media (min-width: 1300px) { .pc-fiche .pc-list { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.tag-prospect { background: var(--amber-bg); color: var(--amber); margin-right: 6px; }
textarea { font: inherit; color: inherit; }

/* ---------- Assistant d'installation et page Connexions (v13) ---------- */
.install-card { max-width: 560px; }
.install-kicker { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.install-etapes { list-style: none; display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; padding: 0; font-size: 12px; color: var(--muted); }
.install-etapes li { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--hover, #F3F0FA); }
.install-etapes li span { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fff; font-weight: 700; }
.install-etapes li.is-en-cours { background: var(--accent); color: #fff; }
.install-etapes li.is-en-cours span { color: var(--accent); }
.install-etapes li.is-fait span { background: var(--accent-soft); color: var(--accent); }
.install-verifs, .cx-liste { list-style: none; padding: 0; margin: 16px 0 20px; display: grid; gap: 8px; }
.install-verifs li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.install-verifs li > span { width: 22px; height: 22px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; }
.install-verifs li.is-ok > span { background: #2E9E6A; }
.install-verifs li.is-ko { border-color: #F2B8BD; background: #FDF1F2; }
.install-verifs li.is-ko > span { background: #D9434E; }
.install-verifs small, .install-option small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.install-choix { border: 0; padding: 0; margin: 0 0 6px; display: grid; gap: 8px; }
.install-choix legend { font-weight: 600; margin-bottom: 8px; }
.install-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.install-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.install-option input { margin-top: 3px; accent-color: var(--accent); }
.install-passer { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.cx-carte { display: grid; gap: 10px; }
.cx-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cx-tete h2 { font-family: 'Playfair Display', serif; font-size: 20px; margin: 0; }
.cx-etat { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.cx-etat.is-ok { background: #DDF3E8; color: #1F7A50; }
.cx-etat.is-ko { background: var(--amber-bg, #FFF1D6); color: var(--amber, #8A5A00); }
.cx-etapes { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.cx-code { width: 100%; min-height: 140px; font: 12px/1.45 ui-monospace, Consolas, monospace; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #FAF9FD; }
.cx-grille { display: grid; gap: 16px; }
.install-card form:has(input[value="vierge"]:checked) .install-si-existante { display: none; }
.marque-texte { font-family: 'Playfair Display', serif; font-weight: 800; font-size: 22px; color: var(--accent); letter-spacing: -.01em; display: inline-block; }
/* ---------- Assistant formules (v14) ---------- */
.fa-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.fa-carte { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.fa-carte:hover { border-color: var(--accent); transform: translateY(-2px); }
.fa-carte strong { font-family: 'Playfair Display', serif; font-size: 19px; }
.fa-ico { font-size: 28px; line-height: 1; }
.fa-form { max-width: 720px; }
.fa-lignes { display: grid; gap: 6px; }
.fa-bandeau { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; text-decoration: none; color: inherit; }
.fa-bandeau:hover { border-color: var(--accent); }
.fa-bandeau.is-vide { background: var(--accent-soft); border-color: var(--accent); }
.fa-apercu { display: grid; gap: 10px; margin-top: 12px; }
.fa-ligne { display: grid; grid-template-columns: 28px 120px 1fr 120px; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.fa-ligne .fa-desc { grid-column: 3 / 5; font-size: 13px; }
.fa-garder { padding-top: 10px; }
.fa-ligne:has(.fa-garder input:not(:checked)) { opacity: .45; }
@media (max-width: 700px) { .fa-ligne { grid-template-columns: 28px 1fr; } .fa-ligne .fa-desc, .fa-ligne .input { grid-column: 2; } }

/* ---------- Version en ligne : inscription et espace éditeur ---------- */
.pf-adresse { display: flex; align-items: center; gap: 6px; }
.pf-adresse input { flex: 1; min-width: 0; }
.pf-adresse b { font-weight: 600; color: var(--muted); white-space: nowrap; }
.pf-cache { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pf-case { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; }
.pf-case input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.login-card.pf-large { max-width: 1080px; }
.pf-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 6px 0 20px; }
.pf-stats div { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #FBFAFE; }
.pf-stats b { display: block; font-family: var(--titre); font-size: 24px; color: var(--accent); }
.pf-stats span { font-size: 12.5px; color: var(--muted); }
.pf-table-wrap { overflow-x: auto; }
.pf-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pf-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.pf-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.pf-etat { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pf-etat.is-ok { background: #E3F4EC; color: #1F7A44; }
.pf-etat.is-essai { background: #F1ECFA; color: var(--accent); }
.pf-etat.is-ko { background: #FDF1F2; color: #B8323D; }
.btn.pf-danger { color: #B8323D; border-color: #F2B8BD; }
