/* ============================================================
   XAMLE — Backoffice Design System
   Épuré & spacieux · ancré sur le bleu de marque de l'app
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Poppins:wght@500;600;700&family=Nunito:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand — le bleu azur de l'app Xamle */
  --brand-50:  #eaf2fe;
  --brand-100: #d6e6fd;
  --brand-200: #aecdfb;
  --brand-500: #2680eb;
  --brand-600: #1e7bf5;
  --brand-700: #1666d6;
  --brand-800: #1453ad;

  /* Accent rose — réservé "épinglé / mis en avant" */
  --pin-500: #db2777;
  --pin-50:  #fce7f1;

  /* Neutres (légèrement froids) */
  --bg:        #f6f7f9;
  --surface:   #ffffff;
  --surface-2: #fbfcfd;
  --border:    #e7eaf0;
  --border-strong: #d7dce6;
  --text:      #14171c;
  --text-2:    #4a5160;
  --text-3:    #8a93a3;

  /* Statuts */
  --ok-600:#11935f;   --ok-bg:#e4f6ee;
  --warn-600:#c9810a; --warn-bg:#fbf0d8;
  --info-600:#1e7bf5; --info-bg:#e7f0fe;
  --mute-600:#5e6678; --mute-bg:#eef0f4;
  --danger-600:#d23b3b; --danger-bg:#fbe8e8;

  /* Rayons & ombres */
  --r-sm: 8px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 22px;
  --sh-1: 0 1px 2px rgba(20,23,28,.04), 0 1px 3px rgba(20,23,28,.06);
  --sh-2: 0 2px 6px rgba(20,23,28,.05), 0 8px 24px rgba(20,23,28,.06);
  --sh-pop: 0 12px 40px rgba(20,23,28,.14);

  --sidebar-w: 256px;
  --topbar-h: 68px;

  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg:        #0e1116;
  --surface:   #161a21;
  --surface-2: #1b2029;
  --border:    #262c37;
  --border-strong:#333b48;
  --text:      #eef1f6;
  --text-2:    #aeb6c4;
  --text-3:    #6f7889;
  --ok-bg:#13301f; --warn-bg:#332708; --info-bg:#102541; --mute-bg:#222833; --danger-bg:#341818;
  --sh-1: 0 1px 2px rgba(0,0,0,.3);
  --sh-2: 0 2px 8px rgba(0,0,0,.35);
  --sh-pop: 0 16px 48px rgba(0,0,0,.6);
}

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

/* Safety floor: any inline icon with no explicit sizing rule defaults to 18px
   instead of ballooning to the SVG default size. This bare `svg` selector has the
   lowest possible specificity, so every authored rule (charts, sparklines, icon
   classes) overrides it. */
svg { width: 18px; height: 18px; }

html, body {
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 22px 18px;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand-600);
  display: grid; place-items: center;
  color: #fff; flex: none;
  box-shadow: 0 4px 12px rgba(30,123,245,.35);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand-sub { font-size: 11px; color: var(--text-3); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-top: 1px; }

.nav { padding: 8px 12px; overflow-y: auto; flex: 1; }
.nav-group-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); padding: 16px 12px 7px;
}
/* ---- groupes repliables ---- */
.nav-group + .nav-group { margin-top: 2px; }
button.nav-group-label { display: flex; align-items: center; width: 100%; gap: 8px;
  background: none; border: none; cursor: pointer; text-align: left; border-radius: 8px; transition: color .12s; }
button.nav-group-label:hover { color: var(--text-2); }
button.nav-group-label svg { width: 14px; height: 14px; margin-left: auto; opacity: .7;
  transform: rotate(90deg); transition: transform .2s ease; }
.nav-group.collapsed button.nav-group-label svg { transform: rotate(0deg); }
.nav-group-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s ease; }
.nav-group.collapsed .nav-group-items { grid-template-rows: 0fr; }
.nav-group-inner { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 9px 12px; border-radius: 10px;
  color: var(--text-2); font-size: 14px; font-weight: 600;
  text-align: left; transition: background .12s, color .12s;
  position: relative;
}
.nav-item svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--brand-50); color: var(--brand-700); }
[data-theme="dark"] .nav-item.active { background: rgba(30,123,245,.16); color: #7fb4ff; }
.nav-item.active svg { opacity: 1; }
.nav-badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--brand-600); color: #fff;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  display: grid; place-items: center;
}
.nav-badge.muted { background: var(--mute-bg); color: var(--text-2); }

.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: 12px; transition: background .12s;
}
.user-chip:hover { background: var(--surface-2); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
}
.user-meta { line-height: 1.25; min-width: 0; overflow: hidden; }
.user-meta b { font-size: 13.5px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 12px; color: var(--text-3); }
.signout-btn { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: var(--text-3); transition: all .12s; }
.signout-btn:hover { background: var(--danger-bg); color: var(--danger-600); }
.signout-btn svg { width: 17px; height: 17px; }

/* ---- Main ---- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 18px;
  padding: 0 30px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 19px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.page-crumb { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 13px; width: 280px;
  color: var(--text-3);
}
.search input { border: none; outline: none; background: none; font-size: 13.5px; color: var(--text); width: 100%; }
.search svg { width: 16px; height: 16px; flex: none; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  color: var(--text-2); border: 1px solid var(--border); background: var(--surface);
  transition: background .12s, color .12s; position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.dot {
  position: absolute; top: 8px; right: 9px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--pin-500); border: 2px solid var(--surface);
}

.content { padding: 28px 30px 60px; }
.screen { display: none; animation: fade .25s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  font-size: 13.5px; font-weight: 700; transition: all .14s;
  border: 1px solid transparent; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--brand-600); color: #fff; box-shadow: 0 2px 8px rgba(30,123,245,.28); }
.btn-primary:hover { background: var(--brand-700); }
.btn-ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .01em;
}
.badge .d { width: 6px; height: 6px; border-radius: 50%; }
.badge.ok    { background: var(--ok-bg);   color: var(--ok-600); }    .badge.ok .d{background:var(--ok-600);}
.badge.warn  { background: var(--warn-bg); color: var(--warn-600); }  .badge.warn .d{background:var(--warn-600);}
.badge.info  { background: var(--info-bg); color: var(--info-600); }  .badge.info .d{background:var(--info-600);}
.badge.mute  { background: var(--mute-bg); color: var(--mute-600); }  .badge.mute .d{background:var(--mute-600);}
.badge.pin   { background: var(--pin-50);  color: var(--pin-500); }   .badge.pin .d{background:var(--pin-500);}

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 9px; border-radius: 7px;
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--border);
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
}

.seg {
  display: inline-flex; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px;
}
.seg button {
  height: 30px; padding: 0 13px; border-radius: 7px; font-size: 12.5px; font-weight: 700;
  color: var(--text-2); display: inline-flex; align-items: center; gap: 6px;
}
.seg button svg { width: 15px; height: 15px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }

.chip {
  height: 33px; padding: 0 13px; border-radius: 9px; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 7px; transition: all .12s;
}
.chip:hover { border-color: var(--border-strong); }
.chip.on { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }
.chip svg { width: 14px; height: 14px; }

.type-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.type-ico svg { width: 15px; height: 15px; }
.ti-video { background: var(--info-bg); color: var(--info-600); }
.ti-audio { background: #efe7fb; color: #7c3aed; }
.ti-image { background: var(--ok-bg); color: var(--ok-600); }
.ti-quiz  { background: var(--warn-bg); color: var(--warn-600); }

/* striped media placeholder */
.ph {
  background:
    repeating-linear-gradient(135deg, var(--surface-2) 0 9px, color-mix(in srgb,var(--surface-2) 60%, var(--border)) 9px 18px);
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.ph .ph-lbl {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-3);
  background: var(--surface); padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border);
}

.section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.section-head h2 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.muted { color: var(--text-3); }
.spacer { flex: 1; }

/* note de rationale */
.rationale {
  background: linear-gradient(180deg, var(--brand-50), var(--surface));
  border: 1px solid var(--brand-200); border-radius: var(--r-lg);
  padding: 18px 20px; display: flex; gap: 14px; margin-bottom: 24px;
}
[data-theme="dark"] .rationale { background: rgba(30,123,245,.08); }
.rationale .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-600); color:#fff; display: grid; place-items: center; flex: none; }
.rationale .ic svg { width: 17px; height: 17px; }
.rationale p { font-size: 13px; color: var(--text-2); line-height: 1.55; max-width: 80ch; }
.rationale b { color: var(--text); }

