/* ==========================================================================
   PubMarket : design system v9
   Palette unique : Navy (marque) + Orange (accent) + gris Slate.
   Un seul jeu de tokens, un seul composant par usage, 3 points de rupture.
   Points de rupture : 640px (sm) · 900px (md) · 1200px (lg)
   ========================================================================== */

:root {
  /* ---------------------------------------------------------- typographie */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-md: 13.5px;
  --fs-base: 14.5px;
  --fs-lg: 16px;
  --fs-xl: 19px;
  --fs-2xl: 23px;
  --fs-3xl: 30px;
  --fs-4xl: 40px;

  /* ------------------------------------------------- marque (logo navy+orange) */
  --brand:        #0b2f6b;
  --brand-700:    #082550;
  --brand-600:    #0e3c86;
  --brand-50:     #eef3fb;
  --brand-100:    #d8e3f6;

  --accent:       #f97316;
  --accent-600:   #ea580c;
  --accent-700:   #c2410c;
  --accent-50:    #fff7ed;
  --accent-100:   #ffedd5;

  /* ------------------------------------------------------------- neutres */
  --ink:    #0f172a;
  --ink-2:  #475569;
  --ink-3:  #64748b;
  --ink-4:  #94a3b8;
  --line:   #e5e9f0;
  --line-2: #cbd5e1;
  --surface:      #ffffff;
  --surface-sub:  #f8fafc;
  --surface-alt:  #f1f5f9;
  --bg:           #f6f8fb;

  /* ------------------------------------------------------------ sémantique */
  --ok:        #16a34a;  --ok-soft:   #ecfdf5;  --ok-ink:   #15803d;
  --warn:      #f59e0b;  --warn-soft: #fffbeb;  --warn-ink: #b45309;
  --bad:       #ef4444;  --bad-soft:  #fef2f2;  --bad-ink:  #b91c1c;
  --info:      #2563eb;  --info-soft: #eff6ff;  --info-ink: #1d4ed8;

  /* --------------------------------------------------- rayons & élévations */
  --r-xs: 8px;
  --r-sm: 11px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --pill: 999px;

  --sh-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --sh-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --sh-md: 0 4px 12px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .04);
  --sh-lg: 0 12px 28px rgba(15, 23, 42, .09), 0 4px 8px rgba(15, 23, 42, .04);
  --sh-xl: 0 24px 48px rgba(15, 23, 42, .12);

  /* ----------------------------------------------------------- dimensions */
  --wrap: 1240px;
  --tap: 44px;              /* cible tactile minimale */
  --dur: .18s;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ========================================================================== */
/*  Reset                                                                     */
/* ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.022em;
  line-height: 1.22;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-base); }

p { line-height: 1.6; }

a {
  color: var(--accent-600);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--accent); }

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

img, svg { display: block; max-width: 100%; }

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .9em;
  background: var(--surface-alt);
  padding: 2px 6px;
  border-radius: 6px;
}

hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* Accessibilité : anneau de focus homogène partout */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================================================== */
/*  Icônes : un seul comportement pour toutes les icônes SVG                  */
/* ========================================================================== */
svg.i {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  vertical-align: -.2em;
}
svg.i.sz-sm { width: 1em;    height: 1em; }
svg.i.sz-lg { width: 1.45em; height: 1.45em; }
svg.i.sz-xl { width: 22px;   height: 22px; vertical-align: 0; }

/* Pastille d'icône : carré arrondi coloré, utilisé partout de la même façon */
.ico-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--surface-alt);
  color: var(--ink-2);
  flex: 0 0 auto;
}
.ico-box svg.i { width: 19px; height: 19px; vertical-align: 0; }
.ico-box.lg { width: 48px; height: 48px; border-radius: var(--r-md); }
.ico-box.lg svg.i { width: 23px; height: 23px; }
.ico-box.round { border-radius: var(--pill); }

