/* =====================================================================
   DASHBOARD — feuille de style
   Clair / sombre, couleur de marque issue du thème du site (--a-brand),
   responsive du smartphone au très grand écran.
   ===================================================================== */

/* ---------- 1. Jetons ---------- */
:root {
  --brand: var(--a-brand, #0b6841); --brand-rgb: var(--a-brand-rgb, 11, 104, 65);
  --brand-soft: rgba(var(--brand-rgb), .1); --brand-soft-2: rgba(var(--brand-rgb), .16);
  --accent: var(--a-accent, #98c93c);
  --bg: #f5f6f8; --panel: #ffffff; --panel-2: #f8f9fb; --panel-3: #f1f3f6; --line: #e6e8ec; --line-2: #eef0f3;
  --text: #121826; --text-2: #374151; --muted: #6b7280; --muted-2: #9aa1ad;
  --success: #16a34a; --success-soft: rgba(22, 163, 74, .1); --warning: #d97706; --warning-soft: rgba(217, 119, 6, .12);
  --danger: #dc2626; --danger-soft: rgba(220, 38, 38, .09); --info: #2563eb; --info-soft: rgba(37, 99, 235, .1);
  --radius: 14px; --radius-sm: 10px; --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05); --shadow-sm: 0 1px 3px rgba(16, 24, 40, .07), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 8px 24px rgba(16, 24, 40, .08); --shadow-lg: 0 24px 60px rgba(16, 24, 40, .16);
  --sb-w: 268px; --sb-w-c: 78px; --tb-h: 64px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .75, .25, 1);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0b0e13; --panel: #12161d; --panel-2: #161b23; --panel-3: #1b212b; --line: #232a35; --line-2: #1d232d;
  --text: #e8ecf2; --text-2: #c9d0da; --muted: #96a0ae; --muted-2: #6e7886;
  --brand-soft: rgba(var(--brand-rgb), .16); --brand-soft-2: rgba(var(--brand-rgb), .24);
  --success-soft: rgba(34, 197, 94, .14); --warning-soft: rgba(245, 158, 11, .15); --danger-soft: rgba(239, 68, 68, .14); --info-soft: rgba(59, 130, 246, .15);
  --success: #22c55e; --warning: #f59e0b; --danger: #ef4444; --info: #60a5fa;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4); --shadow: 0 10px 30px rgba(0, 0, 0, .45); --shadow-lg: 0 30px 70px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: 15px; }
@media (min-width: 2200px) { html { font-size: 17px; } }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; color: var(--text); }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: .4rem 0; }
code, kbd, .mono { font-family: var(--mono); }
code { font-size: .86em; padding: .12em .4em; border-radius: 6px; background: var(--panel-3); border: 1px solid var(--line); word-break: break-all; }
kbd { font-size: .74rem; padding: .1rem .4rem; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--muted); box-shadow: 0 1px 0 var(--line); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-soft-2); }
.icon { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: middle; stroke-width: 1.9; }
.icon-xs { width: .95em; height: .95em; } .icon-sm { width: 1.1em; height: 1.1em; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .center { text-align: center; } .text-center { text-align: center; }
.nowrap { white-space: nowrap; } .num { text-align: right; font-variant-numeric: tabular-nums; } .big { font-size: 1.25rem; }
.text-danger { color: var(--danger) !important; } .text-success { color: var(--success) !important; } .text-info { color: var(--info) !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.link { font-weight: 600; font-size: .88rem; }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; font-size: .86rem; display: inline-flex; align-items: center; gap: .3rem; }
.link-btn:hover { text-decoration: underline; }
.stack { display: grid; gap: 1.25rem; align-content: start; min-width: 0; }
.gap { display: inline-block; width: .5rem; }
.wrap { flex-wrap: wrap; }
.inline-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.inline-row input[type="text"], .inline-row input[type="password"], .inline-row input:not([type]) { flex: 1 1 12rem; min-width: 0; }
.inline-form { display: inline-flex; margin: 0; }

/* ---------- 3. Structure : barre latérale, barre supérieure, contenu ---------- */
body.admin { display: block; min-height: 100vh; }
.sidebar { position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: var(--sb-w); display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); transition: width .3s var(--ease), transform .3s var(--ease); }
.sb-head { display: flex; align-items: center; gap: .5rem; height: var(--tb-h); padding: 0 .75rem 0 1rem; border-bottom: 1px solid var(--line-2); flex: none; }
.sb-brand { display: flex; align-items: center; gap: .7rem; min-width: 0; flex: 1; color: var(--text); text-decoration: none !important; }
.sb-brand img { height: 34px; width: auto; max-width: 64px; object-fit: contain; flex: none; }
.sb-mono, .auth-mono { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--accent))); color: #fff; font-weight: 800; }
.sb-name { display: grid; min-width: 0; font-weight: 750; font-size: .95rem; line-height: 1.2; }
.sb-name, .sb-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-name small { font-weight: 500; color: var(--muted); font-size: .74rem; }
.sb-collapse { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); flex: none; transition: transform .3s var(--ease); }
.sb-collapse:hover { color: var(--text); }
.sb-nav { flex: 1; overflow-y: auto; padding: .75rem .65rem 1rem; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.sb-group + .sb-group { margin-top: 1.1rem; }
.sb-group-label { display: block; padding: 0 .65rem .4rem; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-2); white-space: nowrap; }
.sb-link { position: relative; display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: 10px; color: var(--text-2); font-weight: 550; font-size: .92rem; text-decoration: none !important; white-space: nowrap; transition: background-color .15s, color .15s; }
.sb-link .icon { width: 1.2rem; height: 1.2rem; color: var(--muted); transition: color .15s; }
.sb-link:hover { background: var(--panel-3); color: var(--text); }
.sb-link:hover .icon { color: var(--text); }
.sb-link.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.sb-link.is-active .icon { color: var(--brand); }
.sb-link.is-active::before { content: ""; position: absolute; left: -.65rem; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.sb-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sb-badge { min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem; display: grid; place-items: center; border-radius: 999px; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 750; }
.sb-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem .65rem; border-top: 1px solid var(--line-2); }
.sb-foot .sb-link { flex: 1; }
.sb-version { font-size: .7rem; color: var(--muted-2); padding-right: .4rem; white-space: nowrap; }
.sb-overlay { display: none; }
.main { min-width: 0; margin-left: var(--sb-w); transition: margin-left .3s var(--ease); }
.sb-collapsed .sidebar { width: var(--sb-w-c); }
.sb-collapsed .main { margin-left: var(--sb-w-c); }
.sb-collapsed .sb-name, .sb-collapsed .sb-label, .sb-collapsed .sb-group-label, .sb-collapsed .sb-version, .sb-collapsed .sb-brand img + .sb-name { display: none; }
.sb-collapsed .sb-head { padding: 0 .5rem; justify-content: center; flex-direction: column; height: auto; min-height: var(--tb-h); gap: .4rem; padding-block: .6rem; }
.sb-collapsed .sb-collapse { transform: rotate(180deg); }
.sb-collapsed .sb-link { justify-content: center; padding: .65rem; }
.sb-collapsed .sb-badge { position: absolute; top: 2px; right: 6px; min-width: 1.05rem; height: 1.05rem; font-size: .6rem; padding: 0 .25rem; }
.sb-collapsed .sb-group + .sb-group { margin-top: .4rem; padding-top: .4rem; border-top: 1px solid var(--line-2); }
.sb-collapsed .sb-foot { flex-direction: column; }
@media (max-width: 1080px) {
  .sidebar { transform: translateX(-102%); width: min(86vw, var(--sb-w)); box-shadow: var(--shadow-lg); }
  .sb-open .sidebar { transform: none; }
  .main, .sb-collapsed .main { margin-left: 0; }
  .sb-collapse { display: none; }
  .sb-open .sb-overlay { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(10, 14, 20, .45); backdrop-filter: blur(2px); animation: fade .2s ease; }
  .sb-collapsed .sidebar { width: min(86vw, var(--sb-w)); }
  .sb-collapsed .sb-name, .sb-collapsed .sb-label, .sb-collapsed .sb-group-label, .sb-collapsed .sb-version { display: initial; }
  .sb-collapsed .sb-link { justify-content: flex-start; padding: .55rem .7rem; }
}
@keyframes fade { from { opacity: 0; } }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--tb-h); display: flex; align-items: center; gap: .75rem; padding: 0 clamp(.8rem, 2.5vw, 1.75rem); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.tb-menu { display: none; }
@media (max-width: 1080px) { .tb-menu { display: inline-grid; } }
.tb-search { flex: 0 1 26rem; display: flex; align-items: center; gap: .6rem; height: 40px; padding: 0 .75rem; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--muted); font-size: .9rem; text-align: left; transition: border-color .15s, box-shadow .15s; }
.tb-search span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tb-search:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: 0 0 0 3px var(--brand-soft); }
@media (max-width: 640px) { .tb-search kbd, .tb-search span { display: none; } .tb-search { flex: none; width: 40px; padding: 0; justify-content: center; } }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.tb-btn { position: relative; width: 40px; height: 40px; display: inline-grid; place-items: center; border: 0; border-radius: 11px; background: transparent; color: var(--text-2); text-decoration: none !important; }
.tb-btn:hover { background: var(--panel-3); color: var(--text); }
.tb-btn .icon { width: 1.25rem; height: 1.25rem; }
.tb-dot { position: absolute; top: 5px; right: 5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 800; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.tb-pill { display: inline-flex; align-items: center; gap: .4rem; height: 32px; padding: 0 .75rem; border-radius: 999px; font-size: .8rem; font-weight: 650; text-decoration: none !important; }
.tb-pill.tone-warning { background: var(--warning-soft); color: var(--warning); }
@media (max-width: 760px) { .tb-pill span { display: none; } }
.tt-moon, html[data-theme="dark"] .tt-sun { display: none; }
html[data-theme="dark"] .tt-moon { display: inline; }
.tb-user { display: inline-flex; align-items: center; gap: .55rem; height: 42px; padding: 0 .55rem 0 .3rem; border: 1px solid transparent; border-radius: 12px; background: transparent; }
.tb-user:hover { background: var(--panel-3); }
.tb-user-name { display: grid; text-align: left; font-weight: 650; font-size: .86rem; line-height: 1.2; }
.tb-user-name small { font-weight: 500; color: var(--muted); font-size: .72rem; }
@media (max-width: 760px) { .tb-user-name, .tb-user > .icon { display: none; } }
.avatar { width: 34px; height: 34px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 50%, var(--accent))); color: #fff; font-weight: 750; font-size: .8rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 26px; height: 26px; font-size: .68rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.1rem; }
.content { padding: clamp(1rem, 2.6vw, 2rem) clamp(.8rem, 2.6vw, 2rem) 4rem; max-width: 92rem; margin: 0 auto; }
.content-wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem 1.5rem; margin-bottom: 1.5rem; }
.ph-text { min-width: 0; flex: 1 1 22rem; }
.ph-text h1 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); font-weight: 750; }
.ph-text p { margin: .35rem 0 0; color: var(--muted); max-width: 60rem; }
.ph-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-bottom: .45rem; font-size: .82rem; }
.crumbs a { color: var(--muted); font-weight: 550; }
.crumbs a:hover { color: var(--brand); }
.crumbs .icon { color: var(--muted-2); }