.pad { padding: 20px; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 18px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi-top span:first-child { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.kpi-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.kpi-ic svg { width: 16px; height: 16px; }
.kpi-val { font-size: 32px; font-weight: 700; letter-spacing: -.03em; margin: 12px 0 6px; line-height: 1; }
.kpi-val .u { font-size: 18px; color: var(--text-3); margin-left: 1px; }
.kpi-foot { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.kpi-foot svg { width: 14px; height: 14px; }
.kpi-foot.up { color: var(--ok-600); }
.kpi-foot.down { color: var(--danger-600); }

.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.dash-grid .span2 { grid-column: 1 / 2; }

.legend { display: flex; gap: 14px; }
.lg { font-size: 12px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.bars { display: flex; align-items: flex-end; gap: 16px; height: 180px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; height: 100%; }
.bar-stack { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; justify-content: center; gap: 5px; }
.bar { width: 14px; border-radius: 6px 6px 3px 3px; }
.bar.b1 { background: var(--brand-600); }
.bar.b2 { background: var(--brand-200); }
.bar-lbl { font-size: 11px; font-weight: 600; color: var(--text-3); }

.enc { display: flex; flex-direction: column; gap: 16px; }
.enc-row { display: grid; grid-template-columns: auto 1fr; gap: 11px; align-items: center; }
.enc-meta { line-height: 1.3; min-width: 0; }
.enc-meta b { font-size: 13px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enc-meta .mono { font-size: 11px; color: var(--text-3); }
.prog { grid-column: 2; height: 6px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; }
.prog span { display: block; height: 100%; border-radius: 99px; background: var(--brand-600);
  background-image: linear-gradient(90deg, var(--brand-500), var(--brand-700)); }

.mini-table { width: 100%; border-collapse: collapse; }
.mini-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); padding: 0 12px 10px; }
.mini-table th.ar, .mini-table td.ar { text-align: right; }
.mini-table td { padding: 11px 12px; border-top: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.mini-table tr:first-child td { border-top: none; }
.ct { display: flex; align-items: center; gap: 12px; }
.ct > div { line-height: 1.3; }
.ct b { font-size: 13.5px; font-weight: 700; display: block; }
.ct .mono { font-size: 11px; color: var(--text-3); }
.thumb { width: 52px; height: 36px; border-radius: 7px; flex: none; }
.thumb .ph-lbl { font-size: 8.5px; padding: 1px 4px; }

.donut-wrap { display: flex; align-items: center; gap: 22px; padding: 6px 0; }
.donut { width: 116px; height: 116px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.donut-hole { width: 74px; height: 74px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; line-height: 1.1; }
.donut-hole b { font-size: 24px; font-weight: 700; }
.donut-hole span { font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.leg-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.leg-list li { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 9px; }
.leg-list li b { margin-left: auto; color: var(--text); }

/* stub screens */
.stub { max-width: 460px; margin: 60px auto; text-align: center; color: var(--text-2); }
.stub svg { width: 40px; height: 40px; color: var(--brand-600); margin-bottom: 14px; }
.stub h3 { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.stub p { font-size: 14px; line-height: 1.6; }

@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .span2 { grid-column: auto; }
}

/* ============================================================
   LIBRARY
   ============================================================ */
.lib-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.btn-x { width: 34px; height: 34px; border-radius: 9px; }

.dropzone { border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 22px; background: var(--surface-2); }
.dz-inner { display: flex; align-items: center; gap: 13px; flex: none; }
.dz-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; }
[data-theme="dark"] .dz-ic { background: rgba(30,123,245,.16); }
.dz-ic svg { width: 19px; height: 19px; }
.dz-inner b { font-size: 13.5px; font-weight: 700; }
.dz-up { margin-left: auto; display: grid; grid-template-columns: auto minmax(180px,240px) 1fr auto; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 9px 11px; min-width: 360px; }
.dz-up-meta { line-height: 1.3; min-width: 0; }
.dz-up-meta b { font-size: 12.5px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-up-meta .mono { font-size: 10.5px; color: var(--text-3); }

.result-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: var(--text-2); }

.tag-link { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-200); cursor: pointer; }
[data-theme="dark"] .tag-link { background: rgba(30,123,245,.14); color: #7fb4ff; }
.tag-link svg { width: 13px; height: 13px; }

.lib-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cc { overflow: hidden; transition: box-shadow .15s, transform .15s, border-color .15s; }
.cc:hover { box-shadow: var(--sh-2); border-color: var(--border-strong); transform: translateY(-2px); }
.cc-thumb { aspect-ratio: 16/10; position: relative; }
.cc-badge { position: absolute; top: 10px; left: 10px; }
.cc-badge .badge { background: rgba(255,255,255,.92); backdrop-filter: blur(4px); box-shadow: var(--sh-1); }
.cc-type { position: absolute; top: 10px; right: 10px; }
.cc-type .type-ico { background: rgba(255,255,255,.92); box-shadow: var(--sh-1); }
.cc-dur { position: absolute; bottom: 10px; right: 10px; font-size: 11px; font-weight: 600; color: #fff;
  background: rgba(20,23,28,.72); padding: 2px 7px; border-radius: 6px; }
.cc-play { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.92); box-shadow: var(--sh-2); display: grid; place-items: center; }
.cc-play svg { width: 18px; height: 18px; margin-left: 2px; }
.cc-body { padding: 13px 14px 11px; }
.cc-body h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 9px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.cc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 11px; }
.cc-foot { display: flex; align-items: center; gap: 14px; padding-top: 11px; border-top: 1px solid var(--border); }
.cc-foot .mono { font-size: 12px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.cc-foot .mono svg { width: 14px; height: 14px; color: var(--text-3); }
.cc-foot .cc-more { margin-left: auto; }

/* data table (list view) */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3); padding: 13px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.data-table th.ar, .data-table td.ar { text-align: right; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .tag svg { width: 13px; height: 13px; }
.data-table .type-ico { width: 22px; height: 22px; }
.bar-mini { display: inline-block; width: 54px; height: 6px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; vertical-align: middle; margin-right: 7px; }
.bar-mini span { display: block; height: 100%; background: var(--brand-600); border-radius: 99px; }

.pager { display: flex; align-items: center; gap: 12px; margin-top: 20px; font-size: 13px; }
.pager-btns { display: flex; align-items: center; gap: 5px; }
.pg { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--text-2);
  border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; }
.pg svg { width: 15px; height: 15px; }
.pg:hover:not(:disabled):not(.on) { background: var(--surface-2); }
.pg.on { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }
.pg:disabled { opacity: .4; cursor: default; }

@media (max-width: 1200px) { .lib-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px)  { .lib-grid { grid-template-columns: 1fr; } .dz-up { min-width: 0; width: 100%; } .dropzone { flex-wrap: wrap; } }

/* ============================================================
   FEED
   ============================================================ */
.feed-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.seg-mini button { height: 26px; padding: 0 11px; font-size: 11.5px; }

.algo-note { display: flex; align-items: flex-start; gap: 11px; background: #efe7fb; border: 1px solid #ddc9f5;
  border-radius: var(--r-md); padding: 13px 15px; margin-bottom: 16px; font-size: 13px; color: #5b2ca6; line-height: 1.5; }
[data-theme="dark"] .algo-note { background: rgba(124,58,237,.14); border-color: rgba(124,58,237,.4); color: #c4a6f5; }
.algo-note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.algo-note b { color: inherit; }

.feed-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }

.feed-list { display: flex; flex-direction: column; gap: 10px; }
.feed-card { display: grid; grid-template-columns: auto auto 96px 1fr auto auto; align-items: center; gap: 14px; padding: 12px 14px;
  transition: box-shadow .14s, border-color .14s; }
.feed-card:hover { box-shadow: var(--sh-2); border-color: var(--border-strong); }
.feed-card.pinned { border-color: var(--pin-500); box-shadow: 0 0 0 1px var(--pin-500), var(--sh-1); }
.feed-rank { font-size: 15px; font-weight: 700; color: var(--text-3); width: 22px; text-align: center; }
.feed-grip { width: 26px; height: 30px; display: grid; place-items: center; color: var(--text-3); cursor: grab; border-radius: 7px; }
.feed-grip:hover { background: var(--surface-2); color: var(--text-2); }
.feed-grip svg { width: 17px; height: 17px; }
.feed-thumb { width: 96px; height: 60px; border-radius: 9px; position: relative; flex: none; }
.feed-thumb .ph-lbl { font-size: 8.5px; padding: 1px 4px; }
.feed-thumb .type-ico { position: absolute; bottom: 5px; right: 5px; background: rgba(255,255,255,.92); width: 22px; height: 22px; }
.fc-play { position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.9);
  display: grid; place-items: center; box-shadow: var(--sh-1); }
.fc-play svg { width: 13px; height: 13px; margin-left: 1px; }
.feed-main { min-width: 0; }
.feed-title { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.feed-title h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge.pin svg { width: 12px; height: 12px; }
.feed-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.feed-tags .tag svg { width: 13px; height: 13px; }
.feed-tags .type-ico { width: 20px; height: 20px; }
.feed-perf { display: flex; gap: 18px; padding: 0 6px; }
.feed-perf span { display: flex; flex-direction: column; align-items: center; gap: 2px; line-height: 1.1; white-space: nowrap; }
.feed-perf svg { width: 15px; height: 15px; color: var(--text-3); margin-bottom: 2px; }
.feed-perf b { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.feed-perf em { font-size: 10px; font-style: normal; color: var(--text-3); font-weight: 600; }

/* ---- phone preview ---- */
.feed-preview { position: sticky; top: calc(var(--topbar-h) + 24px); }
.prev-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.phone { width: 100%; max-width: 300px; margin: 0 auto; aspect-ratio: 9 / 19; background: #000; border-radius: 38px; padding: 9px;
  box-shadow: 0 0 0 2px var(--border-strong), var(--sh-pop); position: relative; }
.phone-notch { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); width: 92px; height: 24px; background: #000; border-radius: 99px; z-index: 5; }
.phone-screen { width: 100%; height: 100%; border-radius: 30px; overflow: hidden; position: relative;
  background: linear-gradient(180deg, #2a2f38, #0e1116); }
.phone-screen .ph-lbl { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.tt-top { position: absolute; top: 50px; left: 14px; right: 14px; display: flex; }
.tt-pin { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: #fff;
  background: var(--pin-500); padding: 4px 9px; border-radius: 7px; }
.tt-pin svg { width: 12px; height: 12px; }
.tt-rail { position: absolute; right: 12px; bottom: 92px; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.tt-rail button { display: flex; flex-direction: column; align-items: center; gap: 3px; color: #fff; }
.tt-ic { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.16); backdrop-filter: blur(4px);
  display: grid; place-items: center; }
.tt-ic svg { width: 19px; height: 19px; }
.tt-ava { background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); font-size: 12px; font-weight: 700; }
.tt-rail b { font-size: 10.5px; font-weight: 600; }
.tt-bottom { position: absolute; left: 14px; right: 64px; bottom: 58px; color: #fff; }
.tt-prog { height: 3px; border-radius: 99px; background: rgba(255,255,255,.25); margin-bottom: 12px; overflow: hidden; }
.tt-prog span { display: block; height: 100%; background: #fff; border-radius: 99px; }
.tt-bottom b { font-size: 15px; font-weight: 700; display: block; }
.tt-sub { font-size: 11.5px; opacity: .82; }
.tt-nav { position: absolute; bottom: 0; left: 0; right: 0; height: 46px; background: rgba(14,17,22,.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: space-around; }
.tt-nav span { color: rgba(255,255,255,.55); display: grid; place-items: center; }
.tt-nav span.on { color: var(--brand-500); }
.tt-nav svg { width: 21px; height: 21px; }
.prev-cap { font-size: 11.5px; color: var(--text-3); text-align: center; margin-top: 14px; line-height: 1.5; }

@media (max-width: 1080px) { .feed-layout { grid-template-columns: 1fr; } .feed-preview { position: static; max-width: 320px; }
  .feed-perf { gap: 14px; } }
@media (max-width: 820px) {
  .feed-card { grid-template-columns: auto auto 1fr auto; }
  .feed-thumb { display: none; } .feed-perf { display: none; }
}

/* ============================================================
   PROGRAM BUILDER
   ============================================================ */
.pm-head { padding: 20px; }
.pm-head-top { display: flex; gap: 20px; align-items: flex-start; }
.pm-cover { width: 132px; height: 84px; border-radius: var(--r-md); flex: none; }
.pm-head-main { flex: 1; min-width: 0; }
.pm-switch { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pm-switch h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.pm-stats { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.pm-stats span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pm-stats svg { width: 16px; height: 16px; color: var(--text-3); }
.pm-stats b { color: var(--text); }
.pm-actions { display: flex; gap: 10px; flex: none; }

.pm-progress { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border); }
.pm-prog-row { display: flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.pm-prog-row b { color: var(--text); }
.pm-prog-bar { height: 9px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; display: flex; }
.pm-prog-bar .seg-pub { background: var(--ok-600); height: 100%; }
.pm-prog-bar .seg-cur { background: var(--info-600); height: 100%; }
.pm-prog-leg { display: flex; gap: 18px; margin-top: 11px; }
.pm-prog-leg span { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-2); }

.pm-tree { display: flex; flex-direction: column; gap: 12px; }
.pm-module { overflow: hidden; }
.pm-mod-head { display: grid; grid-template-columns: auto auto auto 1fr auto 120px auto; align-items: center; gap: 13px;
  padding: 13px 14px; cursor: pointer; transition: background .12s; }
.pm-mod-head:hover { background: var(--surface-2); }
.pm-caret { width: 24px; height: 24px; display: grid; place-items: center; color: var(--text-3); border-radius: 6px; }
.pm-caret svg { width: 16px; height: 16px; transition: transform .18s; }
.pm-module.open .pm-caret svg { transform: rotate(90deg); }
.pm-mod-num { font-size: 12px; font-weight: 700; color: var(--brand-700); background: var(--brand-50); padding: 4px 9px; border-radius: 7px; }
[data-theme="dark"] .pm-mod-num { background: rgba(30,123,245,.16); color: #7fb4ff; }
.pm-mod-title { min-width: 0; line-height: 1.3; }
.pm-mod-title b { font-size: 14.5px; font-weight: 700; display: block; }
.pm-mod-title .mono { font-size: 11px; color: var(--text-3); }
.pm-mod-bar { height: 6px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; }
.pm-mod-bar span { display: block; height: 100%; background: var(--ok-600); border-radius: 99px; }

.pm-lessons { display: none; flex-direction: column; padding: 4px 14px 12px 48px; border-top: 1px solid var(--border); background: var(--surface-2); }
.pm-module.open .pm-lessons { display: flex; }
.pm-lesson { display: grid; grid-template-columns: auto auto auto 1fr auto auto auto; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r-sm); position: relative; }
.pm-lesson:hover { background: var(--surface); box-shadow: var(--sh-1); }
.pm-lesson.locked { opacity: .62; }
.pm-line { width: 12px; height: 1px; background: var(--border-strong); }
.pm-les-title { min-width: 0; }
.pm-les-title b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.pm-lesson .feed-grip { height: 26px; }
.pm-lesson .tag { white-space: nowrap; }
.badge svg { width: 12px; height: 12px; }
.pm-add { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; margin: 8px 0 2px 36px;
  font-size: 12.5px; font-weight: 700; color: var(--brand-700); padding: 7px 11px; border-radius: 8px; transition: background .12s; }
.pm-add:hover { background: var(--brand-50); }
[data-theme="dark"] .pm-add:hover { background: rgba(30,123,245,.14); }
.pm-add svg { width: 15px; height: 15px; }

@media (max-width: 1000px) {
  .pm-head-top { flex-wrap: wrap; }
  .pm-actions { width: 100%; }
  .pm-mod-head { grid-template-columns: auto auto auto 1fr auto auto; }
  .pm-mod-bar { display: none; }
  .pm-lesson { grid-template-columns: auto auto auto 1fr auto auto; }
  .pm-lesson .tag { display: none; }
}

/* ============================================================
   QUIZ EDITOR
   ============================================================ */
.qz-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.qz-head-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.qz-title-row { display: flex; align-items: center; gap: 11px; margin-bottom: 6px; }
.qz-title-row h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.qz-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.qz-sub > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.qz-sub svg { width: 14px; height: 14px; color: var(--text-3); }
.qz-sub b { color: var(--text); }
.qz-head-r { margin-left: auto; display: flex; gap: 10px; flex: none; }

.qz-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.qz-stage { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* video */
.qz-video { aspect-ratio: 16/9; border-radius: var(--r-lg); position: relative; overflow: hidden;
  background: linear-gradient(180deg,#2a2f38,#0e1116); }
.qz-video .ph-lbl { position: absolute; top: 14px; left: 14px; }
.qz-vmark { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: #fff;
  background: rgba(217,39,119,.92); padding: 8px 13px; border-radius: 9px; box-shadow: var(--sh-2); }
.qz-vmark svg { width: 15px; height: 15px; }
.qz-transport { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; display: flex; align-items: center; gap: 12px;
  padding: 0 16px; background: linear-gradient(0deg, rgba(0,0,0,.55), transparent); }
.qz-tbtn { color: #fff; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; }
.qz-tbtn:hover { background: rgba(255,255,255,.16); }
.qz-tbtn svg { width: 20px; height: 20px; }
.qz-tbtn.play svg { width: 22px; height: 22px; }
.qz-time { color: #fff; font-size: 12.5px; font-weight: 600; }
.qz-time.muted { color: rgba(255,255,255,.6); margin-left: -6px; }

/* timeline */
.qz-timeline { padding: 16px 18px 14px; }
.qz-tl-head { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.qz-tl-head b { font-size: 14px; font-weight: 800; }
.qz-tl-head .muted { font-size: 12px; font-weight: 600; }
.qz-track { position: relative; height: 12px; border-radius: 99px; background: var(--mute-bg); margin: 0 6px; }
.qz-played { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px;
  background: linear-gradient(90deg,var(--brand-500),var(--brand-700)); }
.qz-playhead { position: absolute; top: -7px; bottom: -7px; width: 2px; background: var(--text); transform: translateX(-1px); z-index: 4; }
.qz-playhead span { position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--text); }
.qz-marker { position: absolute; top: 6px; transform: translateX(-50%); z-index: 5; cursor: grab; touch-action: none; }
.qz-marker:active { cursor: grabbing; }
.qz-mk-stem { position: absolute; left: 50%; top: -18px; width: 2px; height: 18px; background: var(--border-strong); transform: translateX(-50%); }
.qz-mk-dot { position: absolute; left: 50%; top: 0; width: 14px; height: 14px; border-radius: 50%; transform: translate(-50%,-50%);
  background: var(--surface); border: 3px solid var(--warn-600); box-shadow: var(--sh-1); }
.qz-mk-flag { position: absolute; left: 50%; top: -38px; transform: translateX(-50%); font-size: 10.5px; font-weight: 700; color: var(--warn-600);
  background: var(--warn-bg); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.qz-marker.active .qz-mk-dot { border-color: var(--brand-600); width: 17px; height: 17px; }
.qz-marker.active .qz-mk-flag { color: #fff; background: var(--brand-600); }
.qz-marker.active .qz-mk-stem { background: var(--brand-600); }
.qz-ruler { position: relative; height: 16px; margin: 14px 6px 0; }
.qz-ruler span { position: absolute; transform: translateX(-50%); font-size: 10px; font-weight: 600; color: var(--text-3); font-family: var(--mono); }

/* question editor */
.qz-editor { padding: 18px; }
.qz-ed-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.qz-ed-tag { font-size: 12px; font-weight: 700; color: var(--brand-700); background: var(--brand-50); padding: 5px 10px; border-radius: 7px; }
[data-theme="dark"] .qz-ed-tag { background: rgba(30,123,245,.16); color: #7fb4ff; }
.qz-field { display: block; margin-bottom: 16px; }
.qz-field > span { display: block; font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 7px; }
.qz-input { width: 100%; height: 42px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500; outline: none; transition: border-color .12s, box-shadow .12s; }
.qz-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-50); }
[data-theme="dark"] .qz-input:focus { box-shadow: 0 0 0 3px rgba(30,123,245,.18); }
.qz-input.slim { height: 38px; font-size: 13.5px; }
.qz-opts-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; }
.qz-opts-label span:first-child { font-size: 12px; font-weight: 700; color: var(--text-2); }
.qz-opts-label .muted { font-size: 11.5px; font-weight: 600; }
.qz-opts { display: flex; flex-direction: column; gap: 9px; }
.qz-opt { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px;
  padding: 6px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); transition: border-color .12s, background .12s; }
.qz-opt.correct { border-color: var(--ok-600); background: var(--ok-bg); }
.qz-radio { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; flex: none; color: #fff; }
.qz-opt.correct .qz-radio { background: var(--ok-600); border-color: var(--ok-600); }
.qz-radio svg { width: 15px; height: 15px; }
.qz-letter { font-size: 12px; font-weight: 700; color: var(--text-3); width: 16px; text-align: center; }
.qz-opt.correct .qz-letter { color: var(--ok-600); }

.qz-fb { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.qz-fb-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; margin-bottom: 13px; }
.qz-fb-title svg { width: 16px; height: 16px; color: var(--brand-600); }
.qz-fb-row { display: flex; align-items: center; gap: 14px; margin-bottom: 11px; }
.qz-fb-side { display: flex; flex-direction: column; gap: 7px; flex: none; }
.qz-fb-lbl { font-size: 11.5px; font-weight: 700; }
.qz-fb-lbl.ok { color: var(--ok-600); } .qz-fb-lbl.wrong { color: var(--danger-600); }
.qz-sw-row { display: flex; gap: 6px; }
.qz-sw { width: 24px; height: 24px; border-radius: 7px; background: var(--c); border: 2px solid transparent; box-shadow: var(--sh-1); transition: transform .1s; }
.qz-sw:hover { transform: scale(1.08); }
.qz-sw.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }

/* phone quiz preview */
.qz-preview { position: sticky; top: calc(var(--topbar-h) + 24px); }
.q-top { position: absolute; top: 46px; left: 14px; right: 14px; display: flex; justify-content: space-between; color: #fff; z-index: 3; }
.q-prog { font-size: 11.5px; font-weight: 700; background: rgba(0,0,0,.4); padding: 4px 9px; border-radius: 7px; }
.q-timer { font-size: 11.5px; font-weight: 700; background: rgba(0,0,0,.4); padding: 4px 9px; border-radius: 7px; }
.q-sheet { position: absolute; left: 10px; right: 10px; bottom: 14px; background: rgba(255,255,255,.97); border-radius: 18px; padding: 15px; box-shadow: var(--sh-pop); }
.q-q { font-size: 13.5px; font-weight: 700; color: #14171c; line-height: 1.35; margin-bottom: 12px; }
.q-opts { display: flex; flex-direction: column; gap: 8px; }
.q-opt { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 11px; border: 1.5px solid #e7eaf0;
  font-size: 12.5px; font-weight: 600; color: #14171c; background: #fff; }
.q-let { width: 20px; height: 20px; border-radius: 6px; background: #eef0f4; color: #5e6678; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; flex: none; }
.q-opt.is-ok { border-color: var(--c, #11935f); background: color-mix(in srgb, var(--c,#11935f) 12%, #fff); color: var(--c,#11935f); }
.q-opt.is-ok .q-let { background: var(--c,#11935f); color: #fff; }
.q-opt.is-wrong { border-color: var(--c, #d23b3b); background: color-mix(in srgb, var(--c,#d23b3b) 12%, #fff); color: var(--c,#d23b3b); }
.q-opt.is-wrong .q-let { background: var(--c,#d23b3b); color: #fff; }
.q-sheet .q-opt.is-ok { --c: var(--qok); } /* fallback */
.q-banner { margin-top: 12px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: #fff;
  background: var(--c); padding: 10px 12px; border-radius: 11px; }
.q-banner svg { width: 16px; height: 16px; }

@media (max-width: 1080px) { .qz-layout { grid-template-columns: 1fr; } .qz-preview { position: static; max-width: 320px; } }

/* ============================================================
   DESIGN MANAGER
   ============================================================ */
.dm-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.dm-head-l { display: flex; align-items: center; gap: 12px; }
.dm-head-l h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.dm-head-r { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.dm-layout { display: grid; grid-template-columns: 300px 1fr 232px; gap: 20px; align-items: start; }
.dm-grp-t { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
  margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.dm-grp-t svg { width: 14px; height: 14px; color: var(--ok-600); }
.dm-grp-t .muted { text-transform: none; letter-spacing: 0; font-weight: 600; }

.dm-controls { padding: 18px; }
.dm-ctrl { margin-bottom: 18px; }
.dm-ctrl > label { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 9px; }
.dm-ctrl > label .mono { font-size: 11px; color: var(--text-3); font-weight: 500; }
.dm-color { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dm-color input[type=color] { width: 44px; height: 38px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); padding: 3px; cursor: pointer; }
.dm-color input[type=color]::-webkit-color-swatch { border: none; border-radius: 6px; }
.dm-color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.dm-hex { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.dm-sw-row { display: flex; gap: 8px; }
.dm-presw { width: 28px; height: 28px; border-radius: 8px; background: var(--c); border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), var(--sh-1); transition: transform .1s; }
.dm-sw-row.big .dm-presw { width: 34px; height: 34px; border-radius: 9px; }
.dm-presw:hover { transform: scale(1.08); }
.dm-presw.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.dm-select { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer; }
.dm-range { width: 100%; accent-color: var(--brand-600); }

/* text content fields */
.dm-input { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600; font-family: inherit; outline: none; }
.dm-input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(30,123,245,.14); }
.dm-input::placeholder { color: var(--text-3); font-weight: 500; }

/* switch row (e.g. show banner) */
.dm-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dm-switch-row .lbl { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.dm-switch-row .lbl span { display: block; font-size: 11px; font-weight: 500; color: var(--text-3); margin-top: 2px; }

/* image upload rows */
.dm-img-row { display: flex; align-items: center; gap: 11px; padding: 9px; border: 1px solid var(--border);
  border-radius: 11px; background: var(--surface); transition: border-color .14s, background .14s; }
.dm-img-row + .dm-img-row { margin-top: 9px; }
.dm-img-row.over { border-color: var(--brand-500); background: var(--brand-50); border-style: dashed; }
[data-theme="dark"] .dm-img-row.over { background: rgba(30,123,245,.12); }
.dm-img-thumb { width: 46px; height: 46px; border-radius: 9px; flex: none; position: relative; overflow: hidden;
  background-size: cover; background-position: center;
  background-color: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.07); display: grid; place-items: center; }
.dm-img-thumb.circle { border-radius: 50%; }
.dm-img-thumb .ph-ic { color: var(--text-3); opacity: .7; }
.dm-img-thumb .ph-ic svg { width: 18px; height: 18px; }
.dm-img-thumb.has-img .ph-ic { display: none; }
.dm-img-meta { min-width: 0; flex: 1; line-height: 1.3; }
.dm-img-meta b { font-size: 12.5px; font-weight: 700; display: block; }
.dm-img-meta span { font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.dm-img-acts { display: flex; gap: 6px; flex: none; }
.dm-img-btn { font-size: 11.5px; font-weight: 700; color: var(--brand-700); padding: 6px 9px; border-radius: 8px; transition: background .12s; }
.dm-img-btn:hover { background: var(--brand-50); }
[data-theme="dark"] .dm-img-btn:hover { background: rgba(30,123,245,.14); }
.dm-img-btn.del { color: var(--text-3); }
.dm-img-btn.del:hover { background: var(--danger-bg); color: var(--danger-600); }
.dm-img-hint { font-size: 11px; color: var(--text-3); line-height: 1.5; margin-top: 11px; display: flex; align-items: center; gap: 6px; }
.dm-img-hint svg { width: 13px; height: 13px; color: var(--text-3); flex: none; }

.dm-wcag { padding: 16px 18px; margin-top: 16px; }
.dm-wc-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); }
.dm-wc-row:first-of-type { border-top: none; }
.dm-wc-pair { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.dm-wc-sw { width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.dm-wc-sw + .dm-wc-sw { margin-left: -12px; }
.dm-wc-ratio { font-size: 12px; font-weight: 600; color: var(--text); }

/* stage */
.dm-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 4px; }
.dm-phones { display: flex; gap: 26px; justify-content: center; align-items: flex-start; flex-wrap: wrap; width: 100%; }
.dm-phone-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dm-phone-lbl { font-size: 12px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.dm-phone-lbl span { font-size: 10.5px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); padding: 2px 7px; border-radius: 6px; }
.dm-phone { width: 248px; }
.dm-phone.android { border-radius: 30px; }
.dm-phone.android .phone-notch { width: 10px; height: 10px; border-radius: 50%; top: 14px; }

/* ---- app simulator screen ---- */
.dm-screen { background: var(--abg) !important; color: var(--atx); font-family: var(--afont), sans-serif; display: flex; flex-direction: column; }
.as-statusbar { display: flex; justify-content: space-between; align-items: center; padding: 13px 18px 4px; }
.as-statusbar b { font-size: 12px; }
.as-sig { width: 16px; height: 10px; border-radius: 2px; background: currentColor; opacity: .8; }
.as-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px 12px; }
.as-header b { font-size: 17px; font-weight: 800; display: block; letter-spacing: -.02em; }
.as-header span { font-size: 11px; opacity: .55; }
.as-bell { width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--atx) 8%, transparent); display: block; position: relative; }
.as-bell::after { content:''; position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--aa); }
.as-body { flex: 1; padding: 0 14px; display: flex; flex-direction: column; gap: 11px; overflow: hidden; }
.as-continue { background: var(--ab); border-radius: var(--arad); padding: 14px; color: #fff; position: relative; }
.as-tag { font-size: 8.5px; font-weight: 800; letter-spacing: .08em; opacity: .85; }
.as-continue b { font-size: 16px; font-weight: 800; display: block; margin: 3px 0 10px; }
.as-prog { height: 5px; border-radius: 99px; background: rgba(255,255,255,.3); overflow: hidden; margin-bottom: 13px; }
.as-prog span { display: block; width: 62%; height: 100%; background: var(--aa); border-radius: 99px; }
.as-btn { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--ab); border-radius: calc(var(--arad) * .6); padding: 8px 14px; font-size: 12px; font-weight: 700; font-family: inherit; }
.as-btn svg { width: 13px; height: 13px; }
.as-chips { display: flex; gap: 7px; }
.as-chips span { font-size: 11px; font-weight: 700; padding: 6px 12px; border-radius: 99px; background: color-mix(in srgb, var(--atx) 7%, transparent); }
.as-chips span.on { background: var(--aa); color: #fff; }
.as-card { display: flex; align-items: center; gap: 11px; background: color-mix(in srgb, var(--atx) 5%, var(--abg)); border-radius: var(--arad); padding: 9px; }
.as-thumb { width: 56px; height: 42px; border-radius: calc(var(--arad) * .55); background: linear-gradient(135deg, color-mix(in srgb, var(--ab) 55%, #000), var(--ab)); display: grid; place-items: center; flex: none; }
.as-thumb svg { width: 16px; height: 16px; color: #fff; }
.as-cmeta b { font-size: 12.5px; font-weight: 700; display: block; }
.as-cmeta span { font-size: 10.5px; opacity: .55; }
.as-nav { height: 52px; margin-top: 8px; display: flex; align-items: center; justify-content: space-around;
  background: color-mix(in srgb, var(--atx) 5%, var(--abg)); border-top: 1px solid color-mix(in srgb, var(--atx) 9%, transparent); }
.as-nav span { color: color-mix(in srgb, var(--atx) 40%, transparent); }
.as-nav span.on { color: var(--ab); }
.as-nav svg { width: 22px; height: 22px; }

/* ---- editable identity elements in the simulator ---- */
.as-header { gap: 10px; }
.as-logo { width: 34px; height: 34px; border-radius: 10px; flex: none; background-size: cover; background-position: center;
  display: grid; place-items: center; overflow: hidden; }
.as-logo.ph { background: var(--ab); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
.as-logo.ph::after { content: 'X'; }
.as-head-txt { flex: 1; min-width: 0; }
.as-banner { height: 86px; border-radius: var(--arad); margin-bottom: 1px; background-size: cover; background-position: center;
  background-color: color-mix(in srgb, var(--atx) 7%, var(--abg)); position: relative; overflow: hidden;
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--atx) 10%, transparent); }
.as-banner.ph::after { content: 'bannière'; font-size: 10px; font-weight: 600; letter-spacing: .04em; color: color-mix(in srgb, var(--atx) 45%, transparent);
  background-image: repeating-linear-gradient(45deg, transparent, transparent 7px, color-mix(in srgb, var(--atx) 5%, transparent) 7px, color-mix(in srgb, var(--atx) 5%, transparent) 14px); }
.as-banner.ph { background-image: repeating-linear-gradient(45deg, transparent, transparent 9px, color-mix(in srgb, var(--atx) 4%, transparent) 9px, color-mix(in srgb, var(--atx) 4%, transparent) 18px); }
.as-continue.has-cover { padding: 0; overflow: hidden; }
.as-cover { height: 84px; background-size: cover; background-position: center; position: relative;
  background-color: color-mix(in srgb, #000 18%, var(--ab)); }
.as-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.32)); }
.as-continue.has-cover .as-cont-body { padding: 12px 14px 14px; }

/* history */
.dm-history { padding: 16px; }
.dm-hist-item { display: flex; align-items: center; gap: 11px; padding: 9px; border-radius: 11px; cursor: pointer; position: relative; transition: background .12s; }
.dm-hist-item:hover { background: var(--surface-2); }
.dm-hist-item.current { background: var(--brand-50); cursor: default; }
[data-theme="dark"] .dm-hist-item.current { background: rgba(30,123,245,.12); }
.dm-thumb { width: 32px; height: 44px; border-radius: 7px; flex: none; position: relative; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); overflow: hidden; }
.dm-thumb-h { position: absolute; top: 0; left: 0; right: 0; height: 14px; display: block; }
.dm-thumb-d { position: absolute; bottom: 6px; left: 6px; width: 8px; height: 8px; border-radius: 50%; display: block; }
.dm-hist-meta { min-width: 0; line-height: 1.3; }
.dm-hist-meta b { font-size: 12.5px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-hist-meta span { font-size: 10.5px; color: var(--text-3); }
.dm-restore { position: absolute; right: 8px; font-size: 11px; font-weight: 700; color: var(--brand-700); opacity: 0; transition: opacity .12s; }
.dm-hist-item:hover .dm-restore { opacity: 1; }

@media (max-width: 1240px) { .dm-layout { grid-template-columns: 280px 1fr; } .dm-history { grid-column: 1 / -1; }
  .dm-history #dmHist { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 4px; } }
@media (max-width: 820px) { .dm-layout { grid-template-columns: 1fr; } }

/* ============================================================
   ANALYTICS
   ============================================================ */
.an-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.an-toolbar .seg button { height: 30px; }
.an-date { font-variant-numeric: tabular-nums; }
.an-toolbar .spacer { flex: 1; }

/* compare delta pill in toolbar */
.an-cmp { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.an-cmp b { color: var(--text-2); font-weight: 700; }

/* KPI w/ sparkline */
.an-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.an-kpi { padding: 18px 18px 0; overflow: hidden; }
.an-kpi .kpi-top { margin-bottom: 12px; }
.an-kpi-val { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.an-kpi-val .u { font-size: 17px; color: var(--text-3); font-weight: 700; }
.an-kpi-delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; margin-top: 8px; }
.an-kpi-delta svg { width: 13px; height: 13px; flex: none; }
.an-kpi-delta.up { color: var(--ok-600); }
.an-kpi-delta.down { color: var(--danger-600); }
.an-kpi-spark { margin: 12px -18px 0; height: 46px; display: block; width: calc(100% + 36px); }
.an-kpi-spark svg { display: block; width: 100%; height: 100%; }

/* main layout */
.an-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
.an-grid .span2 { grid-column: 1 / -1; }

/* engagement chart */
.an-chart-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.an-chart-head h2 { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.an-chart-wrap { position: relative; }
.an-chart-svg { width: 100%; height: 260px; display: block; overflow: visible; }
.an-grid-line { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.an-area { fill: url(#anFill); }
.an-line { fill: none; stroke: var(--brand-600); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.an-line2 { fill: none; stroke: var(--ok-600); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-dasharray: 2 5; stroke-linecap: round; }
.an-yaxis span { position: absolute; left: 0; transform: translateY(-50%); font-size: 10.5px; font-weight: 600; color: var(--text-3); font-family: var(--mono); }
.an-xaxis { display: flex; justify-content: space-between; margin-top: 10px; padding-left: 4px; }
.an-xaxis span { font-size: 10.5px; font-weight: 600; color: var(--text-3); font-family: var(--mono); }
.an-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--brand-600); border: 2.5px solid var(--surface); box-shadow: var(--sh-1); transform: translate(-50%,-50%); pointer-events: none; }
.an-tip { position: absolute; transform: translate(-50%, -100%); background: var(--text); color: #fff; border-radius: 9px; padding: 8px 11px; font-size: 11.5px; line-height: 1.45; white-space: nowrap; box-shadow: var(--sh-pop); margin-top: -12px; pointer-events: none; }
.an-tip b { font-weight: 700; }
.an-tip .an-tip-d { font-family: var(--mono); }
.an-tip i { font-style: normal; color: rgba(255,255,255,.6); }
.an-tip::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--text); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.an-hit { position: absolute; top: 0; bottom: 0; transform: translateX(-50%); cursor: pointer; }

/* funnel */
.an-funnel { display: flex; flex-direction: column; gap: 3px; }
.an-fn-row { position: relative; }
.an-fn-bar { position: relative; height: 52px; border-radius: 10px; background: var(--brand-600); display: flex; align-items: center; padding: 0 15px; color: #fff; overflow: hidden; transition: width .3s; }
.an-fn-bar.s2 { background: var(--brand-500); }
.an-fn-bar.s3 { background: color-mix(in srgb, var(--brand-500) 78%, var(--brand-200)); }
.an-fn-bar.s4 { background: var(--ok-600); }
.an-fn-bar.s5 { background: var(--pin-500); }
.an-fn-l { font-size: 13px; font-weight: 700; }
.an-fn-v { margin-left: auto; font-size: 15px; font-weight: 700; font-family: var(--mono); }
.an-fn-meta { display: flex; align-items: center; gap: 8px; padding: 5px 4px 9px; }
.an-fn-pct { font-size: 12px; font-weight: 700; color: var(--text-2); font-family: var(--mono); }
.an-fn-drop { font-size: 11.5px; font-weight: 600; color: var(--danger-600); display: inline-flex; align-items: center; gap: 4px; }
.an-fn-drop svg { width: 13px; height: 13px; }
.an-fn-lbl { font-size: 11.5px; font-weight: 600; color: var(--text-3); }

/* horizontal bars (quiz success per module) */
.an-hbars { display: flex; flex-direction: column; gap: 16px; }
.an-hb { display: grid; grid-template-columns: 1fr; gap: 7px; }
.an-hb-top { display: flex; align-items: baseline; gap: 10px; }
.an-hb-name { font-size: 13px; font-weight: 700; }
.an-hb-sub { font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.an-hb-val { margin-left: auto; font-size: 13.5px; font-weight: 700; font-family: var(--mono); }
.an-hb-track { height: 9px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; }
.an-hb-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); transition: width .3s; }
.an-hb-fill.warn { background: linear-gradient(90deg, var(--warn-600), #e0a020); }
.an-hb-fill.low { background: linear-gradient(90deg, var(--danger-600), #e06060); }

/* heatmap */
.an-heat-wrap { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.an-heat-days { display: grid; grid-template-rows: repeat(7, 1fr); gap: 5px; padding-top: 0; }
.an-heat-days span { font-size: 11px; font-weight: 600; color: var(--text-3); height: 26px; display: flex; align-items: center; }
.an-heat-grid { display: grid; grid-template-rows: repeat(7, 1fr); gap: 5px; }
.an-heat-row { display: grid; grid-template-columns: repeat(24, 1fr); gap: 5px; }
.an-heat-cell { height: 26px; border-radius: 5px; background: var(--c); position: relative; }
.an-heat-cell:hover { outline: 2px solid var(--brand-600); outline-offset: 1px; z-index: 2; }
.an-heat-hours { grid-column: 2; display: flex; justify-content: space-between; margin-top: 9px; }
.an-heat-hours span { font-size: 10px; font-weight: 600; color: var(--text-3); font-family: var(--mono); }
.an-heat-legend { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; color: var(--text-3); margin-top: 16px; justify-content: flex-end; }
.an-heat-legend .sw-grad { display: flex; gap: 3px; }
.an-heat-legend .sw-grad i { width: 16px; height: 12px; border-radius: 3px; display: block; }

/* top content rows w/ rank */
.an-top-rank { width: 24px; text-align: center; font-size: 13px; font-weight: 700; color: var(--text-3); font-family: var(--mono); }
.an-spark-cell svg { display: block; width: 64px; height: 26px; }

@media (max-width: 1100px) {
  .an-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .an-grid { grid-template-columns: 1fr; }
  .an-grid .span2 { grid-column: auto; }
}
@media (max-width: 760px) {
  .an-heat-row { grid-template-columns: repeat(24, 1fr); }
  .an-heat-cell { height: 16px; }
}

/* ============================================================
   GÉNÉRIQUE — toggle switch + lignes de réglage (réutilisable)
   ============================================================ */
.switch { position: relative; width: 40px; height: 23px; flex: none; border-radius: 99px; background: var(--mute-bg);
  border: 1px solid var(--border); cursor: pointer; transition: background .16s, border-color .16s; padding: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--sh-1); transition: transform .16s; }
.switch.on { background: var(--brand-600); border-color: var(--brand-600); }
.switch.on::after { transform: translateX(17px); background: #fff; }

.avatar.init { display: grid; place-items: center; color: #fff; font-size: 12.5px; font-weight: 800; letter-spacing: .02em; }
.avatar.a1 { background: linear-gradient(135deg, #2680eb, #1453ad); }
.avatar.a2 { background: linear-gradient(135deg, #11935f, #0c6b45); }
.avatar.a3 { background: linear-gradient(135deg, #db2777, #9d1457); }
.avatar.a4 { background: linear-gradient(135deg, #c9810a, #946008); }
.avatar.a5 { background: linear-gradient(135deg, #7c3aed, #5a23b0); }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }

/* ============================================================
   JOURNAL D'AUDIT
   ============================================================ */
.au-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.au-toolbar .spacer { flex: 1; }
.au-toolbar .chip, .au-quick .chip { white-space: nowrap; flex: none; }
.au-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 13px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); flex: 1; min-width: 220px; max-width: 380px; }
.au-search svg { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.au-search input { border: none; background: none; outline: none; font: inherit; font-size: 13px; color: var(--text); width: 100%; }

.au-quick { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 18px 0 6px; }
.au-quick .lbl { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-right: 4px; white-space: nowrap; }

/* ---- timeline (carte unique, lignes serrées) ---- */
.au-card { padding: 6px 22px; }
.au-day { }
.au-day + .au-day { border-top: 1px solid var(--border); }
.au-day-head { display: flex; align-items: baseline; gap: 8px; padding: 20px 2px 6px; white-space: nowrap; }
.au-day-head h3 { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.au-day-head .cnt { font-size: 11.5px; font-weight: 600; color: var(--text-3); }

.au-feed { position: relative; }
/* vertical rail through the avatar centers (avatar=34, centered at 17 + 2px pad) */
.au-feed::before { content: ''; position: absolute; left: 18px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }

.au-row { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 0 14px;
  padding: 13px 6px 13px 0; align-items: start; }
.au-row + .au-row { border-top: 1px solid var(--border); }

/* actor avatar = node, with action badge */
.au-node { position: relative; width: 34px; height: 34px; z-index: 1; }
.au-node .avatar { width: 34px; height: 34px; border: 2px solid var(--surface); }
.au-badge { position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center; border: 2px solid var(--surface); }
.au-badge svg { width: 10px; height: 10px; }
.au-badge.create  { background: var(--ok-600);     color: #fff; }
.au-badge.edit    { background: var(--info-600);   color: #fff; }
.au-badge.publish { background: var(--brand-600);  color: #fff; }
.au-badge.delete  { background: var(--danger-600); color: #fff; }
.au-badge.security{ background: var(--warn-600);   color: #fff; }
.au-badge.pin     { background: var(--pin-500);    color: #fff; }

.au-body { min-width: 0; padding-top: 1px; }
.au-headline { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.au-txt { font-size: 13.5px; line-height: 1.5; color: var(--text-2); min-width: 0; }
.au-txt b { color: var(--text); font-weight: 700; }
.au-txt .obj { color: var(--text); font-weight: 600; }
.au-verb { color: var(--text-2); font-weight: 600; }

.au-sub { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.au-chiptag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.au-chiptag svg { width: 12px; height: 12px; color: var(--text-3); }
.au-ip { font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.au-dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong, var(--text-3)); opacity: .5; }

/* diff inset */
.au-diff { margin-top: 10px; display: inline-flex; flex-direction: column; gap: 5px; padding: 9px 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.au-diff-row { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.au-diff-k { color: var(--text-3); min-width: 96px; font-weight: 600; }
.au-old { color: var(--danger-600); text-decoration: line-through; opacity: .75; font-family: var(--mono); }
.au-arrow { color: var(--text-3); }
.au-new { color: var(--ok-600); font-weight: 700; font-family: var(--mono); }

/* right meta : just the time, aligned to first line */
.au-time { font-size: 12px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }

.au-loadmore { display: flex; justify-content: center; margin-top: 20px; }

/* ============================================================
   RÉGLAGES
   ============================================================ */
.set-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 26px; overflow-x: auto; }
.set-tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; font-size: 13.5px; font-weight: 700;
  color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.set-tab svg { width: 16px; height: 16px; }
.set-tab:hover { color: var(--text-2); }
.set-tab.on { color: var(--brand-700); border-bottom-color: var(--brand-600); }

.set-panel { display: none; }
.set-panel.on { display: block; }
.set-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.set-layout .full { grid-column: 1 / -1; }

.set-card-head { margin-bottom: 4px; }
.set-card-head h2 { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.set-card-head p { font-size: 12.5px; color: var(--text-3); margin-top: 4px; line-height: 1.5; }

.set-rows { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; gap: 16px; padding: 15px 0; border-top: 1px solid var(--border); }
.set-row:first-child { border-top: none; }
.set-row .info { min-width: 0; flex: 1; }
.set-row .info b { font-size: 13.5px; font-weight: 700; display: block; }
.set-row .info span { font-size: 12px; color: var(--text-3); line-height: 1.5; display: block; margin-top: 3px; }
.set-row .ctl { flex: none; display: flex; align-items: center; gap: 10px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.input, .select { height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); font: inherit; font-size: 13.5px; color: var(--text); outline: none; width: 100%; }
.input:focus, .select:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(30,123,245,.14); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f7889' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 34px; cursor: pointer; }
.field-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* langues : liste réordonnable */
.lang-list { display: flex; flex-direction: column; gap: 8px; }
.lang-item { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: 11px; background: var(--surface); }
.lang-grip { color: var(--text-3); cursor: grab; display: grid; place-items: center; }
.lang-grip svg { width: 18px; height: 18px; }
.lang-flag { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 800;
  color: #fff; background: var(--brand-600); flex: none; }
.lang-name { font-size: 13.5px; font-weight: 700; }
.lang-name span { display: block; font-size: 11px; font-weight: 600; color: var(--text-3); font-family: var(--mono); margin-top: 1px; }

/* équipe & rôles */
.role-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 7px; font-size: 12px; font-weight: 700; }
.role-pill.admin { background: var(--pin-50); color: var(--pin-500); }
.role-pill.editor { background: var(--info-bg); color: var(--info-600); }
.role-pill.review { background: var(--warn-bg); color: var(--warn-600); }
.role-pill.viewer { background: var(--mute-bg); color: var(--mute-600); }

.set-foot { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.set-foot .spacer { flex: 1; }
.set-foot .saved { font-size: 12.5px; font-weight: 600; color: var(--text-3); display: inline-flex; align-items: center; gap: 7px; }
.set-foot .saved svg { width: 15px; height: 15px; color: var(--ok-600); }

.key-box { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2); font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }
.key-box .k { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .02em; }

.danger-zone { border-color: color-mix(in srgb, var(--danger-600) 30%, var(--border)); }
.danger-zone .set-card-head h2 { color: var(--danger-600); }

@media (max-width: 1000px) {
  .set-layout { grid-template-columns: 1fr; }
}

/* ============================================================
   ENGAGEMENT — NOTIFICATIONS / CAMPAGNES
   ============================================================ */
/* canaux : couleurs fonctionnelles */
:root {
  --ch-inapp-c:#1e7bf5; --ch-inapp-bg:#e7f0fe;
  --ch-sms-c:#1f9d57;   --ch-sms-bg:#e4f6ee;
  --ch-wa-c:#199d63;    --ch-wa-bg:#e2f5ec;
  --ch-email-c:#7257d6; --ch-email-bg:#ece8fb;
}
[data-theme="dark"] {
  --ch-inapp-bg:#102541; --ch-sms-bg:#13301f; --ch-wa-bg:#0f2a1d; --ch-email-bg:#201a3a;
}

/* onglets internes (mêmes codes visuels que les réglages) */
.nt-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.nt-tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 14px; font-size: 13.5px; font-weight: 700;
  color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.nt-tab svg { width: 16px; height: 16px; }
.nt-tab:hover { color: var(--text-2); }
.nt-tab.on { color: var(--brand-700); border-bottom-color: var(--brand-600); }
.nt-tab .nav-badge { margin-left: 2px; }
.nt-panel { display: none; }
.nt-panel.on { display: block; }

.nt-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.nt-search { position: relative; display: flex; align-items: center; flex: 1; min-width: 200px; max-width: 360px; }
.nt-search svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.nt-search input { height: 38px; width: 100%; padding: 0 12px 0 36px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); font: inherit; font-size: 13px; color: var(--text); outline: none; }
.nt-search input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(30,123,245,.14); }

/* pastille canal */
.ch-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 7px; border-radius: 7px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ch-chip svg { width: 13px; height: 13px; }
.ch-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.ch-ico svg { width: 16px; height: 16px; }
.ch-inapp { background: var(--ch-inapp-bg); color: var(--ch-inapp-c); }
.ch-sms   { background: var(--ch-sms-bg);   color: var(--ch-sms-c); }
.ch-wa    { background: var(--ch-wa-bg);    color: var(--ch-wa-c); }
.ch-email { background: var(--ch-email-bg); color: var(--ch-email-c); }

/* table campagnes */
.nt-camp .ct b { font-size: 13.5px; font-weight: 700; display: block; letter-spacing: -.01em; }
.nt-camp .ct .sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.nt-camp td .mono { font-variant-numeric: tabular-nums; }
.nt-metric { display: inline-flex; flex-direction: column; gap: 2px; }
.nt-metric b { font-size: 13.5px; font-weight: 700; }
.nt-metric span { font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.nt-rate { display: flex; align-items: center; gap: 9px; }
.nt-rate-bar { width: 54px; height: 6px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; flex: none; }
.nt-rate-bar > span { display: block; height: 100%; border-radius: 99px; background: var(--brand-600); }

/* ============ COMPOSITEUR ============ */
.nc-layout { display: grid; grid-template-columns: 1fr 396px; gap: 22px; align-items: start; }
.nc-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.nc-block { padding: 18px 20px; }
.nc-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.nc-step { width: 22px; height: 22px; border-radius: 7px; background: var(--brand-50); color: var(--brand-700);
  display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
[data-theme="dark"] .nc-step { background: rgba(30,123,245,.16); color: #7fb4ff; }
.nc-block-head h3 { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; }
.nc-block-head .hint { font-size: 11.5px; color: var(--text-3); font-weight: 600; margin-left: auto; }

/* sélecteur de canal */
.nc-channels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.nc-ch { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 13px; border-radius: 11px;
  border: 1.5px solid var(--border); background: var(--surface); text-align: left; transition: all .14s; }
.nc-ch:hover { border-color: var(--border-strong); }
.nc-ch .ch-ico { width: 32px; height: 32px; }
.nc-ch b { font-size: 13px; font-weight: 700; }
.nc-ch span { font-size: 11px; color: var(--text-3); font-weight: 600; line-height: 1.3; }
.nc-ch.on { border-color: var(--brand-500); background: var(--brand-50); box-shadow: 0 0 0 3px rgba(30,123,245,.1); }
[data-theme="dark"] .nc-ch.on { background: rgba(30,123,245,.1); }
.nc-ch.on.c-sms   { border-color: var(--ch-sms-c);   box-shadow: 0 0 0 3px color-mix(in srgb, var(--ch-sms-c) 16%, transparent); background: var(--ch-sms-bg); }
.nc-ch.on.c-wa    { border-color: var(--ch-wa-c);    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ch-wa-c) 16%, transparent);  background: var(--ch-wa-bg); }
.nc-ch.on.c-email { border-color: var(--ch-email-c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ch-email-c) 16%, transparent); background: var(--ch-email-bg); }

/* segments d'audience */
.nc-seg-pick { display: flex; flex-direction: column; gap: 9px; }
.nc-seg-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 11px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; transition: all .14s; text-align: left; width: 100%; }
.nc-seg-opt:hover { border-color: var(--border-strong); }
.nc-seg-opt.on { border-color: var(--brand-500); background: var(--brand-50); }
[data-theme="dark"] .nc-seg-opt.on { background: rgba(30,123,245,.1); }
.nc-seg-opt .sg-ic { width: 32px; height: 32px; border-radius: 9px; background: var(--mute-bg); color: var(--text-2);
  display: grid; place-items: center; flex: none; }
.nc-seg-opt.on .sg-ic { background: var(--brand-600); color: #fff; }
.nc-seg-opt .sg-meta { flex: 1; min-width: 0; }
.nc-seg-opt .sg-meta b { font-size: 13px; font-weight: 700; display: block; }
.nc-seg-opt .sg-meta span { font-size: 11.5px; color: var(--text-3); }
.nc-seg-opt .sg-reach { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nc-seg-opt .sg-reach span { font-size: 10.5px; color: var(--text-3); font-weight: 600; display: block; text-align: right; }

/* critères ajoutés */
.nc-crit { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.crit-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 6px 0 11px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-2); }
.crit-pill b { color: var(--text); font-weight: 700; }
.crit-pill .x { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; color: var(--text-3); }
.crit-pill .x:hover { background: var(--mute-bg); color: var(--text); }
.crit-pill .x svg { width: 13px; height: 13px; }
.crit-add { height: 30px; padding: 0 11px; border-radius: 8px; border: 1px dashed var(--border-strong); background: transparent;
  font-size: 12px; font-weight: 700; color: var(--brand-700); display: inline-flex; align-items: center; gap: 6px; }
.crit-add svg { width: 13px; height: 13px; }

/* éditeur message */
.nc-msg-meta { display: flex; align-items: center; justify-content: space-between; margin-top: -2px; }
.nc-count { font-size: 11px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nc-count.over { color: var(--danger-600); }
.nc-var { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.nc-var button { height: 25px; padding: 0 8px; border-radius: 6px; background: var(--mute-bg); color: var(--text-2);
  font-family: var(--mono); font-size: 11px; font-weight: 600; }
.nc-var button:hover { background: var(--brand-50); color: var(--brand-700); }

/* planification */
.nc-when { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nc-when button { padding: 11px 8px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.nc-when button svg { width: 17px; height: 17px; }
.nc-when button:hover { border-color: var(--border-strong); }
.nc-when button.on { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-700); }
[data-theme="dark"] .nc-when button.on { background: rgba(30,123,245,.1); }
.nc-when-detail { margin-top: 14px; }

/* barre d'envoi */
.nc-send-bar { display: flex; align-items: center; gap: 14px; }
.nc-send-bar .recap { font-size: 12.5px; color: var(--text-2); font-weight: 600; line-height: 1.5; }
.nc-send-bar .recap b { color: var(--text); font-weight: 800; }

/* ---- aperçu téléphone ---- */
.nc-preview { position: sticky; top: 86px; }
.nc-prev-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.nc-prev-head .lbl { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.phone { width: 100%; max-width: 320px; margin: 0 auto; border-radius: 38px; background: #0d1014; padding: 11px;
  box-shadow: 0 24px 60px rgba(13,16,20,.32), 0 0 0 2px rgba(255,255,255,.04) inset; }
.phone-scr { position: relative; border-radius: 28px; overflow: hidden; height: 552px;
  background: linear-gradient(170deg, #2a6fd6 0%, #1e7bf5 38%, #4a93f7 100%); display: flex; flex-direction: column; }
.phone-scr.wa-bg { background: #e7ded4; }
.phone-scr.email-bg { background: #eef0f4; }
.phone-scr.sms-bg { background: linear-gradient(180deg, #f3f5f8, #e9edf2); }
.phone-notch { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 96px; height: 22px;
  background: #0d1014; border-radius: 0 0 14px 14px; z-index: 5; }
.phone-status { display: flex; align-items: center; justify-content: space-between; padding: 11px 22px 0; color: #fff; font-size: 12px; font-weight: 700; z-index: 4; }
.phone-status.dark { color: #1a1d22; }
.phone-status .sg { display: flex; align-items: center; gap: 5px; }
.phone-status .sg svg { width: 14px; height: 14px; }

/* lockscreen push (in-app) */
.lock-time { text-align: center; color: #fff; margin-top: 42px; }
.lock-time .h { font-size: 58px; font-weight: 300; letter-spacing: -.02em; line-height: 1; }
.lock-time .d { font-size: 14px; font-weight: 600; margin-top: 4px; opacity: .95; }
.push-stack { margin-top: auto; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.push-card { background: rgba(255,255,255,.82); backdrop-filter: blur(18px); border-radius: 17px; padding: 12px 13px;
  box-shadow: 0 6px 20px rgba(0,0,0,.16); }
.push-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.push-app { width: 22px; height: 22px; border-radius: 6px; background: var(--brand-600); display: grid; place-items: center; flex: none; }
.push-app svg { width: 13px; height: 13px; color: #fff; }
.push-app-name { font-size: 11.5px; font-weight: 700; color: #1a1d22; text-transform: uppercase; letter-spacing: .03em; }
.push-time { margin-left: auto; font-size: 11px; color: #555; font-weight: 600; }
.push-title { font-size: 13.5px; font-weight: 800; color: #14171c; line-height: 1.3; }
.push-body { font-size: 12.5px; color: #2a2e36; line-height: 1.4; margin-top: 2px; }

/* SMS / WhatsApp chat */
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px 12px; background: rgba(255,255,255,.7); z-index: 3; }
.chat-head.wa { background: #167b5c; color: #fff; }
.chat-head .av { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-600); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none; }
.chat-head.wa .av { background: #fff; color: #167b5c; }
.chat-head .who b { font-size: 13.5px; font-weight: 700; display: block; }
.chat-head .who span { font-size: 11px; opacity: .7; }
.chat-body { flex: 1; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.bubble { max-width: 86%; padding: 9px 12px; font-size: 13px; line-height: 1.42; border-radius: 16px; align-self: flex-start;
  box-shadow: 0 1px 1px rgba(0,0,0,.08); position: relative; }
.bubble.sms { background: #e6e9ee; color: #14171c; border-bottom-left-radius: 5px; }
.bubble.wa { background: #fff; color: #14171c; border-top-left-radius: 5px; }
.bubble .b-time { font-size: 9.5px; color: #8a93a3; text-align: right; margin-top: 4px; font-weight: 600; }
.bubble.sms-out { align-self: flex-end; background: #1e7bf5; color: #fff; border-radius: 16px; border-bottom-right-radius: 5px; }
.chat-sender { font-size: 11px; font-weight: 700; color: var(--ch-sms-c); margin-bottom: -4px; padding-left: 2px; }

/* email preview */
.email-card { margin: 14px; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.email-bar { height: 6px; background: var(--ch-email-c); }
.email-pad { padding: 16px; }
.email-from { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.email-from .av { width: 34px; height: 34px; border-radius: 50%; background: var(--ch-email-c); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.email-from b { font-size: 12.5px; display: block; color: #14171c; }
.email-from span { font-size: 11px; color: #8a93a3; }
.email-subj { font-size: 15px; font-weight: 800; color: #14171c; line-height: 1.3; }
.email-text { font-size: 12.5px; color: #3a3f48; line-height: 1.55; margin-top: 8px; }
.email-cta { display: inline-block; margin-top: 14px; background: var(--ch-email-c); color: #fff; font-size: 12px; font-weight: 700;
  padding: 9px 16px; border-radius: 8px; }

/* ============ AUTOMATISATIONS ============ */
.auto-list { display: flex; flex-direction: column; gap: 14px; }
.auto-card { padding: 16px 18px; display: flex; align-items: center; gap: 16px; }
.auto-card.off { opacity: .62; }
.auto-trig { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.auto-trig svg { width: 19px; height: 19px; }
.auto-main { flex: 1; min-width: 0; }
.auto-main b { font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.auto-flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.flow-node { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.flow-node svg { width: 13px; height: 13px; color: var(--text-3); }
.flow-arrow { color: var(--text-3); display: inline-flex; }
.flow-arrow svg { width: 15px; height: 15px; }
.auto-stat { text-align: right; flex: none; }
.auto-stat b { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; display: block; }
.auto-stat span { font-size: 11px; color: var(--text-3); font-weight: 600; }

/* ============ SEGMENTS ============ */
.seg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.seg-card { padding: 18px; display: flex; flex-direction: column; }
.seg-card-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.seg-card-top .ic { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-50); color: var(--brand-700);
  display: grid; place-items: center; flex: none; }
.seg-card-top .ic svg { width: 19px; height: 19px; }
.seg-card-top b { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; display: block; }
.seg-card-top span { font-size: 11.5px; color: var(--text-3); }
.seg-rules { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.seg-rule { display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 10px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.seg-rule svg { width: 12px; height: 12px; color: var(--text-3); }
.seg-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; align-items: center; }
.seg-reach-big { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.seg-reach-big span { font-size: 11.5px; color: var(--text-3); font-weight: 600; margin-left: 5px; }

/* ============ MODÈLES ============ */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tpl-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.tpl-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.tpl-preview { height: 120px; padding: 16px; display: flex; flex-direction: column; justify-content: center; gap: 6px; position: relative; }
.tpl-preview .tpl-mini-title { font-size: 13px; font-weight: 800; color: #14171c; line-height: 1.3; }
.tpl-preview .tpl-mini-body { font-size: 11px; color: #3a3f48; line-height: 1.4; }
.tpl-preview .ch-chip { position: absolute; top: 12px; right: 12px; background: rgba(255,255,255,.85); }
.tpl-meta { padding: 13px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.tpl-meta b { font-size: 13px; font-weight: 700; }
.tpl-meta .use { margin-left: auto; font-size: 11px; color: var(--text-3); font-weight: 600; }

@media (max-width: 1200px) {
  .nc-layout { grid-template-columns: 1fr; }
  .nc-preview { position: static; }
  .phone { max-width: 300px; }
}
@media (max-width: 1100px) {
  .seg-grid, .tpl-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   ANALYTICS — MODULE (onglets + pages)
   ============================================================ */
/* sticky head : le filtre de période + onglets restent visibles */
.an-head { position: sticky; top: var(--topbar-h); z-index: 15;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(8px);
  margin: -28px -30px 20px; padding: 22px 30px 14px; border-bottom: 1px solid var(--border); }
.an-head .an-toolbar { margin-bottom: 0; }
.an-panel-single { display: block; }

.an-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: thin; }
.an-tab { display: inline-flex; align-items: center; gap: 8px; padding: 11px 13px; font-size: 13.5px; font-weight: 700;
  color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.an-tab svg { width: 16px; height: 16px; }
.an-tab:hover { color: var(--text-2); }
.an-tab.on { color: var(--brand-700); border-bottom-color: var(--brand-600); }
.an-tab .nav-badge { margin-left: 1px; height: 18px; min-width: 18px; font-size: 10px; }

.an-panel { display: none; }
.an-panel.on { display: block; animation: fade .22s ease; }
.an-panel .an-grid:last-child, .an-panel > .card:last-child, .an-panel .an-big-grid:last-child { margin-bottom: 0; }

/* titres de section internes */
.an-page-intro { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 18px; }
.an-page-intro h2 { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.an-page-intro p { font-size: 12.5px; color: var(--text-3); font-weight: 600; line-height: 1.4; }

/* note / insight compacte */
.an-note { display: flex; align-items: flex-start; gap: 11px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 13px 15px; font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin-bottom: 16px; }
.an-note svg { width: 16px; height: 16px; color: var(--brand-600); flex: none; margin-top: 1px; }
.an-note b { color: var(--text); }

/* ---- vue d'ensemble : cartes par section ---- */
.an-ov-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.an-ov-card { padding: 17px 18px; display: flex; flex-direction: column; cursor: pointer;
  transition: box-shadow .15s, transform .15s, border-color .15s; }
.an-ov-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); border-color: var(--border-strong); }
.an-ov-top { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; }
.an-ov-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.an-ov-ic svg { width: 16px; height: 16px; }
.an-ov-top b { font-size: 13px; font-weight: 700; }
.an-ov-top .go { margin-left: auto; color: var(--text-3); display: grid; place-items: center; }
.an-ov-top .go svg { width: 16px; height: 16px; }
.an-ov-card:hover .go { color: var(--brand-600); }
.an-ov-body { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.an-ov-v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.an-ov-v .u { font-size: 15px; color: var(--text-3); font-weight: 700; }
.an-ov-l { font-size: 11.5px; color: var(--text-3); font-weight: 600; margin-top: 6px; }
.an-ov-spark { width: 78px; height: 32px; flex: none; }
.an-ov-foot { display: flex; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.an-ov-foot .an-kpi-delta { margin-top: 0; }
.an-ov-foot .det { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--brand-700); display: inline-flex; align-items: center; gap: 4px; }
.an-ov-foot .det svg { width: 13px; height: 13px; }

/* ---- barre répartie (device, paiement, wifi/data…) ---- */
.an-split { display: flex; height: 36px; border-radius: 10px; overflow: hidden; background: var(--mute-bg); }
.an-split > span { height: 100%; display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 0; overflow: hidden; }
.an-split-leg { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 15px; }
.an-split-leg li { font-size: 12.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; }
.an-split-leg li i { width: 10px; height: 10px; border-radius: 3px; }
.an-split-leg li b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---- grandes stats simples ---- */
.an-big-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.an-big { padding: 22px; }
.an-big .lbl { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.an-big .kpi-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.an-big .kpi-ic svg { width: 16px; height: 16px; }
.an-big .v { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1; margin: 16px 0 7px; }
.an-big .v .u { font-size: 19px; color: var(--text-3); font-weight: 700; }
.an-big .sub { font-size: 12.5px; color: var(--text-3); line-height: 1.5; }

/* ---- liste de statistiques (clé → valeur) ---- */
.an-statrows { display: flex; flex-direction: column; }
.an-statrow { display: flex; align-items: center; gap: 16px; padding: 13px 0; border-top: 1px solid var(--border); }
.an-statrow:first-child { border-top: none; }
.an-statrow .k { font-size: 13px; font-weight: 600; color: var(--text-2); line-height: 1.35; }
.an-statrow .k .sub { display: block; font-size: 11px; color: var(--text-3); font-weight: 500; margin-top: 2px; }
.an-statrow .v { margin-left: auto; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-statrow .v .u { font-size: 12px; color: var(--text-3); font-weight: 600; margin-left: 1px; }
.an-statrow .v.small { font-size: 14px; }

/* canal de notification : pastille dans le tableau */
.an-chrow { display: flex; align-items: center; gap: 10px; }
.an-chrow .ch-ico { width: 28px; height: 28px; border-radius: 8px; }
.an-chrow .ch-ico svg { width: 15px; height: 15px; }
.an-chrow b { font-size: 13.5px; font-weight: 700; }

@media (max-width: 1100px) {
  .an-ov-grid { grid-template-columns: repeat(2, 1fr); }
  .an-head { margin: -24px -20px 18px; padding: 18px 20px 12px; }
}
@media (max-width: 640px) {
  .an-ov-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   MOBILE — UTILISATEURS & CHAMPS DE PROFIL
   ============================================================ */
.mu-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.mu-kpi { padding: 16px 18px; display: flex; align-items: center; gap: 13px; }
.mu-kpi .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.mu-kpi .ic svg { width: 19px; height: 19px; }
.mu-kpi .v { font-size: 23px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.mu-kpi .l { font-size: 12px; font-weight: 600; color: var(--text-3); margin-top: 4px; }

.mu-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* table */
.mu-table td { vertical-align: middle; }
.mu-table tbody tr { cursor: pointer; }
.mu-user { display: flex; align-items: center; gap: 11px; }
.mu-user .nm { line-height: 1.3; min-width: 0; }
.mu-user .nm b { font-size: 13.5px; font-weight: 700; display: block; }
.mu-user .nm .mono { font-size: 11px; color: var(--text-3); }
.mu-prof { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); font-weight: 600; }
.mu-prof span { display: inline-flex; align-items: center; gap: 6px; }
.mu-prof svg { width: 13px; height: 13px; color: var(--text-3); }
.mu-progcell { min-width: 130px; }
.mu-progcell .pm-mod-bar { height: 7px; margin-bottom: 6px; }
.mu-progcell .pm-mod-bar span { background: linear-gradient(90deg, var(--brand-500), var(--brand-700)); }
.mu-progcell .lvl { font-size: 11.5px; font-weight: 600; color: var(--text-2); display: flex; gap: 8px; }
.mu-progcell .lvl b { color: var(--text); }
.badge.susp { background: var(--danger-bg); color: var(--danger-600); } .badge.susp .d { background: var(--danger-600); }
.mu-actbtns { display: inline-flex; gap: 6px; justify-content: flex-end; }
.mu-iconbtn { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); display: grid; place-items: center; transition: all .12s; }
.mu-iconbtn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.mu-iconbtn.danger:hover { background: var(--danger-bg); color: var(--danger-600); border-color: var(--danger-bg); }
.mu-iconbtn svg { width: 16px; height: 16px; }

/* ---- drawer ---- */
.mu-scrim { position: fixed; inset: 0; background: rgba(20,23,28,.42); backdrop-filter: blur(2px); opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s; z-index: 60; }
.mu-scrim.on { opacity: 1; visibility: visible; }
.mu-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: 520px; max-width: 94vw; background: var(--bg);
  border-left: 1px solid var(--border); box-shadow: var(--sh-pop); z-index: 61; transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; overflow: hidden; }
.mu-drawer.on { transform: none; }
.mu-dr-head { padding: 20px 22px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 14px; flex: none; }
.mu-dr-head .avatar { width: 52px; height: 52px; font-size: 17px; }
.mu-dr-id { flex: 1; min-width: 0; }
.mu-dr-id h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.mu-dr-id .sub { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 5px 13px; }
.mu-dr-id .sub span { display: inline-flex; align-items: center; gap: 5px; }
.mu-dr-id .sub svg { width: 13px; height: 13px; }
.mu-dr-close { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; color: var(--text-3);
  border: 1px solid var(--border); background: var(--surface); }
.mu-dr-close:hover { background: var(--surface-2); color: var(--text); }
.mu-dr-close svg { width: 17px; height: 17px; }
.mu-dr-body { flex: 1; overflow-y: auto; padding: 20px 22px 30px; display: flex; flex-direction: column; gap: 20px; }

.mu-sec h3 { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.mu-sec h3 svg { width: 14px; height: 14px; color: var(--brand-600); }

/* profil grid */
.mu-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mu-fld { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 11px 13px; }
.mu-fld .k { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.mu-fld .vv { font-size: 13.5px; font-weight: 700; color: var(--text); margin-top: 4px; display: flex; align-items: center; gap: 7px; }
.mu-fld .vv svg { width: 14px; height: 14px; color: var(--text-2); }

/* learning history */
.mu-prog-head { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 15px; margin-bottom: 12px; }
.mu-prog-head .big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.mu-prog-head .big .u { font-size: 14px; color: var(--text-3); }
.mu-prog-stat { display: flex; flex-direction: column; gap: 2px; }
.mu-prog-stat b { font-size: 15px; font-weight: 700; }
.mu-prog-stat span { font-size: 11px; color: var(--text-3); font-weight: 600; }
.mu-prog-sep { width: 1px; align-self: stretch; background: var(--border); }
.mu-streak { display: inline-flex; align-items: center; gap: 5px; color: var(--warn-600); }
.mu-streak svg { width: 16px; height: 16px; }

.mu-hist { display: flex; flex-direction: column; }
.mu-hrow { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.mu-hrow:first-child { border-top: none; }
.mu-hicon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.mu-hicon svg { width: 15px; height: 15px; }
.mu-hmeta { min-width: 0; line-height: 1.35; }
.mu-hmeta b { font-size: 13.5px; font-weight: 700; display: block; }
.mu-hmeta span { font-size: 11.5px; color: var(--text-3); }
.mu-hright { text-align: right; flex: none; }
.mu-hright .pct { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mu-hright .pct.done { color: var(--ok-600); }
.mu-hright .date { font-size: 11px; color: var(--text-3); font-weight: 600; }

/* certifs & badges */
.mu-certs { display: flex; flex-direction: column; gap: 9px; }
.mu-cert { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 11px 13px; }
.mu-cert .cic { width: 34px; height: 34px; border-radius: 9px; background: var(--brand-50); color: var(--brand-700); display: grid; place-items: center; flex: none; }
[data-theme="dark"] .mu-cert .cic { background: rgba(30,123,245,.16); color: #7fb4ff; }
.mu-cert .cic svg { width: 18px; height: 18px; }
.mu-cert .cm { flex: 1; min-width: 0; line-height: 1.3; }
.mu-cert .cm b { font-size: 13.5px; font-weight: 700; display: block; }
.mu-cert .cm span { font-size: 11.5px; color: var(--text-3); }
.mu-badges { display: flex; flex-wrap: wrap; gap: 9px; }
.mu-badge { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; text-align: center; }
.mu-badge .bic { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.mu-badge .bic svg { width: 22px; height: 22px; }
.mu-badge.locked .bic { background: var(--mute-bg); color: var(--text-3); }
.mu-badge.locked { opacity: .6; }
.mu-badge .bl { font-size: 11px; font-weight: 700; color: var(--text-2); line-height: 1.25; }

/* notif prefs */
.mu-prefs { display: flex; flex-direction: column; }
.mu-pref { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-top: 1px solid var(--border); }
.mu-pref:first-child { border-top: none; }
.mu-pref .ch-ico { width: 32px; height: 32px; }
.mu-pref .pm { flex: 1; min-width: 0; }
.mu-pref .pm b { font-size: 13px; font-weight: 700; display: block; }
.mu-pref .pm span { font-size: 11.5px; color: var(--text-3); }

/* support actions */
.mu-dr-foot { flex: none; border-top: 1px solid var(--border); background: var(--surface); padding: 14px 22px;
  display: flex; gap: 10px; flex-wrap: wrap; }
.mu-act { flex: 1; min-width: 150px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px;
  border-radius: 10px; font-size: 13px; font-weight: 700; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); transition: all .12s; }
.mu-act svg { width: 16px; height: 16px; }
.mu-act:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.mu-act.warn:hover { background: var(--warn-bg); color: var(--warn-600); border-color: var(--warn-bg); }
.mu-act.brand:hover { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200); }
.mu-act.danger { color: var(--danger-600); }
.mu-act.danger:hover { background: var(--danger-600); color: #fff; border-color: var(--danger-600); }

@media (max-width: 1100px) { .mu-kpis { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 760px) { .mu-grid2 { grid-template-columns: 1fr; } }

/* ============ CHAMPS DU PROFIL ============ */
.mf-layout { display: grid; grid-template-columns: 1fr 320px; gap: 26px; align-items: start; }
.mf-table td { vertical-align: middle; }
.mf-grip { color: var(--text-3); display: grid; place-items: center; cursor: grab; }
.mf-grip svg { width: 17px; height: 17px; }
.mf-fname { display: flex; align-items: center; gap: 10px; }
.mf-fname .fic { width: 30px; height: 30px; border-radius: 8px; background: var(--mute-bg); color: var(--text-2); display: grid; place-items: center; flex: none; }
.mf-fname .fic svg { width: 15px; height: 15px; }
.mf-fname b { font-size: 13.5px; font-weight: 700; display: block; }
.mf-fname span { font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.mf-table tr.off { opacity: .5; }
.mf-table tr.sys .mf-grip { opacity: .3; cursor: default; }

.mf-side { position: sticky; top: calc(var(--topbar-h) + 24px); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.mf-phone { background: linear-gradient(180deg, var(--surface), var(--surface-2)); }
.mf-form { position: absolute; inset: 0; padding: 46px 18px 18px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.mf-form .ttl { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.mf-form .ttl span { display: block; font-size: 11px; font-weight: 600; color: var(--text-3); margin-top: 3px; }
.mf-ff { display: flex; flex-direction: column; gap: 5px; }
.mf-ff label { font-size: 10.5px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.mf-ff label i { color: var(--danger-600); font-style: normal; }
.mf-ff .box { height: 32px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  display: flex; align-items: center; padding: 0 10px; font-size: 11px; color: var(--text-3); }
.mf-ff .box svg { width: 13px; height: 13px; margin-left: auto; }
.mf-form .submit { margin-top: auto; height: 38px; border-radius: 10px; background: var(--brand-600); color: #fff;
  font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }

/* add-field modal */
.mf-modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -46%) scale(.97); width: 460px; max-width: 94vw;
  max-height: 88vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--sh-pop); z-index: 61; opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; padding: 22px 24px 24px; }
.mf-modal.on { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.mf-modal h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.mf-modal .desc { font-size: 12.5px; color: var(--text-3); line-height: 1.5; margin-bottom: 20px; }
.mf-modal .field { margin-bottom: 16px; }
.mf-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mf-type { padding: 11px 8px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--text-2); }
.mf-type svg { width: 17px; height: 17px; }
.mf-type:hover { border-color: var(--border-strong); }
.mf-type.on { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-700); }
[data-theme="dark"] .mf-type.on { background: rgba(30,123,245,.1); }
.mf-modal .row2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.mf-modal .row2 .lbl b { font-size: 13px; font-weight: 700; display: block; }
.mf-modal .row2 .lbl span { font-size: 11.5px; color: var(--text-3); }
.mf-modal .acts { display: flex; gap: 10px; margin-top: 22px; }
.mf-modal .acts .btn { flex: 1; justify-content: center; }

@media (max-width: 1000px) { .mf-layout { grid-template-columns: 1fr; } .mf-side { position: static; } }

/* ============================================================
   MULTI-APPS — sélecteur d'application, vue globale, réglages
   ============================================================ */
.ws-switch { display: block; padding: 14px 12px 12px; position: relative; }
.ws-trigger { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 8px; border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-family: inherit; text-align: left; transition: border-color .15s, background .15s; }
.ws-trigger:hover { border-color: var(--border-strong); background: var(--surface-2); }
.ws-mark { width: 34px; height: 34px; flex: none; border-radius: 10px; background: var(--brand-600); color: #fff; display: grid; place-items: center; }
.ws-mark svg { width: 19px; height: 19px; }
.ws-mark.glob { background: var(--text); }
.ws-txt { flex: 1; min-width: 0; line-height: 1.25; }
.ws-txt b { display: block; font-size: 13.5px; font-weight: 800; letter-spacing: -.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-txt span { font-size: 10.5px; color: var(--text-3); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ws-chev { color: var(--text-3); transform: rotate(90deg); flex: none; }
.ws-chev svg { width: 15px; height: 15px; }

.ws-pop { position: absolute; left: 12px; right: 12px; top: calc(100% - 4px); z-index: 40; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--sh-pop); padding: 7px; opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility .16s; }
.ws-pop.open { opacity: 1; visibility: visible; transform: translateY(0); }
.ws-pop-h { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 7px 9px 6px; }
.ws-pop-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.ws-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 9px; border: none; border-radius: 10px; background: none; cursor: pointer; font-family: inherit; text-align: left; }
.ws-opt:hover { background: var(--surface-2); }
.ws-opt.on { background: var(--brand-50); }
[data-theme="dark"] .ws-opt.on { background: rgba(255,255,255,.06); }
.ws-opt-mark { width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--c, var(--brand-600)); color: #fff; display: grid; place-items: center; }
.ws-opt-mark svg { width: 16px; height: 16px; }
.ws-opt-mark.sm { width: 26px; height: 26px; border-radius: 7px; }
.ws-opt-mark.lg { width: 46px; height: 46px; border-radius: 13px; }
.ws-opt-mark.lg svg { width: 24px; height: 24px; }
.ws-opt-ic { width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--mute-bg); color: var(--text-2); display: grid; place-items: center; }
.ws-opt-ic svg { width: 15px; height: 15px; }
.ws-opt-txt { flex: 1; min-width: 0; line-height: 1.3; }
.ws-opt-txt b { display: block; font-size: 13px; font-weight: 700; color: var(--text); }
.ws-opt-txt span { font-size: 11px; color: var(--text-3); font-weight: 500; }
.ws-opt-ck { color: var(--brand-600); flex: none; }
.ws-opt-ck svg { width: 16px; height: 16px; }

.ws-cmp td, .ws-acl td { vertical-align: middle; }
.mini-table th.ac, .mini-table td.ac { text-align: center; }
.ws-on { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-bg); color: var(--ok-600); }
.ws-on svg { width: 13px; height: 13px; }
.ws-off { color: var(--text-3); font-weight: 700; }

.ws-share { display: grid; gap: 14px; }
.ws-share-row { display: grid; grid-template-columns: 132px 1fr 44px; align-items: center; gap: 12px; }
.ws-share-lbl { font-size: 12.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-share-bar { height: 9px; border-radius: 99px; background: var(--mute-bg); overflow: hidden; }
.ws-share-bar span { display: block; height: 100%; border-radius: 99px; }
.ws-share-row b { font-size: 12.5px; text-align: right; }

.ws-appid { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ws-appid-t { line-height: 1.3; }
.ws-appid-t b { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.ws-appid-t span { font-size: 12.5px; color: var(--text-3); }
.ws-form { display: grid; gap: 14px; }
.ws-form > label { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.ws-form > label > input, .ws-form > label > .dm-color { margin-top: 8px; }
.ws-form > label > .dm-color { display: flex; margin-bottom: 0; }
.ws-mods { display: grid; }
.ws-mods .dm-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.ws-mods .dm-switch-row:first-child { border-top: none; }
.ws-mods .lbl { font-size: 13px; font-weight: 700; }
.dm-select.sm { height: 34px; font-size: 12.5px; width: auto; min-width: 104px; }
.ws-lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 8px; }

.ws-overlay { display: none; }
.ws-overlay.open { display: block; }
.ws-scrim { position: fixed; inset: 0; background: rgba(12,16,22,.44); z-index: 60; }
.ws-overlay .mf-modal { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