.ico-box.brand  { background: var(--brand);     color: #fff; }
.ico-box.accent { background: var(--accent);    color: #fff; }
.ico-box.ok     { background: var(--ok-soft);   color: var(--ok-ink); }
.ico-box.warn   { background: var(--warn-soft); color: var(--warn-ink); }
.ico-box.bad    { background: var(--bad-soft);  color: var(--bad-ink); }
.ico-box.info   { background: var(--info-soft); color: var(--info-ink); }
.ico-box.soft   { background: var(--accent-50); color: var(--accent-600); }
.ico-box.navy   { background: var(--brand-50);  color: var(--brand); }

/* ========================================================================== */
/*  Modes d'affichage                                                         */
/* ========================================================================== */
body.dashboard-mode {
  background: var(--surface-sub);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
body.dashboard-mode .top-announcement,
body.dashboard-mode header.top,
body.dashboard-mode footer.site-footer { display: none !important; }
[hidden] { display: none !important; }
body.dashboard-mode main {
  max-width: 100%;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

/* ========================================================================== */
/*  Bandeau d'annonce                                                         */
/* ========================================================================== */
.top-announcement {
  background: var(--brand-700);
  color: #cbd9ef;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.top-announcement svg.i { color: var(--accent); }
.top-announcement .ann-sep { opacity: .35; }
@media (max-width: 639px) {
  .top-announcement .ann-hide { display: none; }
}

/* ========================================================================== */
/*  En-tête public                                                            */
/* ========================================================================== */
header.top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-container {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.brand-logo {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  box-shadow: var(--sh-sm);
  transition: transform var(--dur) var(--ease);
}
.brand-wrap:hover .brand-logo { transform: scale(1.04); }
.brand-text .brand {
  font-weight: 800;
  font-size: var(--fs-xl);
  color: var(--brand);
  letter-spacing: -.03em;
  line-height: 1.1;
}
.brand-text .brand span { color: var(--accent); }
.brand-text .slog {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-4);
  letter-spacing: .01em;
}

.desktop-nav { display: none; align-items: center; gap: 4px; }
.desktop-nav button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--pill);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.desktop-nav button:hover { color: var(--ink); background: var(--surface-alt); }
.desktop-nav button.on { color: var(--accent-700); background: var(--accent-50); }

.header-actions { display: flex; align-items: center; gap: 9px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 13px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-md);
  font-weight: 700;
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.chip:hover { border-color: var(--line-2); color: var(--ink); box-shadow: var(--sh-xs); }
.chip svg.i { color: var(--ink-3); }

@media (min-width: 900px) {
  .desktop-nav { display: flex; }
}
@media (max-width: 899px) {
  .header-container { padding: 10px 14px; }
  .brand-text .slog { display: none; }
  .header-cta-label { display: none; }
}

/* ========================================================================== */
/*  Conteneurs de page                                                        */
/* ========================================================================== */
main {
  flex: 1;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 22px 18px calc(36px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) {
  main { padding: 28px 24px 56px; }
}

.wrap-narrow { max-width: 720px; margin: 0 auto; }
.wrap-form   { max-width: 820px; margin: 0 auto; }
.wrap-auth   { max-width: 440px; margin: 24px auto; }

/* En-tête de page : une seule structure pour toutes les pages */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head h1 { font-size: var(--fs-2xl); color: var(--brand); }
.page-head p {
  color: var(--ink-3);
  font-size: var(--fs-md);
  margin-top: 4px;
  max-width: 62ch;
}
.page-head-actions { display: flex; gap: 9px; flex-wrap: wrap; }

/* En-tête de section */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin: 34px 0 16px;
}
.section-head h2 { font-size: var(--fs-xl); color: var(--brand); }
.section-head p { color: var(--ink-3); font-size: var(--fs-md); margin-top: 3px; }
.section-head .more-link {
  font-weight: 700;
  font-size: var(--fs-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* ========================================================================== */
/*  Boutons                                                                   */
/* ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 11px 19px;
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  font-weight: 700;
  letter-spacing: -.005em;
  background: var(--brand);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: var(--sh-xs);
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.btn:hover { background: var(--brand-600); box-shadow: var(--sh-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn svg.i { color: currentColor; }

.btn.acc { background: var(--accent); color: #fff; }
.btn.acc:hover { background: var(--accent-600); }

.btn.ghost {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--line);
  box-shadow: none;
}
.btn.ghost:hover {
  background: var(--surface-sub);
  color: var(--ink);
  border-color: var(--line-2);
}

.btn.red { background: var(--bad); color: #fff; }
.btn.red:hover { background: #dc2626; }

.btn.sm { min-height: 36px; padding: 8px 14px; font-size: var(--fs-sm); border-radius: var(--r-xs); }
.btn.lg { min-height: 52px; padding: 15px 26px; font-size: var(--fs-lg); border-radius: var(--r-md); }
.btn.wide { width: 100%; }

/* ========================================================================== */
/*  Effet de chargement des boutons                                           */
/* ========================================================================== */
.btn.loading, 
.icon-btn.loading, 
.filebtn.loading,
button.loading {
  position: relative !important;
  pointer-events: none !important;
  cursor: wait !important;
  user-select: none !important;
  color: transparent !important;
}

.btn.loading > *, 
.icon-btn.loading > *, 
.filebtn.loading > *,
button.loading > * {
  opacity: 0 !important;
  visibility: hidden !important;
}

.btn.loading::after, 
.icon-btn.loading::after, 
.filebtn.loading::after,
button.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  margin-left: -9px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: btn-spin 0.65s linear infinite;
  box-sizing: border-box;
  z-index: 2;
  pointer-events: none;
}

.btn.ghost.loading::after, 
.icon-btn.loading::after,
.filebtn.loading::after,
button.ghost.loading::after {
  border-color: rgba(15, 23, 42, 0.18);
  border-top-color: var(--brand);
}

.trust-card .btn.ghost.loading::after {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
}

.btn.sm.loading::after,
.icon-btn.sm.loading::after {
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  border-width: 2px;
}

.btn.lg.loading::after {
  width: 22px;
  height: 22px;
  margin-top: -11px;
  margin-left: -11px;
  border-width: 2.5px;
}

@keyframes btn-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.btnrow { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.btnrow.center { justify-content: center; }
.btnrow.end { justify-content: flex-end; }
.btnrow:first-child { margin-top: 0; }

/* Bouton icône seule */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  position: relative;
  transition: all var(--dur) var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface-sub); }
.icon-btn .dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--surface);
}
.icon-btn.round { border-radius: var(--pill); }

/* ========================================================================== */
/*  Badges & étiquettes                                                       */
/* ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.5;
  background: var(--surface-alt);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 auto;
}
.badge.nodot::before { display: none; }
.badge.ok     { background: var(--ok-soft);   color: var(--ok-ink); }
.badge.warn   { background: var(--warn-soft); color: var(--warn-ink); }
.badge.bad    { background: var(--bad-soft);  color: var(--bad-ink); }
.badge.blue   { background: var(--info-soft); color: var(--info-ink); }
.badge.orange { background: var(--accent-50); color: var(--accent-700); }
.badge.navy   { background: var(--brand-50);  color: var(--brand); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.tag:hover {
  border-color: var(--accent);
  background: var(--accent-50);
  color: var(--accent-700);
}

/* ========================================================================== */
/*  Cartes                                                                    */
/* ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--sh-sm);
  margin-bottom: 16px;
}
.card:last-child { margin-bottom: 0; }
.card > h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-lg);
  margin-bottom: 10px;
}
.card > h2 svg.i { color: var(--accent); }
.card > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-base);
  margin: 22px 0 12px;
  color: var(--brand);
}
.card > h3 svg.i { color: var(--accent); }
.card > h3:first-child { margin-top: 0; }
.card.flat { box-shadow: none; }
.card.tight { padding: 15px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.card-head h2, .card-head h3 { margin: 0; }

/* ========================================================================== */
/*  Grilles                                                                   */
/* ========================================================================== */
.grid2, .grid3, .grid4 { display: grid; gap: 12px; }
.grid2 { grid-template-columns: 1fr; }
.grid3 { grid-template-columns: repeat(2, 1fr); }
.grid4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) {
  .grid2 { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: repeat(3, 1fr); }
  .grid4 { grid-template-columns: repeat(4, 1fr); }
}

.cards-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px)  { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .cards-grid.three { grid-template-columns: repeat(3, 1fr); } }
.cards-grid > .card { margin-bottom: 0; }