/* ---------- 4. Boutons ---------- */
.btn { --b: var(--brand); display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 40px; padding: 0 1rem; border: 1px solid transparent; border-radius: 11px; background: var(--b); color: #fff; font-weight: 650; font-size: .9rem; line-height: 1; white-space: nowrap; text-decoration: none !important; box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 1px 0 rgba(255, 255, 255, .14); transition: background-color .15s, box-shadow .15s, transform .15s, border-color .15s, color .15s; }
.btn:hover { background: color-mix(in srgb, var(--b) 88%, #000); box-shadow: 0 6px 16px rgba(var(--brand-rgb), .25); color: #fff; }
.btn:active { transform: translateY(1px); }
html[data-theme="dark"] .btn:hover { background: color-mix(in srgb, var(--b) 85%, #fff); }
.btn-ghost { background: var(--panel); color: var(--text-2); border-color: var(--line); box-shadow: var(--shadow-xs); }
.btn-ghost:hover, .btn-ghost.is-active { background: var(--panel-3); color: var(--text); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); box-shadow: var(--shadow-xs); }
html[data-theme="dark"] .btn-ghost:hover { background: var(--panel-3); }
.btn-danger { --b: var(--danger); }
.btn-danger:hover { box-shadow: 0 6px 16px rgba(220, 38, 38, .25); }
.btn-warning { --b: var(--warning); }
.btn-whatsapp { --b: #1faa53; }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger-soft); border-color: rgba(220, 38, 38, .3); }
.btn-sm { height: 34px; padding: 0 .75rem; font-size: .84rem; border-radius: 9px; gap: .4rem; }
.btn-xs { height: 28px; padding: 0 .6rem; font-size: .78rem; border-radius: 8px; gap: .3rem; }
.btn-lg { height: 48px; padding: 0 1.4rem; font-size: .98rem; border-radius: 13px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 40px; padding: 0; } .btn-sm.btn-icon { width: 34px; }
.btn[disabled], .btn.is-loading { opacity: .7; pointer-events: none; }
.btn-spinner { display: none; width: 1em; height: 1em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.is-loading .btn-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 11px 0 0 11px; }
.btn-group .btn:last-child { border-radius: 0 11px 11px 0; }
.btn-group .btn:only-child { border-radius: 11px; }
.btn-group .btn + .btn { margin-left: -1px; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.btn-split { display: flex; gap: .4rem; margin-top: .5rem; }
.btn-split .btn { flex: 1; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); text-decoration: none !important; transition: background-color .15s, color .15s; flex: none; }
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.icon-btn:disabled { opacity: .4; pointer-events: none; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--panel-3); border: 1px solid var(--line); }
.seg > a, .seg > button { display: inline-flex; align-items: center; gap: .35rem; height: 32px; padding: 0 .75rem; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600; font-size: .84rem; text-decoration: none !important; white-space: nowrap; }
.seg > a:hover, .seg > button:hover { color: var(--text); }
.seg > .is-active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-sm); }
.seg-sm > a, .seg-sm > button { height: 28px; padding: 0 .6rem; font-size: .8rem; }

/* ---------- 5. Badges, alertes ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; height: 22px; padding: 0 .55rem; border-radius: 999px; font-size: .73rem; font-weight: 650; white-space: nowrap; line-height: 1; }
.badge-success { background: var(--success-soft); color: var(--success); } .badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); } .badge-info { background: var(--info-soft); color: var(--info); }
.badge-neutral { background: var(--panel-3); color: var(--text-2); border: 1px solid var(--line); }
.dot-new { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); margin-right: .45rem; vertical-align: middle; box-shadow: 0 0 0 3px var(--brand-soft); }
.dot-yes { color: var(--success); }
.alert { display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1px solid; font-size: .9rem; margin-bottom: 1rem; }
.alert > .icon { margin-top: .1rem; }
.alert p, .alert ul { margin: .2rem 0 0; } .alert ul { padding-left: 1.1rem; }
.alert-danger { background: var(--danger-soft); border-color: rgba(220, 38, 38, .22); color: var(--danger); }
.alert-warning { background: var(--warning-soft); border-color: rgba(217, 119, 6, .25); color: color-mix(in srgb, var(--warning) 70%, var(--text)); }
.alert-success { background: var(--success-soft); border-color: rgba(22, 163, 74, .25); color: color-mix(in srgb, var(--success) 70%, var(--text)); }
.alert-info { background: var(--info-soft); border-color: rgba(37, 99, 235, .22); color: color-mix(in srgb, var(--info) 70%, var(--text)); }
.alert strong { display: block; }
.info-box { display: flex; gap: .8rem; padding: .9rem 1rem; border-radius: var(--radius-sm); background: var(--brand-soft); border: 1px solid var(--brand-soft-2); font-size: .88rem; color: var(--text-2); }
.info-box > .icon { color: var(--brand); margin-top: .12rem; }
.info-box strong { display: block; color: var(--text); margin-bottom: .1rem; }
.info-box p { margin: 0; }
.banner { display: flex; gap: 1rem; padding: 1.1rem 1.25rem; border-radius: var(--radius); margin-bottom: 1.25rem; border: 1px solid; align-items: flex-start; }
.banner p { margin: .3rem 0 0; font-size: .9rem; }
.banner-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; }
.banner-success { background: var(--success-soft); border-color: rgba(22, 163, 74, .25); } .banner-success .banner-icon { background: var(--success); color: #fff; }
.banner-danger { background: var(--danger-soft); border-color: rgba(220, 38, 38, .28); } .banner-danger .banner-icon { background: var(--danger); color: #fff; }
.banner code { font-size: .86em; padding: 1px 5px; border-radius: 5px; background: rgba(0, 0, 0, .06); }
.banner-brand { background: linear-gradient(120deg, var(--brand-soft), transparent 70%), var(--panel); border-color: var(--brand-soft-2); } .banner-brand .banner-icon { background: var(--brand); color: #fff; }
.banner-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }

/* ---------- 6. Cartes, grilles ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .95rem 1.15rem; border-bottom: 1px solid var(--line-2); }
.card-head h2 { font-size: .98rem; font-weight: 700; }
.card-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-body { padding: 1.15rem; }
.card-flush { overflow: hidden; }
.card + .card, .card + .stats-row, .stats-row + .card, .tabs-links + .card, .card + .grid-2, .grid-2 + .card, .card + .grid-2-1, .grid-2-1 + .card, .grid-2-1 + .grid-2-1, .stats-row + .grid-2-1, .stats-row + .tabs-links, .card + .grid-3, .grid-2 + .grid-3, .grid-3 + .card, .chips-row + .tabs-links { margin-top: 1.25rem; }
.sub-title { font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 1.3rem 0 .6rem; }
.sub-title:first-child { margin-top: 0; }
.grid-2, .grid-3, .grid-2-1, .grid-1-2 { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr); } .grid-1-2 { grid-template-columns: minmax(16rem, 1fr) minmax(0, 2fr); } }
.cards-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head p { margin: 0; }
.chips-row { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: .35rem; height: 28px; padding: 0 .7rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); font-size: .8rem; font-weight: 550; color: var(--text-2); }
button.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip strong { color: var(--brand); }

/* ---------- 7. Cartes statistiques & graphiques ---------- */
.stats-row, .stats-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14.5rem), 1fr)); margin-bottom: 1.25rem; }
.stats-row + .card-flush, .stats-row + section { margin-top: 0; }
.stat-card { position: relative; display: grid; gap: .25rem; align-content: start; padding: 1.1rem 1.15rem 1rem; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-xs); color: var(--text); text-decoration: none !important; overflow: hidden; transition: box-shadow .2s, transform .2s var(--ease), border-color .2s; }
a.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: color-mix(in srgb, var(--tone, var(--brand)) 30%, var(--line)); }
.stat-card::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--tone-soft, var(--brand-soft)); opacity: .7; }
.tone-brand { --tone: var(--brand); --tone-soft: var(--brand-soft); } .tone-success { --tone: var(--success); --tone-soft: var(--success-soft); }
.tone-warning { --tone: var(--warning); --tone-soft: var(--warning-soft); } .tone-danger { --tone: var(--danger); --tone-soft: var(--danger-soft); } .tone-info { --tone: var(--info); --tone-soft: var(--info-soft); }
.sc-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin-bottom: .45rem; }
.sc-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--tone-soft); color: var(--tone); }
.stat-delta { display: inline-flex; align-items: center; gap: .2rem; height: 22px; padding: 0 .45rem; border-radius: 999px; font-size: .72rem; font-weight: 750; }
.stat-delta.up { background: var(--success-soft); color: var(--success); } .stat-delta.down { background: var(--danger-soft); color: var(--danger); } .stat-delta.flat { background: var(--panel-3); color: var(--muted); }
.sc-value { position: relative; z-index: 1; font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sc-label { position: relative; z-index: 1; color: var(--muted); font-size: .86rem; font-weight: 550; }
.sc-hint { position: relative; z-index: 1; color: var(--muted-2); font-size: .77rem; }
.spark { position: relative; z-index: 1; width: 100%; height: 34px; margin-top: .45rem; display: block; }
.spark-line { fill: none; stroke: var(--tone, var(--brand)); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-area { fill: var(--tone-soft, var(--brand-soft)); stroke: none; }
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .ch-grid { stroke: var(--line-2); stroke-width: 1; }
.chart .ch-axis { fill: var(--muted-2); font-size: 11px; font-family: var(--font); }
.chart .ch-line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .ch-area { opacity: .14; }
.chart .ch-bar { rx: 4; transition: opacity .2s; }
.chart .ch-bar:hover { opacity: .8; }
.chart .ch-dot { stroke: var(--panel); stroke-width: 2; }
.ch-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .6rem; font-size: .8rem; color: var(--muted); }
.ch-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.ch-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.ch-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 9rem; padding: .55rem .7rem; border-radius: 10px; background: var(--text); color: var(--panel); font-size: .78rem; box-shadow: var(--shadow); transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.ch-tip strong { display: block; margin-bottom: .2rem; }
.ch-tip span { display: flex; align-items: center; gap: .4rem; }
.ch-tip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.ch-cursor { stroke: var(--muted-2); stroke-dasharray: 3 3; }
.ch-donut-center { font-weight: 800; fill: var(--text); }
.ch-donut-label { fill: var(--muted); font-size: 11px; }
.progress { height: 8px; border-radius: 8px; background: var(--panel-3); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 8px; background: var(--tone, var(--brand)); transition: width .6s var(--ease); }
.mini-progress { display: grid; gap: .25rem; min-width: 8rem; }
.mini-progress small { color: var(--muted); font-size: .75rem; }

/* ---------- 8. Onglets, menus déroulants ---------- */
.tabs-bar { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.tabs-bar::-webkit-scrollbar { display: none; }
.tab { position: relative; display: inline-flex; align-items: center; gap: .45rem; flex: none; height: 42px; padding: 0 .95rem; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap; text-decoration: none !important; border-radius: 9px 9px 0 0; transition: color .15s, background-color .15s; }
.tab:hover { color: var(--text); background: var(--panel-3); }
.tab.is-active { color: var(--brand); }
.tab.is-active::after { content: ""; position: absolute; left: .6rem; right: .6rem; bottom: -1px; height: 2.5px; border-radius: 3px 3px 0 0; background: var(--brand); }
.tab-count { min-width: 1.4rem; height: 1.25rem; padding: 0 .35rem; display: inline-grid; place-items: center; border-radius: 999px; background: var(--panel-3); color: var(--muted); font-size: .7rem; font-weight: 750; }
.tab.is-active .tab-count { background: var(--brand-soft); color: var(--brand); }
.card > .tabs-bar, .builder-side > .tabs-bar { margin: 0 0 1rem; }
.tab-panel { min-width: 0; }
.edit-main > .tab-panel.card + .tab-panel.card { margin-top: 0; }
.tb-dd { position: relative; }
.dd-panel { position: absolute; z-index: 70; top: calc(100% + 6px); right: 0; min-width: 14rem; padding: .35rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-4px) scale(.98); transform-origin: top right; transition: opacity .15s, transform .15s var(--ease), visibility .15s; }
.tb-dd.is-open > .dd-panel, [data-dropdown].is-open > .dd-panel { opacity: 1; visibility: visible; transform: none; }
.dd-panel.is-fixed { position: fixed; z-index: 120; }
/* Une carte dont le menu « ⋯ » est ouvert le laisse déborder (pas de rognage ni de décalage au survol) */
:is(.theme-card, .form-card, .loc-card, .media-card, .album-card):has([data-dropdown].is-open) { overflow: visible; transform: none !important; position: relative; z-index: 30; }
.dd-menu a, .dd-menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .65rem; border: 0; border-radius: 8px; background: none; color: var(--text-2); font-size: .88rem; font-weight: 550; text-align: left; text-decoration: none !important; white-space: nowrap; }
.dd-menu a:hover, .dd-menu button:hover { background: var(--panel-3); color: var(--text); }
.dd-menu .danger { color: var(--danger); }
.dd-menu .danger:hover { background: var(--danger-soft); }
.dd-menu form, .dd-menu .inline-form { display: block; width: 100%; margin: 0; }
.dd-menu hr { margin: .35rem 0; }
.dd-notifs { width: min(24rem, calc(100vw - 1.5rem)); padding: 0; }
.dd-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); }
.dd-body { max-height: min(60vh, 26rem); overflow-y: auto; }
.dd-empty { padding: 1.6rem 1rem; text-align: center; color: var(--muted); font-size: .88rem; }
.notif { display: grid; grid-template-columns: auto 1fr; gap: .7rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line-2); color: var(--text-2); text-decoration: none !important; }
.notif:hover { background: var(--panel-2); }
.notif.is-unread { background: color-mix(in srgb, var(--brand-soft) 50%, transparent); }
.notif .n-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.notif strong { display: block; font-size: .86rem; color: var(--text); }
.notif span { font-size: .8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif small { font-size: .72rem; color: var(--muted-2); }

/* ---------- 9. Tableaux de données ---------- */
.dt { position: relative; }
.dt-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line-2); }
.dt-search { position: relative; flex: 1 1 15rem; max-width: 24rem; }
.dt-search .icon { position: absolute; left: .75rem; top: 50%; translate: 0 -50%; color: var(--muted); }
.dt-search input { width: 100%; height: 38px; padding: 0 .8rem 0 2.3rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); outline: none; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.dt-search input:focus { border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 3px var(--brand-soft); }
.dt-filter select, .select-sm select { height: 36px; padding: 0 2rem 0 .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa1ad' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .65rem center; -webkit-appearance: none; appearance: none; font-size: .86rem; color: var(--text-2); max-width: 15rem; cursor: pointer; outline: none; }
.dt-filter select:focus, .select-sm select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.dt-daterange { display: inline-flex; align-items: center; gap: .35rem; height: 36px; padding: 0 .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--muted); font-size: .84rem; }
.dt-daterange input { border: 0; background: none; outline: none; color: var(--text-2); font-size: .82rem; width: 8.2rem; }
.dt-tools-right { margin-left: auto; display: flex; gap: .45rem; }
.dt-bulk { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .6rem 1rem; background: var(--brand-soft); border-bottom: 1px solid var(--brand-soft-2); animation: fade .2s ease; }
.dt-bulk-count { font-size: .86rem; color: var(--text-2); }
.dt-bulk-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.table-scroll { position: relative; overflow: auto; max-height: min(72vh, 64rem); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.table-scroll-sm { max-height: 24rem; }
.card-body > .table-scroll { margin: -1.15rem; max-height: none; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .88rem; }
.table thead th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); color: var(--muted); font-weight: 650; font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table thead th.num, .table td.num { text-align: right; }
.table td { padding: .72rem .9rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--text-2); }
.table tbody tr { transition: background-color .12s; }
.table tbody tr:hover { background: var(--panel-2); }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr.is-unread td { color: var(--text); font-weight: 550; }
.table tbody tr.is-unread { background: color-mix(in srgb, var(--brand-soft) 35%, transparent); }
.table tbody tr.is-selected { background: var(--brand-soft); }
.table tbody tr.is-off td { opacity: .6; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { padding: .8rem .9rem; border-top: 1px solid var(--line); font-weight: 650; }
.table-plain thead th { position: static; }
.table-compact td { padding: .55rem .8rem; }
.sortable a { display: inline-flex; align-items: center; gap: .3rem; color: inherit; text-decoration: none !important; }
.sortable a:hover { color: var(--text); }
.sort-ind { opacity: .4; display: inline-flex; }
.is-sorted { color: var(--brand) !important; }
.is-sorted .sort-ind { opacity: 1; }
.col-check, .col-grip { width: 42px; padding-right: 0 !important; }
.col-actions { width: 1%; white-space: nowrap; text-align: right !important; }
.row-actions { display: inline-flex; gap: .2rem; justify-content: flex-end; align-items: center; }
.grip { display: inline-grid; place-items: center; width: 26px; height: 30px; color: var(--muted-2); cursor: grab; border-radius: 6px; }
.grip:hover { background: var(--panel-3); color: var(--text); }
tr.is-dragging { opacity: .5; background: var(--brand-soft) !important; }
tr.drop-before td { box-shadow: inset 0 2px 0 var(--brand); }
tr.drop-after td { box-shadow: inset 0 -2px 0 var(--brand); }
.cell-title { display: grid; gap: .1rem; min-width: 0; }
.cell-title strong { color: var(--text); font-weight: 650; }
.cell-title small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; max-width: 32rem; }
.cell-title small.note { color: var(--text-2); font-style: italic; }
.thumb { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; overflow: hidden; background: var(--panel-3); color: var(--muted-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.net-cell, .user-cell { display: inline-flex; align-items: center; gap: .55rem; }
.check-sm { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; cursor: pointer; }
.check-sm input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.check-sm span { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--muted-2); background: var(--panel); transition: all .15s; }
.check-sm input:checked + span { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: var(--brand); }
.check-sm input:indeterminate + span { background: var(--brand) linear-gradient(#fff, #fff) center / 9px 2px no-repeat; border-color: var(--brand); }
.check-sm input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft-2); }
.dt-foot { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem 1.25rem; padding: .75rem 1rem; border-top: 1px solid var(--line-2); font-size: .85rem; color: var(--muted); }
.dt-per label { display: inline-flex; align-items: center; gap: .45rem; }
.dt-per select { height: 32px; padding: 0 .5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.pager { display: flex; align-items: center; gap: .25rem; margin-left: auto; flex-wrap: wrap; }
.pager-center { justify-content: center; margin: 1.5rem 0 0; }
.pager a, .pager span { min-width: 32px; height: 32px; padding: 0 .55rem; display: inline-grid; place-items: center; grid-auto-flow: column; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: .84rem; text-decoration: none !important; border: 1px solid transparent; }
.pager a:hover { background: var(--panel-3); border-color: var(--line); }
.pager .is-current { background: var(--brand); color: #fff; }
.pager .is-disabled { opacity: .35; }
.pager .gap { min-width: 0; padding: 0 .1rem; }
.pager .dbl { margin-left: -.55em; }
.dt-empty { padding: .5rem; }
.dt.is-loading .table-scroll { opacity: .55; pointer-events: none; transition: opacity .15s; }
.dt.is-loading::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--brand), transparent); background-size: 50% 100%; animation: loadbar 1s linear infinite; }
@keyframes loadbar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
@media (max-width: 760px) {
  .table-scroll table.table:not(.table-plain) thead { display: none; }
  .table-scroll table.table:not(.table-plain), .table-scroll table.table:not(.table-plain) tbody { display: block; }
  .table-scroll table.table:not(.table-plain) tr { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .7rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); }
  .table-scroll table.table:not(.table-plain) td { display: flex; justify-content: space-between; align-items: center; gap: .6rem; grid-column: 2; border: 0; padding: .15rem 0; text-align: left !important; }
  .table-scroll table.table:not(.table-plain) td::before { content: attr(data-label); color: var(--muted-2); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; flex: none; }
  .table-scroll table.table:not(.table-plain) td.col-check { grid-column: 1; grid-row: 1 / span 6; align-self: start; padding-top: .2rem; }
  .table-scroll table.table:not(.table-plain) td.col-check::before, .table-scroll table.table:not(.table-plain) td.col-actions::before { content: none; }
  .table-scroll table.table:not(.table-plain) td.col-actions { grid-column: 3; grid-row: 1; align-self: start; }
  .table-scroll table.table:not(.table-plain) td:nth-child(2):not(.col-actions), .table-scroll table.table:not(.table-plain) td:first-child:not(.col-check) { font-size: .95rem; }
  .dt-search { max-width: none; }
  .dt-tools-right { margin-left: 0; width: 100%; }
}

