/* Outil de prospection — interface.
   Pensée pour l'ordinateur d'abord ; les écrans étroits sont traités en fin de fichier.
   Les variables --accent* sont remplacées dans chaque page par la couleur choisie dans les réglages. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("../fonts/sora-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  --bg: #F6F7F9;
  --surface: #fff;
  --line: #E6E9EE;
  --line-2: #D3D9E0;
  --ink: #0F141A;
  --ink-2: #333B46;
  --muted: #6A7482;

  --ok: #12804F;
  --ok-soft: #E5F5EC;
  --warn: #B26A00;
  --warn-soft: #FFF3D9;
  --danger: #C9303A;
  --danger-hover: #AE2630;
  --danger-soft: #FDECEC;

  --accent: #04C28D;
  --accent-rgb: 4 194 141;
  --accent-hover: #04AB7C;
  --accent-ink: #037957;
  --accent-soft: #E6F9F4;
  --accent-soft-2: #CDF3E8;
  --on-accent: #0F141A;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 20, 26, .04), 0 14px 30px -18px rgba(15, 20, 26, .18);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", var(--font);
  --side: 264px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  color: var(--ink-2); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--font-display); color: var(--ink); line-height: 1.2; letter-spacing: -.015em; }
h1 { font-size: 27px; font-weight: 650; }
h2 { font-size: 16.5px; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; padding: 1px 5px; border-radius: 5px; background: var(--bg); color: var(--ink); }
small, .help { font-size: 12.5px; color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Structure ---------- */

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

.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 22px 14px 14px;
  background: var(--surface); border-right: 1px solid var(--line);
}

.brand {
  display: flex; align-items: center; gap: 11px; min-height: 36px;
  color: var(--ink); text-decoration: none;
  font-family: var(--font-display); font-size: 16.5px; font-weight: 650; letter-spacing: -.02em;
}
.side > .brand { padding: 0 8px 20px; }
.brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: 10px; background: var(--accent); color: var(--on-accent);
  font-size: 16px; font-weight: 700;
}
.brand__logo { display: block; max-width: 180px; max-height: 34px; width: auto; height: auto; }
.brand__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__title { padding: 18px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.nav__link {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--ink-2); cursor: pointer;
  font: inherit; font-weight: 500; text-align: left; text-decoration: none;
  transition: background-color .15s, color .15s;
}
.nav__link:hover { background: var(--bg); color: var(--ink); }
.nav__link.is-active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav__link--btn { color: var(--muted); }

.side__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.side__foot form { margin: 0; }
.me { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: var(--radius-sm); color: inherit; text-decoration: none; transition: background-color .15s; }
.me:hover, .me.is-active { background: var(--bg); }
.me__text { display: grid; min-width: 0; line-height: 1.3; }
.me__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 600; }
.me__role { font-size: 12.5px; color: var(--muted); }

.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: 50%; background: var(--accent-soft-2); color: var(--accent-ink);
  font-size: 12.5px; font-weight: 650; letter-spacing: .02em;
}
.avatar--lg { width: 56px; height: 56px; font-size: 19px; }

.topbar, .scrim { display: none; }

.main { width: 100%; max-width: 1380px; padding: 40px 48px 72px; }
.main > * + * { margin-top: 22px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 6px; }
.page-head p { margin-top: 7px; max-width: 68ch; color: var(--muted); }
.page-head__actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0; }

.back { display: inline-flex; align-items: center; gap: 4px; margin-left: -4px; color: var(--muted); font-weight: 500; text-decoration: none; }
.back:hover { color: var(--ink); }
.back .i { width: 16px; height: 16px; }

