/* Psynapse Mail — application (M1) — charte bleue, façon Brevo */
:root {
  --brand: #0A4D8F;
  --brand-dark: #0A3A6B;
  --side-bg: #F5F7FA;
  --side-active: #E6F0FF;
  --side-active-text: #0B5CAD;
  --ink: #16181D;
  --muted: #6B7280;
  --border: #E3E8EE;
  --border-soft: #EFF2F6;
  --bg: #F6F8FB;
  --indigo: #0B6BCB;
  --lav: #E6F0FF;
  --navy: #0A2540;
  --blue: #2A6FF0;
  --ok: #22A06B;
  --warn: #E4571F;
  --err: #DC2626;
  --gold: #E8B93B;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter','Segoe UI',system-ui,sans-serif; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; }
.hidden { display: none !important; }

/* ===== Sidebar ===== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 248px; background: var(--side-bg); border-right: 1px solid var(--border); padding: 14px 12px; display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 9px; padding: 6px 10px 14px; }
.brand .blogo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 800; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.brand .bname { font-weight: 800; font-size: 18px; color: var(--brand); }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #1F2937; cursor: pointer; font-weight: 600; font-size: 13.5px; user-select: none; margin-bottom: 2px; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: rgba(10,77,143,.07); }
.nav-item.active { background: var(--side-active); color: var(--side-active-text); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand); }
.nav-sep { height: 1px; background: rgba(10,77,143,.14); margin: 10px 8px; }

/* ===== Header ===== */
.topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 13px 26px; display: flex; align-items: center; gap: 14px; }
.topbar h1 { font-size: 19px; font-weight: 700; flex: 1; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 600; }

