/* Design system inspiré de Signitic : fond blanc, violet primaire, boutons noirs,
   cartes arrondies, onglets segmentés. */
* { box-sizing: border-box; }
:root {
  --violet: #7c3aed;
  --violet-dark: #6d28d9;
  --violet-light: #ede9fe;
  --ink: #111318;
  --text: #1f2430;
  --muted: #7b8494;
  --line: #ebebef;
  --bg-soft: #f5f5f6;
  --radius: 12px;
}
body {
  margin: 0;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #fff;
}

/* ---------- Barre supérieure ---------- */
/* L'en-tête garde un fond pleine largeur mais son contenu est aligné sur le même
   conteneur que la page (max-width 1360 + 32px de marge), comme chez Signitic :
   le logo s'aligne avec les titres, les icônes avec le bord droit du contenu. */
.topbar {
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg-soft);
  color: var(--ink);
  padding: 9px max(32px, calc((100% - 1296px) / 2));
}
.brand { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 27px; height: 27px; border-radius: 9px;
  background: #ff5a3c; color: #fff; font-size: 15px;
}
.topbar nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; justify-content: center; }
.topbar nav a {
  color: #2b2f38;
  text-decoration: none;
  padding: 7px 15px;
  border-radius: 999px;
  font-weight: 500;
}
.topbar nav a:hover { background: #ebebee; }
.topbar nav a.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.14); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 999px;
  border: none; background: transparent; cursor: pointer;
  font-size: 17px; color: #2b2f38; text-decoration: none;
}
.icon-btn:hover { background: #ebebee; }
.avatar-me {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.14);
  font-weight: 700; font-size: 13px;
}
.mode { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.mode-sim { background: #f59e0b; color: #442c00; }
.mode-live { background: #22c55e; color: #06331a; }
.banner-sim {
  background: #fff7e6;
  border-bottom: 1px solid #f0d9a8;
  color: #6b4e00;
  padding: 8px max(32px, calc((100% - 1296px) / 2));
  font-size: 13px;
}

/* ---------- Page ---------- */
main { max-width: 1360px; margin: 0 auto; padding: 28px 32px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: 26px; margin: 0; letter-spacing: -.01em; }
.page-actions { display: flex; gap: 10px; }
h2 { font-size: 15px; margin: 0 0 12px; }
.muted { color: var(--muted); }
code {
  background: #eef0f4;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 600;
  padding: 9px 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: #f6f6f8; }
.btn-primary { background: var(--violet); border-color: var(--violet); color: #fff; }
.btn-primary:hover { background: var(--violet-dark); }
.btn-black { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-black:hover { background: #2a2e37; }
.btn-danger { background: #fff0f0; border-color: #e6b3b3; color: #b42323; }
.btn-danger:hover { background: #ffe2e2; }
.btn-small { padding: 5px 11px; font-size: 12.5px; font-weight: 500; }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Onglets ---------- */
.segmented {
  display: flex;
  background: #f1f1f4;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
}
.segmented a, .segmented button {
  flex: 1; text-align: center;
  font: inherit; font-weight: 500;
  padding: 10px;
  border: none; background: transparent;
  border-radius: 9px;
  color: #444; cursor: pointer;
  text-decoration: none;
}
.segmented .active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; color: var(--ink); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; flex-wrap: wrap; }
.tabs a, .tabs button {
  font: inherit; font-weight: 500;
  padding: 8px 14px;
  border: none; background: transparent;
  border-radius: 9px 9px 0 0;
  color: #4c5567; cursor: pointer; text-decoration: none;
}
.tabs .active { background: #f1f1f4; color: var(--ink); font-weight: 600; }

/* ---------- Formulaires « fiche » (libellé + description | champ) ---------- */
.field-row {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f0f3;
  align-items: center;
}
.field-row:last-child { border-bottom: none; }
.field-label { font-weight: 600; color: var(--ink); }
.field-desc { color: var(--muted); font-size: 12.5px; font-weight: 400; margin-top: 3px; }
.field-row input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.field-row select, .field-row textarea { width: 100%; max-width: 640px; }
.field-row > .tag { justify-self: start; align-self: center; width: fit-content; }

input, select, textarea {
  font: inherit;
  padding: 9px 12px;
  border: 1px solid #dcdfe6;
  border-radius: 10px;
  background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #c4b5fd; border-color: var(--violet); }
textarea { width: 100%; font-family: Consolas, monospace; font-size: 12.5px; }
label { display: block; margin-bottom: 12px; font-weight: 600; }
label input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
label select { display: block; margin-top: 5px; font-weight: 400; width: 100%; max-width: 440px; }
label input[type="color"] { margin-top: 5px; }
label.check { display: flex; align-items: center; gap: 8px; }
label.check input { width: auto; display: inline; margin: 0; flex: none; }
label.check .field-desc { display: block; font-weight: 400; }

/* ---------- Cartes / panneaux / tableaux ---------- */
.cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 22px;
  min-width: 170px;
}
.card-num { font-size: 28px; font-weight: 800; color: var(--ink); }
.card-sub { font-size: 15px; font-weight: 400; color: #9aa3b5; }
.card-label { color: var(--muted); }

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid #f0f0f3; vertical-align: middle; }
th { background: #fafafb; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: #6b7386; }
tr:last-child td { border-bottom: none; }
tr.row-click:hover td { background: #fafafb; }

/* ---------- Badges / chips / avatars ---------- */
.tag { padding: 3px 10px; border-radius: 999px; font-size: 12px; }
.tag-ok { background: #f1f1f4; color: #16324a; }
.tag-ko { background: #fee2e2; color: #7f1d1d; }
.tag-sim { background: #fef3c7; color: #713f12; }
.tag-live { background: #dbeafe; color: #1e3a8a; }
.tag-def { background: var(--violet-light); color: #5b21b6; font-weight: 600; }
.tag-btn { font: inherit; font-size: 12px; padding: 4px 11px; border-radius: 999px; border: none; cursor: pointer; }
.tag-btn.tag-ok { background: #f1f1f4; color: #16324a; }
.tag-btn.tag-sim { background: #fef3c7; color: #713f12; }

.chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-weight: 500;
}
.chip.active { background: #f1f1f4; border-color: #e3e3e8; color: var(--ink); font-weight: 600; }
.chip-num { background: #eceef2; border-radius: 7px; padding: 1px 8px; font-size: 12px; }
.chip.active .chip-num { background: var(--violet); color: #fff; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 999px;
  background: #eef0f4; color: #4c5567;
  font-weight: 700; font-size: 12px;
  flex: none;
}
.user-cell { display: flex; align-items: center; gap: 10px; }
.row-inactive td { color: #9aa3b5; }
.row-inactive td a, .row-inactive td strong { color: #6b7280; }

.searchbar {
  display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap;
}
.searchbar input[type="search"] { min-width: 320px; }

/* ---------- Interrupteurs on/off (préférés aux cases à cocher) ---------- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; vertical-align: middle; }
.switch input { opacity: 0; width: 0; height: 0; margin: 0; position: absolute; }
.switch .sl {
  position: absolute; inset: 0;
  background: #d5d7dd; border-radius: 999px;
  transition: background .15s; cursor: pointer;
}
.switch .sl::before {
  content: ""; position: absolute;
  width: 18px; height: 18px; left: 2px; top: 2px;
  background: #fff; border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .15s;
}
.switch input:checked + .sl { background: var(--violet); }
.switch input:checked + .sl::before { transform: translateX(18px); }
.switch input:focus-visible + .sl { outline: 2px solid #c4b5fd; }

/* ---------- Icônes (sprite Lucide local) ---------- */
.ic {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -3.5px; flex: none;
}
.ic-sm { width: 14px; height: 14px; vertical-align: -2.5px; }
.ic-nav { width: 19px; height: 19px; vertical-align: middle; }
.ic-big { width: 46px; height: 46px; color: #c3c8d4; }
.gmark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 7px;
  background: #1a73e8; color: #fff; font-weight: 700; font-size: 13px;
}

.nowrap { white-space: nowrap; }
td .tag, td .tag-btn { white-space: nowrap; }

.flash { padding: 11px 16px; border-radius: 10px; margin-bottom: 16px; }
.flash-ok { background: #dcfce7; color: #14532d; }
.flash-warn { background: #fef3c7; color: #713f12; }

/* ---------- Aperçu signature (carte navigateur) ---------- */
.preview-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.preview-card-head {
  display: flex; align-items: center; justify-content: space-between;
  background: #f5f5f6;
  padding: 9px 14px;
  font-weight: 600; color: #4c5567; font-size: 13px;
}
.dots { display: flex; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 999px; }
.dot-g { background: #22c55e; } .dot-o { background: #f59e0b; } .dot-r { background: #ef4444; }
.preview-card-bar {
  display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.preview-card-bar select { flex: 1; min-width: 140px; }
.preview-frame { width: 100%; height: 380px; border: none; background: #fff; display: block; }
.browser-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--line);
}
.browser-url { flex: 1; height: 26px; background: #f1f1f4; border-radius: 999px; }

/* ---------- Éditeur / grilles ---------- */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.vars code { margin-right: 6px; }

.org-grid { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.org-tree { list-style: none; margin: 0 0 16px; padding: 0; }
.org-tree ul { list-style: none; margin: 4px 0 4px 12px; padding-left: 12px; border-left: 2px solid var(--line); }
.org-item {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
  margin-bottom: 6px;
  background: #fff;
  font-weight: 500;
}
.org-item:hover { background: #f6f6f8; }
.org-item.active { background: var(--violet-light); border-color: #ddd3fb; color: #5b21b6; font-weight: 600; }
.org-new input, .org-new select { width: 100%; margin-bottom: 8px; }

/* ---------- Statistiques ---------- */
.barchart { display: flex; align-items: flex-end; gap: 10px; padding: 8px 4px 0; }
.barcol { flex: 1; text-align: center; }
.bar { background: var(--violet); border-radius: 4px 4px 0 0; min-height: 2px; }
.barval { font-size: 11px; color: var(--muted); height: 16px; }
.barlabel { font-size: 11px; color: #9aa3b5; margin-top: 4px; }
.heatmap { border-collapse: separate; border-spacing: 5px; border: none; width: auto; }
.heatmap th, .heatmap td { border: none; padding: 0; background: none; }
.heatmap th { font-size: 11px; color: var(--muted); text-transform: none; letter-spacing: 0; padding: 0 4px; }
.heat {
  width: 42px; height: 22px; border-radius: 6px; background: #f1eefe;
}
.stats-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }

.campaign-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; align-items: end; }
.campaign-form button { margin-bottom: 12px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .big { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }

.radio-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.radio-row input { width: auto; margin-top: 3px; }
.radio-row .field-desc { margin-top: 2px; }

/* ---------- Calendrier des campagnes ---------- */
.calendar { table-layout: fixed; }
.calendar th { text-align: center; font-size: 11px; }
.calendar td { height: 86px; vertical-align: top; padding: 6px 4px; }
.calendar td.cal-out { background: #f7f7f8; color: #b9bec9; }
/* Hauteur fixe pour que les barres de campagne restent alignées d'une cellule
   à l'autre, même quand la pastille « aujourd'hui » est présente. */
.cal-day { text-align: left; height: 28px; line-height: 26px; font-size: 13px; }
.cal-today {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 999px;
  background: var(--violet); color: #fff; font-weight: 700; line-height: 1;
}
.cal-bar {
  background: #d5d7dd;
  color: #3d434e;
  font-size: 11px;
  padding: 2px 6px;
  margin: 0 -4px 3px;
  overflow: hidden;
  white-space: nowrap;
  min-height: 18px;
}
.cal-bar-start { border-radius: 6px 0 0 6px; margin-left: 2px; }
.cal-bar-end { border-radius: 0 6px 6px 0; margin-right: 2px; }
.cal-bar-start.cal-bar-end { border-radius: 6px; }

/* ---------- Lignes de campagne (vue liste) ---------- */
.camp-row {
  display: flex; align-items: center; gap: 18px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}
.camp-row:last-child { border-bottom: none; }
.camp-visual {
  width: 110px; height: 64px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #f7f7f8; border-radius: 10px; overflow: hidden;
}
.camp-visual img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tag-okgreen { background: #dcfce7; color: #14532d; }
.tag-grey { background: #f1f1f4; color: #4c5567; }

.icon-btn.active-icon { background: #2b2f38; color: #fff; }

/* ---------- Éditeur visuel de modèles ---------- */
.ed-layout { display: grid; grid-template-columns: 74px 1fr; gap: 18px; align-items: start; }
.ed-palette { display: flex; flex-direction: column; gap: 10px; }
.palette-item {
  width: 62px; height: 62px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  cursor: grab; font-weight: 700; color: #2b2f38;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.palette-item:hover { border-color: #c4b5fd; }
.pal-ic { font-size: 18px; }
.ed-canvas-wrap { min-width: 0; }
.ed-canvas {
  border: 1px dashed #c9cdd6; border-radius: 10px;
  padding: 18px; background: #fff; min-height: 260px;
}
.ed-row { display: flex; align-items: stretch; margin-bottom: 4px; }
.ed-col {
  border: 1px dashed #dcdfe6; border-radius: 6px; padding: 4px; min-width: 60px;
  display: flex; flex-direction: column;
}
.ed-frame { transition: width .1s; }
.ed-block {
  border: 1px dashed #cdd2dc; border-radius: 4px;
  cursor: pointer; min-width: 40px; min-height: 24px;
  background: #fff;
}
.ed-block.active { border: 2px solid #7c3aed; }
.ed-block:hover { border-color: #a78bfa; }
.sk-text { color: #333; line-height: 1.45; word-break: break-word; }
.sk-text * { max-width: 100%; }
.sk-box {
  background: #d9d9d9; color: #8a8a8a;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; text-decoration: underline;
}
.sk-round { border-radius: 999px; }
.sk-social { display: flex; gap: 5px; justify-content: center; padding: 4px 0; }
.sk-dot { width: 22px; height: 22px; border-radius: 999px; background: #009c9c; display: inline-block; }
.sk-cta { display: inline-block; padding: 8px 16px; font-weight: 700; font-size: 13px; }
/* Zones de dépôt : invisibles au repos, révélées pendant un glisser (classe
   .dragging sur le canevas) — y compris les gouttières verticales qui créent
   une colonne pour poser deux blocs côte à côte, comme chez Signitic. */
.ed-drop { height: 6px; border-radius: 4px; margin: 1px 0; }
.ed-newcol { width: 8px; border-radius: 4px; margin: 0 1px; }
.ed-newrow { display: none; }
.ed-canvas.dragging .ed-drop {
  height: 18px; background: #f4f0ff; outline: 1px dashed #c4b5fd;
}
.ed-canvas.dragging .ed-newcol {
  width: 30px; background: #f4f0ff; outline: 1px dashed #c4b5fd;
}
.ed-canvas.dragging .ed-newrow {
  display: block;
  margin-top: 10px; padding: 12px; text-align: center;
  background: #f4f0ff;
  border: 1px dashed #c4b5fd; border-radius: 8px; color: #7c5cd6; font-size: 12.5px;
}
.ed-drop.over, .ed-newcol.over, .ed-newrow.over { background: #ede9fe !important; outline: 2px dashed #7c3aed !important; }
/* Panneau latéral fixe pleine hauteur, avec son propre défilement (comme Signitic) :
   il s'ouvre à la sélection d'un bloc et se ferme avec ✕. */
.ed-inspector {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 420px; max-width: 92vw;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -10px 0 30px rgba(0,0,0,.10);
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 80;
  display: none;
}
.ed-inspector.open { display: block; }
.ed-insp-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ed-insp-tabs { margin-bottom: 14px; }
.ed-insp-body { margin-bottom: 14px; }
.ed-insp-body .field-label { margin: 14px 0 6px; }
.ed-insp-body .field-label:first-child { margin-top: 0; }
.ed-insp-body label { font-weight: 600; font-size: 13px; }
.ed-insp-body label input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
.ed-insp-body label select { width: 100%; max-width: none; }
.ed-insp-body .check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; margin-bottom: 9px; }
.ed-insp-body .check input { width: auto; margin-top: 2px; flex: none; }
.ed-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.ed-4col { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 8px; }
.ed-4col label { font-weight: 500; font-size: 12px; }
.ed-btnrow { display: flex; gap: 6px; margin-bottom: 12px; }
.ed-btnrow button {
  flex: 1; font: inherit; font-size: 12.5px; padding: 8px 4px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer;
}
.ed-btnrow button.on { background: #f1f1f4; font-weight: 700; }
.ed-colorrow { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ed-insp-body input[type="color"] { width: 46px; height: 34px; padding: 2px; border-radius: 8px; }
.ed-cond {
  display: block; width: 100%; text-align: left;
  font: inherit; padding: 10px 12px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer;
  color: #6b7280;
}
.ed-cond.on { background: #f4f0ff; border-color: #ddd3fb; color: #5b21b6; }
.ed-cond .field-desc { display: block; margin-top: 3px; }
.ed-check { float: right; color: #7c3aed; font-weight: 700; }
.ed-toolbar {
  display: flex; gap: 4px; align-items: center; flex-wrap: wrap;
  background: #f5f5f6; border-radius: 8px; padding: 6px; margin-bottom: 8px;
}
.ed-toolbar button {
  font: inherit; width: 30px; height: 30px;
  border: none; border-radius: 6px; background: transparent; cursor: pointer;
}
.ed-toolbar button:hover { background: #e7e7ea; }
.ed-toolbar select { padding: 4px 6px; font-size: 12.5px; }
.ed-toolbar input[type="color"] { width: 30px; height: 30px; padding: 2px; border-radius: 6px; }
.ed-rte {
  border: 1px solid #dcdfe6; border-radius: 8px; padding: 10px;
  min-height: 140px; font-family: Arial, sans-serif; color: #333;
}
.ed-rte:focus { outline: 2px solid #c4b5fd; }
.ed-source { width: 100%; margin-top: 6px; }
.asg-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 10px;
  font-weight: 500; cursor: pointer;
}
.asg-row input { width: auto; }
.asg-child { margin-left: 40px; }

/* ---------- Gestion des modèles ---------- */
.tpl-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.tpl-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px;
}
.tpl-thumb {
  border: 1px solid var(--line); border-radius: 10px;
  height: 220px; overflow: hidden; background: #fff;
}
.tpl-thumb iframe {
  width: 143%; height: 315px; border: none;
  transform: scale(0.7); transform-origin: top left;
  pointer-events: none;
}
.split-btn { display: inline-flex; align-items: stretch; }
.split-btn > .btn:first-child { border-radius: 10px 0 0 10px; border-right: none; }
.split-btn details { display: inline-flex; }
.split-btn summary.split-caret {
  display: inline-flex; align-items: center;
  height: 100%;
  border-radius: 0 10px 10px 0;
  border-left: 1px solid #3a3f4a;
  padding: 9px 11px;
}
@media (max-width: 950px) { .tpl-cards { grid-template-columns: 1fr; } }

/* ---------- Console d'urgence (menu ⟳) ---------- */
.sync-menu { position: relative; }
.sync-menu summary { list-style: none; cursor: pointer; }
.sync-menu summary::-webkit-details-marker { display: none; }
.sync-dropdown {
  position: absolute; right: 0; top: 42px; z-index: 50;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 260px; padding: 8px;
}
.sync-title { font-weight: 700; padding: 6px 10px 8px; color: var(--ink); }
.sync-item {
  display: block; width: 100%; text-align: left;
  font: inherit; padding: 9px 10px;
  border: none; background: transparent; border-radius: 8px;
  color: var(--text); cursor: pointer; text-decoration: none;
}
.sync-item:hover { background: #f3f4f7; }

/* Menu de synchronisation manuelle (présentation façon Signitic) */
.sync-dropdown-lg { min-width: 400px; padding: 14px; }
.sync-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 2px 4px 10px; }
.sync-head .sync-title { padding: 0; font-size: 15px; }
.sync-desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.sync-history-link {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  color: var(--muted); font-size: 12.5px; text-decoration: none; padding-top: 2px;
}
.sync-history-link:hover { color: var(--violet); }
.sync-line {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-top: 1px solid var(--line);
}
.sync-line-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 999px;
  background: #f3f4f7; color: var(--ink);
}
.sync-line-txt { flex: 1; min-width: 0; }
.sync-line-title { font-weight: 600; color: var(--ink); }
.sync-line-sub { font-size: 12px; color: var(--muted); }
.sync-btn { white-space: nowrap; }
.sync-btn-active, .sync-btn-active:hover {
  background: #dcfce7; border-color: #a7e8bf; color: #14532d; cursor: default;
}

/* ---------- Menu compte (avatar) ---------- */
.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-dropdown {
  position: absolute; right: 0; top: 46px; z-index: 50;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 230px; padding: 8px;
}
.account-head { padding: 6px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.account-name { font-weight: 700; color: var(--ink); }
.account-mail { font-size: 12px; color: var(--muted); }

/* ---------- Pages d'authentification (login / setup) ---------- */
.auth-body { background: var(--bg-soft); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 380px; background: #fff;
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,.08); padding: 30px 28px;
}
.auth-brand { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 700; color: var(--ink); }
.auth-sub { color: var(--muted); margin: 8px 0 20px; }
.auth-label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.auth-label input { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
.auth-error { background: #fee2e2; color: #7f1d1d; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; }
.auth-notice { background: #dcfce7; color: #14532d; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; }

@media (max-width: 950px) {
  .editor-grid, .campaign-form, .org-grid, .stats-grid { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; gap: 6px; }
  .topbar nav { justify-content: flex-start; }
  .calendar td { height: 56px; }
}
