/* =====================================================================
   Interface d'administration
   Mise en page : barre latérale + zone principale. L'éditeur de fiche
   affiche le formulaire à gauche et l'aperçu en direct à droite.
   ===================================================================== */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --border: #e4e7ec;
  --border-strong: #d0d5dd;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --ok: #079455;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --danger: #d92d20;
  --danger-soft: #fef3f2;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 16px 40px -12px rgba(16, 24, 40, .22);
  --ring: 0 0 0 4px rgba(79, 70, 229, .16);
  --sidebar-w: 240px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.5rem; line-height: 1.25; margin: 0; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 1.05rem; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: .95rem; margin: 0; font-weight: 600; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
:focus-visible { outline: none; box-shadow: var(--ring); }
[hidden] { display: none !important; }

/* ---------- Structure générale ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: #0f1324; color: #c7cbe0; display: flex; flex-direction: column; padding: 18px 12px;
  transition: transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; color: #fff; font-weight: 700; font-size: 1rem; letter-spacing: -.01em; }
.sidebar-brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; }
.sidebar nav { display: grid; gap: 2px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: #c7cbe0; font-weight: 500; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(255, 255, 255, .1); color: #fff; }
.nav-link .badge { margin-left: auto; }
.sidebar-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: #6b7194; padding: 18px 12px 6px; font-weight: 600; }
.sidebar-foot { margin-top: auto; display: grid; gap: 2px; }
.sidebar-foot button { width: 100%; background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #f04438; color: #fff; font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; }
.main { flex: 1; min-width: 0; margin-left: var(--sidebar-w); }
.mobile-bar { display: none; }
.page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 80px; }

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar-open .sidebar { transform: none; }
  .sidebar-open .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(15, 19, 36, .45); z-index: 35; }
  .main { margin-left: 0; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 30; padding: 10px 14px; background: #0f1324; color: #fff; }
  .mobile-bar .sidebar-brand { padding: 0; }
  .page { padding: 20px 16px 80px; }
}

/* ---------- En-tête de page ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--panel); color: var(--text-2); font: inherit; font-weight: 600; font-size: .88rem;
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs); text-decoration: none !important;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--panel-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-dark { background: var(--text); border-color: var(--text); color: #fff; }
.btn-dark:hover { background: #1d2939; color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b42318; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: rgba(16, 24, 40, .05); }
.btn-sm { height: 32px; padding: 0 10px; font-size: .82rem; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn .spinner { display: none; }
.btn.loading .spinner { display: inline-block; }
.btn.loading .icon { display: none; }
.spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.inline { display: inline; margin: 0; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; font-weight: 600; }

/* ---------- Pastilles ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #f2f4f7; color: var(--text-2); white-space: nowrap; }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-plain::before { display: none; }

/* ---------- Cartes ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
.card-pad { padding: 20px; }

/* ---------- Statistiques ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { padding: 16px 18px; display: flex; align-items: center; gap: 14px; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat-icon.ok { background: var(--ok-soft); color: var(--ok); }
.stat-icon.warn { background: var(--warn-soft); color: var(--warn); }
.stat-icon.grey { background: #f2f4f7; color: var(--text-2); }
.stat strong { display: block; font-size: 1.45rem; line-height: 1.1; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: .82rem; }

/* ---------- Barre d'outils du tableau de bord ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 38px; }
.segmented { display: inline-flex; padding: 3px; background: #eaecf0; border-radius: 9px; gap: 2px; }
.segmented button { border: 0; background: none; font: inherit; font-size: .84rem; font-weight: 600; color: var(--muted); height: 32px; padding: 0 12px; border-radius: 7px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.segmented button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.segmented .count { font-size: .72rem; background: rgba(16,24,40,.07); padding: 1px 6px; border-radius: 999px; }
.toolbar .spacer { flex: 1; }

/* ---------- Grille de clients ---------- */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.client-card { display: flex; flex-direction: column; overflow: visible; transition: box-shadow .2s, transform .2s, border-color .2s; position: relative; }
.client-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--border-strong); }
.client-cover { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden; display: block; background: var(--cover, #eef2ff); }
.client-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.client-card:hover .client-cover img { transform: scale(1.04); }
.client-cover .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 2rem; font-weight: 800; letter-spacing: -.03em; background: linear-gradient(135deg, var(--cover), color-mix(in srgb, var(--cover) 55%, #000)); }
.client-cover .pill { position: absolute; top: 10px; left: 10px; box-shadow: var(--shadow); background: rgba(255,255,255,.95); }
.client-cover .pill-ok { color: var(--ok); }
.client-cover .pill-warn { left: auto; right: 10px; color: var(--warn); }
.client-logo { position: absolute; left: 14px; top: -24px; width: 44px; height: 44px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); padding: 4px; object-fit: contain; }
.client-body { padding: 16px 16px 12px; flex: 1; position: relative; }
.client-body.with-logo { padding-top: 26px; }
.client-name { font-weight: 650; font-size: 1rem; color: var(--text); display: block; letter-spacing: -.01em; }
.client-meta { color: var(--muted); font-size: .84rem; margin-top: 2px; }
.client-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 6px; background: #f2f4f7; font-size: .76rem; font-weight: 600; color: var(--text-2); }
.chip .dot { width: 9px; height: 9px; border-radius: 3px; }
.client-foot { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--border); }
.client-foot .btn-edit { flex: 1; }
/* vue liste */
.view-list .client-grid { grid-template-columns: 1fr; gap: 8px; }
.view-list .client-card { flex-direction: row; align-items: center; }
.view-list .client-card:hover { transform: none; }
.view-list .client-cover { width: 120px; aspect-ratio: 16 / 10; border-radius: var(--radius-lg) 0 0 var(--radius-lg); flex: none; }
.view-list .client-cover .pill, .view-list .client-logo { display: none; }
.view-list .client-body { padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; }
.view-list .client-tags { margin: 0; }
.view-list .client-foot { border: 0; }
@media (max-width: 700px) { .view-list .client-card { flex-wrap: wrap; } .view-list .client-cover { display: none; } .view-list .client-foot { width: 100%; border-top: 1px solid var(--border); } }

.empty-state { text-align: center; padding: 64px 20px; }
.empty-state .stat-icon { margin: 0 auto 14px; width: 52px; height: 52px; border-radius: 14px; }
.empty-state h2 { margin-bottom: 6px; }

/* ---------- Menus déroulants ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 210px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px;
  animation: pop .14s ease;
}
.menu-list.up { top: auto; bottom: calc(100% + 6px); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.menu-list a, .menu-list button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px;
  border: 0; background: none; font: inherit; font-weight: 500; color: var(--text-2); cursor: pointer; border-radius: 6px; text-decoration: none !important;
}
.menu-list a:hover, .menu-list button:hover { background: var(--panel-2); color: var(--text); }
.menu-list form { margin: 0; }
.menu-list hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu-list .danger { color: var(--danger); }
.menu-list .danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Champs ---------- */
label, .field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .85rem; color: var(--text-2); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
input, select, textarea {
  font: inherit; font-size: .92rem; font-weight: 400; color: var(--text);
  width: 100%; padding: 9px 12px; min-height: 40px;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-xs);
  transition: border-color .15s, box-shadow .15s;
}
textarea { 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='%23667085' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #a5a2f7; box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: #98a2b3; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; box-shadow: none; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.counter { font-weight: 500; color: var(--muted); font-size: .75rem; }
.counter.over { color: var(--danger); }
.grid-2, .grid-3 { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } .span-2 { grid-column: span 2; } .span-all { grid-column: 1 / -1; } }
.stack { display: grid; gap: 16px; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-right: 0; border-radius: 8px 0 0 8px; background: var(--panel-2); color: var(--muted); font-weight: 500; font-size: .88rem; }
.input-prefix input { border-radius: 0 8px 8px 0; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: radial-gradient(800px 500px at 20% 10%, rgba(99,102,241,.55), transparent 60%), radial-gradient(600px 400px at 90% 90%, rgba(168,85,247,.45), transparent 60%), #0f1324; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-side h2 { font-size: 2rem; line-height: 1.15; letter-spacing: -.03em; max-width: 14ch; }
.login-side p { color: #c7cbe0; max-width: 40ch; }
.login-main { display: grid; place-items: center; padding: 32px; background: var(--panel); }
.login-box { width: 100%; max-width: 360px; }
.login-box h1 { margin-bottom: 6px; }
.login-box form { display: grid; gap: 16px; margin-top: 28px; }
.login-box .btn { height: 44px; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-side { display: none; } }

/* ---------- Alertes / notifications ---------- */
.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; font-weight: 500; margin-bottom: 16px; border: 1px solid; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert-error { background: var(--danger-soft); border-color: #fecdca; color: #912018; }
.alert-warning { background: var(--warn-soft); border-color: #fedf89; color: #93370d; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: grid; gap: 10px; width: min(380px, calc(100vw - 40px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: #101828; color: #fff; box-shadow: var(--shadow-lg); font-weight: 500;
  animation: toastIn .25s cubic-bezier(.2,.8,.2,1);
}
.toast.out { animation: toastOut .2s ease forwards; }
.toast .icon { margin-top: 1px; }
.toast-success .icon { color: #47cd89; }
.toast-warning .icon { color: #fdb022; }
.toast-error .icon { color: #f97066; }
.toast a { color: #a5b4fc; font-weight: 600; }
.toast-close { margin-left: auto; background: none; border: 0; color: #98a2b3; cursor: pointer; padding: 0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Boîte de confirmation ---------- */
dialog.modal { border: 0; border-radius: 16px; padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal::backdrop { background: rgba(15, 19, 36, .5); backdrop-filter: blur(2px); }
.modal-body { padding: 22px 22px 8px; display: flex; gap: 14px; }
.modal-body .stat-icon { background: var(--danger-soft); color: var(--danger); flex: none; }
.modal-body p { color: var(--muted); margin: 6px 0 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }

/* =====================================================================
   ÉDITEUR DE FICHE CLIENT
   ===================================================================== */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 46%); min-height: 100vh; }
.editor.no-preview { grid-template-columns: minmax(0, 1fr) 0; }
.editor.no-preview .preview-pane { display: none; }
.editor-main { min-width: 0; }
.editor-head {
  position: sticky; top: 0; z-index: 20; background: rgba(245, 246, 248, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.editor-head-inner { display: flex; align-items: center; gap: 12px; padding: 12px 24px; }
.editor-title { min-width: 0; flex: 1; }
.editor-title h1 { font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 10px; }
.editor-title h1 span.name { overflow: hidden; text-overflow: ellipsis; }
.save-state { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.save-state::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #12b76a; }
.save-state.dirty::before { background: #f79009; }
.save-state.saving::before { background: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.editor-actions { display: flex; align-items: center; gap: 8px; }
.kbd { font-size: .7rem; padding: 1px 5px; border-radius: 4px; background: rgba(255,255,255,.18); font-weight: 600; }
.btn:not(.btn-primary) .kbd { background: #f2f4f7; color: var(--muted); }

.section-nav { display: flex; gap: 4px; padding: 0 24px 10px; overflow-x: auto; scrollbar-width: none; }
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a { padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: .82rem; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.section-nav a:hover { background: rgba(16, 24, 40, .05); color: var(--text); text-decoration: none; }
.section-nav a.active { background: var(--text); color: #fff; }
.section-nav .n { font-size: .7rem; background: rgba(127,127,127,.18); border-radius: 999px; padding: 0 6px; }

.editor-body { padding: 24px; max-width: 860px; margin: 0 auto; display: grid; gap: 20px; }
.form-section { scroll-margin-top: 120px; }
.form-section > header { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.form-section > header .stat-icon { width: 36px; height: 36px; border-radius: 9px; }
.form-section > header p { margin: 2px 0 0; color: var(--muted); font-size: .84rem; }
.form-section > header .head-extra { margin-left: auto; }
.form-section > .section-body { padding: 20px; display: grid; gap: 16px; }

/* --- Zone de dépôt --- */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  padding: 28px 20px; border: 2px dashed var(--border-strong); border-radius: 12px; background: var(--panel-2); color: var(--muted);
  cursor: pointer; transition: border-color .15s, background-color .15s, transform .15s;
}
.dropzone:hover { border-color: #a5a2f7; background: var(--accent-soft); }
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.dropzone .dz-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--panel); color: var(--accent); box-shadow: var(--shadow); margin-bottom: 6px; }
.dropzone strong { color: var(--text); font-size: .95rem; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone-compact { padding: 16px; flex-direction: row; gap: 14px; text-align: left; }
.dropzone-compact .dz-icon { margin: 0; }

/* --- Logo --- */
.logo-field { display: flex; gap: 16px; align-items: center; }
.logo-preview { width: 88px; height: 88px; border-radius: 16px; border: 1px solid var(--border); background: repeating-conic-gradient(#f2f4f7 0 25%, #fff 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; flex: none; overflow: hidden; position: relative; }
.logo-preview img { max-width: 80%; max-height: 80%; object-fit: contain; }
.logo-preview .icon { color: #98a2b3; width: 26px; height: 26px; }
.logo-field .dropzone { flex: 1; }

/* --- Galerie --- */
.gallery-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.g-tile { position: relative; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-xs); touch-action: none; }
.g-tile .g-img { position: relative; aspect-ratio: 4 / 3; background: #f2f4f7; cursor: grab; }
.g-tile .g-img img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.g-tile input { border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; font-size: .8rem; min-height: 34px; padding: 6px 10px; }
.g-tile input:focus { box-shadow: inset 0 0 0 2px #a5a2f7; }
.g-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.g-tile:hover .g-actions, .g-tile:focus-within .g-actions { opacity: 1; }
@media (hover: none) { .g-actions { opacity: 1; } }
.g-actions button { width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(16, 24, 40, .72); color: #fff; display: grid; place-items: center; cursor: pointer; }
.g-actions button:hover { background: #101828; }
.g-actions button.del:hover { background: var(--danger); }
.g-actions .icon { width: 14px; height: 14px; }
.g-cover { position: absolute; left: 6px; top: 6px; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; display: none; letter-spacing: .02em; }
.gallery-editor .g-tile:first-child .g-cover { display: block; }
.g-tile.uploading .g-img::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.55); }
.g-progress { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 6px; border-radius: 6px; background: rgba(16,24,40,.15); overflow: hidden; z-index: 2; }
.g-progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.g-status { position: absolute; left: 10px; bottom: 22px; z-index: 2; font-size: .72rem; font-weight: 600; color: var(--text-2); }
.g-tile.error { border-color: #fda29b; }
.g-tile.error .g-status { color: var(--danger); }
.gallery-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; }

/* --- Tri par glisser --- */
.sorting { cursor: grabbing !important; user-select: none; }
.sorting * { cursor: grabbing !important; }
.is-dragging { opacity: .55; box-shadow: var(--shadow-lg) !important; outline: 2px solid var(--accent); outline-offset: 2px; z-index: 5; }

/* --- Listes répétables (services, avis) --- */
.repeat { display: grid; gap: 10px; }
.r-item { display: grid; grid-template-columns: 28px 1fr; gap: 6px 10px; padding: 14px 14px 14px 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); position: relative; transition: border-color .15s; }
.r-item:focus-within { border-color: #c7c4fb; }
.r-handle { grid-row: 1 / 3; align-self: start; width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; color: #98a2b3; cursor: grab; touch-action: none; margin-top: 4px; }
.r-handle:hover { background: var(--panel-2); color: var(--text-2); }
.r-fields { display: grid; gap: 10px; min-width: 0; }
.r-top { display: grid; grid-template-columns: 1fr 170px auto; gap: 10px; align-items: start; }
@media (max-width: 640px) { .r-top { grid-template-columns: 1fr auto; } .r-top .r-price, .r-top .r-rating { grid-column: 1 / -1; order: 3; } }
.r-title { font-weight: 600; }
.r-tools { display: flex; gap: 2px; }
.r-item textarea { min-height: 64px; }
.add-row { justify-self: start; }
.empty-hint { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 12px; font-size: .86rem; }

/* --- Notation par étoiles --- */
.star-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; height: 40px; align-items: center; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { cursor: pointer; font-size: 1.5rem; line-height: 1; color: #d0d5dd; font-weight: 400; transition: color .1s, transform .1s; display: inline; }
.star-input label:hover { transform: scale(1.15); }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #f5a524; }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }

/* --- Assistant horaires --- */
.hours-helper { border: 1px solid var(--border); border-radius: 12px; padding: 12px; background: var(--panel-2); display: grid; gap: 6px; }
.h-row { display: grid; grid-template-columns: 96px 44px 1fr; gap: 10px; align-items: center; font-size: .85rem; }
.h-row .h-times { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.h-row input[type=time] { width: 108px; min-height: 34px; padding: 4px 8px; }
.h-row.closed .h-times { opacity: .35; pointer-events: none; }
.switch { position: relative; width: 36px; height: 20px; display: inline-block; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #d0d5dd; transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow); transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }

/* --- Thèmes --- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.theme-opt { position: relative; cursor: pointer; display: block; }
.theme-opt > input { position: absolute; opacity: 0; }
.theme-card { display: block; border: 2px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--panel); transition: border-color .15s, box-shadow .15s, transform .15s; height: 100%; }
.theme-opt:hover .theme-card { border-color: var(--border-strong); transform: translateY(-2px); }
.theme-opt > input:checked + .theme-card { border-color: var(--accent); box-shadow: var(--ring); }
.theme-opt > input:focus-visible + .theme-card { box-shadow: var(--ring); }
.theme-check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; z-index: 2; }
.theme-opt > input:checked ~ .theme-check { display: grid; }
.theme-info { display: block; padding: 10px 12px 12px; }
.theme-info strong { display: block; font-size: .9rem; color: var(--text); }
.theme-info small { display: block; color: var(--muted); font-weight: 400; font-size: .76rem; line-height: 1.35; margin-top: 2px; }
.theme-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.theme-tags span { font-size: .66rem; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: #f2f4f7; color: var(--muted); }

/* Mini-maquettes de thème (CSS uniquement) */
.mock { --m-bg: #fff; --m-fg: #111; --m-p: var(--p, #1e4fd8); --m-s: var(--s, #f59e0b); --m-r: 4px; --m-card: #f2f4f7;
  display: block; aspect-ratio: 16 / 10; background: var(--m-bg); padding: 8px; position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.mock i { display: block; position: absolute; border-radius: var(--m-r); }
.mock .m-nav { left: 8px; right: 8px; top: 7px; height: 5px; background: color-mix(in srgb, var(--m-fg) 15%, transparent); border-radius: 2px; }
.mock .m-h1 { background: var(--m-fg); height: 9px; border-radius: 2px; }
.mock .m-h2 { background: color-mix(in srgb, var(--m-fg) 35%, transparent); height: 4px; border-radius: 2px; }
.mock .m-btn { background: var(--m-p); height: 8px; width: 26px; border-radius: 99px; }
.mock .m-img { background: linear-gradient(135deg, color-mix(in srgb, var(--m-p) 70%, #fff), var(--m-p)); }
.mock .m-c { background: var(--m-card); height: 16px; bottom: 8px; width: 28%; }
/* split */
.mock-split .m-h1 { left: 8px; top: 24px; width: 42%; } .mock-split .m-h2 { left: 8px; top: 38px; width: 34%; } .mock-split .m-btn { left: 8px; top: 48px; }
.mock-split .m-img { right: 8px; top: 20px; width: 40%; height: 46%; }
/* full */
.mock-full .m-img { inset: 0; border-radius: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--m-p) 40%, #555), #111); }
.mock-full .m-h1 { left: 10px; bottom: 34px; width: 62%; height: 11px; background: #fff; } .mock-full .m-h2 { left: 10px; bottom: 26px; width: 40%; background: rgba(255,255,255,.6); } .mock-full .m-btn { left: 10px; bottom: 12px; background: var(--m-s); }
.mock-full .m-nav { background: rgba(255,255,255,.35); z-index: 1; } .mock-full .m-c { display: none; }
/* centered */
.mock-centered .m-h1 { left: 22%; right: 22%; top: 20px; } .mock-centered .m-h2 { left: 30%; right: 30%; top: 33px; } .mock-centered .m-btn { left: calc(50% - 13px); top: 42px; }
.mock-centered .m-img { left: 12px; right: 12px; top: 56px; bottom: -6px; }
.mock-centered .m-c { display: none; }
/* editorial */
.mock-editorial .m-h1 { left: 8px; top: 18px; width: 78%; height: 16px; } .mock-editorial .m-h2 { left: 8px; top: 40px; width: 36%; } .mock-editorial .m-btn { right: 8px; top: 38px; border-radius: 0; }
.mock-editorial .m-img { left: 8px; right: 8px; top: 54px; bottom: 6px; border-radius: 0; }
.mock-editorial .m-c { display: none; }
/* bento */
.mock-bento .m-c { left: 8px; top: 18px; bottom: 8px; width: 40%; height: auto; }
.mock-bento .m-h1 { left: 13px; top: 30px; width: 30%; } .mock-bento .m-h2 { left: 13px; top: 44px; width: 24%; } .mock-bento .m-btn { left: 13px; top: 54px; }
.mock-bento .m-img { right: 8px; top: 18px; width: 50%; height: 36%; }
.mock-bento .m-img2 { right: 8px; bottom: 8px; width: 24%; height: 34%; background: color-mix(in srgb, var(--m-s) 70%, #fff); position: absolute; display: block; border-radius: var(--m-r); }
.mock-bento .m-img3 { right: calc(26% + 8px); bottom: 8px; width: 24%; height: 34%; background: color-mix(in srgb, var(--m-p) 40%, #fff); position: absolute; display: block; border-radius: var(--m-r); }
.mock .m-img2, .mock .m-img3 { display: none; }
.mock-bento .m-img2, .mock-bento .m-img3 { display: block; }
/* Habillage par thème */
.mock-t-moderne { --m-r: 0; }
.mock-t-minimal { --m-r: 0; --m-card: #fff; } .mock-t-minimal .m-btn { background: #111; border-radius: 0; }
.mock-t-eclat { --m-bg: linear-gradient(135deg, color-mix(in srgb, var(--m-p) 18%, #fff), color-mix(in srgb, var(--m-s) 18%, #fff)); --m-r: 8px; background: var(--m-bg); } .mock-t-eclat .m-btn { background: linear-gradient(90deg, var(--m-p), var(--m-s)); }
.mock-t-audacieux { --m-bg: color-mix(in srgb, var(--m-s) 30%, #fffdf5); --m-r: 4px; } .mock-t-audacieux .m-img, .mock-t-audacieux .m-btn { border: 2px solid #111; box-shadow: 2px 2px 0 #111; }
.mock-t-urbain { --m-bg: #0b0d10; --m-fg: #eef1f4; --m-card: #1a1f27; --m-r: 6px; } .mock-t-urbain .m-btn { background: var(--m-p); }
.mock-t-nature { --m-bg: #fbf9f4; --m-card: color-mix(in srgb, var(--m-p) 12%, #f4f1e8); } .mock-t-nature .m-img { border-radius: 58% 42% 46% 54% / 48% 44% 56% 52%; }
.mock-t-chaleureux { --m-bg: #fff6ea; --m-r: 10px; --m-fg: #6b3a18; }
.mock-t-gourmet { --m-bg: #f7f3ea; --m-fg: #1d2a22; } .mock-t-gourmet .m-btn { background: var(--m-s); border-radius: 0; }
.mock-t-premium { --m-bg: #0c0c0c; --m-fg: #ece7df; --m-card: #1a1a1a; --m-r: 0; } .mock-t-premium .m-btn { border-radius: 0; }
.mock-t-premium.mock-full .m-img { background: linear-gradient(180deg, #2a2723, #0c0c0c); }

/* --- Mise en page d'accueil --- */
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.hero-grid .theme-card .mock { aspect-ratio: 16 / 11; }
.hero-grid .theme-info { padding: 8px 10px; }
.hero-grid .theme-info strong { font-size: .8rem; }
.hero-grid .mock-auto { display: grid; place-items: center; color: var(--muted); font-size: .76rem; font-weight: 600; background: var(--panel-2); }

/* --- Couleurs --- */
.palettes { display: flex; flex-wrap: wrap; gap: 8px; }
.palette { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600; color: var(--text-2); transition: border-color .15s, transform .1s; }
.palette:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.palette .sw { display: inline-flex; }
.palette .sw i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.palette .sw i + i { margin-left: -7px; }
.palette.active { border-color: var(--accent); box-shadow: var(--ring); }
.color-field { display: flex; align-items: center; gap: 0; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--panel); box-shadow: var(--shadow-xs); }
.color-field:focus-within { border-color: #a5a2f7; box-shadow: var(--ring); }
.color-field input[type=color] { width: 46px; height: 40px; padding: 4px; border: 0; border-right: 1px solid var(--border); border-radius: 0; box-shadow: none; cursor: pointer; background: none; min-height: 0; }
.color-field input[type=text] { border: 0; box-shadow: none !important; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; }
.font-sample { font-size: 1.35rem; font-weight: 600; color: var(--text); line-height: 1.2; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-sample.body { font-size: .95rem; font-weight: 400; }

/* --- SEO --- */
.serp { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; background: var(--panel); font-family: Arial, sans-serif; }
.serp-site { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: #202124; margin-bottom: 6px; }
.serp-site i { width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; display: grid; place-items: center; font-style: normal; font-size: .7rem; font-weight: 700; color: #5f6368; }
.serp-site small { display: block; color: #4d5156; }
.serp-title { color: #1a0dab; font-size: 1.15rem; line-height: 1.3; margin-bottom: 3px; }
.serp-desc { color: #4d5156; font-size: .86rem; line-height: 1.45; }

/* =====================================================================
   Panneau d'aperçu en direct
   ===================================================================== */
.preview-pane { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: #e9ebf0; border-left: 1px solid var(--border); }
.preview-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--panel); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.preview-bar select { width: auto; min-height: 32px; height: 32px; padding: 0 30px 0 10px; font-size: .82rem; font-weight: 600; }
.preview-bar .segmented button { height: 26px; padding: 0 8px; }
.preview-bar .spacer { flex: 1; }
.preview-live { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; color: var(--ok); text-transform: uppercase; letter-spacing: .06em; }
.preview-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(18,183,106,.2); }
.preview-live.busy { color: var(--accent); }
.preview-stage { position: relative; flex: 1; overflow: hidden; display: flex; justify-content: center; padding: 16px; }
.preview-device { position: relative; height: 100%; transform-origin: top center; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 20px 50px -20px rgba(16,24,40,.35), 0 0 0 1px rgba(16,24,40,.08); transition: width .25s ease; }
.preview-device iframe { position: absolute; left: 0; top: 0; border: 0; background: #fff; transform-origin: 0 0; }
.preview-device iframe.next { visibility: hidden; }
.device-mobile .preview-device { border-radius: 28px; box-shadow: 0 20px 50px -20px rgba(16,24,40,.35), 0 0 0 8px #101828; }
@media (max-width: 1180px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .preview-pane { position: fixed; inset: 0; z-index: 60; height: 100vh; display: none; }
  .editor.show-preview .preview-pane { display: flex; }
  .editor.no-preview .preview-pane { display: none; }
}
.preview-close { display: none; }
@media (max-width: 1180px) { .preview-close { display: inline-flex; } }

/* ---------- Secteurs ---------- */
.sector-add { display: flex; gap: 8px; padding: 16px; border-bottom: 1px solid var(--border); }
.sector-add input { flex: 1; }
.sector-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; padding: 16px; }
.sector-item { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.sector-item form.rename { flex: 1; display: flex; min-width: 0; }
.sector-item input { border: 0; box-shadow: none; padding: 6px 0; min-height: 32px; font-weight: 500; background: transparent; }
.sector-item input:focus { box-shadow: none; }
.sector-item:focus-within { border-color: #a5a2f7; box-shadow: var(--ring); }
.sector-item .use { font-size: .72rem; color: var(--muted); background: #f2f4f7; border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.sector-item .save { display: none; }
.sector-item:focus-within .save { display: inline-flex; }

/* ---------- Messages ---------- */
.msg-list { display: grid; gap: 12px; }
.msg { padding: 18px 20px; display: grid; grid-template-columns: 44px 1fr; gap: 14px; }
.msg.unread { border-left: 3px solid var(--accent); }
.msg .avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.msg-head strong { font-size: .95rem; }
.msg-contact { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; color: var(--muted); margin-top: 2px; }
.msg-text { white-space: pre-wrap; margin: 12px 0; color: var(--text-2); background: var(--panel-2); border-radius: 10px; padding: 12px 14px; }
.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Correctifs : petites cartes des maquettes, menus au-dessus des cartes voisines */
.mock .m-c { display: none; }
.mock-bento .m-c { display: block; }
.client-card:focus-within, .client-card:has(details[open]) { z-index: 6; }

/* Barre latérale réduite à des icônes (éditeur) */
@media (min-width: 961px) {
  .compact-nav { --sidebar-w: 68px; }
  .compact-nav .sidebar { padding: 18px 10px; }
  .compact-nav .nav-label, .compact-nav .sidebar-section { display: none; }
  .compact-nav .sidebar-brand { padding: 6px 0 22px; justify-content: center; }
  .compact-nav .nav-link { justify-content: center; padding: 10px; position: relative; }
  .compact-nav .nav-link .badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; font-size: .62rem; padding: 0 4px; }
}

/* Éditeur sur tablette / mobile */
@media (max-width: 960px) {
  .editor-head { top: 58px; }
  .form-section { scroll-margin-top: 180px; }
}
@media (max-width: 680px) {
  .editor-head-inner { flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .editor-title { flex: 1 1 calc(100% - 50px); }
  .editor-actions { width: 100%; }
  .editor-actions [data-save], .editor-actions [data-publish] { flex: 1; }
  .section-nav { padding: 0 14px 10px; }
  .editor-body { padding: 14px; gap: 14px; }
  .form-section > header, .form-section > .section-body { padding: 16px; }
  .logo-field { flex-wrap: wrap; }
  .theme-grid { grid-template-columns: repeat(2, 1fr); }
  .toolbar .search { max-width: none; flex-basis: 100%; }
  .preview-bar { padding: 8px; }
}

.logo-field .dropzone { flex: 1 1 220px; }
@media (max-width: 680px) { .preview-live { display: none; } }

/* Suivi d'envoi des e-mails de contact */
.mail-status { display: flex; align-items: center; gap: 6px; font-size: .82rem; margin: -4px 0 12px; color: var(--muted); }
.mail-sent { color: var(--ok); }
.mail-failed { color: var(--danger); }
.mail-skipped { color: var(--warn); }

/* =====================================================================
   Domaine & espace client
   ===================================================================== */
.access-grid { display: grid; gap: 16px; align-items: start; }
@media (min-width: 640px) { .access-grid { grid-template-columns: 1fr 1fr; } }
.toggle-row { flex-direction: row; align-items: center; gap: 12px; font-weight: 500; }
.check-row { display: grid; gap: 8px; }
.opt { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; margin: 0; cursor: pointer; }
.opt input { margin-top: 3px; flex: none; }
.opt > span { display: grid; gap: 1px; }
.opt strong { color: var(--text); font-weight: 600; }
.access-state { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; margin: 0; padding: 10px 12px; border-radius: 8px; }
.access-state.ok { background: var(--ok-soft); color: var(--ok); }
.access-state.ko { background: var(--warn-soft); color: var(--warn); }
.domain-status { font-size: .85rem; padding: 10px 12px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); font-weight: 400; }
.domain-status ul { margin: 0 0 6px; padding-left: 0; list-style: none; }
.domain-status.ok { border-color: #abefc6; background: var(--ok-soft); }
.domain-status.ko { border-color: #fedf89; background: var(--warn-soft); }
.howto { font-weight: 400; font-size: .85rem; color: var(--text-2); }
.howto summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.howto ol { padding-left: 20px; margin: 8px 0; display: grid; gap: 6px; }
.howto code, .access-grid code { background: #f2f4f7; padding: 1px 6px; border-radius: 4px; font-size: .8rem; word-break: break-all; }
.account-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.account { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.account.off { opacity: .6; }
.account .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; flex: none; }
.account-info { flex: 1; min-width: 160px; display: grid; font-weight: 500; }
.account-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.invite-row { display: grid; grid-template-columns: 1fr 1.4fr auto; gap: 8px; margin-top: 10px; }
@media (max-width: 640px) { .invite-row { grid-template-columns: 1fr; } }
.invite-link { margin-top: 10px; display: grid; gap: 6px; padding: 12px; border-radius: 10px; background: var(--accent-soft); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-family: ui-monospace, Consolas, monospace; font-size: .8rem; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-weight: 400; font-size: .86rem; }
.history-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); }
.menu-note { display: block; padding: 6px 10px 8px; font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* Espace client */
.portal .editor-head { top: 0; }
.portal-welcome { padding: 20px; display: grid; gap: 16px; background: linear-gradient(135deg, #eef2ff, #fdf4ff); border-color: #e0e7ff; }
@media (min-width: 900px) { .portal-welcome { grid-template-columns: 1.4fr 1fr; } }
.portal-welcome h2 { font-size: 1.2rem; margin-bottom: 6px; }
.portal-welcome p { margin: 0 0 6px; }
.portal-history ul { list-style: none; padding: 0; margin: 6px 0 0; font-size: .82rem; display: grid; gap: 4px; }
.portal-side { background: radial-gradient(700px 500px at 20% 10%, rgba(16,185,129,.45), transparent 60%), radial-gradient(600px 400px at 90% 90%, rgba(99,102,241,.45), transparent 60%), #0f1324; }

/* Équipe */
.sidebar-user { padding: 8px 12px; font-size: .8rem; color: #8b91b0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.team-list .account { background: var(--panel); }
.role { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