/* ---------- 10. Champs de formulaire ---------- */
.fields-grid { display: grid; gap: 1rem; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: start; }
.fields-grid > * { grid-column: 1 / -1; min-width: 0; }
@media (min-width: 640px) { .fields-grid > .fld-half { grid-column: span 3; } .fields-grid > .fld-third { grid-column: span 2; } }
.fields-grid-2 { gap: .9rem 1rem; }
.fld { display: grid; gap: .4rem; align-content: start; min-width: 0; }
.lbl { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: .15rem .5rem; font-weight: 600; font-size: .86rem; color: var(--text); }
.lbl-link { font-weight: 550; font-size: .8rem; margin-left: auto; }
.req { color: var(--danger); margin-left: -.3rem; }
.help { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.fld input[type="text"], .fld input[type="email"], .fld input[type="tel"], .fld input[type="url"], .fld input[type="number"], .fld input[type="date"], .fld input[type="time"], .fld input[type="datetime-local"], .fld input[type="password"], .fld input[type="search"], .fld input:not([type]), .fld textarea, .fld select, .auth-form input[type="email"], .auth-form input[type="password"], .auth-form input[type="text"], .inline-row input, .table-modules input[type="text"], .ai-fields input, .input-sm, .copy-field input, .otp-input {
  width: 100%; height: 40px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); font-size: .92rem; outline: none; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.fld textarea { height: auto; min-height: 5.5rem; padding: .65rem .8rem; line-height: 1.5; resize: vertical; }
.fld textarea.mono, .fld .mono { font-family: var(--mono); font-size: .82rem; }
.fld input:focus, .fld textarea:focus, .fld select:focus, .auth-form input:focus, .inline-row input:focus, .table-modules input:focus, .ai-fields input:focus, .input-sm:focus, .otp-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.fld input::placeholder, .fld textarea::placeholder { color: var(--muted-2); }
.fld input[type="file"] { font-size: .86rem; color: var(--muted); }
.fld input[type="file"]::file-selector-button { margin-right: .7rem; height: 34px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-3); color: var(--text); font-weight: 600; cursor: pointer; }
.fld input[type="range"] { width: 100%; accent-color: var(--brand); }
.input-sm { height: 34px; width: auto; min-width: 6.5rem; font-size: .85rem; }
.fld.has-error input, .fld.has-error textarea, .fld.has-error select { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.fld-error { color: var(--danger); font-size: .78rem; font-weight: 600; }
.fld-section { padding-top: .6rem; margin-top: .2rem; border-top: 1px solid var(--line-2); }
.fld-section h3 { font-size: .8rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.fld-section p { margin: .3rem 0 0; color: var(--muted); font-size: .82rem; }
.fields-grid > .fld-section:first-child { border: 0; padding-top: 0; margin-top: 0; }
.select { position: relative; }
.select select, .select-sm select { width: 100%; -webkit-appearance: none; appearance: none; padding-right: 2.2rem; cursor: pointer; }
.select > .icon { position: absolute; right: .75rem; top: 50%; translate: 0 -50%; pointer-events: none; color: var(--muted); }
.select-sm { display: inline-block; }
.select-sm > .icon { display: none; }
.select-sm select { height: 34px; }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { border-radius: 10px 0 0 10px !important; }
.input-suffix span { display: grid; place-items: center; padding: 0 .75rem; border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; background: var(--panel-3); color: var(--muted); font-size: .82rem; font-weight: 650; }
.slug-field { display: flex; align-items: stretch; }
.slug-prefix { display: grid; place-items: center; padding: 0 .65rem; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: var(--panel-3); color: var(--muted); font-family: var(--mono); font-size: .8rem; white-space: nowrap; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.slug-field input { border-radius: 0 10px 10px 0 !important; font-family: var(--mono); font-size: .86rem !important; }
.slug-sm .slug-prefix { padding: 0 .45rem; }
.slug-sm input { height: 34px !important; min-width: 7rem; }
.link-field { position: relative; }
.link-field .icon { position: absolute; right: .75rem; top: 50%; translate: 0 -50%; color: var(--muted-2); pointer-events: none; }
.link-field input { padding-right: 2.2rem !important; }
.color-field { display: flex; gap: .5rem; align-items: center; }
.color-field input[type="color"] { width: 44px; height: 40px; flex: none; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer; }
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.color-field input[type="text"] { font-family: var(--mono); text-transform: lowercase; }
.toggle-row { display: inline-flex; align-items: center; gap: .65rem; cursor: pointer; user-select: none; }
.fld-toggle { align-self: center; padding: .25rem 0; }
.toggle-label { font-size: .9rem; font-weight: 550; color: var(--text-2); }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input[type="checkbox"] { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--muted-2); transition: background-color .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft-2); }
.switch input:disabled + span { opacity: .5; }
.switch-sm { width: 34px; height: 20px; }
.switch-sm span::after { width: 14px; height: 14px; }
.switch-sm input:checked + span::after { transform: translateX(14px); }
.pill-checks { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill-check { position: relative; cursor: pointer; }
.pill-check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill-check span { display: inline-flex; align-items: center; gap: .35rem; height: 32px; padding: 0 .75rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: .83rem; font-weight: 550; color: var(--text-2); transition: all .15s; }
.pill-check input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.pill-check input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-soft-2); }
.pill-toggle { position: relative; cursor: pointer; display: inline-flex; }
.pill-toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pill-toggle span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--line); color: var(--muted-2); background: var(--panel); transition: all .15s; }
.pill-toggle input:checked + span { background: var(--brand-soft); border-color: var(--brand-soft-2); color: var(--brand); }
.check-inline { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; cursor: pointer; }
.check-inline input { accent-color: var(--brand); width: 16px; height: 16px; }
.pw-field, .input-icon { position: relative; display: flex; align-items: center; gap: .4rem; }
.pw-field input { flex: 1; }
.pw-field .icon-btn { position: absolute; right: 4px; }
.pw-field .btn { flex: none; }
.pw-field:has(.btn) .icon-btn { right: calc(4px + 6.2rem); }
.input-icon > .icon { position: absolute; left: .8rem; color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 2.4rem !important; }
.input-icon .pw-toggle { position: absolute; right: 6px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); }
.input-icon .pw-toggle:hover { background: var(--panel-3); color: var(--text); }
.pw-meter { height: 4px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--danger); transition: width .25s, background-color .25s; }
.copy-field { display: flex; gap: .3rem; align-items: center; }
.copy-field input { height: 34px; font-family: var(--mono); font-size: .78rem; color: var(--muted); background: var(--panel-2); }
.form-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; align-items: center; }
.fields-grid > .form-actions { padding-top: .3rem; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; margin: 0 -1px; padding: .8rem 0; background: linear-gradient(transparent, var(--panel) 30%); }
.combo { position: relative; }
.combo-input { padding-right: 3.6rem !important; }
.combo-sm .combo-input { height: 36px; font-size: .86rem; min-width: 11rem; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); padding: 0 3rem 0 .75rem; outline: none; }
.combo-sm .combo-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.combo-icon { position: absolute; right: .7rem; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.combo-clear { position: absolute; right: 2rem; top: 50%; translate: 0 -50%; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--panel-3); color: var(--muted); }
.combo-clear:hover { color: var(--text); }
.combo-list { position: absolute; z-index: 80; left: 0; right: 0; top: calc(100% + 4px); min-width: 14rem; max-height: 16rem; overflow-y: auto; margin: 0; padding: .3rem; list-style: none; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg); overscroll-behavior: contain; }
.combo-list li { display: grid; gap: .05rem; padding: .5rem .65rem; border-radius: 8px; cursor: pointer; font-size: .88rem; color: var(--text-2); }
.combo-list li small { color: var(--muted); font-size: .76rem; }
.combo-list li:hover, .combo-list li[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); }
.combo-list li mark { background: none; color: var(--brand); font-weight: 750; }
.combo-list .combo-empty { cursor: default; text-align: center; color: var(--muted); }
.combo-list .combo-empty:hover { background: none; color: var(--muted); }
.combo-list .combo-loading { color: var(--muted); text-align: center; cursor: default; }

/* Champ média, galerie, icône */
.media-field { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; padding: .6rem; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel-2); transition: border-color .15s, background-color .15s; }
.media-field.is-over { border-color: var(--brand); background: var(--brand-soft); }
.mf-preview { width: 84px; height: 84px; flex: none; display: grid; place-items: center; border-radius: 10px; overflow: hidden; background: var(--panel-3) repeating-conic-gradient(var(--panel-3) 0 25%, var(--panel) 0 50%) 50% / 16px 16px; }
.mf-preview img { width: 100%; height: 100%; object-fit: contain; }
.mp-empty { display: grid; justify-items: center; gap: .2rem; color: var(--muted-2); }
.mp-empty small { font-size: .7rem; }
.file-chip { display: inline-flex; flex-direction: column; align-items: center; gap: .25rem; padding: .3rem; font-size: .68rem; text-align: center; word-break: break-all; color: var(--muted); }
.mf-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.mf-actions .btn { cursor: pointer; }
.media-gallery { display: grid; gap: .7rem; padding: .7rem; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel-2); }
.mg-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .55rem; }
.mg-items:empty { display: none; }
.mg-large .mg-items { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.mg-item { position: relative; border-radius: 10px; overflow: hidden; background: var(--panel-3); aspect-ratio: 1; cursor: grab; border: 1px solid var(--line); }
.mg-large .mg-item { aspect-ratio: auto; display: grid; grid-template-rows: 120px auto; }
.mg-item img { width: 100%; height: 100%; object-fit: cover; }
.mg-caption { width: 100%; border: 0; border-top: 1px solid var(--line); padding: .4rem .55rem; font-size: .78rem; background: var(--panel); outline: none; }
.mg-remove { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; opacity: 0; transition: opacity .15s; }
.mg-item:hover .mg-remove, .mg-item:focus-within .mg-remove { opacity: 1; }
@media (hover: none) { .mg-remove { opacity: 1; } }
.mg-item.is-dragging { opacity: .4; }
.mg-item.is-drop { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon-field { display: flex; align-items: center; gap: .5rem; }
.icon-preview { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--brand); }
.icon-preview:hover { border-color: var(--brand); }
.icon-name { flex: 1; min-width: 0; font-family: var(--mono); font-size: .84rem !important; }
.hours-editor { display: grid; gap: .35rem; }
.he-row { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; padding: .45rem .6rem; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); }
.he-row .toggle-row { min-width: 8.5rem; }
.he-day { font-weight: 600; font-size: .88rem; }
.he-times { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; color: var(--muted); font-size: .82rem; }
.he-times input { width: 7rem; height: 34px; padding: 0 .5rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.he-and { margin: 0 .2rem; }
.he-closed { color: var(--muted-2); font-size: .84rem; font-style: italic; }

/* Éditeur de texte riche */
.rte { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: border-color .15s, box-shadow .15s; }
.rte:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.rte-bar { position: sticky; top: var(--tb-h); z-index: 3; border-radius: 11px 11px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .15rem; padding: .35rem; background: var(--panel-2); border-bottom: 1px solid var(--line-2); }
.rte-bar button { min-width: 32px; height: 30px; padding: 0 .45rem; border: 0; border-radius: 7px; background: none; color: var(--text-2); font-weight: 700; font-size: .82rem; }
.rte-bar button:hover { background: var(--panel-3); color: var(--text); }
.rte-bar button.is-on { background: var(--brand-soft); color: var(--brand); }
.rte-sep { width: 1px; height: 20px; background: var(--line); margin: 0 .2rem; }
.rte-ai { margin-left: auto; display: inline-flex !important; align-items: center; gap: .3rem; color: var(--brand) !important; background: var(--brand-soft) !important; }
.rte-area { min-height: 11rem; max-height: 60vh; overflow-y: auto; padding: .9rem 1rem; outline: none; line-height: 1.65; font-size: .95rem; }
.rte-area:empty::before { content: "Saisissez votre texte…"; color: var(--muted-2); }
.rte-area h2 { font-size: 1.3rem; margin: 1rem 0 .5rem; } .rte-area h3 { font-size: 1.1rem; margin: .9rem 0 .4rem; }
.rte-area p { margin: 0 0 .7rem; } .rte-area ul, .rte-area ol { padding-left: 1.3rem; margin: 0 0 .7rem; }
.rte-area blockquote { margin: .8rem 0; padding: .5rem .9rem; border-left: 3px solid var(--brand); background: var(--panel-2); border-radius: 0 8px 8px 0; }
.rte-area a { text-decoration: underline; }
.rte-area img { border-radius: 8px; max-height: 20rem; }
.rte-src { width: 100%; min-height: 14rem; border: 0; padding: .9rem 1rem; background: var(--panel-2); outline: none; font-family: var(--mono); font-size: .8rem; resize: vertical; color: var(--text); }
.rte.is-html .rte-area { display: none; }
.rte.is-html .rte-src { display: block !important; }

/* Répéteur */
.repeater { display: grid; gap: .55rem; }
.rep-items { display: grid; gap: .55rem; }
.rep-item { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: clip; transition: box-shadow .2s, border-color .2s; }
.rep-item.is-open { box-shadow: var(--shadow-sm); border-color: color-mix(in srgb, var(--brand) 22%, var(--line)); }
.rep-item.is-dragging { opacity: .45; }
.rep-item.is-drop { outline: 2px solid var(--brand); outline-offset: 1px; }
.rep-head { display: flex; align-items: center; gap: .3rem; padding: .35rem .4rem .35rem .3rem; background: var(--panel-2); }
.rep-item.is-open .rep-head { border-bottom: 1px solid var(--line-2); }
.rep-grip { display: grid; place-items: center; width: 26px; height: 30px; color: var(--muted-2); cursor: grab; }
.rep-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; height: 32px; padding: 0 .3rem; border: 0; background: none; text-align: left; }
.rep-num { flex: none; font-size: .72rem; font-weight: 750; color: var(--muted); background: var(--panel-3); border-radius: 6px; padding: .1rem .4rem; }
.rep-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; font-weight: 600; color: var(--text-2); }
.rep-sum:empty::before { content: "Nouvel élément"; color: var(--muted-2); font-weight: 500; }
.rep-tools { display: flex; gap: .1rem; }
.rep-tools .icon-btn { width: 28px; height: 28px; }
.rep-body { padding: .9rem; }
.rep-item:not(.is-open) .rep-body { display: none; }
.rep-add { justify-self: start; border-style: dashed !important; }

