/* =============================================================================
   JOURO — Back-office (admin.jouro.fr)
   Palette et vocabulaire visuel repris de l'admin blog et de l'app.
   ========================================================================== */

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

:root{
  --blue:#0f5cdb;
  --blue-soft:#e0edff;
  --sky:#0ea5e9;
  --text:#0f172a;
  --muted:#5f6f86;
  --line:rgba(15,23,42,.1);
  --line-strong:rgba(15,23,42,.18);
  --bg:#f4f8ff;
  --surface:#fff;
  --red:#e11d48;
  --red-soft:#fef2f2;
  --green:#059669;
  --green-soft:#ecfdf5;
  --amber:#b45309;
  --amber-soft:#fffbeb;
  --r:14px;
  --shadow:0 14px 36px rgba(15,92,219,.08);
}

body{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:.94rem;
  line-height:1.5;
  min-height:100vh;
}
a{color:inherit;text-decoration:none}
input,textarea,select,button{font:inherit;color:inherit}
h1{font-size:1.45rem;letter-spacing:-.02em}
h2{font-size:1.05rem;letter-spacing:-.01em}
code{background:var(--blue-soft);color:var(--blue);padding:1px 5px;border-radius:5px;font-size:.86em}
.is-hidden{display:none !important}
.muted{color:var(--muted)}
.nowrap{white-space:nowrap}
.mt-8{margin-top:8px}