/* ========================================================================== */
/*  Formulaires                                                               */
/* ========================================================================== */
label {
  display: block;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-2);
  margin: 15px 0 6px;
}
label:first-child { margin-top: 0; }
.req::after { content: " *"; color: var(--bad); }

input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 11px 13px;
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

input[type="checkbox"], input[type="radio"] {
  -webkit-appearance: auto !important;
  appearance: auto !important;
  width: 22px !important;
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  padding: 0 !important;
  margin: 2px 0 0 0 !important;
  border-radius: 5px !important;
  accent-color: var(--accent) !important;
  cursor: pointer !important;
  flex: 0 0 22px !important;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--ink-4); }

select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' 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 12px center;
  background-size: 17px;
  padding-right: 38px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-100);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--surface-alt);
  color: var(--ink-4);
  cursor: not-allowed;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.5;
  cursor: pointer;
  user-select: none;
}
.check span { flex: 1; }

.code-input {
  letter-spacing: 8px;
  text-align: center;
  font-size: var(--fs-2xl);
  font-weight: 800;
  padding-left: 8px;
}

.filebtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 52px;
  padding: 14px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-sub);
  color: var(--ink-2);
  font-size: var(--fs-md);
  font-weight: 700;
  transition: all var(--dur) var(--ease);
}
.filebtn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-50);
  color: var(--accent-700);
}
.filebtn:disabled { opacity: .5; cursor: not-allowed; }

/* Carte sélectionnable (type d'annonce, durée, palier) */
.typecard {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 86px;
  padding: 14px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: center;
  line-height: 1.35;
  transition: all var(--dur) var(--ease);
}
.typecard:hover:not(:disabled) {
  border-color: var(--line-2);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}
.typecard.on {
  border-color: var(--accent);
  background: var(--accent-50);
  color: var(--accent-700);
  font-weight: 700;
  box-shadow: 0 0 0 3px var(--accent-100);
}
.typecard:disabled { opacity: .45; cursor: not-allowed; }
.typecard svg.i { width: 22px; height: 22px; vertical-align: 0; color: var(--ink-3); }
.typecard.on svg.i { color: var(--accent); }
.typecard b { font-size: var(--fs-base); color: var(--ink); }
.typecard.on b { color: var(--accent-700); }

/* Vignettes photo */
.thumbwrap { position: relative; display: inline-block; }
.thumb {
  width: 76px; height: 76px;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line);
  background: var(--surface-alt);
}
.thumb.lg { width: 94px; height: 94px; }
.thumbdel {
  position: absolute;
  top: -7px; right: -7px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-sm);
  border: 2px solid var(--surface);
}
.thumbdel svg.i { width: 11px; height: 11px; vertical-align: 0; stroke-width: 3; }

/* ========================================================================== */
/*  Texte utilitaire                                                          */
/* ========================================================================== */
.mut   { color: var(--ink-2); font-size: var(--fs-md); }
.dim   { color: var(--ink-4); }
.small { font-size: var(--fs-sm); }
.center { text-align: center; }
.okline {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ok-ink);
  font-weight: 700;
  font-size: var(--fs-md);
}
.badline { color: var(--bad-ink); font-weight: 600; font-size: var(--fs-md); }

.qline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  font-size: var(--fs-base);
  border-bottom: 1px solid var(--line);
}
.qline:last-child { border-bottom: 0; }
.qline.total {
  border-bottom: 0;
  border-top: 1.5px solid var(--line-2);
  margin-top: 6px;
  padding-top: 13px;
  font-weight: 800;
  font-size: var(--fs-lg);
  color: var(--brand);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: var(--ink-4);
  font-size: var(--fs-md);
  padding: 46px 20px;
  background: var(--surface);
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
}
.empty svg.i { width: 34px; height: 34px; vertical-align: 0; color: var(--line-2); }
.empty b { color: var(--ink-2); font-size: var(--fs-base); }