.who { display: inline-flex; align-items: center; gap: 11px; white-space: nowrap; }
.who--lg { gap: 16px; white-space: normal; }
.who--lg p { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- Cartes et grilles ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card__head a { font-size: 13.5px; font-weight: 500; }
.card__body { padding: 16px 22px 22px; }
.narrow { max-width: 780px; }

/* minmax(0, 1fr) : sans lui, un contenu large (une rangée de boutons, une adresse) élargit la colonne au-delà de la carte */
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.stack--lg { gap: 22px; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0; }
.split p { max-width: 54ch; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tile {
  display: grid; gap: 4px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  color: inherit; text-decoration: none; transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--line-2); transform: translateY(-1px); }
.tile__label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tile__value { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 26px; font-weight: 650; line-height: 1.2; color: var(--ink); letter-spacing: -.02em; }
.tile__value--text { font-size: 18px; min-height: 31px; }
.tile__swatch { width: 18px; height: 18px; border-radius: 6px; background: var(--accent); }
.tile__hint { font-size: 12.5px; color: var(--muted); }

.empty { padding: 48px 24px; text-align: center; }
.empty > * + * { margin-top: 10px; }
.empty p { max-width: 52ch; margin-inline: auto; color: var(--muted); }
.empty__icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--bg); color: var(--muted); }

.feed { margin: 0; padding: 8px 22px 12px; list-style: none; }
.feed__item { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.feed__item:first-child { border-top: 0; }
.feed__main strong { color: var(--ink); font-weight: 600; }
.feed__main { min-width: 0; overflow-wrap: anywhere; }
.feed__meta { flex: none; font-size: 12.5px; color: var(--muted); }

/* ---------- Formulaires ---------- */

.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.field--inline { grid-auto-flow: column; align-items: center; gap: 10px; }
.field--inline > span { font-weight: 500; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; align-items: start; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="tel"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="url"], select, textarea {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #B9C1CB; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .22); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236A7482' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
textarea { min-height: 96px; resize: vertical; }
input[type="file"] { font: inherit; font-size: 13.5px; color: var(--muted); }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 550; cursor: pointer;
}
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); cursor: pointer;
  font: inherit; font-weight: 600; white-space: nowrap; text-decoration: none;
  transition: background-color .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--bg); border-color: #B9C1CB; }
.btn:active { transform: translateY(1px); }
.btn--primary { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { border-color: transparent; background: var(--accent-hover); }
.btn--danger { border-color: transparent; background: var(--danger); color: #fff; }
.btn--danger:hover { border-color: transparent; background: var(--danger-hover); }
.btn--sm { min-height: 32px; padding: 4px 12px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn .i { width: 16px; height: 16px; }

.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--bg); }

/* Couleur d'accent */
.color-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.color-row__picker { width: 56px; height: 40px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.color-row__hex { width: 150px; }
.color-row__hex input { font-family: ui-monospace, Menlo, Consolas, monospace; text-transform: uppercase; }
.swatches { display: flex; gap: 8px; padding-bottom: 6px; }
.swatch { width: 28px; height: 28px; padding: 0; border: 2px solid var(--surface); border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; transition: transform .12s; }
.swatch:hover { transform: scale(1.12); }
.preview { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--bg); }
.preview .btn { pointer-events: none; }
.preview__nav { width: auto; background: var(--accent-soft); }
.logo-current { display: flex; align-items: center; gap: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); }
.logo-current img { max-width: 200px; max-height: 48px; }

/* ---------- Tableaux, étiquettes, messages ---------- */