/* Champ code */
.code-block { margin: 0; padding: .9rem 1rem; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line); font-family: var(--mono); font-size: .8rem; line-height: 1.6; white-space: pre-wrap; word-break: break-all; color: var(--text-2); max-height: 24rem; overflow: auto; }

/* ---------- 11. Cartes de choix, puces radio ---------- */
.choice-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); }
.choice-grid-sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr)); }
.choice-grid-6 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); }
.choice-grid-list { grid-template-columns: 1fr; }
.choice-card { position: relative; display: grid; gap: .25rem; align-content: start; padding: .9rem .95rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s, transform .15s var(--ease); }
.choice-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: translateY(-1px); }
.choice-card > input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card strong { font-size: .9rem; color: var(--text); }
.choice-card small { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.choice-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px var(--brand-soft); }
.choice-card:has(input:checked)::after { content: ""; position: absolute; top: .6rem; right: .6rem; width: 20px; height: 20px; border-radius: 50%; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat; }
.choice-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.cc-ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--panel-3); color: var(--brand); margin-bottom: .35rem; transition: background-color .15s, color .15s; }
.choice-card:has(input:checked) .cc-ico { background: var(--brand); color: #fff; }
.choice-row { grid-template-columns: 1fr; padding-right: 2.6rem; }

/* ---------- 12. États vides, listes clé-valeur, petites listes ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: .45rem; padding: 2.6rem 1.25rem; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: linear-gradient(135deg, var(--brand-soft), var(--brand-soft-2)); color: var(--brand); margin-bottom: .4rem; }
.empty-icon .icon { width: 28px; height: 28px; }
.empty h3 { font-size: 1.05rem; }
.empty p { margin: 0; color: var(--muted); max-width: 30rem; font-size: .9rem; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .6rem; }
.kv { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .55rem 1rem; margin: 0; font-size: .87rem; }
.kv dt { color: var(--muted); font-weight: 550; }
.kv dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.kv-wide { grid-template-columns: minmax(9rem, 30%) 1fr; padding: .9rem 0 0; margin-top: 1rem; border-top: 1px solid var(--line-2); }
.kv-wide dt, .kv-wide dd { padding-bottom: .55rem; border-bottom: 1px dashed var(--line-2); }
.kv-wide dt:nth-last-of-type(1), .kv-wide dd:last-child { border-bottom: 0; }
@media (max-width: 560px) { .kv, .kv-wide { grid-template-columns: 1fr; gap: .15rem; } .kv dd { margin-bottom: .5rem; } .kv-wide dt { border: 0; padding: 0; } }
.meta-list { display: grid; gap: .4rem; margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line-2); font-size: .83rem; }
.meta-list > div { display: flex; justify-content: space-between; gap: .75rem; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; font-weight: 600; color: var(--text-2); }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; }
.mini-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line-2); font-size: .86rem; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list li > span { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; }
.mini-list a { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: .65rem; width: 100%; color: var(--text-2); text-decoration: none !important; padding: .1rem .3rem; margin: 0 -.3rem; border-radius: 8px; }
.mini-list a:hover { background: var(--panel-2); color: var(--text); }
.mini-list a > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.tips li { display: grid; grid-template-columns: 26px 1fr; gap: .55rem; align-items: start; color: var(--text-2); font-size: .85rem; line-height: 1.5; }
.tips li > .icon { width: 26px; height: 26px; padding: 6px; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.steps-list { margin: 0 0 1rem; padding: 0; list-style: none; counter-reset: st; display: grid; gap: .55rem; }
.steps-list li { counter-increment: st; display: grid; grid-template-columns: 26px 1fr; gap: .6rem; font-size: .88rem; color: var(--text-2); }
.steps-list li::before { content: counter(st); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 750; font-size: .75rem; }
.layers-list { margin: 0; padding: 0; list-style: none; counter-reset: ly; display: grid; gap: .45rem; }
.layers-list li { counter-increment: ly; position: relative; padding: .55rem .7rem .55rem 2.6rem; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: .84rem; color: var(--text-2); }
.layers-list li::before { content: counter(ly); position: absolute; left: .6rem; top: 50%; translate: 0 -50%; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; background: var(--success-soft); color: var(--success); font-weight: 800; font-size: .72rem; }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .85rem; }
.log-list li { display: flex; gap: .5rem; align-items: flex-start; }
.uses { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .35rem; font-size: .84rem; }
.uses li { display: flex; gap: .45rem; align-items: center; padding: .45rem .6rem; border-radius: 8px; background: var(--panel-2); }
.side-list { display: grid; gap: .15rem; }
.side-list a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: .9rem; text-decoration: none !important; }
.side-list a:hover { background: var(--panel-3); color: var(--text); }
.side-list a.is-active { background: var(--brand-soft); color: var(--brand); }
.side-title { font-size: .78rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: .75rem; }
.side-danger { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line-2); }
.related-link { display: flex; align-items: center; gap: .4rem; margin: 1rem 0 0; font-size: .86rem; color: var(--muted); }
.quote-box { margin: 0 0 1rem; padding: .85rem 1rem; border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; background: var(--panel-2); font-style: italic; color: var(--text-2); }
.details { border: 1px solid var(--line); border-radius: 10px; padding: .55rem .8rem; background: var(--panel-2); }
.details summary { cursor: pointer; font-weight: 600; font-size: .86rem; color: var(--text-2); }
.details[open] summary { margin-bottom: .5rem; }
.secret { font-family: var(--mono); font-size: .8rem; padding: .15rem .45rem; border-radius: 6px; background: var(--panel-3); word-break: break-all; }
.stars { color: #f59e0b; letter-spacing: .05em; }
.col-center, td.col-center, th.col-center { text-align: center !important; }
.form-end { display: flex; justify-content: flex-end; }
.quick-links { display: flex; flex-wrap: wrap; gap: .45rem; }
.store-badges { display: flex; gap: .7rem; margin-top: .7rem; color: var(--muted); }
.store-badges .icon { width: 28px; height: 28px; }
.file-list { display: grid; gap: .45rem; }
.file-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); color: var(--text-2); text-decoration: none !important; transition: border-color .15s, background-color .15s; }
.file-item:hover { border-color: var(--brand); background: var(--brand-soft); }
.file-item > .icon:first-child { color: var(--brand); }
.file-item span { display: grid; min-width: 0; }
.file-item strong { font-size: .87rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item small { color: var(--muted); font-size: .76rem; }
.contact-strip { display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 1rem; }
.contact-strip > div:not(.contact-actions) { flex: 1; min-width: 10rem; }
.contact-strip strong { font-size: 1rem; }
.contact-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .2rem; }
.card-body > .contact-actions { margin-top: .9rem; }
.md-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line-2); }
.timeline-mini { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.timeline-mini li { position: relative; display: flex; align-items: center; gap: .7rem; padding: .45rem 0 .45rem .2rem; font-size: .85rem; color: var(--text-2); }
.timeline-mini li span { position: relative; z-index: 1; width: 11px; height: 11px; flex: none; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.timeline-mini li:not(:last-child)::before { content: ""; position: absolute; left: calc(.2rem + 5px); top: 1.2rem; bottom: -.5rem; width: 1.5px; background: var(--line); }
.timeline-mini li.ok span { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.timeline-mini li.ko span { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.order-flow { display: flex; list-style: none; margin: 0 0 1.25rem; padding: 1rem 1.1rem; gap: 0; overflow-x: auto; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.order-flow li { position: relative; flex: 1 0 7rem; display: grid; justify-items: center; gap: .45rem; text-align: center; }
.order-flow li:not(:last-child)::after { content: ""; position: absolute; top: 15px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 2px; border-radius: 2px; background: var(--line); }
.order-flow li.is-done:not(:last-child)::after { background: var(--success); }
.of-dot { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); color: var(--muted); font-weight: 750; font-size: .8rem; }
.is-done .of-dot { background: var(--success); border-color: var(--success); color: #fff; }
.is-current .of-dot { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 0 0 5px var(--brand-soft); }
.of-label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.is-current .of-label, .is-done .of-label { color: var(--text); }

/* ---------- 13. Fenêtres (modale, tiroir, palette de commandes, notifications) ---------- */
.modal, .cmdk, .drawer { position: fixed; inset: 0; z-index: 200; }
.modal { display: grid; place-items: center; padding: 1rem; }
.modal-backdrop, .cmdk-backdrop, .drawer-backdrop { position: absolute; inset: 0; background: rgba(9, 12, 20, .5); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s ease; }
.modal-dialog { position: relative; width: min(36rem, 100%); max-height: calc(100dvh - 2rem); display: flex; flex-direction: column; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); animation: pop .26s var(--ease); overflow: hidden; }
.modal-dialog.is-wide { width: min(58rem, 100%); }
.modal-dialog.is-sm { width: min(26rem, 100%); }
.modal-dialog.is-full { width: min(80rem, 100%); height: calc(100dvh - 2rem); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.1rem .9rem 1.3rem; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 1.05rem; font-weight: 700; }
.modal-body { padding: 1.2rem 1.3rem; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.modal-body > form > .sub-title:first-of-type, .modal-body > .sub-title:first-child { margin-top: 0; }
.modal-body .pill-checks + .sub-title { margin-top: 1.2rem; }
.modal-body > form > .form-actions { margin-top: 1.2rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.3rem; border-top: 1px solid var(--line-2); background: var(--panel-2); }
.modal-foot:empty { display: none; }
.modal-dialog.is-full .modal-body { padding: 0; }
.modal-dialog.is-full iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.confirm-body { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.confirm-ico { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--danger-soft); color: var(--danger); }
.confirm-ico.is-info { background: var(--brand-soft); color: var(--brand); }
.confirm-body p { margin: .35rem 0 0; color: var(--text-2); line-height: 1.55; }
.confirm-body .fld { margin-top: .8rem; }
body.has-overlay { overflow: hidden; }
@media (max-width: 640px) {
  .modal { place-items: end center; padding: 0; }
  .modal-dialog, .modal-dialog.is-wide, .modal-dialog.is-sm { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; animation: sheet .3s var(--ease); }
  @keyframes sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
}
.drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(40rem, 100vw); display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .35); animation: slidein .3s var(--ease); }
@keyframes slidein { from { transform: translateX(30px); opacity: .3; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem .9rem 1.2rem; border-bottom: 1px solid var(--line-2); }
.drawer-head h2 { flex: 1; min-width: 0; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); flex: none; }
.drawer-icon:empty { display: none; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.drawer-body .block-form { display: flex; flex-direction: column; min-height: 100%; }
.drawer-body .block-form > .tabs-bar { position: sticky; top: 0; z-index: 4; background: var(--panel); padding: 0 1.2rem; margin: 0; }
.drawer-body .block-form > .tab-panel { padding: 1.2rem; flex: 1; }
.drawer-body .rte-bar { top: 42px; }
.drawer-loading { display: grid; place-items: center; gap: .8rem; padding: 4rem 1rem; color: var(--muted); }
.drawer-loading .btn-spinner { display: block; width: 26px; height: 26px; border-width: 3px; color: var(--brand); }
.drawer-actions { position: sticky; bottom: 0; z-index: 4; display: flex; gap: .5rem; padding: .85rem 1.2rem; border-top: 1px solid var(--line-2); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); }
.cmdk { display: flex; justify-content: center; align-items: flex-start; padding: min(12vh, 7rem) 1rem 1rem; }
.cmdk-box { position: relative; width: min(40rem, 100%); max-height: min(70vh, 34rem); display: flex; flex-direction: column; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); overflow: hidden; animation: pop .22s var(--ease); }
.cmdk-input { display: flex; align-items: center; gap: .7rem; padding: 0 1rem; border-bottom: 1px solid var(--line-2); color: var(--muted); }
.cmdk-input input { flex: 1; height: 56px; border: 0; outline: none; background: none; font-size: 1rem; color: var(--text); }
.cmdk-input input::-webkit-search-cancel-button { display: none; }
.cmdk-results { overflow-y: auto; padding: .4rem; overscroll-behavior: contain; }
.cmdk-group { padding: .55rem .7rem .3rem; font-size: .7rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-2); }
.cmdk-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .75rem; padding: .6rem .7rem; border-radius: 10px; color: var(--text-2); text-decoration: none !important; }
.cmdk-item .ci-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--panel-3); color: var(--muted); }
.cmdk-item span:nth-child(2) { display: grid; min-width: 0; }
.cmdk-item strong { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cmdk-item small { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item .ci-go { opacity: 0; color: var(--brand); }
.cmdk-item.is-active { background: var(--brand-soft); }
.cmdk-item.is-active .ci-ico { background: var(--brand); color: #fff; }
.cmdk-item.is-active .ci-go { opacity: 1; }
.cmdk-empty { padding: 2.2rem 1rem; text-align: center; color: var(--muted); font-size: .9rem; }
.cmdk-foot { display: flex; gap: 1rem; padding: .55rem 1rem; border-top: 1px solid var(--line-2); background: var(--panel-2); font-size: .74rem; color: var(--muted); }
.cmdk-foot kbd { margin-right: .25rem; }

/* Toasts */
.toasts { position: fixed; z-index: 300; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; width: min(24rem, calc(100vw - 2rem)); pointer-events: none; }
.toast { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: start; padding: .8rem .8rem .85rem .9rem; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-lg); pointer-events: auto; overflow: hidden; animation: toast-in .35s var(--ease); }
.toast.is-out { animation: toast-out .3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }
.toast-ico { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--success-soft); color: var(--success); }
.toast-error .toast-ico { background: var(--danger-soft); color: var(--danger); }
.toast-warning .toast-ico { background: var(--warning-soft); color: var(--warning); }
.toast-info .toast-ico { background: var(--info-soft); color: var(--info); }
.toast-msg { font-size: .87rem; line-height: 1.45; color: var(--text); padding-top: .3rem; overflow-wrap: anywhere; }
.toast-close { width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 7px; background: none; color: var(--muted); }
.toast-close:hover { background: var(--panel-3); color: var(--text); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--success); transform-origin: left; animation: toastbar linear forwards; }
.toast-error .toast-bar { background: var(--danger); } .toast-warning .toast-bar { background: var(--warning); } .toast-info .toast-bar { background: var(--info); }
.toast:hover .toast-bar { animation-play-state: paused; }
@keyframes toastbar { to { transform: scaleX(0); } }
@media (max-width: 640px) { .toasts { left: .75rem; right: .75rem; bottom: .75rem; width: auto; } }
.dd { position: relative; display: inline-block; }
.dd-right { right: 0; left: auto; }