.prog {
  height: 8px;
  background: var(--surface-alt);
  border-radius: var(--pill);
  overflow: hidden;
}
.prog > div {
  height: 100%;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-600) 100%);
  border-radius: var(--pill);
  transition: width .5s var(--ease);
}
.prog.ok > div  { background: linear-gradient(90deg, #22c55e 0%, var(--ok) 100%); }
.prog.navy > div { background: linear-gradient(90deg, var(--brand-600) 0%, var(--brand) 100%); }

.stat {
  background: var(--surface-sub);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 12px;
  text-align: center;
}
.stat b {
  display: block;
  font-size: var(--fs-2xl);
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -.03em;
  line-height: 1.2;
}
.stat span { display: block; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; margin-top: 2px; }
.stat.clickable { cursor: pointer; transition: all var(--dur) var(--ease); }
.stat.clickable:hover { border-color: var(--accent); background: var(--accent-50); transform: translateY(-1px); }

.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 800;
}
.rank.top { background: var(--accent-50); color: var(--accent-700); }

.msgbox {
  background: var(--brand-700);
  color: #dbe6f7;
  border-radius: var(--r-md);
  padding: 16px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: var(--fs-md);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
}

.scrollbox {
  max-height: 46vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
  background: var(--surface-sub);
  font-size: var(--fs-md);
  line-height: 1.7;
  white-space: pre-wrap;
}

.avatar {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-sm);
  font-weight: 800;
  letter-spacing: .02em;
  line-height: 1;
  flex: 0 0 auto;
}
.avatar.accent { background: var(--accent); }
.avatar.sm { width: 30px; height: 30px; font-size: var(--fs-xs); }

/* Liste de lignes « média » (icône + texte + action) */
.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.row-item:last-child { border-bottom: 0; }
.row-item-body { flex: 1; min-width: 0; }
.row-item-body > b { display: block; font-size: var(--fs-md); color: var(--ink); }
.row-item-body > span { display: block; font-size: var(--fs-sm); color: var(--ink-3); }

/* ========================================================================== */
/*  Tableaux (se transforment en cartes sous 640px)                           */
/* ========================================================================== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
}
table.t { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
table.t thead th {
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-4);
  padding: 10px 12px;
  border-bottom: 1.5px solid var(--line);
  white-space: nowrap;
}
table.t td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background var(--dur) var(--ease); }
table.t tbody tr:hover { background: var(--surface-sub); }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }

@media (max-width: 639px) {
  table.t.stack-mobile thead { display: none; }
  table.t.stack-mobile tbody tr {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px;
    margin-bottom: 10px;
    background: var(--surface);
  }
  table.t.stack-mobile tbody tr:hover { background: var(--surface); }
  table.t.stack-mobile td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border: 0;
    text-align: right;
  }
  table.t.stack-mobile td::before {
    content: attr(data-label);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-4);
    text-align: left;
    flex: 0 0 auto;
  }
  table.t.stack-mobile td.full {
    display: block;
    text-align: left;
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line);
  }
  table.t.stack-mobile td.full::before { display: none; }
}

/* ========================================================================== */
/*  VITRINE PUBLIQUE                                                          */
/*  Sobre par construction : surfaces blanches, texte navy, une seule couleur */
/*  d'accent réservée aux actions. Aucun aplat décoratif.                     */
/* ========================================================================== */

/* ----- Hero ----- */
.hero {
  display: grid;
  gap: 30px;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 18px 0 10px;
}
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.05fr .95fr; gap: 48px; padding: 44px 0 28px; }
}

.hero h1 {
  font-size: clamp(28px, 6vw, 46px);
  line-height: 1.12;
  letter-spacing: -.034em;
  color: var(--brand);
}
.hero h1 span { color: var(--accent); }

.hero-sub {
  font-size: clamp(14.5px, 2.1vw, 17px);
  color: var(--ink-2);
  margin-top: 18px;
  max-width: 54ch;
  line-height: 1.65;
}

.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

.hero-trust {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-3);
}
.hero-trust b { color: var(--ink-2); display: inline-flex; align-items: center; gap: 7px; }
.hero-trust svg.i { color: var(--ink-3); }

.hero-visual { display: flex; justify-content: center; align-items: center; }
.hero-visual svg { width: 100%; max-width: 430px; height: auto; }

/* ----- Bandeau de statistiques ----- */
.stat-band {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin: 34px 0 10px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
@media (min-width: 760px) { .stat-band { grid-template-columns: repeat(3, 1fr); } }

.stat-band-item {
  background: var(--surface);
  padding: 22px 18px;
  text-align: center;
}
.stat-band-item b {
  display: block;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -.035em;
  line-height: 1.15;
}
.stat-band-item span {
  display: block;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  font-weight: 600;
  margin-top: 4px;
}

/* ----- Les deux profils ----- */
.split-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .split-grid { grid-template-columns: repeat(2, 1fr); } }

.split-card {
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 26px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.split-card:hover { border-color: var(--line-2); box-shadow: var(--sh-md); }

.split-inner { display: flex; align-items: center; gap: 20px; }
.split-body { flex: 1; min-width: 0; }
.split-illus { flex: 0 0 auto; width: 128px; }
.split-illus svg { width: 128px; height: 128px; }
@media (max-width: 599px) {
  .split-inner { flex-direction: column-reverse; align-items: flex-start; }
  .split-illus { width: 104px; align-self: center; }
  .split-illus svg { width: 104px; height: 104px; }
  .split-card { padding: 20px; }
}

.split-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--surface-sub);
  color: var(--ink-2);
  font-size: var(--fs-xs);
  font-weight: 700;
  margin-bottom: 13px;
}
.split-tag svg.i { color: var(--ink-3); }
.split-card h3 { font-size: var(--fs-xl); margin-bottom: 9px; color: var(--brand); letter-spacing: -.025em; }
.split-card p { font-size: var(--fs-md); color: var(--ink-2); margin-bottom: 18px; }