/* position: relative — sans elle, un libellé .sr-only du tableau échappe au défilement et élargit la page */
.table-wrap { position: relative; overflow-x: auto; border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 11px 12px; border-bottom: 1px solid var(--line); background: #FAFBFC; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; line-height: 1.35; text-align: left; text-transform: uppercase; vertical-align: bottom; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table td.cell-main { min-width: 190px; }
.table td.cell-wide { min-width: 340px; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table tbody tr:hover { background: #FAFBFC; }
.table tr.is-off td:not(.table__actions) { opacity: .55; }
.table__actions { width: 1%; text-align: right; white-space: nowrap; }

.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.badge--accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge--muted { background: #EEF1F4; color: var(--ink-2); }
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--danger { background: var(--danger-soft); color: var(--danger); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }

.alert { padding: 12px 16px; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 500; }
.alert--success { background: var(--ok-soft); border-color: #BFE6D0; color: #0C5A37; }
.alert--error { background: var(--danger-soft); border-color: #F6C9CC; color: #8F1F27; }
.alert--info { background: #EEF1F4; border-color: var(--line); color: var(--ink-2); }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; }

.checks { margin: 0; padding: 6px 22px; list-style: none; }
.checks__item { display: grid; grid-template-columns: 10px 230px minmax(0, 1fr); align-items: baseline; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.checks__item:first-child { border-top: 0; }
.checks__label { color: var(--ink); font-weight: 600; }
.checks__detail { color: var(--muted); overflow-wrap: anywhere; }
.dot { width: 10px; height: 10px; border-radius: 50%; transform: translateY(1px); }
.dot--ok { background: var(--ok); }
.dot--warn { background: #E8A317; }
.dot--bad { background: var(--danger); }

/* ---------- Listes : recherche, filtres, sélection ---------- */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.tiles + .toolbar { margin-top: 22px; }
.toolbar select { width: auto; }
.toolbar__reset { font-size: 13.5px; font-weight: 500; }
.search { position: relative; flex: 1 1 280px; max-width: 420px; }
.search .i { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; }
.result-count { margin-bottom: 12px; font-size: 13.5px; color: var(--muted); }

.rowlink { color: var(--ink); font-weight: 600; text-decoration: none; }
.rowlink:hover { color: var(--accent-ink); text-decoration: underline; }
.sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); }
.sub:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 1px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink-2); font-size: 12px; font-weight: 500; line-height: 1.7; white-space: nowrap; }
.chip--choice { font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; transition: background-color .15s, border-color .15s; }
.chip--choice:hover { border-color: var(--line-2); }
.chip--choice.is-on { border-color: transparent; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }

.cell-check { width: 1%; }
.cell-check input { display: block; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.table th.cell-check, .table td.cell-check { padding-right: 2px; }

.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.bulk select, .bulk input[type="text"] { width: auto; min-width: 210px; }
.bulk__label { color: var(--ink); font-weight: 600; }
.bulk.is-idle .bulk__label { color: var(--muted); font-weight: 400; }
.bulk.is-idle select, .bulk.is-idle .btn { opacity: .55; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs__link { margin-bottom: -1px; padding: 9px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 550; text-decoration: none; }
.tabs__link:hover { color: var(--ink); }
.tabs__link.is-active { border-bottom-color: var(--accent); color: var(--ink); }

/* Fiche : le formulaire à gauche, l'état et l'historique à droite */
.sheet { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.feed--stacked .feed__item { flex-direction: column; gap: 2px; }
.inline-form { display: inline; margin: 0; }
.field--short { max-width: 220px; }
.table__actions form { display: inline; }
.table__actions > * + * { margin-left: 6px; }

/* ---------- Import et doublons ---------- */

.nav__badge { min-width: 20px; margin-left: auto; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }

.tiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
div.tile:hover { border-color: var(--line); transform: none; }
.card__lead { max-width: 84ch; padding: 8px 22px 0; color: var(--muted); }
.card__head + .table-wrap, .card__lead + .table-wrap { margin-top: 14px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }

.progress { height: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.progress__bar { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .4s ease; }

.dup .card__head { align-items: flex-start; }
.dup .card__head p { margin-top: 4px; font-size: 13px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.pair dt { font-size: 12px; font-weight: 600; color: var(--muted); }
.pair dd { margin: 2px 0 0; overflow-wrap: anywhere; }

/* Comparaison champ par champ d'un doublon. Ce n'est pas un <table> : sur écran étroit, chaque champ s'empile. */
.cmp { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cmp__row { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr) 84px; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; }
.cmp__row:first-child { border-top: 0; }
label.cmp__row:hover { background: #FAFBFC; }
.cmp__row--head { background: #FAFBFC; color: var(--muted); cursor: default; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.cmp__field { color: var(--ink); font-weight: 600; }
.cmp__current, .cmp__incoming { overflow-wrap: anywhere; }
.cmp__current em { color: var(--muted); }
.cmp__incoming { color: var(--ink); }
.cmp__take, .cmp__row--head > :last-child { text-align: center; }
.cmp__take input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }

/* ---------- Segments : constructeur de conditions ---------- */

.builder { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #FAFBFC; }
.group__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.group__head select { width: auto; }
.group__drop { margin-left: auto; }
.cond { display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(170px, 1fr) minmax(0, 1.7fr) 38px; gap: 8px; align-items: start; }
.cond--gone { grid-template-columns: minmax(0, 1fr) 38px; align-items: center; }
.cond__value { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.cond__value > input, .cond__value > select, .cond__value > textarea { flex: 1 1 140px; min-width: 0; }
.cond__value > .input--short { flex: 0 0 90px; }
.cond .icon-btn { font-size: 20px; line-height: 1; color: var(--muted); }
.cond .icon-btn:hover { color: var(--danger); }
.input--short { width: 90px; }
.option { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.option select { width: auto; }
.result { padding: 14px 22px 0; font-size: 15.5px; transition: opacity .15s; }
.result.is-loading { opacity: .5; }
.result strong { color: var(--ink); font-family: var(--font-display); font-size: 20px; }
.card__note { padding: 10px 22px 16px; font-size: 12.5px; }
.result + .table-wrap { margin-top: 14px; border-top: 1px solid var(--line); border-radius: 0; }

/* ---------- Envoi ---------- */

/* Texte d'un e-mail, tel qu'il part : police à chasse fixe écartée, pour ressembler à une messagerie */
.mail { margin: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #FAFBFC; color: var(--ink); font: inherit; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.pair--stack { grid-template-columns: minmax(0, 1fr); }
.tile__value small { color: var(--muted); font-family: var(--font); font-size: 15px; font-weight: 500; letter-spacing: 0; }
.checks__run { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); }
.checks__run form { margin: 0; }
.checks--flush { padding: 0; }
.table--stats th, .table--stats td { padding-right: 8px; padding-left: 8px; }
.table--stats td.cell-main { min-width: 170px; }
.alerts .feed__main { display: flex; align-items: baseline; gap: 10px; }
.alerts .dot { flex: none; }
.alerts .feed__meta { font-weight: 500; }
.card__links { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px 16px; }


/* ---------- Campagnes ---------- */

.fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.fieldset:disabled input, .fieldset:disabled textarea, .fieldset:disabled select { background: var(--bg); color: var(--ink-2); cursor: default; }
.sheet__sticky { position: sticky; top: 24px; }
.variant { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.variant + .variant { padding-top: 18px; border-top: 1px dashed var(--line-2); }
.variant__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.variant__head strong { color: var(--ink); }
.variant__drop { margin-left: auto; }
.step textarea { min-height: 150px; }
.option > input[type="text"] { width: 90px; }
.todo { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.todo li { position: relative; padding-left: 18px; }
.todo li::before { content: ''; position: absolute; top: .62em; left: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.todo--warn li::before { background: var(--warn); }
.ready { display: flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 600; }
.ready .i { flex: none; width: 18px; height: 18px; }
.toolbar--card { padding: 14px 22px 0; }
.toolbar--card + .table-wrap { margin-top: 14px; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.sub--ink { color: inherit; font-size: inherit; }
.btn.is-disabled { opacity: .45; pointer-events: none; }
.pager--compact { justify-content: space-between; }
.card__head form, .page-head__actions form { margin: 0; }

/* ---------- Connexion ---------- */

.auth { display: grid; place-items: center; min-height: 100vh; padding: 32px 16px; }
.auth__card { width: 100%; max-width: 420px; padding: 34px 32px 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.auth__card > * + * { margin-top: 16px; }
.auth__brand { margin-bottom: 26px; }
.auth__card h1 { font-size: 23px; }
.auth__card h1 + p { margin-top: 8px; }
.auth__foot { margin-top: 20px; font-size: 13.5px; text-align: center; }

/* ---------- Écrans étroits ---------- */

@media (max-width: 1100px) {
  .main { padding: 32px 28px 64px; }
  .sheet { grid-template-columns: 1fr; }
  .sheet__sticky { position: static; }
  .tiles--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app { display: block; }

  .topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  }
  .topbar .brand__mark { width: 30px; height: 30px; font-size: 14px; }
  .topbar .brand__logo { max-height: 28px; }

  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(84vw, 300px);
    transform: translateX(-102%); transition: transform .22s ease;
    box-shadow: 0 0 60px rgba(15, 20, 26, .25);
  }
  .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(15, 20, 26, .42); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .nav-open .side { transform: none; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }

  .main { padding: 22px 16px 56px; }
  h1 { font-size: 23px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .tiles, .form-grid, .sheet { grid-template-columns: 1fr; }
  .split { flex-direction: column; align-items: flex-start; }
  .feed__item { flex-direction: column; gap: 2px; }
  .checks__item { grid-template-columns: 10px minmax(0, 1fr); }
  .checks__detail { grid-column: 2; }
  .card__head { padding: 16px 16px 0; }
  .card__body { padding: 14px 16px 18px; }
  .feed, .checks { padding-inline: 16px; }
  .table th:first-child, .table td:first-child { padding-left: 16px; }
  .table th:last-child, .table td:last-child { padding-right: 16px; }
  .auth__card { padding: 28px 22px 24px; }
}

/* Tableaux : sur un écran étroit, chaque ligne devient une carte.
   Convention à suivre dans chaque tableau : la cellule principale porte .cell-main, les autres
   un attribut data-label (affiché comme intitulé), et les boutons vont dans .table__actions.
   Une cellule vide ne doit contenir aucun espace : elle disparaît alors de la carte. */
@media (max-width: 760px) {
  .card--table { max-width: none; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .card--table .table-wrap { overflow: visible; border-radius: 0; }
  .table, .table tbody { display: block; }
  .table thead { display: none; }
  .table tr {
    position: relative; display: flex; flex-direction: column; gap: 5px;
    margin-bottom: 12px; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .table tr:last-child { margin-bottom: 0; }
  .table tbody tr:hover { background: var(--surface); }
  .table td, .table td:first-child, .table td:last-child { display: block; padding: 0; border: 0; white-space: normal; }
  .table td:empty { display: none; }
  .table td.cell-wide { min-width: 0; }
  .table td.cell-main { order: -1; margin-bottom: 6px; color: var(--ink); font-size: 15.5px; font-weight: 600; }
  .table td.cell-check + td.cell-main { padding-right: 32px; }
  .table td[data-label] { position: relative; min-height: 1.55em; padding-left: 134px; overflow-wrap: anywhere; }
  .table td[data-label]::before {
    content: attr(data-label); position: absolute; top: 2px; left: 0; width: 124px;
    overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap;
  }
  .table td.cell-check { position: absolute; top: 15px; right: 14px; width: auto; }
  .table td.table__actions { order: 10; display: flex; flex-wrap: wrap; gap: 8px; width: auto; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); text-align: left; }
  .table td.table__actions > * { flex: 1; margin: 0; }
  .table td.table__actions:empty { display: none; }
  .table td.table__actions form .btn { width: 100%; }

  .toolbar .search { flex-basis: 100%; max-width: none; }
  .toolbar .field--inline, .toolbar select { flex: 1 1 45%; }
  .toolbar select { width: 100%; }
  .bulk select, .bulk input[type="text"], .bulk .btn { flex: 1 1 100%; min-width: 0; }
  .page-head__actions .btn { flex: 1 1 auto; }
  .tabs { overflow-x: auto; overflow-y: hidden; }
  .tabs__link { margin-bottom: 0; white-space: nowrap; }

  .pair { grid-template-columns: 1fr; }
  .cmp__row--head { display: none; }
  .cond { grid-template-columns: minmax(0, 1fr) 38px; }
  .cond > select, .cond > span, .cond__value { grid-column: 1; }
  .cond > .icon-btn { grid-column: 2; grid-row: 1; }
  .group__head select, .option select { width: 100%; }
  .group__drop { margin-left: 0; }
  .result, .card__note { padding-inline: 2px; }
  .cmp__row { grid-template-columns: minmax(0, 1fr) 30px; gap: 3px 12px; align-items: start; }
  .cmp__field, .cmp__current, .cmp__incoming { grid-column: 1; }
  .cmp__take { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
  .cmp__current::before, .cmp__incoming::before { content: attr(data-label) " : "; color: var(--muted); font-size: 12px; font-weight: 600; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
