/* ============================================================
   Studio HUMANIS — Design system
   ============================================================ */

/* ---------- Tokens — refonte « Sobre & dense » ---------- */
:root {
  /* Accent principal (violet) — noms historiques conservés pour compat modules */
  --accent:        #5b3ad6;
  --accent-50:     #f6f5fd;
  --accent-100:    #eef0fb;
  --accent-200:    #dadffa;
  --accent-300:    #b3b8f0;
  --accent-soft:   #dadffa;
  --accent-pale:   #eef0fb;
  /* Alias attendu par certains modules (newsletter) */
  --primary:       #5b3ad6;
  --primary-soft:  #b3b8f0;

  --bg:            #f4f5f7;
  --surface:       #ffffff;
  --surface-2:     #f8f9fb;
  --surface-alt:   #f8f9fb;
  --sidebar-bg:    #ffffff;
  --sidebar-sub:   #f8f9fb;
  --border:        #e6e8ec;
  --border-strong: #d7dae0;
  --hover:         rgba(20, 22, 34, 0.04);

  --text:          #1d2129;
  --text-muted:    #5e6675;
  --text-faint:    #9aa1ad;

  --green:         #15803d;
  --green-bg:      #edfaf0;
  --red:           #b91c1c;
  --danger:        #dc2626;
  --bg-subtle:     #f8f9fb;
  --orange:        #b45309;
  --warning:       #b45309;
  --warning-bg:    #fdf6e7;
  --warning-border:#e0b65a;
  --warning-text:  #92400e;

  /* Teinte par module — appliquée sur tags/progression (cf refonte-design) */
  --m-brochure:#5b3ad6;  --m-brochure-bg:#eef0fb;
  --m-video:#d6336c;     --m-video-bg:#fdecf2;
  --m-newsletter:#0e7490;--m-newsletter-bg:#e7f4f7;
  --m-graphisme:#c2620c; --m-graphisme-bg:#fbf1e6;

  --shadow-card:   0 1px 1px rgba(20,22,34,.04);
  --shadow-pop:    0 6px 20px rgba(20,22,34,.10);
  --shadow-panel:  0 8px 28px rgba(20,22,34,.14);

  --radius-sm:     5px;
  --radius:        6px;
  --radius-lg:     8px;

  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---------- Icônes Lucide ---------- */
.lucide {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ============================================================
   LOGIN
   ============================================================ */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--surface-2);
}
.login-wrap { width: 100%; max-width: 420px; padding: 24px; }
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-pop);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.login-brand-name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.login-brand-name strong { font-weight: 800; }
.login-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 4px; }
.login-sub { font-size: 13px; color: var(--text-muted); margin: 0 0 28px; }

.login-error {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px; font-weight: 500;
  margin-bottom: 20px;
}

.login-form { display: flex; flex-direction: column; gap: 18px; }

.login-remember {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  user-select: none; margin-top: -4px;
}
.login-remember input[type="checkbox"] { display: none; }
.checkbox-custom {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px; flex-shrink: 0;
  display: grid; place-items: center;
  transition: all .15s; background: var(--surface);
}
.login-remember input:checked + .checkbox-custom { background: var(--accent); border-color: var(--accent); }
.login-remember input:checked + .checkbox-custom::after {
  content: '';
  display: block; width: 5px; height: 9px;
  border: 2px solid white; border-top: none; border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.field-input {
  width: 100%; padding: 7px 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text);
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.field-input::placeholder { color: var(--text-faint); }
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-weak); }
.field-pwd { position: relative; }
.field-pwd .field-input { padding-right: 44px; }
.pwd-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); display: grid; place-items: center; transition: color .15s;
}
.pwd-toggle:hover { color: var(--text-muted); }

/* ---------- Boutons ---------- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px;
  background: var(--accent); color: white;
  font-size: 12px; font-weight: 600;
  border-radius: var(--radius-sm);
  transition: filter .12s, transform .1s;
  cursor: pointer; border: none;
}
.btn-primary:hover { filter: brightness(.92); }
.btn-primary:active { transform: scale(.99); }
.btn-full { width: 100%; }
.btn-sm   { padding: 5px 11px; font-size: 12px; }

/* ---------- Microsoft OAuth ---------- */
.login-ms-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 12px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; color: var(--text);
  text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
  margin-bottom: 14px;
}
.login-ms-btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0 16px;
  color: var(--text-faint); font-size: 12px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-pwd-link {
  text-align: center; margin-top: 14px;
}
.login-pwd-toggle {
  font-size: 12px; color: var(--text-faint);
  text-decoration: none;
  transition: color .15s;
}
.login-pwd-toggle:hover { color: var(--text-muted); }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 224px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar (sobre & dense) ---------- */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 12px 10px;
  gap: 16px;
  position: sticky; top: 0; height: 100vh;
  overflow: visible;
}
.sb-brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 8px; position: relative; z-index: 5;
}
.sb-logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 15px; letter-spacing: -0.01em;
}
.sb-logo-mark {
  width: 26px; height: 26px; border-radius: var(--radius-sm);
  background: var(--accent);
  display: grid; place-items: center;
  color: white; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sb-scroll {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto; scrollbar-width: none;
}
.sb-scroll::-webkit-scrollbar { display: none; }
.sb-user {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* .sb-user-avatar remplacé par .avatar.avatar-md */
.sb-user-name { font-weight: 600; font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: 10px; color: var(--text-faint); margin-top: 1px; }
.sb-group { display: flex; flex-direction: column; gap: 1px; }
.sb-group-label {
  font-size: 10px; font-weight: 600; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .05em; padding: 0 8px 3px;
}
.sb-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-weight: 500; font-size: 13px;
  text-align: left; width: 100%;
  transition: background .1s, color .1s;
}
.sb-item:hover { background: var(--surface-2); color: var(--text); }
.sb-item.active,
.sb-item.has-active {
  background: var(--accent-weak); color: var(--accent); font-weight: 600;
}
.sb-item-chev { margin-left: auto; color: var(--text-faint); transition: transform .2s; }
.sb-item-chev.open { transform: rotate(180deg); }

/* Titre de page dans la topbar */
.tb-page-title {
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text); padding-right: 12px;
}
.sb-sub-wrap { padding: 2px 0 2px 8px; margin-top: 2px; }
.sb-sub { display: flex; flex-direction: column; gap: 1px; border-left: 1px solid var(--border); padding-left: 6px; }
.sb-subitem {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: var(--radius-sm); font-size: 12px; color: var(--text-muted);
  font-weight: 500; transition: all .1s;
}
.sb-subitem:hover { color: var(--text); background: var(--surface-2); }
.sb-subitem.active { color: var(--accent); font-weight: 600; background: var(--accent-weak); }
.sb-subitem-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.sb-subitem.active .sb-subitem-dot { background: var(--accent); }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; position: relative; }