/* ── Boutons ──────────────────────────────────────────────────────────── */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:42px;padding:0 18px;border-radius:999px;border:1px solid transparent;
  font-weight:700;font-size:.9rem;cursor:pointer;transition:filter .15s,background .15s;
  white-space:nowrap;
}
.btn:hover{filter:brightness(.96)}
.btn:disabled{opacity:.45;cursor:not-allowed;filter:none}
.btn-primary{background:var(--blue);color:#fff}
.btn-secondary{background:var(--surface);border-color:var(--line-strong);color:var(--text)}
.btn-ghost{background:transparent;border-color:transparent;color:var(--muted);font-weight:600}
.btn-ghost:hover{background:var(--blue-soft);color:var(--blue)}
.btn-danger{background:var(--red-soft);border-color:#fecaca;color:var(--red)}
.btn-sm{min-height:34px;padding:0 13px;font-size:.83rem}
.btn-full{width:100%}

/* ── Connexion ────────────────────────────────────────────────────────── */
.login-body{display:flex;align-items:center;justify-content:center;padding:24px}
.login-wrap{width:100%;display:flex;justify-content:center}
.login-card{
  width:min(100%,420px);background:var(--surface);border:1px solid var(--line);
  border-radius:22px;padding:36px;box-shadow:var(--shadow);
}
.login-brand{font-weight:800;font-size:1.5rem;letter-spacing:-.03em;margin-bottom:10px}
.login-brand span{color:var(--sky)}
.login-card h1{font-size:1.2rem;margin-bottom:4px}
.login-sub{color:var(--muted);font-size:.9rem;margin-bottom:22px}
.login-hint{margin-top:18px;font-size:.78rem;color:var(--muted);text-align:center}

/* ── Bandeaux ─────────────────────────────────────────────────────────── */
.flash{padding:12px 16px;border-radius:10px;font-weight:600;font-size:.89rem;margin-bottom:18px}
.flash-success{background:var(--green-soft);color:#065f46;border:1px solid #a7f3d0}
.flash-error{background:var(--red-soft);color:#b91c1c;border:1px solid #fecaca}
.flash-info{background:var(--blue-soft);color:var(--blue);border:1px solid #bfdbfe}
.flash a{text-decoration:underline}

/* ── Barre du haut ────────────────────────────────────────────────────── */
.topbar{
  position:sticky;top:0;z-index:50;background:var(--surface);
  border-bottom:1px solid var(--line);min-height:58px;
  display:flex;align-items:center;gap:14px;padding:0 18px;
}
.topbar-brand{font-weight:800;font-size:1.05rem;letter-spacing:-.02em}
.topbar-brand span{color:var(--sky)}
.topbar-brand em{font-style:normal;font-weight:600;color:var(--muted);margin-left:4px}
.topbar-right{margin-left:auto;display:flex;align-items:center;gap:4px}
.nav-toggle{display:none;flex-direction:column;gap:4px;background:none;border:none;padding:8px;cursor:pointer}
.nav-toggle span{display:block;width:20px;height:2px;background:var(--text);border-radius:2px}

/* ── Structure ────────────────────────────────────────────────────────── */
.shell{display:grid;grid-template-columns:248px 1fr;align-items:start}
.sidebar{
  position:sticky;top:58px;height:calc(100vh - 58px);overflow-y:auto;
  background:var(--surface);border-right:1px solid var(--line);padding:18px 12px 24px;
}
.nav-group{
  font-size:.7rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase;
  color:var(--muted);padding:14px 10px 6px;
}
.nav{display:flex;flex-direction:column;gap:2px}
.nav-item{
  display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:10px;
  font-weight:600;font-size:.9rem;color:var(--text);
}
.nav-item:hover{background:var(--bg)}
.nav-item.is-active{background:var(--blue-soft);color:var(--blue)}
.nav-item.is-soon{color:#9aa7ba;cursor:default}
.nav-item.is-soon:hover{background:transparent}
.nav-icon{width:18px;height:18px;flex-shrink:0}
.nav-badge{
  margin-left:auto;font-style:normal;font-size:.68rem;font-weight:800;
  background:var(--bg);border:1px solid var(--line);color:var(--muted);
  padding:2px 7px;border-radius:999px;
}
.sidebar-foot{margin-top:22px;padding:12px 10px;font-size:.75rem;line-height:1.6;color:var(--muted);border-top:1px solid var(--line)}

.content{padding:26px 28px 60px;min-width:0}
.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:22px}
.page-sub{color:var(--muted);font-size:.9rem;margin-top:3px}

/* ── Tuiles ───────────────────────────────────────────────────────────── */
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px;margin-bottom:22px}
.tile{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px 18px;box-shadow:var(--shadow)}
.tile-label{font-size:.76rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.tile-value{font-size:1.9rem;font-weight:800;letter-spacing:-.03em;margin:6px 0 2px}
.tile-value.is-text{font-size:1.1rem;letter-spacing:-.01em}
.tile-value.is-warn{color:var(--amber)}
.tile-note{font-size:.82rem;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* ── Accueil : le programme du jour et les compteurs cliquables ────────── */
a.acc-tile{display:block;text-decoration:none;color:inherit;transition:border-color .12s,transform .12s}
a.acc-tile:hover{border-color:var(--blue);transform:translateY(-1px)}
.acc-tile .tile-value{font-size:1.7rem}

.acc-jour{list-style:none;display:flex;flex-direction:column;gap:2px;
  background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:6px 4px;box-shadow:var(--shadow)}
.acc-jour li{display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:11px 14px;border-bottom:1px solid var(--line)}
.acc-jour li:last-child{border-bottom:none}
.acc-jour-canal{flex-shrink:0;min-width:118px;font-size:.72rem;font-weight:800;
  letter-spacing:.05em;text-transform:uppercase;color:var(--blue)}
.acc-jour-titre{flex:1;min-width:150px;font-weight:700;font-size:.92rem;line-height:1.4}
.acc-jour-duree{font-size:.78rem;font-weight:700;color:var(--muted)}
.acc-jour-pret{font-size:.72rem;font-weight:700;color:var(--green);
  background:var(--green-soft);border-radius:999px;padding:2px 9px}
.acc-jour-retard{font-size:.72rem;font-weight:700;color:var(--red);
  background:#fef2f2;border-radius:999px;padding:2px 9px}

.acc-journal{list-style:none;display:flex;flex-direction:column;gap:1px}
.acc-journal li{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;
  padding:8px 2px;border-bottom:1px solid var(--line);font-size:.85rem}
.acc-journal li:last-child{border-bottom:none}
.acc-journal-quand{flex-shrink:0;width:110px;font-size:.76rem;color:var(--muted)}
.acc-journal-quoi{font-weight:700}
.acc-journal-detail{color:var(--muted);font-size:.82rem}

@media (max-width:640px){
  .acc-jour-canal{min-width:0}
  .acc-journal-quand{width:auto}
}

/* ── Cartes ───────────────────────────────────────────────────────────── */
.cols{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:18px 20px;box-shadow:var(--shadow);margin-bottom:16px}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.card-note{font-size:.8rem;color:var(--muted)}
.empty{color:var(--muted);font-size:.88rem;padding:10px 0}
.log-block{white-space:pre-wrap;background:#0f172a;color:#e5e7eb;border-radius:10px;padding:14px;max-height:320px;overflow:auto;font-size:.82rem;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}

/* Liste « à traiter » */
.todo-list{list-style:none;display:flex;flex-direction:column;gap:2px}
.todo-list a{display:flex;flex-direction:column;gap:2px;padding:9px 10px;border-radius:10px}
.todo-list a:hover{background:var(--bg)}
.todo-title{font-weight:700;font-size:.9rem}
.todo-meta{font-size:.78rem;color:var(--muted)}

/* État de santé — une carte par module, dépliable.
   <details> plutôt que du JS : l'ouverture marche même si un script casse, et
   le clavier la pilote tout seul. La synthèse reste visible fermée : on doit
   savoir ce qui manque SANS ouvrir. */
.mod-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(270px,1fr));
  gap:14px;align-items:start}
.mod-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);
  box-shadow:var(--shadow);overflow:hidden;border-left:3px solid var(--line-strong)}
.mod-card.is-ok{border-left-color:var(--green)}
/* Orange : le module est écrit mais il lui manque quelque chose pour tourner */
.mod-card.is-partiel{border-left-color:var(--amber)}

.mod-card>summary{display:flex;flex-direction:column;gap:5px;padding:15px 17px;
  cursor:pointer;list-style:none}
.mod-card>summary::-webkit-details-marker{display:none}
.mod-card>summary:hover{background:var(--bg)}
.mod-tete{display:flex;align-items:center;justify-content:space-between;gap:10px}
.mod-titre{font-weight:800;font-size:.95rem;letter-spacing:-.01em}
.mod-resume{font-size:.82rem;color:var(--muted);line-height:1.45}
.mod-synthese{font-size:.82rem;font-weight:700;line-height:1.45}
.mod-card.is-ok .mod-synthese{color:var(--green)}
.mod-card.is-partiel .mod-synthese{color:var(--amber)}
.mod-plus{font-size:.78rem;font-weight:700;color:var(--blue)}
.mod-plus::after{content:" ▾"}
.mod-card[open] .mod-plus::after{content:" ▴"}

.mod-corps{padding:0 17px 16px;border-top:1px solid var(--line);margin-top:2px}
.mod-soustitre{font-size:.72rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted);margin:14px 0 7px}
.mod-fonctions{margin:0;padding-left:17px;display:flex;flex-direction:column;gap:5px;
  font-size:.84rem;line-height:1.5}
.mod-manques{list-style:none;display:flex;flex-direction:column;gap:9px;margin-bottom:14px}
.mod-manques li{display:flex;flex-direction:column;gap:3px;padding:9px 11px;
  background:#fffbeb;border:1px solid #fde68a;border-radius:10px;font-size:.83rem}
.mod-manques strong{font-size:.84rem}
.mod-manque-detail{color:var(--muted);line-height:1.5}
.mod-manque-src{font-size:.72rem;color:var(--muted);opacity:.75}
/* Le badge orange existe déjà plus bas : .badge-warn. Ne pas le redéfinir ici. */

/* Tableau */
.table{width:100%;border-collapse:collapse;font-size:.87rem}
.table th{text-align:left;font-size:.72rem;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);padding:0 10px 8px;font-weight:800}
.table td{padding:9px 10px;border-top:1px solid var(--line);vertical-align:top}
.pill{display:inline-flex;padding:2px 9px;border-radius:999px;background:var(--bg);border:1px solid var(--line);font-size:.78rem;font-weight:700}
.pill-warn{background:var(--amber-soft);border-color:#fde68a;color:var(--amber)}

/* Diagnostic */
.diag{list-style:none;display:flex;flex-direction:column;gap:10px}
.diag li{display:flex;gap:11px;align-items:flex-start}
.diag-mark{
  flex-shrink:0;width:21px;height:21px;border-radius:50%;display:grid;place-items:center;
  font-weight:800;font-size:.78rem;
}
.diag li.is-ok .diag-mark{background:var(--green-soft);color:var(--green)}
.diag li.is-ko .diag-mark{background:var(--red-soft);color:var(--red)}
.diag li.is-opt .diag-mark{background:var(--amber-soft);color:var(--amber)}
.diag strong{display:block;font-size:.88rem}
.diag-detail{display:block;font-size:.8rem;color:var(--muted);word-break:break-word}

/* ── Module Blog ──────────────────────────────────────────────────────── */
.blog-layout{display:grid;grid-template-columns:320px 1fr;gap:18px;align-items:start}

.article-col{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden;position:sticky;top:78px}
.article-col-head{display:flex;gap:8px;padding:12px;border-bottom:1px solid var(--line)}
.filter-input{flex:1;min-width:0;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);font-size:.87rem}
.article-list{max-height:calc(100vh - 260px);overflow-y:auto}
.article-item{display:flex;flex-direction:column;gap:4px;padding:12px 14px;border-bottom:1px solid var(--line)}
.article-item:hover{background:var(--bg)}
.article-item.is-active{background:var(--blue-soft)}
.article-title{font-weight:700;font-size:.88rem;line-height:1.35}
.article-meta{font-size:.76rem;color:var(--muted);display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.badge{display:inline-flex;padding:2px 8px;border-radius:999px;font-size:.68rem;font-weight:800;letter-spacing:.03em}
.badge-ok{background:rgba(5,150,105,.12);color:#065f46}
.badge-draft{background:rgba(15,23,42,.07);color:var(--muted)}

.import-box{border-top:1px solid var(--line);padding:12px 14px;font-size:.86rem}
.import-box summary{cursor:pointer;font-weight:700;color:var(--muted)}
.import-box form{display:flex;flex-direction:column;gap:10px;margin-top:12px}
.import-box input[type=file]{width:100%;padding:12px;border:1px dashed var(--line-strong);border-radius:10px;background:var(--bg);font-size:.82rem}

.editor-col{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);padding:20px}
.editor-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:18px}
.editor-head-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.editor-head-actions form{margin:0}
.editor-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.col-full{grid-column:1/-1}
.editor-actions{display:flex;justify-content:flex-end;padding-top:4px}
.editor-actions .btn{min-width:190px}

.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field label{font-weight:700;font-size:.84rem;color:var(--muted)}
.field input,.field textarea,.field select{
  width:100%;padding:11px 13px;border:1px solid var(--line);border-radius:10px;
  background:var(--bg);font-size:.91rem;
}
.field input:focus,.field textarea:focus,.field select:focus{
  outline:3px solid rgba(15,92,219,.16);border-color:var(--blue);background:var(--surface);
}
.field textarea{resize:vertical}
.req{color:var(--red)}
.hint{font-size:.78rem;color:var(--muted)}
.counter{font-size:.78rem;color:var(--muted);text-align:right}
.counter.is-over{color:var(--red);font-weight:700}

/* Image */
.upload-zone{border:2px dashed var(--line-strong);border-radius:12px;background:var(--bg);transition:border-color .15s,background .15s}
.upload-zone.is-dragover{border-color:var(--blue);background:var(--blue-soft)}
.upload-preview{padding:10px}
.upload-preview img{width:100%;max-height:190px;object-fit:cover;border-radius:9px;display:block}
.upload-placeholder{display:flex;flex-direction:column;align-items:center;gap:9px;padding:26px 18px;text-align:center;font-size:.88rem;font-weight:600}
.upload-pick{cursor:pointer}
.upload-status{padding:9px 12px;font-size:.85rem;font-weight:600}
.upload-status.is-error{color:#b91c1c}
.upload-status.is-ok{color:#065f46}
.image-url-row{display:flex;gap:8px;align-items:center;margin-top:10px;flex-wrap:wrap}
.image-url-row input{flex:1;min-width:220px;padding:10px 13px;border:1px solid var(--line);border-radius:10px;background:var(--bg);font-size:.88rem}

/* Éditeur de contenu */
.toolbar{display:flex;flex-wrap:wrap;gap:6px;padding:10px;background:var(--bg);border:1px solid var(--line);border-bottom:none;border-radius:10px 10px 0 0}
.tool{min-height:31px;padding:0 11px;border-radius:7px;border:1px solid var(--line);background:var(--surface);font-size:.81rem;font-weight:700;cursor:pointer}
.tool:hover{background:var(--blue-soft);border-color:rgba(15,92,219,.3)}
.content-area{
  width:100%;min-height:360px;padding:14px;border:1px solid var(--line);
  border-radius:0 0 10px 10px;font-size:.92rem;line-height:1.7;resize:vertical;background:var(--surface);
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}
.content-area:focus{outline:3px solid rgba(15,92,219,.16);border-color:var(--blue)}

/* ── Module Support & bot ─────────────────────────────────────────────── */
.setup-list{margin:12px 0 12px 20px;display:flex;flex-direction:column;gap:14px;font-size:.9rem;line-height:1.6}
.setup-list li{padding-left:4px}
.setup-list .log-block{margin-top:8px;font-size:.8rem}

.inbox-layout{display:grid;grid-template-columns:330px 1fr;gap:18px;align-items:start}

.inbox-col{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden;position:sticky;top:78px}
.inbox-filters{display:flex;flex-wrap:wrap;gap:6px;padding:12px;border-bottom:1px solid var(--line)}
.chip{
  min-height:30px;padding:0 11px;border-radius:999px;border:1px solid var(--line);
  background:var(--bg);font-size:.79rem;font-weight:700;color:var(--muted);cursor:pointer;
}
.chip:hover{border-color:var(--line-strong)}
.chip.is-active{background:var(--blue);border-color:var(--blue);color:#fff}
.chip-icon{margin-left:auto;font-size:.95rem;line-height:1}

.inbox-list{max-height:calc(100vh - 220px);overflow-y:auto}
.inbox-item{
  display:flex;flex-direction:column;gap:4px;width:100%;text-align:left;
  padding:12px 14px;border:none;border-bottom:1px solid var(--line);
  background:none;cursor:pointer;font:inherit;
}
.inbox-item:hover{background:var(--bg)}
.inbox-item.is-active{background:var(--blue-soft)}
.inbox-item-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.inbox-item-who{font-weight:700;font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.inbox-item-sum{font-size:.82rem;color:var(--muted);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.inbox-item-meta{font-size:.74rem;color:var(--muted)}
.badge.status-needs_human{background:var(--amber-soft);color:var(--amber)}
.badge.status-answered{background:var(--blue-soft);color:var(--blue)}
.badge.status-resolved{background:rgba(5,150,105,.12);color:#065f46}
.badge.status-open{background:rgba(15,23,42,.07);color:var(--muted)}

.thread-col{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow);padding:18px 20px;min-height:420px}
.thread-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-bottom:14px;border-bottom:1px solid var(--line)}
.thread-email{font-weight:800;font-size:1rem}
.thread-meta{font-size:.82rem;color:var(--muted);margin-top:2px}
.thread-messages{display:flex;flex-direction:column;gap:12px;padding:16px 0;max-height:52vh;overflow-y:auto}

.msg{border-radius:12px;padding:11px 14px;max-width:min(92%,620px);background:var(--bg);border:1px solid var(--line)}
.msg-who{font-size:.72rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);margin-bottom:4px}
.msg-body{font-size:.9rem;line-height:1.6;white-space:pre-wrap;word-break:break-word}
.msg-time{font-size:.72rem;color:var(--muted);margin-top:5px}
.msg-user{align-self:flex-start}
.msg-assistant{align-self:flex-start;background:var(--surface)}
.msg-admin{align-self:flex-end;background:var(--blue-soft);border-color:#bfdbfe}
.msg-admin .msg-who{color:var(--blue)}

.thread-reply{border-top:1px solid var(--line);padding-top:14px;display:flex;flex-direction:column;gap:8px}
.thread-reply textarea{
  width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:10px;
  background:var(--bg);font-size:.9rem;line-height:1.6;resize:vertical;min-height:84px;
}
.thread-reply textarea:focus{outline:3px solid rgba(15,92,219,.16);border-color:var(--blue);background:var(--surface)}
.thread-reply-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.hint.is-ok{color:var(--green);font-weight:600}
.hint.is-error{color:var(--red);font-weight:600}
.hint.is-warn{color:var(--amber);font-weight:600}

/* ── Module Statistiques ──────────────────────────────────────────────── */
.stats-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:18px}
.stats-section{margin-bottom:26px}
.stats-section.cols{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.section-head{margin-bottom:12px}
.eyebrow{font-size:.7rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase;color:var(--muted)}
.section-head h2{margin-top:2px}
.section-head h3{font-size:.98rem}

.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(215px,1fr));gap:14px}
.kpi-card{
  display:flex;align-items:flex-start;gap:12px;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--r);padding:16px;box-shadow:var(--shadow);
}
.kpi-icon{
  flex-shrink:0;width:38px;height:38px;border-radius:11px;display:grid;place-items:center;
  background:var(--blue-soft);color:var(--blue);
}
.kpi-icon svg{width:20px;height:20px}
.kpi-body{display:flex;flex-direction:column;min-width:0}
.kpi-label{font-size:.76rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.kpi-value{font-size:1.6rem;font-weight:800;letter-spacing:-.03em;margin:3px 0}
.kpi-sub{font-size:.79rem;color:var(--muted);line-height:1.45}
.is-muted{color:#9aa7ba;font-size:.95rem;font-weight:700}

.metric-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px}
.metric-grid-tight{grid-template-columns:1fr}
.metric-card{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:13px 15px;
}
.stats-section.cols .metric-card{background:var(--bg);box-shadow:none}
.metric-text{display:flex;flex-direction:column;min-width:0}
.metric-label{font-weight:700;font-size:.87rem}
.metric-sub{font-size:.77rem;color:var(--muted);line-height:1.45}
.metric-value{font-size:1.12rem;font-weight:800;letter-spacing:-.02em;white-space:nowrap}
.metric-value.is-up{color:var(--green)}
.metric-value.is-down{color:var(--red)}

.charts{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.chart-card{margin-bottom:0}
.chart-shell{position:relative;height:250px}
.chart-canvas{width:100%;height:100%;display:block}
.chart-empty{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted);font-size:.87rem}
.chart-stats{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.chart-stat{display:flex;flex-direction:column;gap:1px;background:var(--bg);border:1px solid var(--line);border-radius:9px;padding:7px 11px;flex:1;min-width:96px}
.cs-label{font-size:.7rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.cs-value{font-size:.94rem;font-weight:800}

.privacy-note{font-size:.79rem;color:var(--muted);line-height:1.6;padding:14px 2px 0;border-top:1px solid var(--line)}

/* Bascule entre les vues d'un module */
.segmented{display:inline-flex;gap:3px;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:3px;margin-bottom:20px}
.seg{padding:7px 16px;border-radius:999px;font-size:.86rem;font-weight:700;color:var(--muted)}
.seg:hover{color:var(--text)}
.seg.is-active{background:var(--blue);color:#fff}

/* Tableaux larges */
.table-card{padding:0;overflow:hidden}
.table-scroll{overflow-x:auto}
.table-scroll .table{min-width:820px}
.table-scroll .table th,.table-scroll .table td{padding:10px 14px}
.table-scroll .table thead th{background:var(--bg);position:sticky;top:0;z-index:1}
.table .num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.table td.is-empty{color:#c3ccda}
.cell-page{max-width:290px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cell-page a{color:var(--blue);font-weight:600}
.cell-page a:hover{text-decoration:underline}
.table tbody tr:hover{background:var(--bg)}

/* ── Module Utilisateurs ──────────────────────────────────────────────── */
.users-search{flex:1;min-width:220px;max-width:420px}
.users-layout{display:grid;grid-template-columns:1fr 380px;gap:18px;align-items:start;margin-top:16px}
.table-users tbody tr{cursor:pointer}
.table-users tbody tr.is-active{background:var(--blue-soft)}
.badge-trial{background:var(--amber-soft);color:var(--amber)}
.badge-warn{background:var(--amber-soft);color:var(--amber)}

.pager{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-top:1px solid var(--line)}

/* En-têtes de colonne triables */
.th-sort{
  display:inline-flex;align-items:center;gap:5px;background:none;border:none;padding:0;
  font:inherit;font-size:.72rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase;
  color:var(--muted);cursor:pointer;
}
.th-sort:hover{color:var(--text)}
.th-sort::after{content:"↕";font-size:.85em;opacity:.35;font-weight:700}
.th-sort.is-sorted{color:var(--blue)}
.th-sort.is-sorted::after{content:"↓";opacity:1}
.th-sort.is-sorted.is-asc::after{content:"↑"}
.num .th-sort{flex-direction:row-reverse}

.user-panel{position:sticky;top:78px;max-height:calc(100vh - 100px);overflow-y:auto}
.user-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.user-email{font-weight:800;font-size:.98rem;word-break:break-all}
.user-meta{font-size:.79rem;color:var(--muted);margin-top:3px;line-height:1.5}

.user-facts{display:flex;flex-direction:column;gap:1px;padding:14px 0}
.fact{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:7px 0;border-bottom:1px solid var(--line)}
.fact:last-child{border-bottom:none}
.fact-label{font-size:.81rem;color:var(--muted)}
.fact-value{font-size:.85rem;font-weight:700;text-align:right}

.user-actions{border-top:1px solid var(--line);padding-top:14px}
.user-actions h3{font-size:.9rem;margin-bottom:8px}
.grant-form{display:flex;flex-direction:column;gap:10px;background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:14px;margin:12px 0}
.grant-form .field span{font-size:.78rem;font-weight:700;color:var(--muted)}
.danger-zone{display:flex;flex-direction:column;gap:8px}

/* ── Module Appels ────────────────────────────────────────────────────── */
.ap-delai{flex-direction:row;align-items:center;gap:8px}
.ap-delai span{font-size:.82rem;font-weight:700;color:var(--muted);white-space:nowrap}
/* Le lien tel: est l'action principale de la fiche : il doit être au pouce,
   pas noyé dans le formulaire de compte rendu. */
.ap-tel{display:block;text-align:center;margin:14px 0 2px;text-decoration:none}
.ap-histo{margin:12px 0;padding:12px 14px;background:var(--bg);border:1px solid var(--line);border-radius:12px}
.ap-histo .hint{margin:0}
.ap-note{margin-top:8px;font-size:.84rem;line-height:1.6;white-space:pre-wrap}

/* ── Module Marketing ─────────────────────────────────────────────────── */
.moment{
  display:flex;flex-direction:column;gap:7px;background:var(--surface);
  border:1px solid var(--line);border-radius:12px;padding:14px 16px;
}
.moment.is-now{border-color:rgba(15,92,219,.35);box-shadow:var(--shadow)}
/* Temps fort au repos : il reste lisible et cliquable, il ne mène plus la semaine. */
.moment.is-paused{opacity:.62;box-shadow:none;border-color:var(--line)}
.mkt-saison-pause,.mkt-saison-ok{font-size:.82rem;line-height:1.55;margin:0 0 2px}
.mkt-saison-pause{color:var(--muted)}
.mkt-saison-ok{color:var(--blue)}
.moment-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.moment-head strong{font-size:.95rem}
.moment-angle{font-size:.84rem;color:var(--muted);line-height:1.55}
.moment-canaux{font-size:.74rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--blue)}
.moment .btn{align-self:flex-start;margin-top:2px}

.mkt-semaine-grille{display:grid;grid-template-columns:repeat(auto-fit,minmax(290px,1fr));gap:14px}
.mkt-jour{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:14px 16px;box-shadow:var(--shadow)}
.mkt-jour-nom{
  display:flex;align-items:baseline;justify-content:space-between;gap:8px;
  font-size:.74rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase;
  color:var(--blue);margin-bottom:8px;
}
/* Temps cumulé de la journée : l'heure quotidienne de Kevin, d'un coup d'œil */
.mkt-jour-duree{letter-spacing:0;text-transform:none;font-weight:700;font-size:.76rem;color:var(--muted)}
.mkt-jour-duree.is-over{color:var(--amber)}
.mkt-jour .mkt-item{padding:9px 0}
.mkt-jour .mkt-idee-actions{margin-top:4px}

.mkt-add{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.mkt-add input[type=text]{flex:1;min-width:180px}
.mkt-add input,.mkt-add select{padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);font-size:.88rem}

.mkt-list{list-style:none;display:flex;flex-direction:column;gap:2px}
.mkt-item{display:flex;align-items:flex-start;gap:10px;padding:10px 4px;border-bottom:1px solid var(--line)}
.mkt-item:last-child{border-bottom:none}
.mkt-item.is-done .mkt-titre{text-decoration:line-through;color:var(--muted)}
.mkt-check{
  flex-shrink:0;width:21px;height:21px;margin-top:1px;border-radius:6px;
  border:1.5px solid var(--line-strong);background:var(--surface);cursor:pointer;
  font-size:.8rem;font-weight:800;color:var(--green);line-height:1;
}
.mkt-check:hover{border-color:var(--blue)}
.mkt-item.is-done .mkt-check{background:var(--green-soft);border-color:#a7f3d0}
.mkt-body{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}
.mkt-titre{font-weight:700;font-size:.88rem;line-height:1.4}
.mkt-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:.76rem;color:var(--muted)}
.mkt-late{color:var(--red);font-weight:700}
.mkt-planifiee{color:var(--blue);font-weight:700}
.mkt-note{font-size:.8rem;color:var(--muted);line-height:1.5}
.mkt-del{background:none;border:none;color:#c3ccda;cursor:pointer;font-size:.9rem;padding:2px 4px}
.mkt-del:hover{color:var(--red)}
/* Texte actuellement ouvert dans la zone de rédaction */
.mkt-item.is-current{background:var(--blue-soft,#eef4ff);border-radius:10px;padding-left:10px;padding-right:6px}

/* Objectif visé, mot-clé, durée estimée */
.badge-goal{background:var(--blue-soft);color:var(--blue)}
/* Famille de sujets : c'est l'étiquette qui rend la répétition visible. */
.badge-theme{background:rgba(124,58,237,.10);color:#6d28d9}
.badge-theme.is-saison{background:rgba(217,119,6,.12);color:#b45309}
.mkt-duree{font-weight:700}
.mkt-motcle{font-size:.8rem;color:var(--blue);font-style:italic}
/* Mot-clé déjà occupé par une autre page : cannibalisation en préparation. */
.mkt-conflit{
  display:block;font-size:.78rem;line-height:1.5;color:#b45309;
  background:rgba(217,119,6,.09);border-left:3px solid rgba(217,119,6,.5);
  border-radius:0 6px 6px 0;padding:6px 10px;margin-top:2px;
}
/* Rédaction refusée : la recherche visée appartient déjà à une autre page.
   Plus appuyé que le badge des cartes — ici, rien n'a été écrit. */
.mkt-draft-conflit{
  display:flex;flex-wrap:wrap;align-items:center;gap:12px;justify-content:space-between;
  margin:12px 0;padding:12px 14px;font-size:.86rem;line-height:1.55;
  color:#b45309;background:rgba(217,119,6,.10);
  border:1px solid rgba(217,119,6,.35);border-radius:10px;
}
.mkt-draft-conflit-txt{flex:1 1 260px}
.mkt-draft-conflit-actions{display:flex;flex-wrap:wrap;gap:8px}

/* Date de publication réelle, corrigeable */
.mkt-publie{display:flex;align-items:center;gap:6px;font-size:.76rem;color:var(--muted)}
.mkt-publie input{padding:3px 7px;border:1px solid var(--line);border-radius:7px;
  background:var(--bg);font-size:.76rem;color:inherit}
.mkt-refus-btn{font-size:.78rem;color:var(--muted);text-decoration:none}
.mkt-refus-btn:hover{color:var(--red);text-decoration:underline}

/* Publication programmée : cochée d'avance, pas encore sortie */
.metric-value.is-planned{color:var(--blue)}

/* ── Audience : relevé hebdomadaire tous canaux ───────────────────────── */
.aud-saisie,.aud-couts-form{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end;margin:14px 0}
.aud-champ{display:flex;flex-direction:column;gap:4px;min-width:110px}
.aud-champ-label{display:flex;align-items:center;gap:5px;font-size:.76rem;font-weight:700;color:var(--muted)}
.aud-auto{font-size:.64rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;
  color:var(--blue);background:var(--blue-soft);border-radius:999px;padding:1px 6px}
.aud-champ input{padding:9px 12px;border:1px solid var(--line);border-radius:10px;
  background:var(--bg);font-size:.9rem;width:100%}
.aud-champ.is-auto .aud-valeur{padding:9px 12px;border:1px solid var(--line);border-radius:10px;
  background:var(--surface);font-size:.9rem;font-weight:700}

/* ── Connexion Google : assistant en trois étapes ─────────────────────── */
.google-etapes{padding-left:20px;line-height:1.75;font-size:.88rem;margin:8px 0 16px}
.google-etapes li{margin-bottom:6px}
.google-uri{display:block;margin:6px 0 2px;padding:9px 12px;background:var(--blue-soft);
  color:var(--blue);border-radius:8px;font-size:.82rem;word-break:break-all;font-weight:700}
.google-form{display:flex;flex-direction:column;gap:12px;max-width:520px}
.google-form label{display:flex;flex-direction:column;gap:4px}
.google-form span{font-size:.78rem;font-weight:700;color:var(--muted)}
.google-form input{padding:10px 12px;border:1px solid var(--line);border-radius:10px;
  background:var(--bg);font-size:.9rem}
.google-form .btn{align-self:flex-start}
.google-code{margin:8px 0;padding:12px 14px;background:#1b2430;color:#e2e8f0;border-radius:10px;
  font-size:.8rem;line-height:1.7;overflow-x:auto;white-space:pre}

/* ── Push : rédaction et aperçu ───────────────────────────────────────── */
.ph-form{display:flex;flex-direction:column;gap:14px}
.ph-champ{display:flex;flex-direction:column;gap:5px}
.ph-champ > span{display:flex;justify-content:space-between;align-items:baseline;
  font-size:.78rem;font-weight:700;color:var(--muted)}
.ph-champ em{font-style:normal;font-weight:400;font-size:.74rem;opacity:.8}
.ph-champ input,.ph-champ textarea,.ph-champ select{padding:10px 12px;border:1px solid var(--line);
  border-radius:10px;background:var(--bg);font-size:.92rem;font-family:inherit;width:100%}
.ph-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:4px}
.ph-actions .btn-primary:disabled{opacity:.45;cursor:not-allowed}

/* Aperçu : une notification telle qu'elle apparaît sur un téléphone */
.ph-apercu{background:linear-gradient(160deg,#1b2430,#334155);border-radius:16px;
  padding:22px 16px;display:grid;place-items:center;min-height:150px}
.ph-notif{width:100%;max-width:320px;background:rgba(255,255,255,.96);border-radius:14px;
  padding:11px 13px;display:flex;flex-direction:column;gap:3px;
  box-shadow:0 8px 22px rgba(0,0,0,.25)}
.ph-notif-app{font-size:.68rem;font-weight:700;text-transform:uppercase;
  letter-spacing:.06em;color:var(--blue)}
.ph-notif-titre{font-size:.9rem;line-height:1.3;color:#1b2430}
.ph-notif-corps{font-size:.83rem;line-height:1.4;color:#4a5568;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ── Résultats : barres de répartition ────────────────────────────────── */
.res-barres{list-style:none;display:flex;flex-direction:column;gap:12px}
.res-barre{display:grid;grid-template-columns:minmax(110px,1fr) 2fr auto;
  align-items:center;gap:10px}
.res-barre-nom{font-size:.86rem;font-weight:700}
.res-barre-piste{height:9px;background:var(--bg);border-radius:999px;overflow:hidden}
.res-barre-piste span{display:block;height:100%;background:var(--blue);border-radius:999px}
.res-barre-val{font-size:.9rem;font-weight:800;text-align:right;white-space:nowrap}
.res-barre-sub{grid-column:2/4;font-size:.74rem;color:var(--muted);margin-top:-6px}
.res-manques{margin-top:14px}
.res-manques ul{margin-top:6px;padding-left:18px;line-height:1.6}

@media (max-width:640px){
  .res-barre{grid-template-columns:1fr auto}
  .res-barre-piste{grid-column:1/3;order:3}
  .res-barre-sub{grid-column:1/3;order:4;margin-top:0}
}

/* ── Visibilité IA : robots par opérateur, relevés de citation ────────── */
.via-op{background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:14px 16px;margin-bottom:10px}
.via-op-nom{font-size:.74rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase;
  color:var(--blue);margin-bottom:8px}
.via-agents{list-style:none;display:flex;flex-direction:column;gap:7px}
.via-agent{display:flex;align-items:center;gap:9px;flex-wrap:wrap;font-size:.84rem}
.via-puce{width:8px;height:8px;border-radius:50%;background:var(--green);flex-shrink:0}
.via-agent.is-ecart .via-puce{background:var(--red)}
.via-agent-nom{font-weight:700;font-family:ui-monospace,monospace;font-size:.8rem}
.via-etat{color:var(--muted);font-size:.78rem}
.via-etat em{font-style:normal;opacity:.7}
.via-attendu{font-size:.76rem;font-weight:700;color:var(--red);background:#fef2f2;
  border-radius:999px;padding:2px 9px}
.via-note{flex-basis:100%;font-size:.76rem;color:var(--muted);padding-left:17px}

.via-ajout{display:flex;gap:8px;flex-wrap:wrap;align-items:flex-start;margin:12px 0}
.via-ajout input,.via-ajout textarea{flex:1;min-width:200px;padding:10px 12px;
  border:1px solid var(--line);border-radius:10px;background:var(--bg);
  font-size:.9rem;font-family:inherit}
.via-releve{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:6px}
.via-releve select{padding:5px 9px;border:1px solid var(--line);border-radius:8px;
  background:var(--bg);font-size:.78rem}

/* llms.txt — complétion assistée. Les champs restent modifiables : la méta
   description est un point de départ, pas la phrase définitive. */
.llms-list{list-style:none;display:flex;flex-direction:column;gap:2px;margin:14px 0}
.llms-item{display:flex;flex-direction:column;gap:6px;padding:11px 4px;
  border-bottom:1px solid var(--line)}
.llms-item:last-child{border-bottom:none}
.llms-tete{display:flex;align-items:center;gap:9px;cursor:pointer}
.llms-case{width:17px;height:17px;flex-shrink:0;accent-color:var(--blue)}
.llms-chemin{flex:1;min-width:0;font-family:ui-monospace,monospace;font-size:.8rem;
  font-weight:700;overflow-wrap:anywhere}
.llms-item input[type=text]{width:100%;padding:7px 11px;border:1px solid var(--line);
  border-radius:9px;background:var(--bg);font-size:.84rem;font-family:inherit}
.llms-item .llms-desc{color:var(--muted)}
.llms-item input[type=text]:focus{border-color:var(--blue);outline:none}
.llms-actions{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:10px}

/* ── SEO : onglets, alertes, frise du cycle de modification ───────────── */
.seo-onglets{display:flex;gap:6px;flex-wrap:wrap;margin:18px 0 14px}
.seo-onglet{border:1px solid var(--line);background:var(--surface);border-radius:999px;
  padding:7px 16px;cursor:pointer;font-size:.84rem;font-weight:700;color:var(--muted)}
.seo-onglet.is-active{background:var(--blue);border-color:var(--blue);color:#fff}

.seo-g-haute{background:#fef2f2;color:var(--red)}
.seo-g-moyenne{background:var(--amber-soft);color:var(--amber)}
.seo-g-basse{background:rgba(15,23,42,.07);color:var(--muted)}

.seo-declarer{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:14px 0 18px;
  padding-bottom:16px;border-bottom:1px solid var(--line)}
.seo-declarer select,.seo-declarer input{padding:9px 12px;border:1px solid var(--line);
  border-radius:10px;background:var(--bg);font-size:.88rem}
.seo-declarer input{flex:1;min-width:170px}

.seo-changement{background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:14px 16px;margin-bottom:10px}
.seo-changement.is-tarde{border-color:#fde68a;background:var(--amber-soft)}
.seo-chg-head{display:flex;align-items:center;gap:9px;flex-wrap:wrap;font-size:.9rem}
.seo-chg-desc{font-size:.84rem;color:var(--muted);margin-top:6px;line-height:1.55}
.seo-tarde{font-size:.82rem;color:var(--amber);margin-top:8px;line-height:1.55}

/* La frise : quatre pastilles, grises tant qu'elles ne sont pas atteintes */
.seo-frise{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:12px}
.seo-etape{display:flex;align-items:center;gap:6px;font-size:.74rem;color:var(--muted);
  padding-right:10px}
.seo-etape:not(:last-child)::after{content:"→";margin-left:4px;color:var(--line-strong)}
.seo-pastille{width:9px;height:9px;border-radius:50%;border:2px solid var(--line-strong);flex-shrink:0}
.seo-etape.is-on{color:var(--green);font-weight:700}
.seo-etape.is-on .seo-pastille{background:var(--green);border-color:var(--green)}

/* ── Notes : capture en cinq secondes, pensée pour le pouce ───────────── */
.nt-capture{position:sticky;top:0;z-index:5}
.nt-barre{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.nt-barre #nt-titre{flex:1;min-width:180px;padding:12px 14px;border:1px solid var(--line);
  border-radius:12px;background:var(--bg);font-size:.95rem}
.nt-types{display:flex;gap:4px;background:var(--bg);border:1px solid var(--line);
  border-radius:999px;padding:3px}
.nt-type{border:none;background:none;border-radius:999px;padding:6px 14px;cursor:pointer;
  font-size:.82rem;font-weight:700;color:var(--muted)}
.nt-type.is-active{background:var(--blue);color:#fff}
/* 48px : atteignable au pouce sans viser */
.nt-micro{width:48px;height:48px;flex-shrink:0;border-radius:50%;border:none;cursor:pointer;
  background:var(--blue);color:#fff;display:grid;place-items:center}
.nt-micro svg{width:22px;height:22px}
.nt-micro:hover{filter:brightness(1.08)}
.nt-micro.is-on{background:var(--red);animation:nt-pulse 1.4s ease-in-out infinite}
@keyframes nt-pulse{0%,100%{opacity:1}50%{opacity:.6}}

.nt-enreg{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px;
  padding:10px 14px;background:var(--red-soft,#fef2f2);border:1px solid #fecaca;border-radius:12px}
.nt-pastille{width:10px;height:10px;border-radius:50%;background:var(--red);
  animation:nt-pulse 1.4s ease-in-out infinite;flex-shrink:0}
.nt-chrono{font-variant-numeric:tabular-nums;font-weight:800;font-size:1rem;min-width:48px}
.nt-niveau{flex:1;min-width:70px;height:6px;background:#fecaca;border-radius:999px;overflow:hidden}
.nt-niveau span{display:block;height:100%;width:0;background:var(--red);transition:width .08s linear}

.nt-filtres{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:14px}
.nt-filtre{border:1px solid var(--line);background:var(--surface);border-radius:999px;
  padding:6px 14px;cursor:pointer;font-size:.82rem;font-weight:700;color:var(--muted)}
.nt-filtre.is-active{background:var(--blue-soft);border-color:#bfdbfe;color:var(--blue)}
.nt-filtres input{flex:1;min-width:150px;padding:8px 12px;border:1px solid var(--line);
  border-radius:10px;background:var(--bg);font-size:.88rem}

.nt-list{list-style:none;display:flex;flex-direction:column;gap:2px}
.nt-item{display:flex;align-items:flex-start;gap:10px;padding:11px 4px;
  border-bottom:1px solid var(--line)}
.nt-item:last-child{border-bottom:none}
.nt-item.is-done{opacity:.55}
.nt-item.is-done .nt-titre{text-decoration:line-through;color:var(--muted)}
.nt-body{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0;cursor:pointer}
.nt-titre{font-weight:700;font-size:.9rem;line-height:1.4}
.nt-meta{display:flex;align-items:center;gap:9px;flex-wrap:wrap;font-size:.76rem;color:var(--muted)}
.nt-idee{background:var(--blue-soft);color:var(--blue)}
.nt-bug{background:#fef2f2;color:var(--red)}
.nt-encours{font-style:italic;color:var(--amber)}

/* Fiche : panneau latéral, plein écran sur mobile */
.nt-panneau{position:fixed;inset:0;z-index:60;display:flex;justify-content:flex-end}
.nt-panneau-fond{position:absolute;inset:0;background:rgba(15,23,42,.35)}
.nt-panneau-corps{position:relative;width:min(560px,100%);height:100%;overflow-y:auto;
  background:var(--surface);padding:20px 22px 40px;box-shadow:-8px 0 28px rgba(15,23,42,.12)}
.nt-fiche-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px}
.nt-fiche-titre{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:10px;
  background:var(--bg);font-size:1.05rem;font-weight:700;margin-bottom:10px}
.nt-fiche-contenu{width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:10px;
  background:var(--bg);font-size:.9rem;line-height:1.6;font-family:inherit;resize:vertical}
.nt-apercu{margin-top:12px;padding:12px 14px;background:var(--bg);border-radius:10px;
  font-size:.87rem;line-height:1.65}
.nt-section{font-size:.74rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase;
  color:var(--blue);margin:22px 0 8px}
.nt-audio{background:var(--bg);border:1px solid var(--line);border-radius:10px;
  padding:12px 14px;margin-bottom:10px}
.nt-audio audio{width:100%}
.nt-audio-outils{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:8px;
  font-size:.78rem;color:var(--muted)}
.nt-erreur{margin-top:8px;font-size:.82rem;color:var(--red);display:flex;align-items:center;
  gap:8px;flex-wrap:wrap}
.nt-transcription{margin-top:10px;font-size:.85rem}
.nt-transcription summary{cursor:pointer;font-weight:700;color:var(--blue)}
.nt-transcription p{margin:8px 0;line-height:1.65;white-space:pre-wrap}
.nt-images{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:8px}
.nt-image{position:relative;margin:0}
.nt-image img{width:100%;height:96px;object-fit:cover;border-radius:8px;display:block}
.nt-image .mkt-del{position:absolute;top:2px;right:2px;background:rgba(255,255,255,.9);
  border-radius:6px}
.nt-ajout-image{display:inline-block;margin-top:10px;cursor:pointer}
.nt-sep{border:none;border-top:1px solid var(--line);margin:24px 0 14px}
.nt-supprimer{color:var(--red)}

@media (max-width:640px){
  .nt-panneau-corps{width:100%;padding:16px 16px 32px}
  .nt-barre #nt-titre{order:-1;width:100%;flex-basis:100%}
}

/* Courbes : légende cliquable, une couleur par canal */
.aud-shell{height:300px;background:var(--surface);border:1px solid var(--line);
  border-radius:12px;padding:8px 10px}
.aud-modes{display:flex;gap:6px}
.aud-modes .btn.is-active{background:var(--blue);color:#fff;border-color:var(--blue)}
.aud-legende{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 6px}
.aud-leg{display:flex;align-items:center;gap:6px;background:var(--surface);
  border:1px solid var(--line);border-radius:999px;padding:4px 11px;cursor:pointer;
  font-size:.78rem;font-weight:700;color:var(--text)}
.aud-leg:hover{border-color:var(--line-strong)}
.aud-leg.is-off{opacity:.4}
.aud-leg.is-off .aud-leg-puce{background:var(--muted)!important}
.aud-leg-puce{width:9px;height:9px;border-radius:50%;flex-shrink:0;display:inline-block}

/* Lecture : une carte par canal */
.aud-carte{align-items:flex-start}
.aud-carte .metric-label{display:flex;align-items:center;gap:6px}
.aud-lecture{display:block;margin-top:6px;font-size:.8rem;line-height:1.5;color:var(--text)}
.aud-echantillon{display:block;font-size:.72rem;color:var(--muted);font-style:italic}
.aud-variation{display:block;font-size:.76rem;font-weight:700;margin-top:2px}

/* Listes Brevo proposées quand l'identifiant manque */
.aud-brevo-listes{list-style:none;margin:10px 0;display:flex;flex-direction:column;gap:5px;font-size:.86rem}
.aud-brevo-listes code{font-weight:700}

.aud-semaine{background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:14px 16px;margin-bottom:10px;box-shadow:var(--shadow)}
.aud-semaine-nom{font-size:.74rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase;
  color:var(--blue);margin-bottom:10px}
.aud-grille{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr));gap:10px}
.aud-cell{display:flex;flex-direction:column;gap:1px}
.aud-cell-label{font-size:.7rem;color:var(--muted)}
.aud-cell-val{font-size:1.05rem;font-weight:800}
.aud-cell-delta{font-size:.76rem;font-weight:700;color:var(--muted)}
.aud-cell-delta.is-up{color:var(--green)}
.aud-cell-delta.is-down{color:var(--red)}
.aud-pub{margin-top:12px;padding-top:10px;border-top:1px solid var(--line)}
.aud-pub-titre{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.aud-pub ul{list-style:none;margin-top:6px;display:flex;flex-direction:column;gap:4px;font-size:.84rem}
.aud-pub-vide{margin-top:10px;font-size:.8rem;color:var(--muted);font-style:italic}

/* Veille du site — ce qui a bougé depuis le dernier passage */
.veille-bloc{display:flex;flex-direction:column;gap:8px;background:var(--surface);
  border:1px solid var(--line);border-radius:12px;padding:14px 16px;margin-bottom:10px;box-shadow:var(--shadow)}
.veille-bloc.is-version{border-color:#a7f3d0;background:var(--green-soft)}
.veille-bloc.is-new{border-color:#bfdbfe;background:var(--blue-soft)}
.veille-bloc.is-diag{border-color:#fde68a;background:var(--amber-soft)}
.veille-bloc.is-diag .diag{margin-top:6px}
.diag li.is-ko .diag-mark{background:#fee2e2;color:var(--red)}
.diag-groupe{font-size:.72rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase;
  color:var(--blue);margin:18px 0 8px}
.diag-groupe:first-of-type{margin-top:10px}
.diag-detail{font-size:.8rem;color:var(--muted)}
.veille-head{display:flex;align-items:center;gap:9px;font-size:.9rem}
.veille-titre{font-size:.88rem;color:var(--muted)}
.veille-details{list-style:disc;padding-left:20px;font-size:.83rem;line-height:1.6;
  max-height:180px;overflow-y:auto}
.veille-liste{list-style:none;display:flex;flex-direction:column;gap:8px;font-size:.85rem}
.veille-liste li{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.veille-liste a{font-weight:700;color:var(--blue)}
.veille-page-titre{flex:1;min-width:140px;color:var(--muted);font-size:.82rem}
/* « Nouvelle page » ou « modifiée le … » */
.veille-quand{flex-shrink:0;font-size:.74rem;color:var(--muted);white-space:nowrap}
.veille-quand.is-new{font-weight:700;color:var(--green);background:var(--green-soft);
  border-radius:999px;padding:2px 9px}
.veille-pied{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.veille-reste{color:var(--muted);font-size:.8rem;font-style:italic}
.btn-lien{background:none;border:none;padding:0;color:var(--blue);font-weight:700;
  font-size:inherit;cursor:pointer;text-decoration:underline}

/* Historique — la mémoire longue */
.mkt-histo-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:22px 0 2px}
.mkt-histo-head h3{font-size:1rem}
.mkt-histo-liste{list-style:none;max-height:320px;overflow-y:auto;margin-top:10px;
  border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.mkt-histo-item{display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:9px 14px;border-bottom:1px solid var(--line);font-size:.85rem}
.mkt-histo-item:last-child{border-bottom:none}
.mkt-histo-date{flex-shrink:0;width:120px;font-size:.76rem;color:var(--muted)}
.mkt-histo-titre{flex:1;min-width:160px}
.mkt-histo-rouvert{font-size:.72rem;font-weight:700;color:var(--green);
  background:var(--green-soft);border-radius:999px;padding:2px 9px}
.mkt-histo-note{display:block;font-size:.78rem;color:var(--muted);font-style:italic;margin-top:2px}

/* Pouces : le seul retour de performance dont on dispose */
.mkt-avis{display:flex;align-items:center;gap:4px;flex-shrink:0}
.mkt-pouce{
  background:none;border:1px solid transparent;border-radius:8px;cursor:pointer;
  font-size:.95rem;line-height:1;padding:3px 6px;filter:grayscale(1);opacity:.45;
}
.mkt-pouce:hover{filter:none;opacity:1;background:var(--bg)}
.mkt-pouce.is-on{filter:none;opacity:1;background:var(--green-soft);border-color:#a7f3d0}
.mkt-pouce.is-on.is-down{background:#fee2e2;border-color:#fecaca}
.mkt-avis-note{font-size:.74rem}

.mkt-ideas-form,.mkt-draft-form{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}
.mkt-ideas-form select,.mkt-ideas-form input,
.mkt-draft-form select,.mkt-draft-form input{
  padding:9px 12px;border:1px solid var(--line);border-radius:10px;background:var(--bg);font-size:.88rem;
}
.mkt-ideas-form input,.mkt-draft-form input{flex:1;min-width:180px}

.mkt-idees{list-style:none;display:flex;flex-direction:column;gap:10px}
.mkt-idee{display:flex;flex-direction:column;gap:6px;background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:12px 14px}
.mkt-idee-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mkt-idee-head strong{font-size:.9rem;line-height:1.4}
.mkt-idee-angle{font-size:.82rem;color:var(--muted);line-height:1.55}
.mkt-idee-accroche{font-size:.82rem;font-style:italic;color:var(--text);line-height:1.5}
.mkt-idee-actions{display:flex;gap:6px;margin-top:2px}

.mkt-draft-result{display:flex;flex-direction:column;gap:10px}
.mkt-draft-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.mkt-draft-bar .btn{margin-left:6px}
#mkt-draft-texte{
  width:100%;padding:14px;border:1px solid var(--line);border-radius:10px;background:var(--bg);
  font-size:.9rem;line-height:1.7;resize:vertical;
}
#mkt-draft-texte:focus{outline:3px solid rgba(15,92,219,.16);border-color:var(--blue);background:var(--surface)}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width:1100px){
  .cols,.stats-section.cols,.charts,.users-layout{grid-template-columns:1fr}
  .user-panel{position:static;max-height:none}
  .blog-layout,.inbox-layout{grid-template-columns:1fr}
  .article-col,.inbox-col{position:static}
  .article-list,.inbox-list{max-height:340px}
  .msg{max-width:100%}
}
@media (max-width:900px){
  .nav-toggle{display:flex}
  .shell{grid-template-columns:1fr}
  .sidebar{
    position:fixed;top:58px;left:0;width:250px;z-index:40;
    transform:translateX(-100%);transition:transform .2s ease;
    box-shadow:0 20px 50px rgba(15,23,42,.15);
  }
  .sidebar.is-open{transform:translateX(0)}
  .content{padding:20px 16px 60px}
  .editor-grid{grid-template-columns:1fr}
  .topbar-right .btn:not(:last-child){display:none}
  /* Exception : le bouton d'installation ne sert QUE sur téléphone.
     Le :not([hidden]) est indispensable — sans lui, cette règle rendrait
     visible un bouton que le JS a explicitement caché. */
  .topbar-right .btn-install:not([hidden]){display:inline-flex}
}

/* ── Installation sur le téléphone ────────────────────────────────────── */
/* ⚠️ .btn pose display:inline-flex, ce qui l'emporte sur le [hidden] du
   navigateur (même spécificité, feuille de l'auteur en dernier). Sans cette
   règle, l'attribut hidden d'un bouton ne cacherait rien du tout. */
.btn[hidden]{display:none}

.btn-install{background:var(--blue-soft);color:var(--blue)}
.login-card .btn-install{margin-top:14px}

.pwa-aide{
  position:fixed;left:50%;bottom:18px;transform:translateX(-50%);z-index:120;
  display:flex;align-items:flex-start;gap:10px;
  width:min(420px,calc(100vw - 32px));
  background:var(--text);color:#fff;border-radius:12px;padding:14px 14px 14px 16px;
  box-shadow:0 18px 40px rgba(15,23,42,.28);font-size:.86rem;line-height:1.45;
}
.pwa-aide-fermer{
  background:none;border:none;color:#fff;opacity:.7;cursor:pointer;
  font-size:1.3rem;line-height:1;padding:0 2px;
}
.pwa-aide-fermer:hover{opacity:1}