/* ===== Boutons ===== */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: filter .12s, background .12s; }
.btn svg { width: 15px; height: 15px; }
.btn-dark { background: #0A2540; color: #fff; }
.btn-dark:hover { filter: brightness(1.3); }
.btn-brand { background: var(--brand); color: #fff; }
.btn-brand:hover { filter: brightness(1.15); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--border); }
.btn-ghost:hover { background: #F3F4F6; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== Vue ===== */
.view { display: none; }
.view.active { display: block; animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.page-body { padding: 22px 26px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; padding: 18px 26px 0; }
.page-head h2 { font-size: 19px; font-weight: 800; color: #0F172A; flex: 1; }

/* ===== Table ===== */
.tbl-wrap { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin: 14px 26px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #101828; font-weight: 800; padding: 11px 14px; border-bottom: 2px solid var(--border); background: #F8FAFC; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); font-size: 13px; color: #1F2937; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFBFD; }
.td-actions { display: flex; gap: 6px; }
.ico-sm { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); cursor: pointer; }
.ico-sm:hover { background: #F3F4F6; color: var(--ink); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.badge.green { background: #E6F5EE; color: #0A6B4F; }
.badge.gray { background: #EEF0F3; color: #374151; }
.badge.amber { background: #FDF1E1; color: #B45309; }
.badge.blue { background: #E6F0FF; color: #0B5CAD; }
.badge.red { background: #FDECEA; color: #B42318; }
.info-i { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 7px; border-radius: 50%; background: #E6F0FF; color: #0B5CAD; font-size: 11px; font-weight: 700; cursor: help; vertical-align: middle; user-select: none; }
.info-i:hover { background: #0B5CAD; color: #fff; }

.filterbar { display: flex; align-items: center; gap: 12px; padding: 16px 26px 0; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; width: 300px; }
.search input { border: none; outline: none; flex: 1; font-size: 13px; background: transparent; }
.select-pill { display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 500; cursor: pointer; }
.pager { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.pager .pbtn { width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; color: var(--muted); }
.pager .pbtn:disabled { opacity: .4; cursor: default; }

.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ===== Modales ===== */
.mask { position: fixed; inset: 0; background: rgba(10,16,28,.5); display: none; align-items: center; justify-content: center; z-index: 60; }
.mask.open { display: flex; }
.modal { background: #fff; border-radius: 16px; width: 520px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.modal.lg { width: 1000px; }
.modal-head { padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.x-btn { border: none; background: transparent; font-size: 17px; color: var(--muted); cursor: pointer; width: 30px; height: 30px; border-radius: 8px; }
.x-btn:hover { background: #F3F4F6; }

/* ===== Formulaires ===== */
.fld { margin-bottom: 14px; }
.fld label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 5px; color: #374151; }
.fld input, .fld select, .fld textarea { width: 100%; border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; font-size: 13.5px; font-family: inherit; }
.fld input:focus, .fld select:focus, .fld textarea:focus { outline: 2px solid var(--blue); outline-offset: -1px; }
.fld-row { display: flex; gap: 12px; }
.fld-row .fld { flex: 1; }
.fld .hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ===== Indicateur de chargement ===== */
#chargement { position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
  background: linear-gradient(90deg, transparent, var(--indigo), var(--indigo), transparent);
  background-size: 40% 100%; background-repeat: no-repeat; }
#chargement.on { opacity: 1; animation: chargement-defile 1.1s linear infinite; }
@keyframes chargement-defile { from { background-position: -40% 0; } to { background-position: 140% 0; } }
/* petite roue pour les boutons qui travaillent */
.charge { pointer-events: none; opacity: .85; }
.charge::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 8px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%;
  animation: tourne .8s linear infinite; vertical-align: -1px; }
.btn-ghost.charge::before { border-color: rgba(0,0,0,.15); border-top-color: var(--indigo); }
@keyframes tourne { to { transform: rotate(360deg); } }

.camp-nom-input { font-size: 14px; font-weight: 700; padding: 2px 6px; border: 1px solid var(--indigo); border-radius: 6px; width: 100%; font-family: inherit; }
/* ===== Toast ===== */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); background: #101828; color: #fff; padding: 11px 20px; border-radius: 10px; font-size: 13.5px; font-weight: 500; z-index: 90; box-shadow: 0 10px 30px rgba(0,0,0,.25); display: none; }
.toast.show { display: block; animation: fade .2s; }
.toast.err { background: #7F1D1D; }

/* ===== Œil « voir le mot de passe » ===== */
.champ-secret { position: relative; display: block; }
.champ-secret > input { padding-right: 42px; }
.champ-secret .oeil { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border: none; border-radius: 7px; background: none;
  color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; }
.champ-secret .oeil:hover { background: #F3F4F6; color: #111827; }
.champ-secret .oeil[aria-pressed="true"] { color: var(--blue, #1D4ED8); }

/* ===== Dashboard widgets ===== */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.kpi .k { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.kpi .v { font-size: 26px; font-weight: 800; margin-top: 4px; color: var(--brand-dark); }
.greet { font-size: 22px; font-weight: 800; margin-bottom: 2px; }
.greet-sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

/* ===== Import CSV ===== */
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.step { flex: 1; padding: 8px 12px; border-radius: 9px; background: #EEF0F3; color: var(--muted); font-size: 12px; font-weight: 600; text-align: center; }
.step.on { background: var(--lav); color: var(--indigo); }
.dropzone { border: 2px dashed #B9C8F0; border-radius: 12px; padding: 34px; text-align: center; color: var(--indigo); font-weight: 600; cursor: pointer; margin-bottom: 14px; transition: background .15s, border-color .15s; }
.dropzone.over { border-color: var(--indigo); background: #F2F6FF; }
.map-row { display: grid; grid-template-columns: 1fr 30px 1fr; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border-soft); font-size: 12.5px; }
.rapport { display: flex; gap: 14px; margin-top: 14px; }
.rstat { flex: 1; border-radius: 10px; padding: 12px; text-align: center; }
.rstat .n { font-size: 22px; font-weight: 800; }
.rstat .l { font-size: 11.5px; color: var(--muted); }

/* ===== Éditeur email ===== */
.ed-shell { display: flex; flex-direction: column; height: 100vh; }
.ed-top { background: #fff; border-bottom: 1px solid var(--border); padding: 10px 18px; display: flex; align-items: center; gap: 14px; }
.ed-top .blogo-sm { width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ed-title { font-weight: 600; font-size: 13.5px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-save { display: inline-flex; align-items: center; gap: 6px; color: #2B7FFF; font-size: 12.5px; font-weight: 600; }
.ed-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.device-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.device-toggle button { border: none; background: #fff; padding: 7px 10px; color: var(--muted); cursor: pointer; display: inline-flex; }
.device-toggle button + button { border-left: 1px solid var(--border); }
.device-toggle button.on { background: #EEF2F7; color: var(--ink); }
.ed-body { flex: 1; display: flex; min-height: 0; }
.ed-rail { width: 64px; background: #F9FAFB; border-right: 1px solid var(--border); padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail-btn { width: 54px; padding: 9px 0; border-radius: 10px; border: none; background: transparent; color: #6B7280; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; }
.rail-btn svg { width: 19px; height: 19px; }
.rail-btn.on { background: var(--lav); color: var(--indigo); }
.ed-panel { width: 296px; background: #fff; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; }
.panel-tabs { display: flex; gap: 18px; padding: 14px 18px 0; border-bottom: 1px solid var(--border-soft); }
.panel-tab { padding: 8px 2px 10px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; }
.panel-tab.on { color: var(--indigo); border-bottom-color: var(--indigo); }
.blocks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px 18px; }
.block-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 6px 9px; display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: grab; background: #fff; transition: border-color .12s, box-shadow .12s; }
.block-card:hover { border-color: var(--indigo); box-shadow: 0 3px 10px rgba(11,107,203,.12); }
.block-card:active { cursor: grabbing; }
.block-card svg { width: 22px; height: 22px; color: var(--brand); }
.block-card .bl { font-size: 11px; color: var(--ink); text-align: center; line-height: 1.25; }
.grip6 { display: grid; grid-template-columns: repeat(3, 3px); gap: 2px; align-self: flex-end; }
.grip-d { width: 2.5px; height: 2.5px; border-radius: 50%; background: #C7CBD3; }
/* ===== Panneau de réglages du bloc — présentation identique à Brevo ===== */
/* ===== Barre d'outils de texte (rangée horizontale au-dessus du mail, comme Brevo) ===== */
.txt-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: 6px;
  flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; background: #fff; border: 1px solid #E5E7EB;
  border-radius: 8px; padding: 6px 10px; margin: 0 auto 14px; width: 100%; max-width: 100%;
  box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.txt-bar::-webkit-scrollbar { height: 4px; }
.txt-bar::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 2px; }
.txt-bar.hidden { display: none; }
.txt-bar .tb-lbl { font-size: 11.5px; color: #6B7280; font-weight: 600; }
.txt-bar .tb-sel { height: 32px; border: 1px solid #E5E7EB; border-radius: 6px; background: #fff;
  font-size: 11.5px; color: #111827; padding: 0 18px 0 7px; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 5px center; background-size: 13px; }
.txt-bar .tb-sel.tb-sm { padding-right: 17px; }
#tb-style { width: 82px; } #tb-police { width: 80px; } #tb-taille { width: 46px; }
#tb-align { width: 62px; } #tb-case { width: 64px; }
.txt-bar .tb-btn { width: 32px; height: 32px; border: 1px solid transparent; border-radius: 6px; background: none;
  color: #4B5563; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; position: relative; }
.txt-bar .tb-btn:hover { background: #F3F4F6; border-color: #E5E7EB; }
.txt-bar .tb-btn svg { width: 17px; height: 17px; }
.txt-bar .tb-btn.tb-color b { font-size: 13px; font-weight: 800; color: #111827; line-height: 1; }
.txt-bar .tb-btn.tb-color i { position: absolute; left: 6px; right: 6px; bottom: 4px; height: 3px; border-radius: 2px; background: #111827; }
.txt-bar .tb-btn.tb-color i.sur { background: #FFF3C4; }
.txt-bar .tb-hidden-color { width: 0; height: 0; opacity: 0; position: absolute; pointer-events: none; }
.txt-bar .tb-sep { width: 1px; height: 16px; background: #E5E7EB; margin: 0 1px; }

.ed-panel-r { width: 0; flex-shrink: 0; border-left: 1px solid var(--border); background: #fff;
  overflow-y: auto; display: none; }
.ed-panel-r.on { display: block; width: 340px; }
.pan-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid #E5E7EB; }
.pan-head > svg { width: 18px; height: 18px; color: #4B5563; flex-shrink: 0; }
.pan-head .t { font-size: 15px; font-weight: 700; color: #111827; flex: 1; }
.pan-x { border: none; background: none; width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; color: #6B7280; cursor: pointer; line-height: 0; }
.pan-x:hover { background: #F3F4F6; color: #111827; }
.pan-x svg { width: 17px; height: 17px; }
.ed-panel-r .sec { padding: 14px 18px; border-bottom: 1px solid #E5E7EB; }
.ed-panel-r .sec:last-child { padding-bottom: 44px; }
.ed-panel-r .sec h4 { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: #111827;
  text-transform: none; letter-spacing: 0; border: none; padding: 0; }
.ed-panel-r .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; min-height: 32px; }
.ed-panel-r .row:last-child { margin-bottom: 0; }
.ed-panel-r .row.off { opacity: .45; pointer-events: none; }
.ed-panel-r .row .lab { font-size: 13px; color: #4B5563; display: inline-flex; align-items: center; gap: 5px; }
.ed-panel-r .aide { color: #9CA3AF; cursor: help; line-height: 0; }
.ed-panel-r .aide svg { width: 13px; height: 13px; }
.ed-panel-r .hint { font-size: 12px; color: #6B7280; line-height: 1.45; margin: 0 0 12px; }
.ed-panel-r .sel, .ed-panel-r .txt, .ed-panel-r .nu { height: 34px; border: 1px solid #D1D5DB; border-radius: 6px;
  background: #fff; font-size: 13px; color: #111827; }
.ed-panel-r .sel { padding: 0 26px 0 9px; min-width: 108px;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 14px; }
.ed-panel-r .txt { padding: 0 9px; width: 150px; }
.ed-panel-r .nu { display: inline-flex; align-items: center; overflow: hidden; width: 78px; }
.ed-panel-r .nu input { width: 100%; border: none; outline: none; padding: 0 4px 0 9px; font-size: 13px; color: #111827; background: transparent; }
.ed-panel-r .nu .un { font-size: 12px; color: #6B7280; padding-right: 8px; }
.ed-panel-r .nu .ic { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  flex: 0 0 32px; padding: 0; border: 0; background: transparent; color: #9CA3AF; cursor: pointer; border-radius: 8px; }
.ed-panel-r .nu .ic:hover { background: #EEF2F7; color: #0A4D8F; }
.ed-panel-r .nu .ic:focus-visible { outline: 2px solid #0A4D8F; outline-offset: 1px; }
.nu-pair { flex-wrap: wrap; }
.nu-pair.cotes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%;
  border-left: 2px solid #BFD7F0; padding-left: 8px; }
.nu-pair.cotes .nu { width: 100%; min-width: 0; }
.tags-ico:hover { background: #EEF2F7; border-color: #D1D5DB; color: #0A4D8F; }
.ed-panel-r .nu .ic svg { width: 14px; height: 14px; }
.ed-panel-r .nu-pair { display: inline-flex; gap: 8px; }
.ed-panel-r .pill { width: 32px; height: 32px; padding: 0; border: 1px solid #D1D5DB; border-radius: 6px; background: #fff; cursor: pointer; }
.ed-panel-r .pill::-webkit-color-swatch-wrapper { padding: 2px; }
.ed-panel-r .pill::-webkit-color-swatch { border: none; border-radius: 4px; }
.ed-panel-r .seg-bts { display: inline-flex; border: 1px solid #D1D5DB; border-radius: 6px; overflow: hidden; }
.ed-panel-r .seg-bts button { width: 34px; height: 32px; border: none; background: #fff; color: #6B7280;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-right: 1px solid #E5E7EB; }
.ed-panel-r .seg-bts button:last-child { border-right: none; }
.ed-panel-r .seg-bts button svg {width: 17px; height: 17px; }
.ed-panel-r .seg-bts button:hover { background: #F9FAFB; }
.ed-panel-r .seg-bts button.on { background: #EEF4FB; color: #0A4D8F; }
.ed-panel-r .switch { position: relative; display: inline-flex; width: 40px; height: 22px; }
.ed-panel-r .switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ed-panel-r .switch span { position: absolute; inset: 0; background: #D1D5DB; border-radius: 22px; transition: background .14s; pointer-events: none; }
.ed-panel-r .switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  background: #fff; border-radius: 50%; transition: transform .14s; }
.ed-panel-r .switch input:checked + span { background: #0A4D8F; }
.ed-panel-r .switch input:checked + span::after { transform: translateX(18px); }
.ed-panel-r .btn-lite { height: 32px; padding: 0 12px; border: 1px solid #D1D5DB; border-radius: 6px; background: #fff;
  font-size: 13px; color: #374151; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.ed-panel-r .btn-lite:hover { background: #F9FAFB; border-color: #9CA3AF; }
.ed-panel-r .btn-lite svg { width: 14px; height: 14px; }
.ed-panel-r .tags-ico { font-size: 12px; font-weight: 700; color: #6B7280; border: 1px solid #E5E7EB;
  border-radius: 6px; padding: 0 10px; min-height: 32px; display: inline-flex; align-items: center; background: #F9FAFB; cursor: pointer; }
.ed-panel-r .codearea { width: 100%; border: 1px solid #D1D5DB; border-radius: 6px; font-size: 12px;
  font-family: ui-monospace, Consolas, monospace; padding: 8px; color: #111827; }
.ed-canvas { flex: 1; background: #F3F4F6; overflow-y: auto; padding: 26px 20px 90px; display: flex; justify-content: flex-start; flex-direction: column; align-items: center; }
.email-sheet { box-shadow: 0 1px 3px rgba(16,24,40,.12), 0 8px 24px rgba(16,24,40,.08); }
.email-sheet b, .email-sheet strong { font-weight: 800; }
.email-sheet h1, .email-sheet h2, .email-sheet h3, .ed-h { font-weight: 800; color: #0F172A; }
/* Lisibilité générale UI : <b> dans l'interface = sombre */
.view b, .view strong, .card b, td b { color: #0F172A; font-weight: 700; }

/* La feuille doit être centrée dans son espace : `align-self: flex-start` la collait
   à gauche du canevas, ce qui la décalait vers la gauche et gênait la composition. */
.email-sheet { width: 620px; background: #fff; border-radius: 4px; min-height: 400px; box-shadow: 0 18px 60px rgba(0,0,0,.4); align-self: center; transition: width .2s; }
.email-sheet.mobile { width: 375px; }
.ed-block { position: relative; padding: 18px 26px; }
.ed-block.selected { outline: 2px solid var(--blue); outline-offset: -2px; }
.ed-block .handle { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 6px; background: #fff; border: 1px solid var(--border); display: none; align-items: center; justify-content: center; cursor: grab; z-index: 6; color: #9CA3AF; }
.ed-block.selected .handle, .ed-block:hover .handle { display: flex; }
/* La barre d'outils du bloc se pose dans la marge, en colonne le long du bloc, comme chez
   Brevo : une rangée horizontale était trop large pour la marge et finissait par recouvrir le
   texte, ce qui gênait la lecture. En colonne elle ne fait que la largeur d'un bouton, donc
   elle tient toujours dans la marge, à gauche du bloc.
   Sans marge du tout (mail en pleine largeur), le JavaScript la ramène à l'intérieur du bloc. */
.block-float { position: absolute; right: 100%; margin-right: 8px; top: 0; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.14); display: none; flex-direction: column; align-items: center; gap: 2px; padding: 5px 4px; z-index: 7; white-space: nowrap; }
.block-float.bf-droite { right: auto; left: 100%; margin-right: 0; margin-left: 8px; }
/* Faute de marge, la barre revient à l'intérieur du bloc, en haut à droite, en rangée. */
.block-float.bf-dedans { right: 4px; margin: 0; top: 4px; flex-direction: row; padding: 4px 5px; gap: 3px; }
/* en colonne, le libellé du bouton IA ne tient pas : l'icône violette suffit, avec son infobulle */
.block-float .ai span { display: none; }
.block-float.bf-dedans .ai span { display: inline; }
.ed-block.selected .block-float, .ed-block:hover .block-float { display: flex; }
/* plus de placement particulier pour le dernier bloc : la barre vit dans la marge */
/* plus de placement particulier pour le dernier bloc : la barre vit dans la marge */
.float-btn { border: none; background: transparent; width: 36px; height: 36px; border-radius: 7px; display: inline-flex;
  align-items: center; justify-content: center; color: #1F2937; cursor: pointer; font-size: 12.5px; font-weight: 700; }
.float-btn svg { width: 19px; height: 19px; display: block; }
.float-btn.dup svg { width: 20px; height: 20px; stroke-width: 2.2; }
.float-btn:hover { background: #EEF2F6; color: #0F172A; }
.float-btn:active { background: #E1E7EF; }
.float-btn.ai { gap: 6px; color: #5B21B6; width: auto; padding: 0 11px; font-weight: 800; letter-spacing: .1px; }
.float-btn.ai:hover { background: #F3EEFF; color: #4C1D95; }
.float-btn.ai svg { stroke: #6D28D9; }
.float-btn.danger { color: #B42318; }
.float-btn.danger:hover { background: #FEF3F2; color: #912018; }
.float-sep { width: 17px; height: 1px; background: #E5E7EB; margin: 3px 0; }
.block-float.bf-dedans .float-sep { width: 1px; height: 17px; margin: 0 3px; }
.float-btn[title] { position: relative; }

/* ===== Fenetre Utiliser l'IA ===== */
#mask-ia .modal { max-height: 88vh; overflow: auto; }
#mask-ia textarea { width: 100%; border: 1px solid #D0D5DD; border-radius: 8px; padding: 9px 11px;
  font-size: 13.5px; font-family: inherit; color: #101828; line-height: 1.5; resize: vertical; }
#mask-ia textarea:focus { outline: none; border-color: #6D28D9; box-shadow: 0 0 0 3px rgba(109,40,217,.12); }
#mask-ia .fld label { font-size: 13px; font-weight: 700; color: #101828; margin-bottom: 5px; display: block; }
#ia-resultat { background: #FCFCFD; }
#ia-modele-info { flex: 1; text-align: right; }
.ed-h { font-size: 20px; font-weight: 700; }
.ed-text { font-size: 14px; line-height: 1.6; color: #23272E; }
.ed-h[contenteditable]:focus, .ed-text[contenteditable]:focus, .ed-btn-inline[contenteditable]:focus { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }
.var { background: #FFF3B0; padding: 0 3px; border-radius: 3px; }
/* Un import de Brevo peut livrer un <span class="var"> qui enveloppe des paragraphes entiers. Un
   element en ligne autour de blocs se coupe en morceaux : il ne restait que deux traits jaunes
   verticaux, en haut et en bas du bloc. Une variable n'est surlignée que si elle ne contient rien
   d'autre que son texte. */
.var:has(p, div, ul, ol, table, h1, h2, h3, br) { background: transparent; padding: 0; }
.var:empty { display: none; }
.ed-img-empty { border: 2px dashed #93B4F5; border-radius: 8px; min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: #3B5FC7; font-weight: 600; font-size: 13px; background: #F8FAFF; }
.ed-img-empty .pick { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ed-img-empty img { max-width: 100%; display: block; }
/* Un espace vide ne doit pas avoir de couleur à lui : il est transparent et laisse
   voir le fond du mail, exactement comme chez Brevo où deux espaces séparent un bouton
   en prenant la couleur de l'arrière-plan. Le motif de repérage qui le grisait est retiré :
   il masquait cette couleur. On le repère par un contour qui n'apparaît qu'au survol. */
#email-sheet .pm-spacer { background: transparent; border-radius: 4px; }
/* Le repère de l'espace vide est un simple contour : il ne remplit rien, donc il ne masque
   pas la couleur du fond, et il permet de cliquer sur l'espace pour le sélectionner ou
   l'attraper. Au survol et à la sélection, il s'assombrit. */
#email-sheet .ed-block[data-btype="espaceur"] .pm-spacer { outline: 1px dashed rgba(156,163,175,.5); outline-offset: -1px; }
#email-sheet .ed-block[data-btype="espaceur"]:hover .pm-spacer,
#email-sheet .ed-block[data-btype="espaceur"].selected .pm-spacer { outline-color: #6B7280; outline-style: solid; }
.ed-btn-inline { display: inline-block; background: #101828; color: #fff; padding: 11px 26px; border-radius: 8px; font-weight: 600; font-size: 13.5px; }
.drop-active { outline: 2px dashed var(--blue); outline-offset: -4px; }

/* Bibliothèque images */
.lib-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.lib-item { border: 1.5px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; }
.lib-item:hover { border-color: var(--indigo); }
.lib-item.sel { border: 3px solid var(--indigo); }
.lib-thumb { height: 82px; background: #F3F4F6 center/cover no-repeat; display: flex; align-items: center; justify-content: center; }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; }
.lib-name { font-size: 10px; color: var(--muted); padding: 5px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-drop { border: 2px dashed #B9C8F0; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--indigo); font-weight: 600; font-size: 12px; cursor: pointer; min-height: 96px; text-align: center; padding: 8px; }

/* Style global : pleine largeur mobile */
.email-sheet.full-mob { max-width: 100% !important; }
.editor-canvas.full-mob-canvas .email-sheet { max-width: 100% !important; }

/* ===== Campagnes : mise en page dense façon Brevo ===== */
.filter-bar { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; margin: 14px 26px 0; padding: 10px 14px; }
.filter-input { flex: 1; border: 1px solid var(--border); border-radius: 9px; padding: 8px 12px; font-size: 13px; min-width: 0; }
.filter-select { border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-size: 13px; background: #fff; }
.filter-count { font-size: 12.5px; color: #5A6870; font-weight: 600; white-space: nowrap; }
.btn-dark { background: #0F172A; color: #fff; border: 1px solid #0F172A; font-weight: 700; }
.btn-dark:hover { background: #1E293B; }
.tbl-campagnes td { vertical-align: middle; padding: 14px; }
.tbl-campagnes th.num, .tbl-campagnes td.num { text-align: right; }
.cell-camp { min-width: 260px; }
.camp-nom { font-weight: 700; color: #101828; font-size: 13.5px; }
.camp-meta { font-size: 12px; color: #5A6870; margin-top: 3px; }
/* objet et préheader du mailing, sous son nom dans la liste */
.camp-objet, .camp-pre { font-size: 11.5px; color: #6B7280; margin-top: 2px; max-width: 460px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camp-pre { color: #98A2B3; }
.camp-nom + .camp-meta b { color: #6B7280; font-weight: 600; }
.pt { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.tbl-campagnes td.num b { display: block; font-size: 14px; color: #101828; }
.tbl-campagnes td.num .pc { font-size: 11.5px; color: #6B7280; }
.tbl-campagnes input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--brand); }
.ed-panel-r .sec-title, .ed-panel .sec-title,
.ed-panel-r [class*="sec"] > .t, .ed-panel-r h4 {
  font-size: 12px !important; font-weight: 800 !important; color: #101828 !important;
  text-transform: uppercase; letter-spacing: .03em; margin: 0 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border); }
.set-sub { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #667085; margin: 16px 0 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.ico-sm svg { width: 15px; height: 15px; display: block; }
.btn .bi { width: 15px; height: 15px; }
.tag-list { display: inline-block; background: #EEF4FB; color: #0A4D8F; border-radius: 6px;
  padding: 2px 8px; font-size: 11.5px; font-weight: 700; }
.tbl-wrap table td.num { text-align: right; }
.ico-sm { color: #475467; }
.ico-sm:hover { color: var(--brand); background: #EEF4FB; }
.bulk-bar { display: flex; align-items: center; gap: 10px; background: #EEF4FB; border: 1px solid #C7DCF5;
  border-radius: 10px; margin: 10px 26px 0; padding: 8px 14px; font-size: 12.5px; font-weight: 700; color: #0A4D8F; }
.btn.ghost-danger, .btn.danger { color: #B42318; border-color: #F3C9C4; }
.kebab-menu { position: absolute; z-index: 300; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 34px rgba(15,23,42,.18); padding: 6px; min-width: 210px; }
.kebab-menu button { display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 9px 12px; font-size: 13px; color: #1F2937; border-radius: 7px; cursor: pointer; font-weight: 600; }
.kebab-menu button:hover { background: #F1F5F9; }
.kebab-menu button.danger { color: #B42318; }

/* Panneau réglages détaillé (façon Brevo) */
.set-title { font-weight: 800; font-size: 12.5px; margin-bottom: 8px; color: #0F172A; letter-spacing: .1px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; }
.set-row label { font-size: 12px; color: #1F2937; font-weight: 700; }
.set-row .num-with-unit { display: inline-flex; align-items: center; gap: 5px; }
.set-row .num-with-unit input { width: 64px; border: 1px solid var(--border); border-radius: 7px; padding: 5px 7px; font-size: 12px; text-align: right; }
.set-row .num-with-unit .u { font-size: 11px; color: var(--muted); }
.set-row .cs-in { width: 34px; height: 26px; padding: 2px; border: 1px solid var(--border); border-radius: 7px; cursor: pointer; background: #fff; }
.set-row .cs-sel { border: 1px solid var(--border); border-radius: 7px; padding: 5px 7px; font-size: 12px; max-width: 150px; }
.set-row .cs-txt { flex: 1; border: 1px solid var(--border); border-radius: 7px; padding: 6px 9px; font-size: 12px; min-width: 0; }
.set-row input[type=number].cs-txt, .set-row input[type=text].cs-txt { width: auto; }
.seg-bts { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-bts button { border: none; background: #fff; padding: 5px 9px; font-size: 12px; cursor: pointer; color: #4B5563; }
.seg-bts button + button { border-left: 1px solid var(--border); }
.seg-bts button.on { background: var(--lav); color: var(--indigo); font-weight: 700; }
#inline-bar { position: absolute; display: none; gap: 2px; background: #101828; padding: 5px; border-radius: 9px; box-shadow: 0 8px 24px rgba(0,0,0,.35); z-index: 200; }
#inline-bar button { border: none; background: transparent; color: #E5E7EB; width: 27px; height: 25px; border-radius: 6px; cursor: pointer; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
#inline-bar button:hover { background: rgba(255,255,255,.14); }
/* Visibilité par appareil, vue depuis l'éditeur.
   On ne montre QUE ce que verra l'appareil regardé : un bloc réservé au mobile n'apparaît pas en
   vue ordinateur, et inversement. Philippe ne veut ni étiquette « Mobile uniquement » ni contour
   pointillé : ces repères se voyaient dans le mail et ne ressemblaient à rien. Le bloc masqué
   reste dans la page (donc il est conservé à l'enregistrement) ; pour le régler, on bascule sur
   l'autre appareil. */
.email-sheet .ed-block.hide-desk { display: none; }
.email-sheet.mq-mob .ed-block.hide-desk { display: block; }
.email-sheet.mq-mob .ed-block.hide-mob { display: none; }
.email-sheet.mq-mob .ed-block.hide-fallback { display: block; }

/* Aperçu + test */
.pv-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.pv-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pv-meta { background: #FAFBFC; border-bottom: 1px solid var(--border-soft); padding: 12px 16px; font-size: 12.5px; }
.pv-meta .row { display: flex; gap: 8px; margin-bottom: 4px; }
.pv-meta .k { font-weight: 700; min-width: 56px; }
.pv-render { padding: 18px; max-height: 420px; overflow-y: auto; }

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 26px 26px; }
.login-card { background: #fff; border-radius: 18px; padding: 34px 36px; width: 400px; box-shadow: 0 30px 90px rgba(0,0,0,.4); }
.login-card .blogo { width: 44px; height: 44px; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 800; font-size: 22px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.login-card h1 { text-align: center; font-size: 20px; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 22px; }
.login-err { color: var(--err); font-size: 12.5px; margin: -6px 0 10px; display: none; }
.login-err.show { display: block; }
/* Annuler / Rétablir */
.ed-undo-btn { width: 32px; height: 32px; border: 0; border-radius: 7px; background: transparent;
  color: #6B7280; font-size: 17px; line-height: 1; cursor: pointer; }
.ed-undo-btn:hover:not(:disabled) { background: #EEF2F7; color: #111827; }
.ed-undo-btn:disabled { opacity: .3; cursor: default; }
.ed-undo { display: flex; align-items: center; gap: 2px; }

/* Aperçu du trait des séparateurs */
.apercu-sep { height: 0; border-top: 3px solid #9CA3AF; margin: 10px 4px 14px; }

/* Repère de dépôt pendant un glisser-déposer */
#ins-line { height: 3px; border-radius: 2px; background: #0A4D8F;
  box-shadow: 0 0 0 3px rgba(10, 77, 143, .16); margin: 3px 2px; pointer-events: none; }
.block-card.drag-src { opacity: .45; }

/* Note « version téléphone » dans le panneau de réglages */
.hint.mob { background: #EEF4FF; border: 1px solid #C7DBFF; color: #0A4D8F;
  border-radius: 6px; padding: 8px 10px; margin: 8px 0 2px; font-size: 12px; line-height: 1.45; }
.hint.mob .lien-mob { color: #0A4D8F; font-weight: 600; text-decoration: underline; cursor: pointer; }


/* ---------- Réseaux sociaux : liste des liens dans le panneau de droite ---------- */
.soc-liste { display: flex; flex-direction: column; gap: 8px; }
.soc-item { border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; background: #fff; }
.soc-tete { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.soc-puce { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; flex: 0 0 18px;
  align-items: center; justify-content: center; }
.soc-tete b { font-size: 12.5px; flex: 1; color: #111827; }
.soc-outils { display: flex; gap: 2px; }
.soc-outils button { width: 22px; height: 22px; border: 1px solid var(--border); background: #fff;
  border-radius: 5px; cursor: pointer; font-size: 11px; line-height: 1; color: #4B5563; padding: 0; }
.soc-outils button:hover { background: #F3F4F6; }
.soc-outils .soc-x:hover { background: #FEF3F2; color: #B42318; border-color: #FECACA; }
.soc-url { width: 100%; box-sizing: border-box; }
.soc-ajout { display: flex; gap: 6px; margin-top: 9px; }
.soc-ajout .sel { flex: 1; }
.soc-ajout button[disabled] { opacity: .5; }