/* ---------- Topbar (sobre & dense) ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px; height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.tb-spacer { flex: 1; }
.tb-actions { display: flex; align-items: center; gap: 6px; }

/* Présence projet (avatars des personnes actuellement sur le projet) */
.tb-presence { display: flex; align-items: center; gap: 8px; margin-right: 10px; }
.tb-presence-label {
  font-size: 11px; color: var(--text-faint); font-weight: 500; white-space: nowrap;
}
.tb-presence-avatars { display: flex; align-items: center; }
.tb-presence-av { display: inline-flex; margin-right: -8px; transition: transform .12s; }
.tb-presence-av:hover { transform: translateY(-2px); z-index: 2; }
.tb-presence-av .avatar { border: 2px solid var(--surface); box-sizing: content-box; }
.tb-presence-more {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 5px; margin-left: 2px;
  border-radius: 11px; background: var(--surface-2, #eef0f3);
  font-size: 10px; font-weight: 700; color: var(--text-muted);
}
@media (max-width: 720px) { .tb-presence-label { display: none; } }

/* Recherche expansible */
.tb-search-wrap {
  display: flex; align-items: center;
  overflow: hidden;
  width: 0;
  transition: width .25s cubic-bezier(.4,0,.2,1);
}
.tb-search-wrap.open { width: 260px; }

.tb-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  width: 260px; flex-shrink: 0;
  transition: border-color .15s, box-shadow .15s;
}
.tb-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
.tb-search input {
  border: none; outline: none; background: transparent;
  flex: 1; font-size: 13px; color: var(--text);
}
.tb-search input::placeholder { color: var(--text-faint); }

/* Icônes topbar */
.tb-icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--text-muted); position: relative; transition: all .1s;
}
.tb-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.tb-icon-btn.active { background: var(--accent-weak); color: var(--accent); }
.tb-badge {
  position: absolute; top: 3px; right: 3px;
  min-width: 16px; height: 16px; border-radius: 999px;
  background: var(--accent); color: white;
  font-size: 10px; font-weight: 700;
  display: grid; place-items: center; padding: 0 3px;
  border: 2px solid var(--surface);
}
/* .tb-avatar remplacé par .avatar.avatar-md */

/* ============================================================
   PANEL NOTIFICATIONS
   ============================================================ */
.notif-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 30;
  background: rgba(15,17,28,.15);
}
.notif-overlay.open { display: block; }

.notif-panel {
  position: fixed;
  top: 0; right: 0;
  width: 380px; height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-panel);
  z-index: 40;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
}
.notif-panel.open { transform: translateX(0); }

.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.notif-panel-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.notif-mark-all { display: none; } /* remplacé par le dropdown */

/* Dropdown actions notifications */
.notif-actions-wrap { position: relative; }
.notif-actions-trigger {
  width: 28px; height: 28px; border-radius: 6px;
  display: grid; place-items: center;
  border: none; background: none; cursor: pointer;
  color: var(--text-muted); transition: all .15s;
}
.notif-actions-trigger:hover { background: var(--hover); color: var(--text); }
.notif-actions-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-pop);
  min-width: 180px; z-index: 100; overflow: hidden;
}
.notif-actions-wrap.open .notif-actions-dropdown { display: block; }
.notif-actions-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 9px 14px; font-size: 13px; font-weight: 500;
  color: var(--text); background: none; border: none; cursor: pointer;
  transition: background .1s;
}
.notif-actions-dropdown button:hover { background: var(--hover); }
.notif-actions-dropdown button.danger { color: var(--danger, #dc2626); }
.notif-actions-dropdown button.danger:hover { background: #fef2f2; }

.notif-list { flex: 1; overflow-y: auto; padding: 8px 0; }

.notif-loading, .notif-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* Item de notification */
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 20px;
  cursor: pointer; transition: background .15s;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--accent-50); }
.notif-item.unread:hover { background: var(--accent-100); }

.notif-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0; margin-top: 5px;
  transition: opacity .15s;
}
.notif-item:not(.unread) .notif-dot { opacity: 0; }