.split-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 11px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
  font-size: var(--fs-md);
  font-weight: 700;
  transition: all var(--dur) var(--ease);
}
.split-link:hover {
  border-color: var(--accent);
  color: var(--accent-700);
  background: var(--accent-50);
}
.split-link svg.i { transition: transform var(--dur) var(--ease); }
.split-link:hover svg.i { transform: translateX(3px); }

/* ----- Catégories (liste informative, non cliquable) ----- */
.cat-list {
  list-style: none;
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}
@media (min-width: 640px)  { .cat-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cat-list { grid-template-columns: repeat(3, 1fr); } }

.cat-item {
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-2);
}
.cat-item svg.i { color: var(--ink-4); }
.cat-item span { flex: 1; min-width: 0; }
.cat-item em {
  font-style: normal;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-4);
  background: var(--surface-alt);
  padding: 2px 9px;
  border-radius: var(--pill);
}

/* ----- Étapes ----- */
.steps-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px 22px;
}
.step-card .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--r-xs);
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-md);
  font-weight: 800;
  margin-bottom: 14px;
}
.step-card h3 { font-size: var(--fs-lg); margin-bottom: 7px; color: var(--brand); }
.step-card p { font-size: var(--fs-md); color: var(--ink-2); }

/* ----- Bandeau confiance ----- */
.trust-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 30px;
  margin-top: 38px;
}
.trust-card h2 { color: #fff; display: flex; align-items: center; gap: 10px; font-size: var(--fs-xl); }
.trust-card h2 svg.i { color: #fff; opacity: .7; }
.trust-card p { color: #c3d4ee; font-size: var(--fs-md); margin-top: 8px; max-width: 62ch; }
.trust-card .btn.ghost {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
}
.trust-card .btn.ghost:hover { background: rgba(255, 255, 255, .18); color: #fff; }

/* ========================================================================== */

/* ========================================================================== */
/*  ESPACE DE TRAVAIL : annonceur, ambassadeur, admin, super admin           */
/*  Une seule et même coquille pour tous les rôles connectés.                */
/* ========================================================================== */
.dash-layout {
  display: grid;
  grid-template-columns: 1fr;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--surface-sub);
}
@media (min-width: 900px)  { .dash-layout { grid-template-columns: 260px 1fr; } }
@media (min-width: 1360px) {
  .dash-layout { grid-template-columns: 260px 1fr 300px; }
  .dash-layout.no-aside { grid-template-columns: 260px 1fr; }
}

/* ----- Barre latérale ----- */
.dash-sidebar {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 14px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  box-sizing: border-box;
  overscroll-behavior: contain;
}
@media (max-width: 899px) {
  .dash-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 270px;
    max-width: 86vw;
    z-index: 210;
    transform: translateX(-100%);
    transition: transform .26s var(--ease);
    box-shadow: var(--sh-xl);
  }
  .dash-sidebar.open { transform: translateX(0); }
  .dash-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 205;
    opacity: 0;
    pointer-events: none;
    transition: opacity .26s var(--ease);
  }
  .dash-backdrop.on { opacity: 1; pointer-events: auto; }
}
@media (min-width: 900px) { .dash-backdrop { display: none; } }

.dash-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.dash-brand-logo { width: 38px; height: 38px; border-radius: var(--r-xs); flex: 0 0 auto; }
.dash-brand-title { font-size: var(--fs-lg); font-weight: 800; color: var(--brand); letter-spacing: -.03em; line-height: 1.1; }
.dash-brand-title span { color: var(--accent); }
.dash-brand-sub { font-size: var(--fs-xs); color: var(--ink-4); font-weight: 600; }

.dash-menu-label {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-4);
  padding: 0 10px;
  margin-bottom: 7px;
}
.dash-nav-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.dash-nav-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--ink-2);
  text-align: left;
  transition: all var(--dur) var(--ease);
}
.dash-nav-btn:hover { background: var(--surface-alt); color: var(--ink); }
.dash-nav-btn.on { background: var(--brand); color: #fff; box-shadow: var(--sh-sm); }
.dash-nav-btn.on svg.i { color: var(--accent); }
.dash-nav-content { display: flex; align-items: center; gap: 11px; min-width: 0; }
.dash-nav-content span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-nav-content svg.i { color: var(--ink-4); }
.dash-nav-btn:hover svg.i { color: var(--ink-2); }
.dash-nav-badge {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: var(--pill);
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  text-align: center;
  flex: 0 0 auto;
}
.dash-nav-btn.on .dash-nav-badge { background: rgba(255, 255, 255, .22); }

.dash-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px;
  border-radius: var(--r-md);
  background: var(--surface-sub);
  border: 1px solid var(--line);
}
.dash-user-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dash-user-info > div { min-width: 0; }
.dash-user-info > div b { display: block; font-size: var(--fs-md); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-user-info > div span { display: block; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; }

/* ----- Espace de travail ----- */
.dash-workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 18px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.dash-topbar-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.dash-topbar-title {
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-role-badge { display: none; }
@media (min-width: 760px) { .dash-role-badge { display: inline-flex; } }
.dash-topbar-actions { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }

.dash-search {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  height: 40px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--surface-sub);
}
.dash-search svg.i { color: var(--ink-4); }
.dash-search input { border: 0; background: none; min-height: 38px; padding: 0; font-size: var(--fs-md); }
.dash-search input:focus { outline: none; box-shadow: none; }

.dash-date {
  display: none;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-3);
  padding: 8px 14px;
  border-radius: var(--pill);
  background: var(--surface-sub);
  border: 1px solid var(--line);
  white-space: nowrap;
}
@media (min-width: 1100px) { .dash-date { display: block; } }

