/* AHARTE Gestion — feuille de style */
:root {
  --red: #C4143B; --red-dark: #9e0f2f; --red-soft: #fbe9ed;
  --green: #177131; --green-dark: #10561f; --green-soft: #e5f2e8;
  --amber: #8a5a00; --amber-soft: #fff3d6;
  --ink: #241f1d; --ink-2: #4c4441; --muted: #7a706b;
  --line: #ebe3da; --line-2: #f3ede6;
  --bg: #f7f2ec; --surface: #ffffff; --sand: #f6efe6;
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(36, 31, 29, .05), 0 8px 24px -12px rgba(36, 31, 29, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-family: var(--serif); font-weight: 700; font-size: 30px; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 650; }
.h3 { font-size: 15.5px; font-weight: 650; margin-bottom: 12px; }
p { margin: 0 0 12px; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.strong { font-weight: 650; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }
.ic { flex: none; vertical-align: -3px; }
:focus-visible { outline: 3px solid rgba(196, 20, 59, .35); outline-offset: 2px; }
code { font-size: 12.5px; background: var(--sand); padding: 1px 6px; border-radius: 5px; }

/* ---------- Structure application ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 256px; flex: none; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); padding: 4px 8px 18px; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 50%; }
.brand span { display: flex; flex-direction: column; line-height: 1.2; }
.brand strong { font-family: var(--serif); font-size: 19px; letter-spacing: .02em; }
.brand small { color: var(--muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; }
.nav a:hover { background: var(--line-2); text-decoration: none; color: var(--ink); }
.nav a.is-active { background: var(--red-soft); color: var(--red); font-weight: 600; }
.nav-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 18px 12px 6px; font-weight: 600; }
.side-foot { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: var(--ink); padding: 6px; border-radius: 10px; }
.me:hover { background: var(--line-2); text-decoration: none; }
.me span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.me strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me small { color: var(--muted); font-size: 12px; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.main { padding: 30px 36px 60px; max-width: 1280px; width: 100%; }
.side-backdrop { display: none; }

/* ---------- Composants ---------- */
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--red-soft); color: var(--red);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none;
}
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar.lg { width: 58px; height: 58px; font-size: 19px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head.pad { padding: 16px 20px 0; margin-bottom: 10px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin-top: 2px; }
.page-head p { margin: 4px 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumb { font-size: 13.5px; color: var(--muted); }
.who { display: flex; gap: 16px; align-items: center; }
.tags { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 8px !important; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px;
  padding: 9px 15px; font: 600 14px/1.2 var(--font); cursor: pointer; background: var(--line-2); color: var(--ink); white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: #d6cabd; background: #fffdfb; }
.btn-link { background: none; color: var(--muted); }
.btn-danger-ghost { background: var(--surface); border-color: #f0c9d1; color: var(--red); }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 20px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px;
  border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: var(--line-2); color: var(--ink-2); white-space: nowrap;
}
.tag-sm { font-size: 11px; padding: 1px 7px; }
.tag-green, .tag-actif { background: var(--green-soft); color: var(--green-dark); }
.tag-red { background: var(--red-soft); color: var(--red); }
.tag-amber, .tag-en_attente { background: var(--amber-soft); color: var(--amber); }
.tag-inactif { background: #eeeae6; color: #6b625e; }
.tag-radie { background: #efe7e7; color: #8a4a55; text-decoration: line-through; }

.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.flash span { flex: 1; }
.flash-success { background: var(--green-soft); color: var(--green-dark); border-color: #c4e2cc; }
.flash-error { background: var(--red-soft); color: var(--red-dark); border-color: #f2c4ce; }
.flash-warning { background: var(--amber-soft); color: var(--amber); border-color: #f1dca6; }
.flash-x { background: none; border: 0; color: inherit; cursor: pointer; opacity: .7; padding: 2px; }
.callout { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; background: var(--amber-soft); border: 1px solid #f1dca6; color: #5c3d00; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.callout > span:first-child { display: flex; gap: 8px; align-items: center; }
.callout-actions { display: flex; gap: 8px; }
.empty { color: var(--muted); padding: 22px 20px; text-align: center; margin: 0; }
.note { background: var(--sand); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; margin: 12px 0; color: var(--ink-2); }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; box-shadow: var(--shadow); color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
a.kpi:hover { text-decoration: none; border-color: #dccfc1; }
.kpi-label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi-value { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 16px; color: var(--muted); font-weight: 600; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.meter { display: block; height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--green); border-radius: 99px; min-width: 2px; }
.meter.big { height: 12px; margin: 14px 0 10px; }

/* Graphique */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 18px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-2); stroke-width: 1; }
.chart .baseline { stroke: #cfc3b6; stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .bar-cot { fill: var(--red); }
.chart .bar-don { fill: url(#hatch); }
.chart path:hover { opacity: .82; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-cot { background: var(--red); }
.sw-don { background: repeating-linear-gradient(45deg, var(--green) 0 2.5px, #7fb08b 2.5px 4px); }
.table-view { margin-top: 10px; font-size: 13.5px; }
.table-view summary { cursor: pointer; color: var(--muted); }
.bars { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.bars a { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; color: var(--ink); }
.bars a:hover { text-decoration: none; }
.bars a:hover .bars-label { color: var(--red); }
.bars .meter { grid-column: 1 / -1; }
.bars-label { font-weight: 600; }
.bars-val { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13.5px; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
.table-wrap.tall { max-height: 520px; overflow-y: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fcfaf7; white-space: nowrap; }
.table th a { color: inherit; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-compact td, .table-compact th { padding: 8px 12px; }
.table.nowrap td { white-space: nowrap; }
.table-click tbody tr { cursor: pointer; }
.table-click tbody tr:hover td { background: #fdfaf6; }
.row-link { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.row-link:hover { text-decoration: none; color: var(--red); }
.actions-col { width: 1%; white-space: nowrap; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions form { margin: 0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 4px 0 20px; font-size: 14px; color: var(--muted); }
.pager a { font-weight: 600; }

/* Filtres */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px; }
.filters select, .filters input { min-height: 40px; }
.search { position: relative; flex: 1 1 240px; display: flex; align-items: center; }
.search .ic { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px !important; width: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 16px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; font-size: 13px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0; }

/* Formulaires */
input, select, textarea {
  font: 15px/1.4 var(--font); color: var(--ink); background: #fff; border: 1px solid #ddd2c6; border-radius: 10px;
  padding: 9px 12px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a706b' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
select[size] { background-image: none; padding: 4px; }
select[size] option { padding: 6px 8px; border-radius: 6px; }
.filters select, .inline-form select { width: auto; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(196, 20, 59, .12); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--red); margin: 0; flex: none; padding: 0; }
textarea { resize: vertical; min-height: 80px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; }
.form label small { font-weight: 400; color: var(--muted); }
.form label.check, label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; color: var(--ink); }
label.check input { margin-top: 2px; }
.form label.half { max-width: 50%; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.form-grid .card { margin-bottom: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.form-actions.start { justify-content: flex-start; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 22px 0 14px; margin-top: 4px; }
.narrow { max-width: 680px; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
legend { font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.years, .seg, .amount-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.amount-choices { margin-bottom: 12px; }
.pill-check { position: relative; display: inline-flex !important; margin: 0 !important; cursor: pointer; }
.pill-check input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.pill-check span { display: inline-block; padding: 9px 16px; border: 1px solid #ddd2c6; border-radius: 10px; background: #fff; font-weight: 600; color: var(--ink); font-size: 14px; }
.pill-check input:checked + span { border-color: var(--red); background: var(--red-soft); color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.pill-check input:focus-visible + span { outline: 3px solid rgba(196, 20, 59, .35); }
.pill-check.is-done span { background: var(--green-soft); color: var(--green-dark); border-color: #c4e2cc; cursor: not-allowed; }
.amount-input { position: relative; display: block; }
.amount-input input { padding-right: 34px; font-size: 17px; font-weight: 600; }
.amount-input span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.who-box { display: flex; align-items: center; gap: 12px; background: var(--sand); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; }
.dropzone { border: 2px dashed #d9ccbe; border-radius: 14px; padding: 26px 16px; text-align: center; align-items: center; color: var(--ink-2); background: #fffdfb; cursor: pointer; }
.dropzone:hover { border-color: var(--red); }
.dropzone input { border: 0; padding: 0; background: none; max-width: 300px; font-size: 13.5px; }
.select-filter { margin-bottom: 4px; }
.hp { position: absolute; left: -5000px; height: 0; overflow: hidden; }

/* Fiche adhérent */
.show-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stack > .card:last-child { margin-bottom: 0; }
.dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; margin: 0 0 14px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: 0; }
.timeline .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); margin-top: 7px; flex: none; }
.mini-list { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.mini-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.danger-zone { border-color: #f2d6dc; }
.danger-zone .btn { margin-top: 8px; }
.danger-zone form { margin: 0; }

/* Menus déroulants */
.dropdown { position: relative; }
.menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 170px; z-index: 20; }
.dropdown.is-open .menu { display: block; }
.menu a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); font-size: 14px; }
.menu a:hover { background: var(--line-2); text-decoration: none; }

/* Emails */
.templates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.template { display: flex; flex-direction: column; gap: 6px; color: var(--ink); margin: 0; }
.template .ic { color: var(--red); }
.template:hover { text-decoration: none; border-color: #dccfc1; }
.email-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.email-grid > .card { margin-bottom: 0; }
.vars { margin: -6px 0 14px; color: var(--ink-2); line-height: 2; }
.preview-card { position: sticky; top: 20px; }
.preview-count { background: var(--green-soft); color: var(--green-dark); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.preview-count strong { font-size: 20px; }
.mail-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.mail-subject { background: var(--sand); padding: 10px 14px; font-weight: 650; border-bottom: 1px solid var(--line); }
.mail-body { padding: 16px; font-size: 14.5px; max-height: 520px; overflow: auto; }
.send-box .send-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.send-msg { color: var(--ink-2); }

/* Import */
.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.import-grid .card { margin-bottom: 0; }
.steps { padding-left: 20px; margin: 0 0 12px; }
.steps li { margin-bottom: 10px; }
.map-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
select.is-mapped { border-color: #a9d3b4; background-color: #f7fcf8; }
.issues { margin: 0; padding-left: 18px; font-size: 14px; max-height: 320px; overflow: auto; }

/* Admin */
.role-help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.role-help .card p { margin: 6px 0 0; }
.sig-preview { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.sig-preview img { max-height: 70px; max-width: 200px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }

/* ---------- Pages publiques & espace adhérent ---------- */
.pub { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.pub-in { max-width: 1060px; margin: 0 auto; padding: 0 20px; width: 100%; }
.pub-head { background: #fff; border-top: 4px solid var(--red); border-bottom: 1px solid var(--line); }
.pub-head .pub-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
.pub-head .brand { padding: 0; }
.pub-nav { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 600; }
.pub-nav a, .pub-nav button { color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.pub-nav form { margin: 0; }
.pub-main { flex: 1; padding: 36px 0 60px; }
.pub-foot { border-top: 1px solid var(--line); background: #fff; font-size: 13px; color: var(--muted); }
.pub-foot .pub-in { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
.pub-foot a { color: var(--ink-2); }
.auth-card { max-width: 460px; margin: 24px auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 26px; margin-bottom: 8px; }
.auth-card.center { text-align: center; }
.auth-links { margin-top: 14px; text-align: center; font-size: 14px; }
.auth-alt { margin: 18px 0 0; padding-top: 16px; border-top: 1px solid var(--line-2); text-align: center; font-size: 14px; color: var(--muted); }
.big-icon { width: 70px; height: 70px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--red-soft); color: var(--red); margin-bottom: 14px; }
.big-icon.ok { background: var(--green-soft); color: var(--green); }
.hello { margin-bottom: 22px; }
.hello p { margin: 4px 0 0; }
.espace-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.espace-grid .card { margin-bottom: 0; }
.status-card { border-width: 2px; }
.status-card.is-ok { border-color: #b9dcc3; background: linear-gradient(180deg, #f4fbf6, #fff 60%); }
.status-card.is-due { border-color: #f0c2cc; background: linear-gradient(180deg, #fff5f7, #fff 60%); }
.status-card h2 { font-family: var(--serif); font-size: 22px; margin: 6px 0 8px; }
.status-icon { width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.is-ok .status-icon { background: var(--green-soft); color: var(--green); }
.is-due .status-icon { background: var(--red-soft); color: var(--red); }
.pay-form { margin-top: 14px; }
.pay-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; max-width: 240px; }
.pay-form .btn { margin-bottom: 8px; }
.receipts { list-style: none; padding: 0; margin: 0; }
.receipts li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.receipts li:last-child { border-bottom: 0; }
.join-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 36px; align-items: start; }
.join-intro h1 { font-size: 36px; margin-bottom: 14px; }
.lead { font-size: 17px; color: var(--ink-2); }
.checks { list-style: none; padding: 0; margin: 18px 0; }
.checks li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.checks .ic { color: var(--green); margin-top: 3px; }

/* ---------- Mobile ---------- */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .show-grid, .email-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-card { position: static; }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
  body.side-open .side { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(36, 31, 29, .35); z-index: 40; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .brand-mini { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; color: var(--ink); font-size: 17px; }
  .brand-mini img { border-radius: 50%; }
  .main { padding: 20px 16px 50px; }
  h1 { font-size: 25px; }
  .form-grid, .import-grid, .espace-grid, .join-grid, .templates, .role-help { grid-template-columns: minmax(0, 1fr); }
  .join-grid { gap: 18px; }
  .join-intro h1 { font-size: 28px; }
}
@media (max-width: 640px) {
  .kpis { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 23px; }
  .grid-2, .grid-3, .map-grid { grid-template-columns: minmax(0, 1fr); }
  .form label.half { max-width: none; }
  .page-head { align-items: flex-start; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .filters > * { flex: 1 1 100%; }
  .filters select { width: 100%; }
  .who { align-items: flex-start; }
  .avatar.lg { width: 46px; height: 46px; font-size: 16px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  /* tableaux en cartes */
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; flex: none; }
  .table td:first-child { text-align: left; }
  .table td.actions-col { width: 100%; justify-content: flex-end; }
  .table .num { text-align: right; }
  .table.nowrap td { white-space: normal; }
  .table td.hide-sm { display: none; }
  .table-click td:first-child { padding-bottom: 6px; }
  .callout-actions { width: 100%; }
  .callout-actions .btn { flex: 1; }
  .send-box .send-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-card { padding: 24px 18px; margin: 8px auto; }
  .pub-main { padding: 22px 0 40px; }
  .pub-in { padding: 0 16px; }
  .pub-nav span { display: none; }
  .brand small { display: none; }
  .legend { width: 100%; }
}
@media print {
  .side, .topbar, .head-actions, .filters, .pager { display: none !important; }
  .main { padding: 0; }
  .card { box-shadow: none; }
}
.ok-callout { background: var(--green-soft); border-color: #c4e2cc; color: var(--green-dark); }
.ok-callout > span { align-items: flex-start !important; }
