/* ═══════════════════════════════════════════════════════════════════════════
   Mbenguiste — thème des surfaces web (portail partenaire, console admin, 404).
   Calqué sur src/proTheme.ts (verrouillé 11/07) : quasi-monochrome encre + crème,
   UN seul accent vert, sémantiques à sens unique.
   Aucun style inline nulle part : la CSP est stricte (style-src 'self').
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --page:#F3F2EF; --sheet:#FFFFFF; --field:#ECEBE7;
  --ink:#1B1A1E; --ink2:#66645E; --ink3:#9A968E;
  --line:rgba(20,18,22,.09); --line2:rgba(20,18,22,.14);
  --accent:#3A6B63; --accent-deep:#2B4E48; --accent-tint:#E4EDE8;
  --danger:#B23A3A; --danger-tint:rgba(178,58,58,.09);
  --clay:#A9793C; --clay-tint:rgba(169,121,60,.12);
  --slate:#4E6E7E;
  --serif:'Iowan Old Style','Palatino Linotype',Palatino,Georgia,serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --shadow:0 1px 2px rgba(20,18,22,.04), 0 8px 24px -12px rgba(20,18,22,.14);
  --radius:16px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 24px 20px 90px; }

/* ── Typographie ───────────────────────────────────────────────────────── */
.brand { font-family: var(--serif); font-size: 27px; font-weight: 500; letter-spacing: .3px; }
.brand-sub { font-family: var(--serif); font-style: italic; color: var(--ink3); font-size: 15px; }
h1 { font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1.15; margin: 0 0 6px; }
h2 { font-family: var(--serif); font-size: 21px; font-weight: 500; margin: 0 0 14px; }
.sub { color: var(--ink2); font-size: 13.5px; margin: 0; }
.eyebrow { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--ink3); font-weight: 600; }
.whisper { font-family: var(--serif); font-style: italic; color: var(--ink3); font-size: 14px; }
.mono { font-family: var(--mono); }
.tnum { font-variant-numeric: tabular-nums; }

/* ── Cartes ────────────────────────────────────────────────────────────── */
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { margin: 0; }

/* ── Formulaires ───────────────────────────────────────────────────────── */
label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--ink3); margin: 0 0 6px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line2); border-radius: 12px;
  background: var(--sheet); color: var(--ink); font-size: 15px; font-family: inherit;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input::placeholder, textarea::placeholder { color: var(--ink3); }
input[type=checkbox] { width: auto; }
.field + .field { margin-top: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.inline { display: flex; align-items: center; gap: 9px; }
.inline label { margin: 0; text-transform: none; letter-spacing: 0; font-family: inherit;
  font-size: 14px; color: var(--ink); }
.hint { font-size: 12.5px; color: var(--ink3); line-height: 1.5; margin: 8px 0 0; }

/* ── Boutons ───────────────────────────────────────────────────────────── */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line2);
  background: var(--sheet); color: var(--ink); font: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer; text-decoration: none; transition: background .12s, opacity .12s;
}
button:hover, .btn:hover { background: var(--field); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-deep); }
.btn-ok { background: var(--accent-tint); border-color: rgba(58,107,99,.3); color: var(--accent-deep); }
.btn-danger { background: var(--danger-tint); border-color: rgba(178,58,58,.3); color: var(--danger); }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink2); }
.btn-quiet:hover { background: var(--field); }

/* ── Pastilles / statuts ───────────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; letter-spacing: .2px; }
.pill-ok { background: var(--accent-tint); color: var(--accent-deep); }
.pill-wait { background: var(--clay-tint); color: var(--clay); }
.pill-off { background: rgba(20,18,22,.06); color: var(--ink3); }
.pill-danger { background: var(--danger-tint); color: var(--danger); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ── Tableaux ──────────────────────────────────────────────────────────── */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-family: var(--mono); font-size: 9.5px; letter-spacing: .9px;
  text-transform: uppercase; color: var(--ink3); font-weight: 600;
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(20,18,22,.015); }
.tright { text-align: right; }

/* ── États (vide, chargement, erreur) ──────────────────────────────────── */
.empty { text-align: center; padding: 40px 20px; color: var(--ink3); }
.empty-title { font-family: var(--serif); font-size: 18px; color: var(--ink2); margin-bottom: 6px; }
.empty-sub { font-size: 13.5px; }
.skeleton { background: linear-gradient(90deg, var(--field) 25%, #F6F5F1 50%, var(--field) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; height: 14px; }
.skel-row { padding: 16px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: center; }
.skel-row .skeleton:first-child { flex: 2; }
.skel-row .skeleton:last-child { flex: 1; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

.notice { padding: 13px 15px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; margin-top: 14px; }
.notice-err { background: var(--danger-tint); color: var(--danger); }
.notice-ok { background: var(--accent-tint); color: var(--accent-deep); }
.notice-wait { background: var(--clay-tint); color: var(--clay); }

/* ── Toasts (remplacent alert()) ───────────────────────────────────────── */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: flex;
  flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--ink); color: #fff; padding: 14px 16px; border-radius: 13px;
  box-shadow: 0 14px 34px -12px rgba(0,0,0,.5); font-size: 14px; line-height: 1.5;
  animation: toastIn .18s ease-out; white-space: pre-wrap; }
.toast-ok { background: var(--accent-deep); }
.toast-err { background: var(--danger); }
.toast-title { font-weight: 700; margin-bottom: 3px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ── Modale de confirmation ────────────────────────────────────────────── */
.modal-back { position: fixed; inset: 0; background: rgba(20,18,22,.45); z-index: 70;
  display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal { background: var(--sheet); border-radius: 20px; padding: 24px; width: 100%; max-width: 440px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.45); }
.modal h2 { margin-bottom: 8px; }
.modal p { color: var(--ink2); font-size: 14px; margin: 0 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ── Divers ────────────────────────────────────────────────────────────── */
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.rule { height: 1px; background: var(--line); margin: 22px 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
a { color: var(--accent-deep); }
.linkish { background: none; border: none; padding: 0; color: var(--accent-deep);
  font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; }
.linkish:hover { background: none; text-decoration: underline; }

@media (max-width: 720px) {
  .grid-2 { grid-template-columns: 1fr; }
  .wrap { padding: 18px 14px 70px; }
  h1 { font-size: 25px; }
}