@media (max-width: 639px) { .dash-topbar { padding: 10px 14px; } }

.dash-mobile-toggle { display: inline-flex; }
@media (min-width: 900px) { .dash-mobile-toggle { display: none; } }

.dash-body { padding: 20px 18px 40px; }
@media (min-width: 900px) { .dash-body { padding: 24px; } }

.dash-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-700) 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.dash-welcome h2 { color: #fff; font-size: var(--fs-2xl); }
.dash-welcome p { color: #bdd0ec; font-size: var(--fs-md); margin-top: 6px; max-width: 58ch; }

/* ----- KPI ----- */
.kpi-grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 18px; }
@media (min-width: 640px)  { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 19px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--line-2); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.kpi-value { font-size: var(--fs-3xl); font-weight: 800; color: var(--brand); letter-spacing: -.035em; line-height: 1.1; }
.kpi-label { font-size: var(--fs-md); font-weight: 600; color: var(--ink-3); margin-top: 3px; }
.kpi-foot { font-size: var(--fs-xs); color: var(--ink-4); font-weight: 600; margin-top: 12px; }
.kpi-card .prog { margin-top: 12px; }

/* ----- Cartes de contenu dashboard ----- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  margin-bottom: 18px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: var(--fs-lg); color: var(--brand); }
.panel-body { padding: 18px; }
.panel-body.flush { padding: 0; }
.panel-body.flush table.t thead th:first-child,
.panel-body.flush table.t td:first-child { padding-left: 18px; }
.panel-body.flush table.t thead th:last-child,
.panel-body.flush table.t td:last-child { padding-right: 18px; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 16px;
  padding: 8px 14px 8px 11px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: var(--surface);
  min-height: 38px;
  transition: all var(--dur) var(--ease);
}
.back-link:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface-sub); }

/* ----- Colonne droite ----- */
.dash-aside {
  display: none;
  flex-direction: column;
  gap: 18px;
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 20px 18px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow-y: auto;
  box-sizing: border-box;
  overscroll-behavior: contain;
}
@media (min-width: 1360px) { .dash-aside { display: flex; } }

/* Défilement indépendant et barres de défilement discrètes */
.dash-sidebar,
.dash-workspace,
.dash-aside {
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.dash-sidebar::-webkit-scrollbar,
.dash-workspace::-webkit-scrollbar,
.dash-aside::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.dash-sidebar::-webkit-scrollbar-track,
.dash-workspace::-webkit-scrollbar-track,
.dash-aside::-webkit-scrollbar-track {
  background: transparent;
}
.dash-sidebar::-webkit-scrollbar-thumb,
.dash-workspace::-webkit-scrollbar-thumb,
.dash-aside::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: var(--pill);
}
.dash-sidebar::-webkit-scrollbar-thumb:hover,
.dash-workspace::-webkit-scrollbar-thumb:hover,
.dash-aside::-webkit-scrollbar-thumb:hover {
  background: var(--ink-4);
}

.aside-title {
  font-size: var(--fs-xs);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--ink-4);
}