.notif-content { flex: 1; min-width: 0; }
.notif-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-body {
  font-size: 12px; color: var(--text-muted); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.notif-date { font-size: 11px; color: var(--text-faint); margin-top: 4px; }

.notif-actions {
  display: flex; flex-direction: column; gap: 4px; flex-shrink: 0;
  opacity: 0; transition: opacity .15s;
}
.notif-item:hover .notif-actions { opacity: 1; }
.notif-action-btn {
  width: 26px; height: 26px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--text-faint); transition: all .15s;
}
.notif-action-btn:hover { background: var(--hover); color: var(--text); }

/* ---------- Page content ---------- */
.page {
  padding: 20px 22px 56px;
  display: flex; flex-direction: column; gap: 18px;
}
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding: 8px 4px;
}
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.crumbs {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted); margin-top: 4px;
}
.crumbs .sep { opacity: .4; }
.crumbs .current { color: var(--accent); font-weight: 600; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.card-title { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; }

/* ============================================================
   COMPOSANTS — Tables, Tabs, Badges, Alerts, Forms, Perms
   ============================================================ */

/* ---------- Helpers typo ---------- */
.text-muted   { color: var(--text-muted); }
.text-faint   { color: var(--text-faint); }
.text-sm      { font-size: 12px; }
.text-mono    { font-family: var(--font-mono); font-size: 12px; }

/* ---------- Alertes ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
}
.alert-success { background: var(--green-bg); border-color: #bbf0cb; color: var(--green); }
.alert-error   { background: #FEF2F2; border-color: #FECACA; color: var(--red); }

/* ---------- Toasts (Studio.toast) ---------- */
.studio-toasts {
  position: fixed; bottom: 18px; right: 18px; z-index: 9998;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.studio-toast {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  font-size: 13px; font-weight: 500; color: var(--text);
  max-width: 360px;
  transform: translateX(20px); opacity: 0;
  transition: transform .22s cubic-bezier(.4,0,.2,1), opacity .22s;
  pointer-events: auto;
}
.studio-toast--in { transform: translateX(0); opacity: 1; }
.studio-toast svg { flex-shrink: 0; }
.studio-toast--success svg { color: var(--green); }
.studio-toast--error   { border-color: #fecaca; }
.studio-toast--error svg { color: var(--red); }
.studio-toast--info svg { color: var(--accent); }

/* ---------- Pills de statut (composant partagé) ----------
   Forme commune réutilisée par les modules. Les variantes de couleur sont
   sémantiques (neutral/info/warning/success/accent/premium) : chaque module
   mappe ses statuts métier sur ces variantes. */
.studio-status,
/* Les pills des modules partagent EXACTEMENT la même forme (forme unique) */
.brf-block-status-btn,
.vid-shot-badge-btn, .vid-badge,
.nws-block-status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 600; letter-spacing: .02em;
  white-space: nowrap; border: 1px solid transparent;
  font-family: var(--font); cursor: default; transition: filter .12s; line-height: 1.3;
}
button.studio-status, .brf-block-status-btn, .vid-shot-badge-btn { cursor: pointer; }
button.studio-status:hover, .brf-block-status-btn:hover, .vid-shot-badge-btn:hover { filter: brightness(.97); }
.studio-status.is-neutral { background: var(--surface-2); color: var(--text-faint); border-color: var(--border); }
.studio-status.is-info    { background: #eff4ff; color: #1d4ed8; }
.studio-status.is-warning { background: var(--warning-bg); color: var(--warning); }
.studio-status.is-success { background: var(--green-bg); color: var(--green); }
.studio-status.is-accent  { background: var(--accent-weak); color: var(--accent); }
/* Variante « validé/intégré » mise en avant (fond ivoire, texte bronze) */
.studio-status.is-premium {
  background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #92400e;
  border-color: #e0b65a;
}
.studio-status.is-premium::before { content: '✦'; font-size: 8px; color: #c2620c; line-height: 1; }

/* ---------- Overlay de verrou collaboratif (socle) ----------
   Forme commune à tous les modules : voile blanc clair + texte gris discret,
   léger flou. Sert à signaler un contenu verrouillé (édition par autrui,
   statut figé...) tout en laissant deviner le contenu dessous.
   Les modules ne fournissent QUE le positionnement spécifique si besoin. */
.studio-lock,
/* Les overlays de verrou des modules partagent EXACTEMENT cette forme */
.brf-editor-lock-overlay,
.vid-edit-lock, .vid-chap-lock,
.nws-block-lock {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px);
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  border-radius: inherit;
  pointer-events: none; z-index: 10;
}
.studio-lock svg,
.brf-editor-lock-overlay svg, .vid-edit-lock svg, .vid-chap-lock svg,
.nws-block-lock svg { flex-shrink: 0; }

/* ---------- Assignation : avatars empilés + tooltip (socle) ----------
   Rangée d'avatars qui se chevauchent légèrement, chacun avec une bulle
   d'info au survol, et un bouton « + » pour affecter. L'avatar lui-même
   (image/initiales) vient du composant serveur .avatar-*. Les modules
   rattachent leurs classes ici plutôt que de dupliquer ce style. */
.studio-assignees,
.brf-block-assignees, .vid-assign-row {
  display: flex; align-items: center;
  width: 100%; padding: 3px 8px; gap: 0;
  border-top: 1px dashed var(--border);
}
.studio-av,
.brf-av-tip, .vid-av-tip {
  position: relative; display: inline-flex;
  margin-right: -4px; cursor: default;
}
.studio-av:hover,
.brf-av-tip:hover, .vid-av-tip:hover { z-index: 10; }
/* Bulle d'info (nom de la personne) */
.studio-tip,
.brf-tip, .vid-av-tip .brf-tip {
  position: absolute; bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff;
  font-size: 10px; font-weight: 500;
  padding: 3px 8px; border-radius: 4px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s; z-index: 500;
}
.studio-tip::after,
.brf-tip::after, .vid-av-tip .brf-tip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent; border-top-color: #1e293b;
}
.studio-av:hover .studio-tip,
.brf-av-tip:hover .brf-tip, .vid-av-tip:hover .brf-tip { opacity: 1; }
/* Bouton « + » d'affectation (cercle pointillé) */
.studio-assign-btn,
.brf-assign-btn, .vid-assign-btn {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px dashed var(--border);
  background: var(--surface); color: var(--text-faint);
  cursor: pointer; display: grid; place-items: center;
  transition: all .15s; flex-shrink: 0; margin-left: 2px;
}
.studio-assign-btn:hover,
.brf-assign-btn:hover, .vid-assign-btn:hover {
  border-color: var(--accent); color: var(--accent); background: var(--accent-pale);
}
/* Sélecteur d'affectation dans une modale (déclencheur + liste à cocher).
   Partagé brochure/vidéo (et tout module futur). */
.studio-assignees-field, .brf-assignees-dropdown { position: relative; }
.studio-assignees-trigger, .brf-assignees-trigger {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13px; color: var(--text); font-family: var(--font);
  transition: border-color .15s;
}
.studio-assignees-trigger:focus, .brf-assignees-trigger:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.studio-assignees-list, .brf-assignees-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
  z-index: 300; max-height: 200px; overflow-y: auto; padding: 4px;
}
.studio-assignee-option, .brf-assignee-option {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 4px; cursor: pointer;
  transition: background .1s;
}
.studio-assignee-option:hover, .brf-assignee-option:hover { background: var(--hover); }
.studio-assignee-option input[type="checkbox"],
.brf-assignee-option input[type="checkbox"] {
  width: 15px; height: 15px; accent-color: var(--accent); flex-shrink: 0;
}
.studio-assignee-name, .brf-assignee-name {
  font-size: 13px; font-weight: 500; color: var(--text);
}
/* Variante interactive (bloque les clics dessous, curseur interdit) */
.studio-lock.is-blocking { pointer-events: auto; cursor: not-allowed; }
/* Variante « avertissement » (brainstorm, attention) : voile ambré */
.studio-lock.is-warning { background: rgba(255,251,235,.82); color: #92400e; }

/* ---------- Poignée de glisser-déposer (socle) ----------
   Colonne verticale à gauche d'une carte draggable : icône de préhension,
   fond légèrement grisé, séparateur à droite. Commune brochure/vidéo. */
.studio-grip,
.brf-block-grip, .vid-shot-grip {
  display: flex; align-items: center; justify-content: center;
  width: 20px; flex-shrink: 0;
  color: var(--text-faint); cursor: grab;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  transition: color .12s;
}
.studio-grip:hover,
.brf-block-grip:hover, .vid-shot-grip:hover { color: var(--text-muted); }

/* ---------- Dropdown / menu flottant (socle) ----------
   Panneau qui s'ouvre sous (ou au-dessus de) un déclencheur : changement de
   statut d'une pill, menu d'actions « ⋯ », sélection de badge, etc.
   Le module ne fixe QUE le sens d'ouverture (left/right) et le min-width
   particulier ; toute l'apparence vient d'ici. Affichage piloté par .open. */
.studio-dropdown,
.brf-status-dropdown,
.vid-shot-badge-dd, .vid-rv-cmenu {
  position: absolute; top: 100%; margin-top: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-pop);
  z-index: 200; min-width: 130px; padding: 4px; display: none;
}
.studio-dropdown.open,
.brf-status-dropdown.open,
.vid-shot-badge-dd.open { display: block; }
/* Menus dont l'ouverture passe par une classe sur le wrapper */
.vid-rv-cmenu-wrap--open .vid-rv-cmenu { display: block; }
/* Ouverture vers le haut (proche du bord bas) */
.studio-dropdown.up,
.brf-status-dropdown.up {
  top: auto; bottom: 100%; margin-top: 0; margin-bottom: 2px;
}
/* Une ligne / option du menu */
.studio-dropdown-item,
.brf-status-option,
.vid-shot-badge-opt, .vid-rv-cmenu-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 4px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  border: none; background: none; width: 100%;
  font-family: var(--font); text-align: left;
  transition: background .1s; color: var(--text);
}
.studio-dropdown-item:hover, .studio-dropdown-item--active,
.brf-status-option:hover,
.vid-shot-badge-opt:hover, .vid-shot-badge-opt--active,
.vid-rv-cmenu-item:hover { background: var(--hover); }
/* Variante action destructive (rouge) */
.studio-dropdown-item--danger,
.vid-rv-cmenu-item--danger { color: #ef4444; }
.studio-dropdown-item--danger:hover,
.vid-rv-cmenu-item--danger:hover { background: #fee2e2; }
/* Item désactivé + séparateur (utilisés par Studio.menu) */
.studio-dropdown-item:disabled {
  opacity: .45; cursor: default; pointer-events: none;
}
.studio-menu-sep {
  height: 1px; margin: 4px 0;
  background: var(--border);
}
/* Le menu d'actions s'ouvre par défaut aligné à droite du déclencheur
   (le bouton « ⋯ » est toujours à droite). .studio-menu--left pour l'inverse. */
.studio-menu { right: 0; }
.studio-menu.studio-menu--left { right: auto; left: 0; }

/* ---------- Barre d'annotation (socle) ----------
   Barre d'outils de dessin flottante, partagée par les revues/annotations de
   brochure (PDF), vidéo et graphisme. Pilule sombre, icônes claires.
   Les modules conservent leurs classes historiques (.vid-annot-*, .gfx-annot-*)
   qui pointent toutes ici. */
.studio-annot-toolbar, .vid-annot-toolbar, .gfx-annot-toolbar {
  display: flex; align-items: center; gap: 3px;
  padding: 6px 10px;
  background: rgba(15,17,28,.82);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.studio-annot-tool, .vid-annot-tool, .gfx-annot-tool {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px;
  background: transparent; color: rgba(255,255,255,.7);
  cursor: pointer; transition: background .12s, color .12s; padding: 0;
}
.studio-annot-tool:hover, .vid-annot-tool:hover, .gfx-annot-tool:hover { background: rgba(255,255,255,.12); color: #fff; }
.studio-annot-tool.active, .vid-annot-tool.active, .gfx-annot-tool.active { background: rgba(255,255,255,.2); color: #fff; }
.studio-annot-tool:disabled, .vid-annot-tool:disabled, .gfx-annot-tool:disabled { opacity: .3; cursor: default; pointer-events: none; }
/* Variantes valider / annuler (revue vidéo & brochure) */
.vid-annot-ok        { color: #4ade80 !important; }
.vid-annot-ok:hover  { background: rgba(74,222,128,.2) !important; }
.vid-annot-cancel        { color: #f87171 !important; }
.vid-annot-cancel:hover  { background: rgba(248,113,113,.2) !important; }
.studio-annot-sep, .vid-annot-sep, .gfx-annot-sep {
  width: 1px; height: 20px; background: rgba(255,255,255,.15); margin: 0 3px; flex-shrink: 0;
}
.studio-annot-color, .vid-annot-color, .gfx-annot-color {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: transform .1s, border-color .1s; padding: 0;
}
.studio-annot-color:hover, .vid-annot-color:hover, .gfx-annot-color:hover { transform: scale(1.2); }
.studio-annot-color.active, .vid-annot-color.active, .gfx-annot-color.active { border-color: #fff; transform: scale(1.15); }
/* Boutons supprimer / annuler / valider (graphisme) alignés sur le style outil */
.gfx-annot-del, .gfx-annot-cancel, .gfx-annot-validate {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px; background: transparent; color: rgba(255,255,255,.7); cursor: pointer; padding: 0;
}
.gfx-annot-del:hover:not(:disabled),
.gfx-annot-cancel:hover { background: rgba(248,113,113,.25); color: #fff; }
.gfx-annot-cancel { color: #f87171; }
.gfx-annot-validate { color: #4ade80; }
.gfx-annot-validate:hover { background: rgba(74,222,128,.2); color: #fff; }
.gfx-annot-del:disabled { opacity: .3; cursor: default; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 600;
}
.badge-green  { background: var(--green-bg); color: var(--green); }
.badge-red    { background: #FEF2F2; color: var(--red); }
.badge-accent { background: var(--accent-weak); color: var(--accent); }
.badge-amber  { background: var(--warning-bg); color: var(--warning); }

/* ---------- Table ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th {
  padding: 7px 10px;
  text-align: left;
  font-size: 10px; font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table .row-muted td { opacity: .5; }
.table-actions { text-align: right; white-space: nowrap; }
.ua-cell { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-cell { display: flex; align-items: center; gap: 10px; }
/* .user-avatar-sm remplacé par .avatar.avatar-sm */
.user-name { font-weight: 600; font-size: 13px; }

/* ---------- Boutons icône ---------- */
.btn-icon,
/* Variantes compactes des modules (même pattern, tailles plus petites) */
.btn-icon-sm, .btn-icon-xs,
.brf-block-menu-btn, .vid-shot-menu-btn {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  color: var(--text-muted); transition: all .15s;
  border: none; background: none; cursor: pointer;
}
/* Taille « sm » (24px) et « xs » (22px) */
.btn-icon-sm { width: 24px; height: 24px; border-radius: 4px; }
.btn-icon-xs,
.brf-block-menu-btn, .vid-shot-menu-btn {
  width: 22px; height: 22px; border-radius: 4px;
  color: var(--text-faint);
}
.btn-icon:hover, .btn-icon-sm:hover, .btn-icon-xs:hover,
.brf-block-menu-btn:hover, .vid-shot-menu-btn:hover {
  background: var(--hover); color: var(--text);
}
.btn-icon-danger:hover, .btn-icon--danger:hover { background: #FEF2F2; color: var(--red); }
/* Petit bouton texte (compact) */
.btn-xs {
  padding: 3px 10px; font-size: 11px; font-weight: 500;
  border-radius: 4px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  cursor: pointer; transition: background .12s, color .12s;
}
.btn-xs:hover { background: var(--hover); }
.btn-ghost.btn-xs { background: none; }
.btn-danger-sm {
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  color: var(--red); border: 1px solid #FECACA;
  background: #FEF2F2; cursor: pointer; transition: opacity .15s;
}
.btn-danger-sm:hover { opacity: .8; }

/* ---------- Onglets de page ---------- */
/* Onglets « soulignés » (socle) : barre avec trait sous l'onglet actif.
   Commun core/brochure/newsletter. Le style « segmented control » de la
   vidéo (fond pilule) est un autre composant et n'est pas concerné. */
.tabs-bar,
.nws-tabs-bar {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.tab-link,
.brf-page-tab-btn, .nws-tab {
  display: flex; align-items: center; gap: 4px;
  padding: 9px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px; white-space: nowrap;
  font-family: var(--font);
  transition: color .15s, border-color .15s;
}
.tab-link:hover,
.brf-page-tab-btn:hover, .nws-tab:hover { color: var(--text); }
.tab-link.active, .tab-link--active,
.brf-page-tab-btn--active, .nws-tab.active {
  color: var(--accent); border-bottom-color: var(--accent);
}

/* ---------- Formulaires ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.form-footer {
  display: flex; gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.field-hint { font-size: 11px; color: var(--text-faint); font-weight: 400; margin-left: 4px; }

/* Tag rôle système */
.role-system-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--text-faint);
  border: 1px solid var(--border);
  vertical-align: middle;
}

/* Selects — chevron SVG custom, apparence native supprimée */
select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 32px;
  /* Le chevron est injecté via background sur les règles spécifiques ci-dessous */
}

/* Chevron pour select.field-input — combine avec le background blanc du champ */
select.field-input {
  background: var(--surface)
    url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIj48cGF0aCBkPSJNMiA0bDQgNCA0LTQiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZCNzI4MCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==")
    no-repeat right 10px center;
  padding-right: 32px;
}

/* Selects inline (sans field-input) — style complet avec chevron */
select:not(.field-input) {
  padding: 8px 32px 8px 12px;
  background: var(--surface)
    url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMiIgaGVpZ2h0PSIxMiIgdmlld0JveD0iMCAwIDEyIDEyIj48cGF0aCBkPSJNMiA0bDQgNCA0LTQiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzZCNzI4MCIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==")
    no-repeat right 10px center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.5;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
select:not(.field-input):focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Toggle (checkbox stylée) */
.toggle-label {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  user-select: none;
}
.toggle-label input[type="checkbox"] { display: none; }
.toggle-custom {
  width: 36px; height: 20px; border-radius: 999px;
  background: var(--border-strong); flex-shrink: 0;
  position: relative; transition: background .2s;
}
.toggle-custom::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: white;
  transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-label input:checked + .toggle-custom { background: var(--accent); }
.toggle-label input:checked + .toggle-custom::after { transform: translateX(16px); }

/* ---------- Permissions ---------- */
.perm-list {
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 8px;
}
.perm-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: background .12s;
  font-size: 13px;
}
.perm-row:hover { background: var(--surface-2); }
.perm-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); flex-shrink: 0; }
.perm-key  { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); min-width: 200px; }
.perm-label { color: var(--text); }

/* ---------- Système d'avatars unifié ---------- */
.avatar {
  border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  font-weight: 700; overflow: hidden;
  position: relative;
}
.avatar-xs     { width: 22px;  height: 22px;  font-size: 8px;  }
.avatar-sm     { width: 32px;  height: 32px;  font-size: 11px; }
.avatar-md     { width: 38px;  height: 38px;  font-size: 13px; }
.avatar-upload { width: 110px; height: 110px; font-size: 28px; letter-spacing: -0.02em; cursor: pointer; position: relative; }
.avatar .avatar-img { position: absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.avatar.avatar-xs { width: 22px; height: 22px; border-radius: 50%; }
.avatar.avatar-xs .avatar-img { height: 100%; border-radius: 50%; border: 1px solid var(--accent); }
.avatar.avatar-sm { width: 32px; height: 32px; border-radius: 50%; }
.avatar.avatar-sm .avatar-img { height: 100%; border-radius: 50%; border: 2px solid var(--accent); }
.avatar.avatar-md { width: 38px; height: 38px; border-radius: 50%; }
.avatar.avatar-md .avatar-img { height: 100%; border-radius: 50%; border: 2px solid var(--accent); }

/* Overlay hover sur avatar upload */
.avatar-upload .avatar-overlay {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(15,17,28,.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: white; font-size: 11px; font-weight: 600;
  opacity: 0; transition: opacity .2s;
}
.avatar-upload:hover .avatar-overlay { opacity: 1; }
.avatar-upload input[type="file"] { display: none; }
.avatar-hint { font-size: 11px; color: var(--text-faint); text-align: center; margin: 0; }

/* ---------- Formulaire utilisateur — layout 2 colonnes ---------- */
.user-edit-layout {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 700px) { .user-edit-layout { grid-template-columns: 1fr; } }

.user-edit-sidebar {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding-top: 4px;
}
.avatar-upload-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.text-center { text-align: center; }

/* Card du formulaire */
.user-edit-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Sections */
.form-section { padding: 22px 24px; border-bottom: 1px solid var(--border); }
.form-section.no-border,
.form-section:last-of-type { border-bottom: none; }
.form-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-faint); margin-bottom: 18px;
}

/* Grille de champs — espacement explicite, pas de margin auto */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.field-center { display: flex; flex-direction: column; justify-content: flex-end; }

/* Générateur de mot de passe — sous les champs, pleine largeur */
.pwd-actions { display: flex; flex-direction: column; gap: 8px; }

/* Footer unifié pour tous les onglets */
.form-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display: flex; gap: 10px; align-items: center;
}
/* Quand le footer est dans user-edit-main, pas besoin de le redéfinir */
.user-edit-main .form-footer { border-radius: 0; }

/* Bouton ghost */
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 13px; font-size: 12px; font-weight: 600;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: background .1s, border-color .1s, color .1s;
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--text-faint); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* Générateur de mot de passe */
.pwd-gen-wrap { display: flex; flex-direction: column; gap: 8px; }
.btn-generate {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 12px; font-weight: 600;
  color: var(--accent); background: var(--accent-pale);
  border: 1px solid var(--accent-soft); border-radius: var(--radius-sm);
  cursor: pointer; transition: opacity .15s; align-self: flex-start;
}
.btn-generate:hover { opacity: .8; }

.generated-pwd-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 4px;
}
.generated-pwd-text {
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
  flex: 1; word-break: break-all;
}
.btn-copy {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; font-size: 11px; font-weight: 600;
  color: var(--text-muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.btn-copy:hover { background: var(--hover); color: var(--text); }

.field-uppercase { text-transform: uppercase; }

/* ---------- Layout rôle (pleine largeur, pas de sidebar avatar) ---------- */
.role-edit-layout { display: flex; flex-direction: column; gap: 0; }

.field-mono { font-family: var(--font-mono); font-size: 12px; }

/* Propagation inline dans le footer */
.propagate-inline {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted); font-weight: 500;
  cursor: pointer; margin-right: auto;
}
.propagate-inline input { accent-color: var(--accent); width: 14px; height: 14px; }

/* ---------- Groupes de permissions ---------- */
.perm-group { margin-bottom: 20px; }
.perm-group:last-child { margin-bottom: 0; }
.perm-group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-faint);
  padding: 0 12px; margin-bottom: 4px;
}
.perm-row-disabled { opacity: .45; cursor: not-allowed; }
.perm-row-disabled input { cursor: not-allowed; }
.perm-dep { font-size: 11px; color: var(--text-faint); font-style: italic; }

.propagate-row {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.propagate-row .perm-key { display: none; }

/* ---------- Dropdown topbar ---------- */
.tb-dropdown-wrap { position: relative; }
.tb-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  z-index: 50;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tb-dropdown-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; color: var(--text);
  transition: background .12s; cursor: pointer;
  border: none; background: none; font-family: var(--font);
}
.tb-dropdown-item:hover { background: var(--hover); }

/* ---------- Zone module topbar ---------- */
.tb-module-zone {
  display: flex; align-items: center; gap: 8px;
  padding: 0 8px;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}

/* ---------- Carte projet ---------- */
.project-card-settings {
  width: 26px; height: 26px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--text-faint);
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all .15s; flex-shrink: 0;
  text-decoration: none;
}
.project-card-settings:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-pale); }

.project-status-pill {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 600;
}

.project-card-link { text-decoration: none; color: inherit; display: block; }
.project-card-link:hover .project-card-name { color: var(--c, var(--accent)); }

/* Barre de progression */
.project-progress-bar-wrap {
  display: flex; align-items: center; gap: 8px; margin-top: 2px;
}
/* Barre de progression (socle). Le module ne fixe que sa largeur (fixe ou
   flex) et, si besoin, la couleur du remplissage via --c ou une variante. */
.project-progress-bar, .studio-progress,
.brf-spread-progress-bar, .vid-progress-wrap, .nws-edition-progress-bar {
  flex: 1; height: 4px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden;
}
.project-progress-fill, .studio-progress-fill,
.brf-spread-progress-fill, .vid-progress-fill, .nws-edition-progress-fill {
  height: 100%; border-radius: 999px;
  background: var(--c, var(--accent)); transition: width .3s;
}
.project-progress-label { font-size: 11px; font-weight: 600; color: var(--text-faint); flex-shrink: 0; font-family: var(--font-mono); }


/* ---------- Membres projet ---------- */
.member-row {
  border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: none; }
.member-summary {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; cursor: pointer;
  list-style: none;
}
.member-summary::-webkit-details-marker { display: none; }
.member-summary:hover { background: var(--surface-2); }
.member-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.member-chev { margin-left: auto; color: var(--text-faint); transition: transform .2s; flex-shrink: 0; }
details[open] .member-chev { transform: rotate(180deg); }
.member-detail {
  padding: 16px 20px 20px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.member-form { margin: 0; }

/* ---------- Grille widgets home ---------- */
.widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.widget > .card { margin: 0; }

/* ---------- Grille projets ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  color: inherit;
  transition: border-color .1s, box-shadow .1s;
}
.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}
.project-card-new {
  border-style: dashed; color: var(--text-faint);
  align-items: center; justify-content: center;
  gap: 6px; text-align: center; background: transparent;
  font-size: 13px; font-family: var(--font);
}
.project-card-new:hover { color: var(--accent); border-color: var(--accent); }

.project-card-head { display: flex; align-items: center; justify-content: space-between; }
.project-type-badge {
  font-size: 10px; font-weight: 600;
  color: var(--c, var(--accent));
  background: var(--c-bg, var(--accent-weak));
  padding: 2px 7px; border-radius: 4px;
}
.project-status {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
}
.project-status-active   { background: #F0FDF4; color: #15803D; }
.project-status-archived { background: var(--surface-2); color: var(--text-faint); }
.project-status-draft    { background: #FEF9C3; color: #854D0E; }

.project-card-name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

.project-card-members { display: flex; align-items: center; gap: -4px; }
.project-card-members .avatar { margin-right: -6px; border: 2px solid var(--surface); }
.project-members-more {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  margin-left: 10px;
}
.project-card-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.project-meta-item { display: flex; gap: 4px; font-size: 12px; }
.project-meta-key  { color: var(--text-faint); }
.project-meta-val  { color: var(--text); font-weight: 600; }

/* ---------- Modale ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20,22,34,.5);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-panel);
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 48px);
  margin: auto;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.modal-body  { padding: 16px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-shrink: 0;
}

.btn-danger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; font-size: 13px; font-weight: 600;
  background: var(--red); color: white;
  border-radius: var(--radius-sm); cursor: pointer; border: none;
  transition: opacity .15s;
}
.btn-danger:hover { opacity: .85; }

/* ---------- Hamburger (masqué en desktop) ---------- */
.tb-hamburger {
  display: none;
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  place-items: center;
  color: var(--text-muted); transition: background .15s;
  flex-shrink: 0;
}
.tb-hamburger:hover { background: var(--hover); color: var(--text); }

/* Bouton fermeture sidebar (masqué en desktop) */
.sb-close {
  display: none;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  place-items: center;
  color: var(--text-muted); transition: background .15s; flex-shrink: 0;
}
.sb-close:hover { background: var(--hover); }

/* Overlay mobile */
.sb-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 45;
  background: rgba(15,17,28,.4);
}
.sb-overlay.open { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed; inset: 0 auto 0 0;
    width: 280px; z-index: 50;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    box-shadow: var(--shadow-panel);
  }
  .sidebar.open { transform: translateX(0); }

  .tb-hamburger { display: grid; }
  .sb-close     { display: grid; }

  .page { padding: 20px 16px 48px; }
  .notif-panel { width: 100%; }
  .tb-search-wrap.open { width: 200px; }
  .tb-search { width: 200px; }
}

/* ---- Page Activité / Logs ---- */
.activity-filters {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.activity-list { display: flex; flex-direction: column; gap: 2px; }
.activity-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 14px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  transition: background .1s;
}
.activity-item:hover { background: var(--surface-2); }
.activity-avatar { flex-shrink: 0; margin-top: 2px; }
.activity-body { flex: 1; min-width: 0; }
.activity-label { font-size: 13px; color: var(--text); }
.activity-project { color: var(--text-muted); font-weight: 400; }
.activity-meta {
  display: flex; gap: 10px; margin-top: 3px;
  font-size: 11px; color: var(--text-faint);
}
.activity-action {
  font-family: var(--font-mono); background: var(--surface-2);
  padding: 1px 5px; border-radius: 3px; border: 1px solid var(--border);
}
.activity-detail-btn {
  font-size: 11px; color: var(--accent); background: none; border: none;
  cursor: pointer; padding: 0 0 0 8px; text-decoration: underline;
}
.activity-detail {
  margin-top: 10px; border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
}

/* Diff avant/après */
.audit-diff {
  display: grid; grid-template-columns: 1fr 1fr;
}
.audit-diff-col { min-width: 0; }
.audit-diff-col + .audit-diff-col { border-left: 1px solid var(--border); }
.audit-diff-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-faint);
  padding: 4px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.audit-diff-content {
  font-size: 12px; padding: 8px 10px; white-space: pre-wrap;
  word-break: break-word; font-family: var(--font-mono);
}
.audit-diff-before { background: #fef2f2; color: #991b1b; }
.audit-diff-after  { background: #f0fdf4; color: #166534; }

/* Pagination */
.pagination { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination-btn {
  padding: 5px 10px; border-radius: 5px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none;
  font-size: 12px; font-weight: 600; transition: all .1s;
}
.pagination-btn:hover { border-color: var(--accent); color: var(--accent); }
.pagination-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Éditeur Quill (socle commun) ----------
   Base partagée par Studio.quill() : typographie et rendu de contenu identiques
   partout. La « boîte » (bordure, hauteur, fond) reste propre à chaque module.
   Le saut de ligne « softbreak » (Shift+Enter) est un vrai <br> (rendu natif). */
.ql-editor {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}
/* Placeholder discret, cohérent avec les champs du design */
.ql-editor.ql-blank::before {
  color: var(--text-faint);
  font-style: italic;
  font-size: 13px;
}
/* Espacement de paragraphe homogène */
.ql-editor p { margin: 0 0 0.6em; }
.ql-editor p:last-child { margin-bottom: 0; }
/* Médias et citations */
.ql-editor img { max-width: 100%; border-radius: 4px; }
.ql-editor blockquote {
  border-left: 3px solid var(--accent);
  margin: 6px 0; padding: 2px 0 2px 12px;
  color: var(--text-muted); font-style: italic;
}
/* Quill pose des bordures par thème ; on neutralise au profit de la boîte module */
.ql-container.ql-snow { font-family: var(--font); }


/* ---------- Tooltip (socle) — remplace l'attribut title= ----------
   Bulle gérée par Studio.tooltip (JS délégué, position:fixed). */
.studio-tooltip {
  position: fixed; z-index: 99999; display: none;
  max-width: 260px; padding: 5px 9px;
  background: #1e293b; color: #fff;
  font-family: var(--font); font-size: 12px; font-weight: 500; line-height: 1.35;
  border-radius: 6px; box-shadow: 0 4px 14px rgba(0,0,0,.22);
  pointer-events: none; white-space: normal;
  opacity: 0; transform: translateY(2px); transition: opacity .12s, transform .12s;
}
.studio-tooltip--in { opacity: 1; transform: translateY(0); }
/* Petite flèche (--tip-arrow = position horizontale calculée en JS) */
.studio-tooltip::after {
  content: ''; position: absolute; left: var(--tip-arrow, 50%);
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #1e293b;
  top: 100%;
}
.studio-tooltip--below::after {
  top: auto; bottom: 100%;
  border-top-color: transparent; border-bottom-color: #1e293b;
}