/* Fenêtre « Médiathèque » et sélecteur d'icônes */
.picker { display: grid; gap: .8rem; }
.picker-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.picker-tools .search-input { flex: 1 1 14rem; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .55rem; max-height: 56vh; overflow-y: auto; padding: 2px; }
.picker-item { position: relative; display: grid; grid-template-rows: 1fr auto; aspect-ratio: 1; border: 2px solid transparent; border-radius: 11px; background: var(--panel-3); overflow: hidden; cursor: pointer; padding: 0; text-align: left; }
.picker-item img { width: 100%; height: 100%; object-fit: cover; grid-row: 1 / -1; grid-column: 1; }
.picker-item .pi-file { grid-row: 1 / -1; grid-column: 1; display: grid; place-items: center; color: var(--muted); }
.picker-item small { grid-row: 2; grid-column: 1; z-index: 1; padding: .25rem .4rem; font-size: .68rem; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-item:hover { border-color: color-mix(in srgb, var(--brand) 50%, transparent); }
.picker-item.is-picked { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.picker-item.is-picked::after { content: ""; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.picker-more { justify-self: center; }
.picker-empty { grid-column: 1 / -1; padding: 2rem; text-align: center; color: var(--muted); }
.icon-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: .4rem; max-height: 56vh; overflow-y: auto; padding: 2px; }
.icon-picker-grid button { display: grid; justify-items: center; gap: .3rem; padding: .7rem .3rem; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); color: var(--text-2); font-size: .66rem; }
.icon-picker-grid button .icon { width: 22px; height: 22px; }
.icon-picker-grid button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-picker-grid button:hover, .icon-picker-grid button.is-picked { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.export-cols { display: flex; flex-wrap: wrap; gap: .35rem; }
.export-formats { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .5rem; }
.export-formats .choice-card { justify-items: center; text-align: center; padding: .8rem .5rem; }
.export-formats .cc-ico { margin: 0 0 .2rem; }

/* ---------- 14. Constructeurs (pages, formulaires, emails, thèmes) ---------- */
body.builder-page .content { padding-bottom: 1rem; }
.builder { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 1100px) {
  .builder { grid-template-columns: minmax(22rem, 27rem) minmax(0, 1fr); }
  .builder:has(.builder-side-wide) { grid-template-columns: minmax(24rem, 34rem) minmax(0, 1fr); }
  .builder-preview { position: sticky; top: calc(var(--tb-h) + 1rem); }
}
.builder-side { min-width: 0; padding: 1rem; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.builder-side > form.tab-panel, .builder-side > .tab-panel { display: grid; gap: 1rem; align-content: start; }
.builder-side > .tab-panel[hidden] { display: none; }
.builder-side .fields-grid { gap: .85rem; }
.builder-save { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; margin: 1rem -1rem -1rem; padding: .85rem 1rem; border-top: 1px solid var(--line-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); }
.builder-preview { min-width: 0; display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-xs); overflow: hidden; }
.bp-bar { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; border-bottom: 1px solid var(--line-2); background: var(--panel-2); flex-wrap: wrap; }
.bp-url { flex: 1; min-width: 8rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 32px; padding: 0 .8rem; border-radius: 9px; background: var(--panel); border: 1px solid var(--line-2); color: var(--muted); font-size: .8rem; font-family: var(--mono); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bp-url .icon { color: var(--success); flex: none; }
.bp-stage { position: relative; display: flex; justify-content: center; height: calc(100dvh - var(--tb-h) - 9.5rem); min-height: 26rem; padding: 1rem; background: var(--panel-3) radial-gradient(var(--line) 1px, transparent 1px) 0 0 / 18px 18px; overflow: auto; }
.bp-frame-wrap { position: relative; width: 100%; height: 100%; flex: none; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 10px 40px -12px rgba(0, 0, 0, .3); transition: width .45s var(--ease), height .45s var(--ease), border-radius .45s; transform-origin: top center; }
.bp-frame-wrap[data-device="tablet"] { width: 820px; max-width: 100%; }
.bp-frame-wrap[data-device="mobile"] { width: 390px; max-width: 100%; border-radius: 28px; outline: 8px solid #111827; outline-offset: -1px; height: min(100%, 844px); margin-top: 6px; }
.bp-frame-wrap[data-device="tv"] { width: 1920px; height: 1080px; }
.bp-frame { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.bp-frame-wrap.is-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%) 0 0 / 220% 100%; animation: shimmer 1.1s linear infinite; pointer-events: none; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (max-width: 1099px) { .bp-stage { height: 70vh; } }
.bk-list { display: grid; gap: .45rem; }
.bk-card { position: relative; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: .45rem; padding: .45rem .5rem .45rem .3rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: border-color .15s, box-shadow .15s, opacity .2s, transform .2s var(--ease); }
.bk-card:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: var(--shadow-sm); }
.bk-card.is-off { background: var(--panel-2); }
.bk-card.is-off .bk-icon, .bk-card.is-off .bk-main strong { opacity: .55; }
.bk-card.is-current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.bk-card.is-dragging { opacity: .45; }
.bk-card.drop-before::before, .bk-card.drop-after::after { content: ""; position: absolute; left: 6px; right: 6px; height: 3px; border-radius: 3px; background: var(--brand); }
.bk-card.drop-before::before { top: -5px; } .bk-card.drop-after::after { bottom: -5px; }
.bk-card.is-new { animation: bk-new 1.2s var(--ease); }
@keyframes bk-new { 0% { opacity: 0; transform: translateY(-8px) scale(.98); } 30% { opacity: 1; transform: none; box-shadow: 0 0 0 4px var(--brand-soft-2); } 100% { box-shadow: none; } }
.bk-grip { display: grid; place-items: center; width: 22px; height: 34px; color: var(--muted-2); cursor: grab; border-radius: 6px; }
.bk-grip:hover { color: var(--text); background: var(--panel-3); }
.bk-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--brand-soft); color: var(--brand); }
.bk-main { display: grid; gap: .1rem; min-width: 0; padding: .2rem .25rem; border: 0; background: none; text-align: left; border-radius: 8px; }
.bk-main strong { font-size: .88rem; color: var(--text); }
.bk-main small { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-badges { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .2rem; }
.bk-badges:empty { display: none; }
.bk-badges .badge { height: 19px; font-size: .67rem; padding: 0 .45rem; }
.bk-tools { display: flex; gap: .05rem; }
.bk-tools .icon-btn { width: 30px; height: 30px; }
@media (hover: hover) and (min-width: 1100px) { .bk-tools { opacity: 0; transition: opacity .15s; } .bk-card:hover .bk-tools, .bk-card:focus-within .bk-tools { opacity: 1; } }
.bk-insert { position: relative; height: 10px; margin: -6px 0; display: grid; place-items: center; z-index: 2; }
.bk-insert button { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--brand); background: var(--panel); color: var(--brand); opacity: 0; transform: scale(.7); transition: all .15s; }
.bk-insert:hover button, .bk-insert button:focus-visible { opacity: 1; transform: none; }
.bk-insert::before { content: ""; position: absolute; left: 30px; right: 30px; top: 50%; height: 1px; background: var(--brand); opacity: 0; transition: opacity .15s; }
.bk-insert:hover::before { opacity: .5; }
.bk-empty { display: grid; justify-items: center; gap: .5rem; padding: 2rem 1rem; margin-bottom: .6rem; border: 1.5px dashed var(--line); border-radius: 12px; color: var(--muted); text-align: center; font-size: .88rem; }
.bk-empty .icon { width: 30px; height: 30px; color: var(--brand); }
.bk-empty p { margin: 0; }
.bk-add { margin-top: .8rem; }
.rev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.rev-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .7rem; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); }
.rev-list li > div { display: grid; min-width: 0; }
.rev-list strong { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rev-list small { font-size: .75rem; color: var(--muted); }
.seo-preview { display: grid; gap: .2rem; padding: .9rem 1rem; border-radius: 12px; background: #fff; border: 1px solid #e5e7eb; font-family: Arial, sans-serif; }
.sp-url { color: #202124; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-title { color: #1a0dab; font-size: 1.1rem; font-weight: 400; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-desc { color: #4d5156; font-size: .82rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html[data-theme="dark"] .seo-preview { background: #202124; border-color: #3c4043; }
html[data-theme="dark"] .sp-url { color: #dadce0; } html[data-theme="dark"] .sp-title { color: #8ab4f8; } html[data-theme="dark"] .sp-desc { color: #bdc1c6; }
.lib { display: grid; gap: 1rem; }
.lib-search { position: sticky; top: -1.2rem; z-index: 2; display: flex; align-items: center; gap: .6rem; margin: -1.2rem -1.3rem 0; padding: .9rem 1.3rem; background: var(--panel); border-bottom: 1px solid var(--line-2); color: var(--muted); }
.lib-search input { flex: 1; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 .8rem; background: var(--panel-2); outline: none; }
.lib-search input:focus { border-color: var(--brand); background: var(--panel); box-shadow: 0 0 0 3px var(--brand-soft); }
.lib-cat { font-size: .74rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: .2rem 0 -.3rem; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.5rem), 1fr)); gap: .55rem; }
.lib-item { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: .1rem .7rem; align-items: center; padding: .75rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: left; transition: all .15s var(--ease); }
.lib-item:hover, .lib-item:focus-visible { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.lib-ico { grid-row: 1 / span 2; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--panel-3); color: var(--brand); transition: background-color .15s, color .15s; }
.lib-item:hover .lib-ico { background: var(--brand); color: #fff; }
.lib-item strong { font-size: .88rem; color: var(--text); }
.lib-item small { font-size: .75rem; color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-item.is-busy { opacity: .6; pointer-events: none; }
.lib-none { text-align: center; color: var(--muted); padding: 1.5rem; }

/* Éditeur de thème : aperçu vivant */
.theme-live { min-height: 100%; width: 100%; max-width: 64rem; align-self: flex-start; border-radius: 14px; overflow: hidden; background: var(--m-bg); color: var(--m-text); font-family: var(--m-font-b), system-ui, sans-serif; box-shadow: 0 10px 40px -12px rgba(0, 0, 0, .3); transition: background-color .25s, color .25s; }
.tl-nav { display: flex; align-items: center; gap: 1.2rem; padding: .9rem 1.4rem; background: var(--m-surface); border-bottom: 1px solid var(--m-border); font-size: .82rem; color: var(--m-muted); flex-wrap: wrap; }
.tl-logo { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--m-primary); color: var(--m-on-primary); font-weight: 800; font-family: var(--m-font-h), serif; margin-right: auto; }
.tl-btn { display: inline-flex; align-items: center; justify-content: center; height: 2.6em; padding: 0 1.3em; border-radius: var(--m-btn-radius); background: var(--m-primary); color: var(--m-on-primary); font-weight: 650; font-size: .85rem; border: 1.5px solid var(--m-primary); }
.tl-btn-sm { height: 2.3em; font-size: .78rem; }
.tl-btn-ghost { background: transparent; color: var(--m-text); border-color: var(--m-border); }
.tl-btn-accent { background: var(--m-accent); border-color: var(--m-accent); color: #fff; }
.tl-hero { padding: 3rem 1.6rem 2.6rem; text-align: center; background: linear-gradient(180deg, var(--m-surface-2), var(--m-bg)); }
.tl-hero.has-gradient { background: radial-gradient(60% 80% at 15% 0%, color-mix(in srgb, var(--m-primary) 22%, transparent), transparent), radial-gradient(50% 70% at 90% 20%, color-mix(in srgb, var(--m-accent) 20%, transparent), transparent), var(--m-bg); }
.tl-hero.has-gradient .tl-btn:not(.tl-btn-ghost) { background: linear-gradient(135deg, var(--m-primary), var(--m-secondary)); border-color: transparent; }
.tl-eyebrow { display: inline-block; font-family: var(--m-font-s), cursive; color: var(--m-accent); font-size: 1.25rem; margin-bottom: .4rem; }
.tl-hero h2 { font-family: var(--m-font-h), serif; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.15; color: var(--m-text); margin: 0 0 .7rem; }
.tl-hero h2 em { font-style: italic; color: var(--m-primary); }
.tl-hero p { color: var(--m-muted); margin: 0 auto 1.3rem; max-width: 30rem; font-size: .92rem; }
.tl-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; }
.tl-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; padding: 1.6rem; }
.tl-card { display: grid; gap: .35rem; padding: 1.2rem; border-radius: var(--m-radius); background: var(--m-surface); border: 1px solid var(--m-border); box-shadow: 0 6px 20px -10px rgba(0, 0, 0, .25); }
.tl-card strong { font-family: var(--m-font-h), serif; font-size: 1.02rem; color: var(--m-text); }
.tl-card small { color: var(--m-muted); font-size: .8rem; }
.tl-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: calc(var(--m-radius) * .6); background: color-mix(in srgb, var(--m-primary) 14%, transparent); color: var(--m-primary); margin-bottom: .3rem; }
.tl-link { color: var(--m-primary); font-size: .8rem; font-weight: 650; margin-top: .2rem; }
.tl-band { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin: 0 1.6rem 1.6rem; padding: 1.2rem 1.4rem; border-radius: var(--m-radius); background: var(--m-primary); color: var(--m-on-primary); }
.tl-band strong { font-family: var(--m-font-h), serif; font-size: 1.15rem; }
.font-sample { display: grid; gap: .35rem; padding: 1.1rem 1.2rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); }
.fs-h { font-size: 1.7rem; font-weight: 700; line-height: 1.15; color: var(--text); }
.fs-s { font-size: 1.35rem; color: var(--brand); }
.fs-b { font-size: .95rem; color: var(--text-2); line-height: 1.6; }
.builder-form .tab-panel .alert { margin: 0; }
.form-preview { min-height: 100vh; }