.mini-cal {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px;
  background: var(--surface-sub);
}
.mini-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink);
  text-transform: capitalize;
  margin-bottom: 10px;
}
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.cal-head {
  font-size: 10px;
  font-weight: 800;
  color: var(--ink-4);
  padding: 4px 0;
  text-transform: uppercase;
}
.cal-day {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink-2);
  padding: 6px 0;
  border-radius: 7px;
}
.cal-day.pad { color: transparent; }
.cal-day.today { background: var(--accent); color: #fff; font-weight: 800; }

.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  background: var(--surface-sub);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.task-item:hover { background: var(--surface); box-shadow: var(--sh-sm); transform: translateX(2px); }
.task-item.on   { border-left-color: var(--accent); }
.task-item.navy { border-left-color: var(--brand); }
.task-item.ok   { border-left-color: var(--ok); }
.task-item b { display: block; font-size: var(--fs-md); color: var(--ink); }
.task-item span { display: block; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 600; margin-top: 2px; }


/* ========================================================================== */
/*  Pied de page                                                              */
/* ========================================================================== */
.site-footer {
  background: var(--brand-700);
  color: #a9bdd9;
  margin-top: 50px;
  padding-bottom: env(safe-area-inset-bottom);
}

.footer-container { max-width: var(--wrap); margin: 0 auto; padding: 40px 20px 22px; }
.footer-top { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px)  { .footer-top { grid-template-columns: 1.6fr 1fr 1fr; } }
@media (min-width: 1000px) { .footer-top { grid-template-columns: 2fr 1fr 1fr 1fr; } }

.footer-brand .brand { font-size: var(--fs-xl); font-weight: 800; color: #fff; letter-spacing: -.03em; }
.footer-brand .brand span { color: var(--accent); }
.footer-brand p { font-size: var(--fs-md); margin-top: 10px; max-width: 46ch; line-height: 1.6; }
.footer-pay { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; font-size: var(--fs-sm); line-height: 1.6; }
.footer-pay svg.i { margin-top: 2px; }
.footer-pay svg.i { color: var(--ok); }

.footer-col h5 {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 13px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col a, .footer-col button, .footer-col span {
  font-size: var(--fs-md);
  color: #a9bdd9;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color var(--dur) var(--ease);
}
.footer-col a:hover, .footer-col button:hover { color: #fff; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: var(--fs-sm);
}
.footer-bottom-meta { display: flex; gap: 18px; flex-wrap: wrap; }

/* ========================================================================== */
/*  Toast & modale                                                            */
/* ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translate(-50%, 24px);
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 32px);
  padding: 13px 19px;
  border-radius: var(--pill);
  background: var(--brand-700);
  color: #fff;
  font-size: var(--fs-md);
  font-weight: 600;
  box-shadow: var(--sh-xl);
  opacity: 0;
  pointer-events: none;
  transition: all .26s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); }
@media (min-width: 900px) { .toast { bottom: 26px; } }

.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fadeIn .18s var(--ease);
}
@media (min-width: 640px) { .modal-bg { align-items: center; padding: 24px; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--sh-xl);
  animation: slideUp .24s var(--ease);
}
@media (min-width: 640px) {
  .modal { border-radius: var(--r-xl); padding: 26px; }
}
@keyframes slideUp { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-lg);
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.modal h2 svg.i { color: var(--accent); }
.modal h3 { font-size: var(--fs-base); margin: 18px 0 8px; color: var(--brand); }

/* ========================================================================== */
/*  Impression                                                                */
/* ========================================================================== */
@media print {
  .top-announcement, header.top, .site-footer,
  .dash-sidebar, .dash-aside, .dash-topbar, .btnrow, .toast { display: none !important; }
  body { background: #fff; }
  .card, .panel { box-shadow: none; border-color: #ddd; break-inside: avoid; }
}

/* ==========================================================================
   Utilitaires d'espacement, remplacent les anciens styles en ligne
   ========================================================================== */
.mt-xs { margin-top: 6px; }
.right { text-align: right; flex-shrink: 0; }
.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 20px; }
.mb-sm { margin-bottom: 12px; }
.mb-md { margin-bottom: 20px; }

.row-item.bare { border: 0; padding: 0; min-width: 0; }
.qline.bare { border-bottom: 0; padding-bottom: 4px; }
.btnrow.flush { margin: 0; }

/* Éléments masqués par le filtre de recherche */
.ad-card[hidden], tr[hidden], .card[hidden] { display: none !important; }

/* Libellés secondaires des états vides */
.empty span { font-size: var(--fs-md); max-width: 46ch; }

/* ==========================================================================
   Portefeuille ambassadeur
   ========================================================================== */
.balance-card {
  background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-700) 100%);
  border: 0;
  color: #fff;
  text-align: center;
  padding: 30px 22px;
  box-shadow: var(--sh-md);
}
.balance-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #9fb8dd;
}
.balance-value {
  font-size: clamp(38px, 11vw, 52px);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
  margin: 6px 0;
  color: #fff;
}
.balance-sub { font-size: var(--fs-md); color: #a9c0e1; }
.balance-sub b { color: #fff; }
.balance-prog { max-width: 400px; margin: 18px auto 0; }
.balance-prog .prog { background: rgba(255, 255, 255, .18); }
.balance-prog .prog > div { background: linear-gradient(90deg, #fbbf24 0%, var(--accent) 100%); }
.balance-prog .balance-sub { margin-top: 8px; }

.code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.code-pill {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  background: var(--accent-50);
  border: 1.5px dashed var(--accent-100);
  color: var(--accent-700);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: .07em;
}

.pts-up { color: var(--ok-ink); font-variant-numeric: tabular-nums; }
.pts-down { color: var(--bad-ink); font-variant-numeric: tabular-nums; }

table.t .rank-cell { width: 44px; }

/* ==========================================================================
   Bandeau « mode démo » du tableau de bord
   ========================================================================== */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--warn-soft);
  border-color: #fde68a;
}
.demo-banner .row-item-body b { color: var(--warn-ink); }
.demo-banner .row-item-body span { font-size: var(--fs-sm); color: var(--ink-2); }

/* Titre d'onglet d'administration : l'icône suit la taille du titre */
.dash-body .page-head h1 { display: flex; align-items: center; gap: 10px; }
.dash-body .page-head h1 svg.i { color: var(--accent); width: 22px; height: 22px; vertical-align: 0; }

/* ==========================================================================
   Encart d'information en tête de page (rappel, alerte douce, consigne)
   ========================================================================== */
.callout {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 15px 18px;
  margin-bottom: 18px;
}
.callout .row-item-body { flex: 1; min-width: 200px; }
.callout .row-item-body > b { display: block; font-size: var(--fs-md); color: var(--ink); }
.callout .row-item-body > span { display: block; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.55; }
.callout .row-item-body > span b { font-weight: 800; color: var(--ink); }

/* Barres de progression empilées dans la colonne de droite */
.aside-prog { margin-bottom: 12px; }
.aside-prog:last-child { margin-bottom: 0; }

/* Choix du rôle à l'inscription : la carte doit rester lisible et haute */
#roleChoice .typecard { min-height: 108px; padding: 16px 12px; }
#roleChoice .typecard b { font-size: var(--fs-md); }
#roleChoice .typecard .dim { font-size: var(--fs-xs); line-height: 1.4; }

/* ==========================================================================
   Paramètres et paliers
   ========================================================================== */
.setting { margin-bottom: 16px; }
.setting label { margin: 0 0 6px; }
.setting-help {
  font-size: var(--fs-sm);
  color: var(--ink-3);
  margin-top: 5px;
  line-height: 1.5;
}

.tier-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.tier-row input { flex: 1; min-width: 0; }
.tier-sep {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-4);
  flex: 0 0 auto;
}
.tier-row .icon-btn { flex: 0 0 auto; }

.week-picker {
  width: auto;
  min-width: 140px;
  min-height: 38px;
  padding: 7px 36px 7px 13px;
  font-size: var(--fs-md);
  font-weight: 600;
  border-radius: var(--pill);
}

/* Illustration des états vides */
.empty-illus { width: 128px; margin-bottom: 2px; }
.empty-illus svg { width: 100%; height: auto; }
.empty svg.i { width: 26px; height: 26px; }

/* Marche à suivre numérotée dans une modale */
.howto {
  margin: 0 0 14px 18px;
  padding: 0;
  font-size: var(--fs-md);
  color: var(--ink-2);
  line-height: 1.7;
}
.howto li { margin-bottom: 3px; }

/* Aide repliable sous un champ de formulaire */
.helper {
  margin: 10px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-sub);
  padding: 0 14px;
}
.helper summary {
  cursor: pointer;
  padding: 11px 0;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--ink-2);
  list-style: none;
}
.helper summary::-webkit-details-marker { display: none; }
.helper summary::before { content: "+ "; color: var(--accent); font-weight: 800; }
.helper[open] summary::before { content: "– "; }
.helper[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.helper p {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 10px;
}
.helper p:last-child { padding-bottom: 12px; }
.helper code { font-size: 11.5px; word-break: break-all; }

/* Cartes d'options interactives pour la déclaration d'annonce */
.opt-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 18px 0;
}
.opt-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: all var(--dur) var(--ease);
  cursor: pointer;
  user-select: none;
}
.opt-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}
.opt-card.on {
  border-color: var(--accent);
  background: var(--accent-50);
  box-shadow: 0 0 0 2px var(--accent-100);
}
.opt-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.opt-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  background: var(--surface-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  flex-shrink: 0;
  transition: all var(--dur) var(--ease);
}
.opt-card.on .opt-icon {
  background: var(--accent);
  color: #fff;
}
.opt-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.opt-info .opt-title {
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  word-break: break-word;
}
.opt-card.on .opt-info .opt-title {
  color: var(--accent-700);
}
.opt-pricing-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.opt-pricing-line b {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--ink);
}
.opt-card.on .opt-pricing-line b {
  color: var(--accent-700);
}
.opt-pricing-line .opt-mode-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-4);
}
.opt-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--pill);
  font-size: var(--fs-xs);
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
  flex-shrink: 0;
  pointer-events: none; /* Le clic sur la carte gère l'action */
}
.opt-card:hover .opt-action-btn {
  border-color: var(--accent);
  color: var(--accent);
}
.opt-card.on .opt-action-btn {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: var(--sh-sm);
}