/* Thèmes (liste + installation) */
.theme-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr)); }
.card + .theme-grid, .inline-settings + .theme-grid { margin-top: 1.25rem; }
article.theme-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-xs); overflow: hidden; transition: box-shadow .2s, transform .2s var(--ease), border-color .2s; }
article.theme-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
article.theme-card.is-active { border-color: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
article.theme-card .tc-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 0; height: 150px; border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0; overflow: hidden; }
.tc-mock { position: relative; display: grid; align-content: start; gap: .45rem; padding: .8rem; background: var(--m-bg); overflow: hidden; }
.tcm-nav { display: flex; align-items: center; gap: .3rem; padding: .35rem .45rem; border-radius: 6px; background: var(--m-surface); border: 1px solid var(--m-border); }
.tcm-nav i { width: 14px; height: 4px; border-radius: 3px; background: var(--m-muted); opacity: .45; }
.tcm-nav b { margin-left: auto; width: 20px; height: 8px; border-radius: var(--m-btn); background: var(--m-primary); }
.tcm-title { font-size: 1.5rem; font-weight: 700; line-height: 1; color: var(--m-text); margin-top: .2rem; }
.tcm-line { height: 5px; width: 85%; border-radius: 3px; background: var(--m-muted); opacity: .35; }
.tcm-line.short { width: 55%; }
.tcm-cards { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.tcm-cards i { height: 22px; border-radius: var(--m-radius); background: var(--m-surface); border: 1px solid var(--m-border); }
.tcm-btn { width: 52%; height: 14px; border-radius: var(--m-btn); background: linear-gradient(90deg, var(--m-primary), var(--m-accent)); }
.tc-body { display: grid; gap: .45rem; padding: .95rem 1rem .6rem; flex: 1; align-content: start; }
.tc-body p { margin: 0; }
.tc-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.tc-head h3 { font-size: 1rem; }
.tc-swatches { display: flex; align-items: center; gap: .3rem; }
.tc-swatches span { width: 22px; height: 22px; border-radius: 7px; border: 1px solid rgba(0, 0, 0, .08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.tc-sep { width: 1px !important; height: 18px !important; border: 0 !important; background: var(--line); margin: 0 .2rem; box-shadow: none !important; }
.tc-fonts { display: flex; align-items: center; gap: .35rem; margin: 0; }
.tc-actions { display: flex; flex-wrap: wrap; gap: .35rem; padding: .7rem 1rem .9rem; border-top: 1px solid var(--line-2); }
.tc-actions > .tb-dd { margin-left: auto; }
.tc-actions form { margin: 0; }
label.theme-card { position: relative; display: grid; gap: .25rem; padding: .55rem .55rem .75rem; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); cursor: pointer; transition: all .15s var(--ease); }
label.theme-card:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); transform: translateY(-1px); }
label.theme-card > input { position: absolute; opacity: 0; pointer-events: none; }
label.theme-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
label.theme-card:has(input:checked)::after { content: ""; position: absolute; top: .9rem; right: .9rem; width: 22px; height: 22px; border-radius: 50%; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat; box-shadow: 0 0 0 2px #fff; }
label.theme-card strong { font-size: .9rem; padding: .3rem .25rem 0; }
label.theme-card small { font-size: .76rem; color: var(--muted); padding: 0 .25rem; line-height: 1.4; }
label.theme-card .tc-preview { display: grid; grid-template-columns: 1.4fr 1fr; height: 82px; border-radius: 10px; overflow: hidden; }
.tc-l { display: grid; align-content: center; gap: 6px; padding: 10px 12px; background: var(--b); }
.tc-l i { display: block; height: 7px; border-radius: 4px; background: var(--t); opacity: .7; }
.tc-l i:nth-child(1) { width: 70%; height: 10px; opacity: 1; }
.tc-l i:nth-child(2) { width: 90%; opacity: .25; }
.tc-l i:nth-child(3) { width: 45%; height: 14px; border-radius: 99px; background: linear-gradient(90deg, var(--p), var(--a)); opacity: 1; }
.tc-d { display: grid; align-content: center; gap: 6px; padding: 10px 12px; background: var(--d); }
.tc-d i { display: block; height: 7px; border-radius: 4px; background: #fff; opacity: .2; }
.tc-d i:nth-child(2) { width: 60%; height: 14px; border-radius: 99px; background: var(--dp); opacity: 1; }
.inline-settings { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 1rem; }
.inline-settings > .fields-grid { flex: 1 1 28rem; }
.inline-settings > p { flex-basis: 100%; margin: 0; }

/* Constructeur de formulaires */
.card-form { max-width: 44rem; margin: 0 auto; padding: 1.5rem; border-radius: 16px; background: var(--c-surface, #fff); box-shadow: 0 10px 40px -15px rgba(0, 0, 0, .2); }
.form-card, .loc-card { display: flex; flex-direction: column; gap: .7rem; padding: 1.1rem; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-xs); transition: box-shadow .2s, transform .2s var(--ease); }
.form-card:hover, .loc-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.form-card.is-off, .loc-card.is-off { opacity: .75; }
.form-card > header { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: .75rem; }
.form-card h3 { font-size: 1rem; }
.form-card h3 a { color: var(--text); text-decoration: none; }
.form-card h3 a:hover { color: var(--brand); }
.form-card p { margin: 0; }
.fc-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.fc-meta { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; font-size: .82rem; color: var(--text-2); }
.fc-meta li { display: flex; align-items: center; gap: .45rem; min-width: 0; }
.fc-meta li .icon { color: var(--muted-2); flex: none; }
.form-card > footer, .loc-card > footer { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--line-2); }
.loc-card { padding: 0; overflow: hidden; gap: 0; }
.loc-map { height: 160px; background: var(--panel-3); }
.loc-map iframe { width: 100%; height: 100%; border: 0; display: block; filter: saturate(.9); }
html[data-theme="dark"] .loc-map iframe { filter: invert(.9) hue-rotate(180deg) saturate(.6); }
.loc-map-empty { display: grid; place-items: center; align-content: center; gap: .3rem; color: var(--muted-2); font-size: .8rem; }
.loc-map-empty .icon { width: 30px; height: 30px; }
.loc-body { padding: 1rem 1.1rem .4rem; display: grid; gap: .45rem; }
.loc-body h3 { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: 1rem; }
.loc-body p { margin: 0; }
.loc-card > footer { padding: .75rem 1.1rem 1rem; margin: 0; }

/* Réseaux sociaux */
.social-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.social-list li { display: grid; grid-template-columns: auto auto 1fr auto auto auto; align-items: center; gap: .6rem; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.social-list li.is-off { background: var(--panel-2); opacity: .75; }
.social-list li.is-dragging { opacity: .4; }
.social-list li.is-drop { outline: 2px solid var(--brand); outline-offset: 1px; }
.social-list form { margin: 0; }
@media (max-width: 560px) { .social-list li { grid-template-columns: auto 1fr auto auto; } .social-list .mn-grip { display: none; } .sl-toggles { grid-column: 1 / -1; } }
.sl-toggles { display: flex; gap: .25rem; }
.net-ico { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: #64748b; flex: none; }
.net-whatsapp { background: #25d366; } .net-facebook { background: #1877f2; } .net-messenger { background: linear-gradient(135deg, #0099ff, #a033ff 60%, #ff5280); }
.net-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); } .net-telegram { background: #229ed9; }
.net-linkedin { background: #0a66c2; } .net-tiktok { background: #111; } .net-youtube { background: #ff0000; } .net-x { background: #000; }
.net-snapchat { background: #fffc00; color: #111; } .net-pinterest { background: #e60023; } .net-threads { background: #000; } .net-viber { background: #7360f2; }
.net-discord { background: #5865f2; } .net-tripadvisor { background: #34e0a1; color: #000; } .net-google { background: #fff; color: #4285f4; border: 1px solid var(--line); }
.net-website { background: var(--brand); } .net-email { background: #ea4335; } .net-phone { background: #16a34a; } .net-custom { background: #64748b; }
html[data-theme="dark"] .net-x, html[data-theme="dark"] .net-threads, html[data-theme="dark"] .net-tiktok { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.net-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.6rem, 1fr)); gap: .4rem; }
.net-choice { position: relative; display: grid; justify-items: center; gap: .3rem; padding: .55rem .25rem .45rem; border: 1.5px solid var(--line-2); border-radius: 11px; cursor: pointer; text-align: center; transition: all .15s; }
.net-choice input { position: absolute; opacity: 0; pointer-events: none; }
.net-choice small { font-size: .66rem; color: var(--muted); line-height: 1.2; }
.net-choice .net-ico { width: 32px; height: 32px; border-radius: 9px; }
.net-choice:hover { border-color: var(--line); background: var(--panel-2); }
.net-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.net-choice:has(input:checked) small { color: var(--brand); font-weight: 650; }
.net-choice:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Menus */
.mn-tree, .mn-children { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.mn-children { margin: .4rem 0 0 2rem; padding-left: .8rem; border-left: 2px dashed var(--line); }
.mn-children:empty { display: none; }
.mn-tree.is-dragging .mn-children:empty { display: grid; min-height: 10px; margin-top: .2rem; }
.mn-item.is-dragging > .mn-row { opacity: .4; }
.mn-row { display: flex; align-items: center; gap: .55rem; padding: .5rem .55rem .5rem .35rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); transition: border-color .15s, box-shadow .15s; }
.mn-row:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); box-shadow: var(--shadow-xs); }
.mn-item.is-off > .mn-row { background: var(--panel-2); }
.mn-item.is-off > .mn-row .mn-text { opacity: .65; }
.mn-item.drop-before > .mn-row { box-shadow: 0 -3px 0 var(--brand); }
.mn-item.drop-after > .mn-row { box-shadow: 0 3px 0 var(--brand); }
.mn-item.drop-inside > .mn-row { border-color: var(--brand); background: var(--brand-soft); }
.mn-grip { display: grid; place-items: center; width: 24px; height: 32px; color: var(--muted-2); cursor: grab; border-radius: 6px; flex: none; }
.mn-grip:hover { background: var(--panel-3); color: var(--text); }
.mn-ico { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--panel-3); color: var(--muted); flex: none; }
.mn-text { flex: 1; min-width: 0; display: grid; gap: .05rem; }
.mn-text strong { font-size: .9rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mn-text small { font-size: .76rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mn-text small a { color: inherit; }
.mn-badges { display: flex; align-items: center; gap: .3rem; }
.mn-tools { display: flex; align-items: center; gap: .05rem; }
.mn-tools .icon-btn { width: 30px; height: 30px; }
.mn-tree > .mn-item:first-child > .mn-row [data-mn-indent], .mn-tree > .mn-item > .mn-row [data-mn-outdent] { opacity: .3; pointer-events: none; }
.mn-children .mn-children { display: none; }
@media (max-width: 560px) { .mn-badges { display: none; } .mn-children { margin-left: 1rem; } }

/* Médiathèque */
.media-layout { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 900px) { .media-layout { grid-template-columns: 15rem minmax(0, 1fr); } }
@media (min-width: 1280px) { .media-layout.has-detail { grid-template-columns: 15rem minmax(0, 1fr) 21rem; } }
@media (min-width: 900px) and (max-width: 1279px) { .media-layout.has-detail .media-detail { grid-column: 1 / -1; } }
.media-folders .card-body { display: grid; gap: .1rem; padding: .6rem; }
.mf-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border-radius: 9px; color: var(--text-2); font-size: .87rem; font-weight: 550; text-decoration: none !important; }
.mf-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-link em { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--panel-3); border-radius: 999px; padding: .05rem .45rem; }
.mf-link:hover { background: var(--panel-3); color: var(--text); }
.mf-link.is-active { background: var(--brand-soft); color: var(--brand); }
.mf-link.is-active em { background: var(--brand); color: #fff; }
.mf-row { display: flex; align-items: center; gap: .1rem; }
.mf-row .tb-dd { opacity: 0; transition: opacity .15s; }
.mf-row:hover .tb-dd, .mf-row .tb-dd.is-open { opacity: 1; }
@media (hover: none) { .mf-row .tb-dd { opacity: 1; } }
.mf-row .dd-panel { right: 0; }
@media (max-width: 899px) { .media-folders .card-body { display: flex; overflow-x: auto; gap: .3rem; } .mf-link, .mf-row { flex: none; } .mf-row .tb-dd { display: none; } }
.media-main { min-width: 0; display: grid; gap: 1rem; }
.media-toolbar { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.search-input { position: relative; flex: 1 1 14rem; max-width: 26rem; }
.search-input .icon { position: absolute; left: .75rem; top: 50%; translate: 0 -50%; color: var(--muted); pointer-events: none; }
.search-input input { width: 100%; height: 38px; padding: 0 .8rem 0 2.3rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); outline: none; transition: border-color .15s, box-shadow .15s; }
.search-input input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.dropzone { position: relative; display: flex; align-items: center; gap: .9rem; padding: 1rem 1.2rem; border: 2px dashed var(--line); border-radius: 14px; background: var(--panel); color: var(--muted); font-size: .88rem; transition: border-color .15s, background-color .15s, transform .15s; }
.dropzone > .icon { width: 30px; height: 30px; color: var(--brand); flex: none; }
.dropzone p { margin: 0; }
.dropzone strong { color: var(--text); }
.dropzone.is-over { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.005); }
.dropzone-lg { flex-direction: column; text-align: center; padding: 2rem 1.5rem; margin-bottom: 1.25rem; }
.dropzone-lg > .icon { width: 42px; height: 42px; }
.dropzone-file { flex-direction: column; text-align: center; padding: 1.4rem; }
.dropzone-file input[type="file"] { max-width: 100%; }
.dz-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 0 0 12px 12px; overflow: hidden; background: var(--panel-3); }
.dropzone-lg .dz-progress { position: relative; height: auto; width: min(26rem, 100%); background: none; display: grid; gap: .35rem; }
.dz-progress span { display: block; height: 4px; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .25s; }
.dropzone-lg .dz-progress span { height: 6px; background-color: var(--panel-3); }
.dz-progress em { font-style: normal; font-size: .8rem; color: var(--text-2); }
.bulk-bar { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; padding: .55rem .8rem; margin-bottom: .8rem; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--brand-soft-2); font-size: .86rem; animation: fade .2s ease; }
.bulk-bar > span { margin-right: auto; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
@media (max-width: 480px) { .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; } }
.media-tile { position: relative; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; transition: box-shadow .2s, transform .2s var(--ease), border-color .2s; }
.media-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.media-tile.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.media-tile:has(input:checked) { border-color: var(--brand); }
.mt-link { display: grid; color: inherit; text-decoration: none !important; }
.mt-img { aspect-ratio: 1; display: grid; place-items: center; background: var(--panel-3) repeating-conic-gradient(var(--panel-3) 0 25%, var(--panel-2) 0 50%) 50% / 18px 18px; overflow: hidden; }
.mt-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.media-tile:hover .mt-img img { transform: scale(1.04); }
.mt-file { display: grid; justify-items: center; gap: .3rem; color: var(--muted); }
.mt-file .icon { width: 34px; height: 34px; }
.mt-file small { font-size: .7rem; font-weight: 750; letter-spacing: .05em; }
.mt-meta { display: grid; padding: .5rem .65rem .6rem; min-width: 0; }
.mt-name { font-size: .8rem; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-meta small { font-size: .7rem; color: var(--muted); }
.mt-warn { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--warning); color: #fff; box-shadow: var(--shadow-sm); }
.mt-check { position: absolute; z-index: 2; top: 8px; left: 8px; width: 24px; height: 24px; cursor: pointer; }
.mt-check input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.mt-check span { display: block; width: 24px; height: 24px; border-radius: 7px; border: 2px solid #fff; background: rgba(0, 0, 0, .3); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: all .15s; }
.mt-check input:checked + span { background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat; border-color: var(--brand); }
@media (hover: hover) { .mt-check { opacity: 0; transition: opacity .15s; } .media-tile:hover .mt-check, .album-item:hover .mt-check, .mt-check:has(input:checked), .has-selection .mt-check { opacity: 1; } }
.media-detail .card-body { display: grid; gap: .9rem; }
.media-detail .kv { font-size: .82rem; grid-template-columns: auto 1fr; }
.md-preview { position: relative; display: grid; place-items: center; min-height: 10rem; border-radius: 12px; overflow: hidden; background: var(--panel-3) repeating-conic-gradient(var(--panel-3) 0 25%, var(--panel-2) 0 50%) 50% / 18px 18px; }
.md-preview img { max-height: 18rem; width: 100%; object-fit: contain; }
.md-preview.is-image { cursor: crosshair; }
.focal-dot { position: absolute; width: 26px; height: 26px; translate: -50% -50%; border-radius: 50%; border: 3px solid #fff; background: rgba(var(--brand-rgb), .55); box-shadow: 0 0 0 2px rgba(0, 0, 0, .3), 0 4px 12px rgba(0, 0, 0, .3); pointer-events: none; transition: left .2s var(--ease), top .2s var(--ease); }

/* Albums */
.album-form { display: grid; gap: 1rem; }
.album-toolbar { position: sticky; top: var(--tb-h); z-index: 6; display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; padding: .6rem .8rem; border-radius: 12px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line); backdrop-filter: blur(8px); box-shadow: var(--shadow-xs); }
.album-toolbar-right { margin-left: auto; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem; }
@media (max-width: 480px) { .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; } }
.album-item { position: relative; display: flex; flex-direction: column; border-radius: 13px; background: var(--panel); border: 1px solid var(--line); overflow: hidden; cursor: grab; transition: box-shadow .2s, transform .2s var(--ease), opacity .2s, border-color .2s; }
.album-item:hover { box-shadow: var(--shadow); }
.album-item.is-cover { border-color: #f59e0b; box-shadow: 0 0 0 2px rgba(245, 158, 11, .25); }
.album-item.is-dragging { opacity: .4; }
.album-item.is-drop { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.album-item:has(input[data-album-check]:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ai-media { position: relative; aspect-ratio: 4 / 3; background: var(--panel-3); display: grid; place-items: center; overflow: hidden; }
.ai-media img, .ai-media video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ai-play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(4px); pointer-events: none; }
.ai-cover-badge { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .5rem; border-radius: 999px; background: #f59e0b; color: #fff; font-size: .7rem; font-weight: 750; }
.ai-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: .25rem; }
.ai-tools .icon-btn { width: 30px; height: 30px; background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(4px); }
.ai-tools .icon-btn:hover { background: rgba(0, 0, 0, .75); color: #fff; }
.ai-tools .icon-btn.danger:hover { background: var(--danger); }
@media (hover: hover) { .ai-tools { opacity: 0; transition: opacity .15s; } .album-item:hover .ai-tools, .album-item:focus-within .ai-tools { opacity: 1; } }
.ai-fields { display: grid; gap: .35rem; padding: .55rem; }
.ai-fields input { height: 32px !important; font-size: .8rem !important; padding: 0 .55rem !important; border-radius: 8px !important; }
.ai-alt { color: var(--muted) !important; }

/* Icônes */
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .55rem; }
.icon-tile { position: relative; }
.it-btn { width: 100%; display: grid; justify-items: center; gap: .45rem; padding: 1rem .4rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text-2); transition: all .15s var(--ease); }
.it-btn .icon { width: 26px; height: 26px; color: var(--text); transition: transform .2s var(--ease), color .15s; }
.it-btn span { font-size: .7rem; font-family: var(--mono); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.it-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.it-btn:hover .icon { transform: scale(1.15); color: var(--brand); }
.it-del { position: absolute; top: 4px; right: 4px; margin: 0; opacity: 0; transition: opacity .15s; }
.it-del .icon-btn { width: 26px; height: 26px; background: var(--panel); }
.icon-tile:hover .it-del { opacity: 1; }
@media (hover: none) { .it-del { opacity: 1; } }

/* Apparence, réglages, rôles */
.anim-demo { display: flex; justify-content: center; gap: .8rem; padding: 1.2rem .5rem 1rem; margin-bottom: .6rem; border-radius: 12px; background: var(--panel-2); overflow: hidden; }
.ad-card { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--brand); box-shadow: var(--shadow-sm); }
.ad-card .icon { width: 26px; height: 26px; }
.brand-preview { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.brand-preview > div { min-height: 88px; display: grid; place-items: center; padding: .9rem; border-radius: 12px; border: 1px solid var(--line); }
.brand-preview img { max-height: 54px; max-width: 100%; object-fit: contain; }
.bp-light { background: #fff; }
.bp-dark { background: #0f1115; }
.bp-fav { grid-column: 1 / -1; min-height: 64px !important; display: flex !important; align-items: center; justify-content: flex-start !important; gap: .7rem; background: var(--panel-2); font-size: .82rem; color: var(--muted); }
.bp-fav img { width: 32px; height: 32px; border-radius: 6px; }
.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: .7rem; }
.role-card { display: grid; gap: .3rem; padding: .9rem 1rem; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.role-card strong { font-size: .9rem; }
.role-card small { font-size: .78rem; color: var(--muted); line-height: 1.45; }
.card + .roles-grid, .dt + .roles-grid, .section-head + .roles-grid { margin-top: 1rem; }
.edit-layout { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 1100px) { .edit-layout { grid-template-columns: minmax(0, 1fr) 18rem; } .sticky-side { position: sticky; top: calc(var(--tb-h) + 1rem); } }
.edit-main { min-width: 0; display: grid; gap: 1rem; }
.edit-main > .tabs-bar { margin-bottom: 0; }
.edit-side .btn-split { margin-top: .5rem; }

/* Maintenance, CRON, SEO */
.maint-status, .cron-health { border-left: 4px solid var(--tone); }
.maint-status .card-body, .cron-health .card-body { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem 2rem; }
.ms-main { flex: 1 1 22rem; display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; }
.ms-main h2 { font-size: 1.15rem; margin-bottom: .2rem; }
.ms-main p { margin: 0; }
.ms-ico { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 15px; background: var(--tone-soft); color: var(--tone); }
.ms-ico .icon { width: 26px; height: 26px; }
.maint-status.tone-warning .ms-ico { animation: pulse-ring 2s infinite; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 var(--tone-soft); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ms-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.countdown-mini { display: inline-flex; gap: .3rem; align-items: baseline; margin-top: .6rem; padding: .35rem .7rem; border-radius: 9px; background: var(--tone-soft); color: var(--tone); font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.countdown-mini span { font-size: 1.05rem; font-weight: 800; }
.cron-cmds { flex: 1 1 100%; display: grid; gap: .7rem; }
@media (min-width: 900px) { .cron-cmds { grid-template-columns: 1fr 1fr; } }
.cron-cmds small { display: block; margin-bottom: .3rem; }
.score-card .card-body { display: grid; justify-items: center; gap: .5rem; padding: 1.6rem 1rem; }
.score-ring { --size: 150px; position: relative; width: var(--size); height: var(--size); display: grid; place-items: center; align-content: center; border-radius: 50%; background: conic-gradient(var(--tone) calc(var(--p) * 1%), var(--panel-3) 0); }
.score-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--panel); }
.score-ring span, .score-ring small { position: relative; line-height: 1; }
.score-ring span { font-size: 2.6rem; font-weight: 800; color: var(--tone); letter-spacing: -.02em; }
.score-ring small { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.issue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.issue-list li { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; padding: .65rem .75rem; border-radius: 11px; background: var(--panel-2); border: 1px solid var(--line-2); }
.issue-list li > div { display: grid; min-width: 0; }
.issue-list strong { font-size: .84rem; }
.issue-list span { font-size: .8rem; color: var(--muted); }
.il-ico { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--tone-soft); color: var(--tone); }

/* Tableau de bord */
.dash-grid { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 1200px) { .dash-grid { grid-template-columns: minmax(0, 1fr) 22rem; } }
.dash-main, .dash-side { display: grid; gap: 1.25rem; min-width: 0; }
.dash-main > .card + .card, .dash-side > .card + .card { margin-top: 0; }
.stats-grid + .dash-grid, .banner + .stats-grid { margin-top: 1.25rem; }
.todo-list, .health-list, .rank-list, .bar-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.todo-list a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .7rem; padding: .5rem .55rem; border-radius: 10px; color: var(--text-2); font-size: .87rem; text-decoration: none !important; }
.todo-list a:hover { background: var(--panel-2); color: var(--text); }
.todo-list strong { min-width: 1.8rem; height: 1.5rem; padding: 0 .45rem; display: grid; place-items: center; border-radius: 999px; background: var(--panel-3); color: var(--muted); font-size: .75rem; }
.todo-list a.has-items strong { background: var(--tone, var(--brand)); color: #fff; }
.todo-list a:not(.has-items) { opacity: .7; }
.ti { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--tone-soft); color: var(--tone); }
.todo-list a.has-items:has(.tone-danger) strong { background: var(--danger); } .todo-list a.has-items:has(.tone-warning) strong { background: var(--warning); } .todo-list a.has-items:has(.tone-info) strong { background: var(--info); } .todo-list a.has-items:has(.tone-success) strong { background: var(--success); }
.health-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; padding: .5rem .2rem; border-bottom: 1px solid var(--line-2); font-size: .86rem; }
.health-list li:last-child { border: 0; }
.health-list li > .icon { color: var(--success); }
.health-list li.warn > .icon { color: var(--warning); }
.health-list small { color: var(--muted); font-weight: 600; }
.rank-list li, .bar-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l v" "b b"; gap: .25rem .6rem; padding: .35rem 0; font-size: .84rem; }
.rk-label, .bl-label { grid-area: l; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.rank-list strong, .bl-val { grid-area: v; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .82rem; }
.rk-bar, .bl-bar { grid-area: b; height: 6px; border-radius: 6px; background: var(--panel-3); overflow: hidden; }
.rk-bar span, .bl-bar span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--brand), var(--accent)); transform-origin: left; animation: grow .9s var(--ease) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* Journal technique */
.log-view { max-height: 65vh; overflow: auto; padding: .6rem 0; border-radius: 12px; background: #0d1117; font-family: var(--mono); font-size: .76rem; line-height: 1.55; }
.lv { padding: .1rem 1rem; color: #c9d1d9; white-space: pre-wrap; word-break: break-word; border-left: 3px solid transparent; }
.lv:hover { background: rgba(255, 255, 255, .04); }
.lv-error { color: #ff7b72; border-left-color: #ff7b72; }
.lv-warning { color: #e3b341; border-left-color: #e3b341; }
.lv-notice { color: #79c0ff; }
.lv-info { color: #8b949e; }

/* Assistant IA */
.ai-layout { display: grid; gap: 1rem; height: calc(100dvh - var(--tb-h) - 9rem); min-height: 30rem; }
@media (min-width: 960px) { .ai-layout { grid-template-columns: 17rem minmax(0, 1fr); } }
.ai-side { display: flex; flex-direction: column; gap: .8rem; min-height: 0; padding: .8rem; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); }
@media (max-width: 959px) { .ai-side { max-height: 11rem; } .ai-layout { height: auto; } .ai-main { height: 70dvh; } }
.ai-convs { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: .15rem; margin: 0 -.3rem; padding: 0 .3rem; }
.ai-conv { display: flex; align-items: center; gap: .1rem; border-radius: 9px; transition: background-color .15s; }
.ai-conv a { flex: 1; min-width: 0; display: grid; padding: .45rem .55rem; color: var(--text-2); text-decoration: none !important; }
.ai-conv a span { font-size: .85rem; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-conv a small { font-size: .7rem; color: var(--muted-2); }
.ai-conv .icon-btn { width: 26px; height: 26px; opacity: 0; }
.ai-conv:hover { background: var(--panel-3); }
.ai-conv:hover .icon-btn, .ai-conv.is-active .icon-btn { opacity: 1; }
.ai-conv.is-active { background: var(--brand-soft); }
.ai-conv.is-active a span { color: var(--brand); }
@media (hover: none) { .ai-conv .icon-btn { opacity: 1; } }
.ai-empty-list { padding: .4rem .55rem; }
.ai-main { display: flex; flex-direction: column; min-height: 0; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); overflow: hidden; }
.ai-thread { flex: 1; overflow-y: auto; padding: 1.4rem clamp(1rem, 3vw, 2rem); display: flex; flex-direction: column; gap: 1.2rem; scroll-behavior: smooth; }
.ai-welcome { margin: auto; max-width: 38rem; display: grid; justify-items: center; text-align: center; gap: .5rem; padding: 1rem 0; }
.ai-welcome h2 { font-size: 1.5rem; letter-spacing: -.01em; }
.ai-welcome p { margin: 0; }
.ai-logo { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 20px; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; box-shadow: 0 12px 30px -10px rgba(var(--brand-rgb), .6); margin-bottom: .4rem; animation: float 4s ease-in-out infinite; }
.ai-logo .icon { width: 28px; height: 28px; }
@keyframes float { 50% { transform: translateY(-5px); } }
.ai-suggest { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: .5rem; margin-top: 1rem; width: 100%; }
.ai-chip { display: flex; align-items: center; gap: .55rem; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text-2); font-size: .84rem; text-align: left; transition: all .15s var(--ease); }
.ai-chip .icon { color: var(--brand); flex: none; }
.ai-chip:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.ai-msg { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: start; max-width: 52rem; width: 100%; animation: fade .3s ease; }
.ai-msg.ai-user { grid-template-columns: minmax(0, 1fr) auto; margin-left: auto; max-width: 42rem; }
.ai-msg.ai-user .ai-avatar { order: 2; }
.ai-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; font-size: .72rem; font-weight: 750; }
.ai-user .ai-avatar { background: var(--panel-3); color: var(--text-2); }
.ai-error .ai-avatar { background: var(--danger-soft); color: var(--danger); }
.ai-bubble { min-width: 0; font-size: .92rem; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.ai-user .ai-bubble { justify-self: end; padding: .65rem .95rem; border-radius: 16px 16px 4px 16px; background: var(--brand); color: #fff; }
.ai-error .ai-bubble { padding: .65rem .95rem; border-radius: 12px; background: var(--danger-soft); color: var(--danger); }
.ai-bubble > :first-child { margin-top: 0; } .ai-bubble > :last-child { margin-bottom: 0; }
.ai-bubble p { margin: 0 0 .7rem; }
.ai-bubble h1, .ai-bubble h2, .ai-bubble h3, .ai-bubble h4 { font-size: 1.02rem; margin: 1rem 0 .45rem; }
.ai-bubble ul, .ai-bubble ol { padding-left: 1.3rem; margin: 0 0 .7rem; }
.ai-bubble li { margin-bottom: .25rem; }
.ai-bubble table { width: 100%; border-collapse: collapse; margin: .5rem 0 .9rem; font-size: .84rem; display: block; overflow-x: auto; }
.ai-bubble th, .ai-bubble td { padding: .45rem .65rem; border: 1px solid var(--line); text-align: left; }
.ai-bubble th { background: var(--panel-2); font-weight: 650; }
.ai-bubble pre { margin: .5rem 0 .8rem; padding: .8rem 1rem; border-radius: 10px; background: #0d1117; color: #c9d1d9; overflow-x: auto; font-size: .8rem; }
.ai-bubble code { font-size: .84em; }
.ai-bubble pre code { background: none; padding: 0; color: inherit; }
.ai-bubble blockquote { margin: .5rem 0; padding: .4rem .9rem; border-left: 3px solid var(--brand); color: var(--text-2); }
.ai-bubble a { text-decoration: underline; }
.ai-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .9rem; margin-top: .6rem; font-size: .72rem; color: var(--muted-2); }
.ai-meta .link-btn { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; }
.ai-typing { display: inline-flex; gap: 4px; padding: .7rem 0; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); animation: typing 1.2s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.ai-composer { margin: 0 clamp(.6rem, 2vw, 1.4rem) clamp(.6rem, 2vw, 1.2rem); border: 1px solid var(--line); border-radius: 16px; background: var(--panel-2); transition: border-color .15s, box-shadow .15s; }
.ai-composer:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: var(--panel); }
.ai-composer textarea { width: 100%; min-height: 3rem; max-height: 14rem; padding: .85rem 1rem .3rem; border: 0; outline: none; resize: none; background: none; font-size: .95rem; line-height: 1.5; color: var(--text); }
.ai-bar { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem .5rem .7rem; }
.ai-model { margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ai-send { border-radius: 11px; }
@media (max-width: 480px) { .ai-send span:not(.btn-spinner) { display: none; } .ai-model { display: none; } }
.provider-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }
.provider-card { transition: border-color .2s, box-shadow .2s; margin: 0 !important; }
.provider-card.is-on { border-color: color-mix(in srgb, var(--success) 45%, var(--line)); box-shadow: 0 0 0 3px var(--success-soft); }

/* Profil : double authentification */
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .4rem; margin: .7rem 0 1rem; }
.recovery-codes code { display: block; text-align: center; padding: .45rem; font-size: .86rem; letter-spacing: .06em; border: 1px dashed var(--line); }
.totp-setup { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; margin-bottom: 1rem; }
.qr-box { width: 172px; height: 172px; padding: 10px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.qr-box svg, .qr-box img { width: 100%; height: 100%; display: block; }
.totp-key { display: inline-block; margin-top: .3rem; padding: .45rem .7rem; font-size: .95rem; letter-spacing: .1em; word-break: break-all; }

/* ---------- 15. Authentification, installation, assistant ---------- */
body.auth { min-height: 100dvh; display: grid; background: var(--bg); overflow-x: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-bg span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: blob 18s ease-in-out infinite alternate; }
.ab1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: radial-gradient(circle, rgba(var(--brand-rgb), .55), transparent 65%); }
.ab2 { width: 38vmax; height: 38vmax; right: -10vmax; bottom: -12vmax; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 65%); animation-delay: -6s !important; }
.ab3 { width: 26vmax; height: 26vmax; left: 55%; top: 10%; background: radial-gradient(circle, rgba(var(--brand-rgb), .3), transparent 65%); animation-delay: -11s !important; }
html[data-theme="dark"] .auth-bg span { opacity: .35; }
@keyframes blob { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(4vmax, 3vmax) scale(1.08); } 100% { transform: translate(-3vmax, 5vmax) scale(.95); } }
@media (prefers-reduced-motion: reduce) { .auth-bg span, .ai-logo { animation: none; } }
.auth-main { position: relative; z-index: 1; display: grid; place-items: center; padding: clamp(1rem, 4vw, 3rem) 1rem; }
.auth-card, .install-card { width: min(27rem, 100%); padding: clamp(1.5rem, 4vw, 2.3rem); border-radius: 22px; background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .35); backdrop-filter: blur(20px) saturate(1.3); -webkit-backdrop-filter: blur(20px) saturate(1.3); }
[data-anim-in] { animation: auth-in .6s var(--ease) both; }
@keyframes auth-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.auth-card h1 { font-size: 1.55rem; text-align: center; letter-spacing: -.015em; }
.auth-sub { text-align: center; color: var(--muted); margin: .45rem 0 1.4rem; font-size: .92rem; }
.auth-logo { display: grid; place-items: center; margin-bottom: 1.1rem; }
.auth-logo img { max-height: 64px; max-width: 70%; object-fit: contain; }
.auth-mono { width: 58px; height: 58px; font-size: 1.5rem; border-radius: 17px; }
.auth-icon { width: 58px; height: 58px; display: grid; place-items: center; margin: 0 auto 1.1rem; border-radius: 17px; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; box-shadow: 0 12px 28px -10px rgba(var(--brand-rgb), .65); }
.auth-icon .icon { width: 26px; height: 26px; }
.auth-form { display: grid; gap: 1rem; }
.auth-form .alert { margin: 0; }
.auth-card > .alert { margin-bottom: 1rem; }
.auth-form input[type="email"], .auth-form input[type="password"], .auth-form input[type="text"] { height: 46px; font-size: .95rem; }
.auth-form .btn-lg { margin-top: .3rem; }
.otp-input { height: 54px !important; text-align: center; font-size: 1.5rem !important; font-weight: 700; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.auth-foot { margin: 1.4rem 0 0; text-align: center; font-size: .86rem; }
.auth-foot a { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); }
.auth-foot a:hover { color: var(--brand); }
.install-card { width: min(34rem, 100%); }
.install-wide { width: min(52rem, 100%); }
.install-head { text-align: center; margin-bottom: 1.4rem; }
.install-head h1 { font-size: clamp(1.5rem, 3vw, 1.95rem); letter-spacing: -.02em; margin: .7rem 0 .45rem; }
.install-head p { color: var(--muted); margin: 0 auto; max-width: 36rem; }
.install-badge { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .76rem; font-weight: 700; }
.checklist { list-style: none; margin: 0 0 1.2rem; padding: 0; display: grid; gap: .4rem; }
.checklist li { display: flex; align-items: flex-start; gap: .6rem; padding: .55rem .75rem; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: .87rem; }
.checklist li.ok > .icon { color: var(--success); }
.checklist li.ko { background: var(--danger-soft); border-color: transparent; }
.checklist li.ko > .icon { color: var(--danger); }
.install-card form + .muted { margin-top: .8rem; }
.wizard { display: grid; gap: 1.2rem; }
.wz-steps { display: flex; list-style: none; margin: 0; padding: 0; gap: .3rem; counter-reset: none; }
.wz-steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .4rem; position: relative; font-size: .78rem; font-weight: 600; color: var(--muted); text-align: center; }
.wz-steps li span { position: relative; z-index: 1; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--line); background: var(--panel); font-weight: 800; transition: all .3s var(--ease); }
.wz-steps li:not(:last-child)::after { content: ""; position: absolute; top: 15px; left: calc(50% + 20px); right: calc(-50% + 20px); height: 2px; border-radius: 2px; background: var(--line); transition: background-color .3s; }
.wz-steps li.is-active { color: var(--text); }
.wz-steps li.is-active span { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 0 0 5px var(--brand-soft); }
.wz-steps li.is-done { color: var(--text-2); }
.wz-steps li.is-done span { border-color: var(--success); background: var(--success); color: #fff; }
.wz-steps li.is-done::after { background: var(--success); }
.wz-panel { animation: wz-in .35s var(--ease); }
.wz-panel > p { margin: 0 0 1rem; }
@keyframes wz-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.wz-nav { display: flex; gap: .5rem; justify-content: space-between; padding-top: 1rem; border-top: 1px solid var(--line-2); }
.wz-nav [data-wz-next], .wz-nav [data-wz-submit] { margin-left: auto; }
.wizard .theme-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr)); gap: .65rem; max-height: 26rem; overflow-y: auto; padding: 4px; margin: -4px; }
.wizard .choice-grid { max-height: 26rem; overflow-y: auto; padding: 4px; margin: -4px; }
@media (max-width: 480px) { .wz-steps li { font-size: 0; gap: 0; } .wz-steps li span { font-size: .8rem; } }

/* Vérification anti-robots (connexion) */
.captcha-slot:empty { display: none; }
.captcha { display: grid; gap: .8rem; padding: 1rem; border-radius: 14px; border: 1.5px solid var(--line); background: var(--panel-2); animation: fade .3s ease; }
.captcha-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; font-size: .88rem; font-weight: 650; }
.captcha-head span { display: inline-flex; align-items: center; gap: .45rem; }
.captcha-head .icon { color: var(--brand); }
.captcha-refresh { width: 2rem; height: 2rem; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--panel); color: var(--muted); transition: transform .4s; }
.captcha-refresh:hover { transform: rotate(180deg); color: var(--brand); }
.captcha-puzzle { position: relative; width: 100%; max-width: 300px; aspect-ratio: 300 / 160; border-radius: 10px; overflow: hidden; margin-inline: auto; user-select: none; touch-action: none; background: var(--panel-3); }
.captcha-puzzle img.cp-bg { width: 100%; height: 100%; display: block; }
.captcha-puzzle img.cp-piece { position: absolute; left: 0; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .35)); pointer-events: none; }
.cp-track { position: relative; max-width: 300px; width: 100%; height: 2.9rem; margin-inline: auto; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); touch-action: none; }
.cp-track-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: .8rem; color: var(--muted); pointer-events: none; }
.cp-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: var(--brand-soft); }
.cp-knob { position: absolute; top: .2rem; left: .2rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--brand); color: #fff; box-shadow: 0 6px 14px rgba(var(--brand-rgb), .35); cursor: grab; touch-action: none; }
.cp-knob:active { cursor: grabbing; }
.captcha-img { width: 100%; max-width: 240px; height: auto; border-radius: 9px; background: #fff; margin-inline: auto; display: block; }
.captcha-q { text-align: center; color: var(--muted); font-size: .86rem; margin: 0; }
.captcha-answer { display: flex; gap: .5rem; max-width: 300px; width: 100%; margin-inline: auto; }
.captcha-answer input { flex: 1; min-width: 0; height: 46px; padding: 0 .9rem; border-radius: 10px; border: 1.5px solid var(--line); background: var(--panel); text-align: center; font-size: 1.15rem; font-weight: 700; letter-spacing: .12em; outline: none; color: var(--text); }
.captcha-answer input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.captcha-icons { display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem; }
.captcha-icons button { width: 3.3rem; height: 3.3rem; display: grid; place-items: center; border-radius: .9rem; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); transition: all .2s; }
.captcha-icons button:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); }
.captcha-icons button.is-picked { background: var(--brand); border-color: var(--brand); color: #fff; }
.captcha-icons .icon { width: 1.5rem; height: 1.5rem; }
.captcha.is-ok { border-color: color-mix(in srgb, var(--success) 50%, transparent); background: var(--success-soft); }
.captcha-ok { display: flex; align-items: center; justify-content: center; gap: .5rem; color: var(--success); font-weight: 700; font-size: .9rem; }
.captcha.is-error { animation: shake .45s ease; border-color: var(--danger); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- 16. Divers ---------- */
.is-flash { animation: flash 1.4s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--brand-soft-2); } 30% { box-shadow: 0 0 0 6px var(--brand-soft-2); } 100% { box-shadow: 0 0 0 0 transparent; } }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--panel-3), var(--panel-2), var(--panel-3)) 0 0 / 200% 100%; animation: shimmer 1.2s linear infinite; }
.dirty-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); margin-left: .4rem; }
@media print {
  .sidebar, .topbar, .ph-actions, .dt-tools, .dt-bulk, .dt-foot, .toasts, .sb-overlay, .tabs-bar, .form-actions, .btn { display: none !important; }
  .main { margin: 0 !important; } .content { padding: 0 !important; max-width: none !important; }
  .card { box-shadow: none !important; break-inside: avoid; }
  .table-scroll { max-height: none !important; overflow: visible !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
.dd-panel.is-up { top: auto; bottom: calc(100% + 6px); transform-origin: bottom right; }
.dd-panel.is-left { right: auto; left: 0; transform-origin: top left; }
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: background-color .3s ease, border-color .3s ease, color .2s ease !important; }
.media-field.is-busy { opacity: .6; pointer-events: none; }
.combo-select .combo-input { cursor: pointer; }
.combo-select .combo-input:focus { cursor: text; }
.combo-sm.combo-select .combo-input { padding-right: 2rem; }
.dt-filter.combo-select .combo-input, .dt-tools .combo-select .combo-input { height: 36px; min-width: 10rem; max-width: 15rem; }
.dd-empty .icon { width: 28px; height: 28px; color: var(--muted-2); margin-bottom: .3rem; }
.dd-empty p { margin: 0; }
.pw-label { min-height: 1em; }
.rte-area.is-flash, textarea.is-flash { animation: flash 1.4s ease; }
.lib-item[hidden], .lib-grid[hidden], .lib-cat[hidden] { display: none !important; }
.builder-side .tab, .drawer .tab { padding: 0 .7rem; gap: .35rem; font-size: .86rem; }

.rte-area, .rte-src { border-radius: 0 0 11px 11px; }
.drawer-body .rte-bar, .modal-body .rte-bar { top: 0; }
.drawer-body .block-form > .tab-panel .rte-bar { top: 42px; }
@media (max-width: 640px) {
  .stats-row, .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .stat-card { padding: .85rem .85rem .75rem; }
  .stat-card::after { width: 70px; height: 70px; right: -22px; top: -22px; }
  .sc-icon { width: 32px; height: 32px; border-radius: 9px; }
  .sc-value { font-size: 1.35rem; }
  .sc-label { font-size: .8rem; }
  .sc-hint { display: none; }
  .stat-delta { font-size: .68rem; }
  .ph-actions { width: 100%; }
}

/* ---------- Agent IA du site : conversation ---------- */
.cv-card { display: flex; flex-direction: column; }
.cv-card .card-head h2 { display: inline-flex; align-items: center; gap: .45rem; }
.cv-thread { display: flex; flex-direction: column; gap: .7rem; max-height: min(64vh, 46rem); min-height: 18rem; overflow-y: auto; padding: 1.1rem; background: radial-gradient(circle at 100% 0, var(--brand-soft), transparent 40%), var(--panel-2); overscroll-behavior: contain; }
.cv-msg { display: flex; }
.cv-msg.is-new { animation: fade .35s ease; }
.cv-visitor { justify-content: flex-start; }
.cv-bot, .cv-admin { justify-content: flex-end; }
.cv-bubble { max-width: min(78%, 40rem); padding: .6rem .85rem .55rem; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-xs); font-size: .9rem; line-height: 1.55; overflow-wrap: anywhere; }
.cv-visitor .cv-bubble { border-radius: 14px 14px 14px 4px; }
.cv-bot .cv-bubble { border-radius: 14px 14px 4px 14px; background: var(--brand-soft); border-color: var(--brand-soft-2); }
.cv-admin .cv-bubble { border-radius: 14px 14px 4px 14px; background: var(--brand); border-color: var(--brand); color: #fff; }
.cv-admin .cv-meta, .cv-admin .cv-meta strong { color: rgba(255, 255, 255, .85); }
.cv-admin .cv-text a { color: #fff; }
.cv-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .2rem; font-size: .72rem; color: var(--muted); }
.cv-meta strong { color: var(--text-2); font-weight: 700; }
.cv-text p { margin: 0 0 .45rem; } .cv-text p:last-child { margin: 0; }
.cv-text ul, .cv-text ol { margin: .2rem 0 .45rem; padding-left: 1.15rem; }
.cv-extra { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.cv-chips { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.cv-chips span { padding: .15rem .5rem; border-radius: 999px; border: 1px dashed var(--line); font-size: .72rem; color: var(--muted); background: var(--panel); }
.cv-sys { align-self: center; display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: .78rem; font-weight: 600; }
.cv-composer { display: grid; gap: .5rem; padding: .85rem 1rem 1rem; border-top: 1px solid var(--line-2); }
.cv-composer textarea { width: 100%; min-height: 3.2rem; max-height: 12rem; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); font: inherit; font-size: .92rem; resize: none; outline: none; }
.cv-composer textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.cv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.cv-bar .check-inline { margin-right: auto; color: var(--muted); }
.cv-composer .help { margin: 0; }
.cv-presence { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--muted); font-weight: 600; }
.cv-presence i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.cv-presence.is-online { color: var(--success); }
.cv-presence.is-online i { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); animation: pulse-ring 2s infinite; }