/* Carte de certification obligatoire */
.cert-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  margin: 18px 0;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-sub);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  user-select: none;
}
.cert-card:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.cert-card.on {
  border-color: var(--accent);
  background: var(--accent-50);
  box-shadow: 0 0 0 2px var(--accent-100);
}
.cert-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.cert-card-title {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink);
}
.cert-card.on .cert-card-title {
  color: var(--accent-700);
}
.cert-card-desc {
  font-size: var(--fs-xs);
  color: var(--ink-2);
  line-height: 1.5;
}

/* Notification d'installation PWA */
.pwa-prompt {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 460px;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 99999;
  animation: pwaSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pwaSlideUp {
  from { opacity: 0; transform: translate(-50%, 25px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.pwa-prompt-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.pwa-prompt-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: var(--sh-sm);
}
.pwa-prompt-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pwa-prompt-text b {
  font-size: var(--fs-sm);
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pwa-prompt-text span {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.35;
}
.pwa-prompt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pwa-install-btn {
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--pill);
}
.pwa-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--ink-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  background: none;
}
.pwa-close-btn:hover {
  color: var(--ink);
  background: var(--surface-sub);
}

/* Administration des options payantes (superadmin) */
.opt-admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.opt-admin-table th {
  padding: 10px 14px;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.opt-admin-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.opt-admin-table tr:last-child td {
  border-bottom: none;
}
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle-track {
  width: 44px;
  height: 24px;
  background: var(--line-2);
  border-radius: var(--pill);
  position: relative;
  transition: background var(--dur) var(--ease);
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--sh-sm);
  transition: transform var(--dur) var(--ease);
}
.toggle-switch input:checked + .toggle-track {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}
.toggle-label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--ink-2);
}
.toggle-switch input:checked ~ .toggle-label {
  color: var(--accent-700);
}

@keyframes shakeEl {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.shake {
  animation: shakeEl 0.4s ease-in-out;
  border-color: var(--bad) !important;
}

/* Grille de sélection des moyens de paiement Mobile Money */
.paymethod-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 12px 0 16px 0;
}
@media (max-width: 640px) {
  .paymethod-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.paymethod-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 86px;
  padding: 12px 10px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-align: center;
  user-select: none;
}
.paymethod-card:hover {
  border-color: var(--line-2);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}
.paymethod-card.on {
  border-color: var(--accent);
  background: var(--accent-50);
  box-shadow: 0 0 0 2px var(--accent-100);
}
.paymethod-card b {
  font-size: var(--fs-base);
  color: var(--ink);
  font-weight: 700;
}
.paymethod-card.on b {
  color: var(--accent-700);
}
.paymethod-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--pill);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.paymethod-badge.wave   { background: #e0f2fe; color: #0284c7; }
.paymethod-badge.orange { background: #ffedd5; color: #ea580c; }
.paymethod-badge.mtn    { background: #fef08a; color: #a16207; }
.paymethod-badge.moov   { background: #dcfce7; color: #16a34a; }


