/* Be Marketing — système de design */
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --bg: #f6f5fb;
  --surface: #ffffff; --surface-2: #faf9fe; --surface-3: #f1eff9;
  --border: #e9e6f3; --border-strong: #d8d3ea;
  --text: #16112b; --text-2: #4b4663; --muted: #827d99;
  --brand: #6d4aff; --brand-2: #ff4f8b; --brand-ink: #fff; --brand-soft: #efeaff; --brand-strong: #140c33;
  --grad: linear-gradient(120deg, #6d4aff 0%, #a64dff 50%, #ff4f8b 100%);
  --focus: #6d4aff;
  --green: #0e8a5c; --green-soft: #e2f6ec; --amber: #a35c00; --amber-soft: #fff1d9; --red: #c92f45; --red-soft: #fde9ec;
  --blue: #2563d6; --blue-soft: #e7effd; --violet: #6d4aff; --violet-soft: #efeaff; --gray: #5f5a75; --gray-soft: #efedf5;
  --c1: #6d4aff; --c2: #ff4f8b; --c3: #10b4a0; --c4: #f59e0b; --c5: #3b82f6; --c6: #8b5cf6;
  --shadow-xs: 0 1px 2px rgba(22, 17, 43, .05);
  --shadow: 0 1px 2px rgba(22, 17, 43, .04), 0 4px 14px -4px rgba(22, 17, 43, .07);
  --shadow-md: 0 8px 24px -8px rgba(22, 17, 43, .14);
  --shadow-lg: 0 30px 60px -16px rgba(22, 17, 43, .3);
  --radius: 16px; --radius-sm: 10px; --sidebar: 268px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0a16; --surface: #14111f; --surface-2: #191527; --surface-3: #221d33; --border: #2a2440; --border-strong: #3a3357;
    --text: #efedf7; --text-2: #c3bed6; --muted: #8f89a8; --brand: #8b70ff; --brand-soft: #241d45; --brand-strong: #06040e; --focus: #a08cff;
    --green: #4ad69f; --green-soft: #0f2f22; --amber: #f5b54a; --amber-soft: #352610; --red: #ff8597; --red-soft: #3a1520;
    --blue: #8db4ff; --blue-soft: #15254a; --violet: #b3a3ff; --violet-soft: #241d45; --gray: #b0abc4; --gray-soft: #221d33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px -4px rgba(0, 0, 0, .5); --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 60px -16px rgba(0, 0, 0, .8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0a16; --surface: #14111f; --surface-2: #191527; --surface-3: #221d33; --border: #2a2440; --border-strong: #3a3357;
  --text: #efedf7; --text-2: #c3bed6; --muted: #8f89a8; --brand: #8b70ff; --brand-soft: #241d45; --brand-strong: #06040e; --focus: #a08cff;
  --green: #4ad69f; --green-soft: #0f2f22; --amber: #f5b54a; --amber-soft: #352610; --red: #ff8597; --red-soft: #3a1520;
  --blue: #8db4ff; --blue-soft: #15254a; --violet: #b3a3ff; --violet-soft: #241d45; --gray: #b0abc4; --gray-soft: #221d33;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px -4px rgba(0, 0, 0, .5); --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 60px -16px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; letter-spacing: -.006em; }
body.no-scroll { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.02em; }
h1 { font-size: 25px; font-weight: 760; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 680; display: flex; align-items: center; gap: 8px; }
h4 { font-size: 13.5px; font-weight: 680; }
p { margin: 0 0 10px; }
.ic { flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; } .mt-s { margin-top: 8px; } .mb { margin-bottom: 16px; }
.lead { font-size: 15px; color: var(--text-2); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes pulse { 50% { transform: scale(1.08); opacity: .85; } }
@keyframes orbit { to { transform: rotate(360deg); } }
.anim > * { animation: rise .4s var(--ease) both; }
.anim > *:nth-child(2) { animation-delay: 40ms; } .anim > *:nth-child(3) { animation-delay: 80ms; } .anim > *:nth-child(4) { animation-delay: 120ms; } .anim > *:nth-child(n+5) { animation-delay: 160ms; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.splash { min-height: 100vh; display: grid; place-items: center; }
.spin { width: 20px; height: 20px; border: 2.5px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.loading-box { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 50px 0; color: var(--muted); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; text-decoration: none !important; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 60%, transparent); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, black); }
.btn.magic { background: var(--grad); border: 0; color: #fff; box-shadow: 0 8px 20px -8px rgba(166, 77, 255, .7); }
.btn.magic:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.btn.sm { height: 31px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.loading { color: transparent !important; position: relative; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2.4px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.primary):not(.magic):not(.danger).loading::after { border-color: var(--border); border-top-color: var(--brand); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }
.dot-count { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--brand-2); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

/* ---------- Formulaires ---------- */
input, select, textarea { font: inherit; color: var(--text); }
.field { display: grid; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field > label i { color: var(--red); font-style: normal; }
.field small { color: var(--muted); font-size: 12px; }
.field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea, .input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.field textarea, textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.invalid { border-color: var(--red) !important; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-section { grid-column: 1 / -1; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); color: var(--muted); text-transform: uppercase; font-size: 11.5px; letter-spacing: .06em; }
.form-section:first-child { border: 0; padding: 0; margin: 0; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.check.full { grid-column: 1 / -1; }
.chips-input { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-opt { position: relative; cursor: pointer; }
.chip-opt input { position: absolute; opacity: 0; pointer-events: none; }
.chip-opt span { display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--border-strong); background: var(--surface); font-size: 13px; font-weight: 550; transition: all .15s; }
.chip-opt:hover span { border-color: var(--brand); }
.chip-opt input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.chip-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.range { display: flex; align-items: center; gap: 10px; } .range input { flex: 1; accent-color: var(--brand); } .range output { min-width: 34px; font-weight: 700; }
.search-input { position: relative; } .search-input .ic { position: absolute; left: 11px; top: 11px; color: var(--muted); } .search-input input { padding-left: 34px !important; }

/* ---------- Badges, puces ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 640; white-space: nowrap; background: var(--blue-soft); color: var(--blue); }
.badge.green { background: var(--green-soft); color: var(--green); } .badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); } .badge.violet { background: var(--violet-soft); color: var(--violet); }
.badge.gray { background: var(--gray-soft); color: var(--gray); } .badge.grad { background: var(--grad); color: #fff; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); font-size: 12.5px; font-weight: 550; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.net { display: inline-grid; place-items: center; flex: none; border-radius: 7px; background: var(--net); color: #fff; font-weight: 800; line-height: 1; font-family: Arial, sans-serif; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; flex: none; }

/* ---------- Structure ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 14px 12px; gap: 4px; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; font-weight: 800; font-size: 17.5px; letter-spacing: -.03em; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 32px; height: 32px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 14px -6px rgba(166, 77, 255, .8); }
.ws-switch { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; text-align: left; font: inherit; color: var(--text); margin-bottom: 8px; }
.ws-switch:hover { border-color: var(--border-strong); }
.ws-switch b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-switch small { color: var(--muted); font-size: 11.5px; }
.nav-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 14px 10px 6px; display: flex; align-items: center; justify-content: space-between; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--text-2); font-weight: 560; font-size: 14px; text-decoration: none !important; transition: background .12s, color .12s; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.on { background: var(--brand-soft); color: var(--brand); }
.nav a .ic { opacity: .85; }
.nav a .count { margin-left: auto; font-size: 11.5px; background: var(--surface-3); color: var(--text-2); padding: 1px 7px; border-radius: 99px; }
.proj-chip { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); margin: 2px 0 6px; }
.proj-chip .swatch { width: 26px; height: 26px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 12px; }
.proj-chip b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border); display: grid; gap: 6px; }
.plan-card { padding: 12px; border-radius: 12px; background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-2) 12%, var(--surface))); font-size: 12.5px; }
.plan-card b { display: block; font-size: 13px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 26px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; min-width: 0; }
.crumbs a { color: var(--muted); } .crumbs b { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.engine { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 650; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.engine i { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.engine.on i { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.view { padding: 22px 26px 60px; max-width: 1360px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .sub { margin: 5px 0 0; color: var(--muted); max-width: 720px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cartes, grilles ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); padding: 18px; min-width: 0; }
.card.pad-0 { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.card.hover { transition: border-color .15s, box-shadow .15s, transform .15s; cursor: pointer; }
.card.hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card.glow { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.g-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span2 { grid-column: span 2; }
.stat { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.stat.green .stat-ic { background: var(--green-soft); color: var(--green); } .stat.amber .stat-ic { background: var(--amber-soft); color: var(--amber); }
.stat.red .stat-ic { background: var(--red-soft); color: var(--red); } .stat.pink .stat-ic { background: color-mix(in srgb, var(--brand-2) 14%, var(--surface)); color: var(--brand-2); }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 560; }
.stat-value { font-size: 23px; font-weight: 760; letter-spacing: -.03em; line-height: 1.2; margin-top: 2px; }
.stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.progress { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width .5s var(--ease); }
.progress.green span { background: var(--green); } .progress.red span { background: var(--red); }
.ring text { font-size: 15px; font-weight: 760; fill: var(--text); }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty .ic { color: var(--brand); opacity: .8; }
.empty h3 { color: var(--text); font-size: 16px; }
.empty p { max-width: 460px; margin: 0 0 8px; }
.callout { display: flex; gap: 12px; padding: 13px 15px; border-radius: 12px; background: var(--blue-soft); color: var(--text); font-size: 13.5px; }
.callout .ic { color: var(--blue); margin-top: 2px; }
.callout.amber { background: var(--amber-soft); } .callout.amber .ic { color: var(--amber); }
.callout.violet { background: var(--violet-soft); } .callout.violet .ic { color: var(--violet); }
.callout.green { background: var(--green-soft); } .callout.green .ic { color: var(--green); }
.hero-card { position: relative; overflow: hidden; border-radius: 20px; padding: 26px; color: #fff; background: radial-gradient(600px 300px at 90% -20%, rgba(255, 79, 139, .55), transparent 60%), radial-gradient(500px 300px at 0% 120%, rgba(16, 180, 160, .35), transparent 60%), #1b1240; }
.hero-card h2 { font-size: 22px; } .hero-card p { color: rgba(255, 255, 255, .78); }
.hero-card .btn:not(.magic) { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .25); color: #fff; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tr.click { cursor: pointer; }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table.fin td, .table.fin th { padding: 7px 10px; font-size: 13px; }
.table.fin tr.total td { font-weight: 700; background: var(--surface-2); }
.table.fin tr.sub td:first-child { padding-left: 24px; color: var(--text-2); }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.tab .count { font-size: 11px; background: var(--surface-3); padding: 0 7px; border-radius: 99px; color: var(--text-2); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); padding: 5px 11px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* ---------- Fenêtres ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(12, 8, 30, .5); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: rise .15s both; overflow-y: auto; }
.modal-bg.out { opacity: 0; transition: opacity .18s; }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .22s var(--ease) both; }
.modal.lg { width: min(820px, 100%); } .modal.xl { width: min(1100px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.menu { position: absolute; z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); padding: 6px; animation: pop .14s both; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; text-align: left; text-decoration: none !important; }
.menu button:hover, .menu a:hover { background: var(--surface-3); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: grid; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-radius: 12px; background: var(--brand-strong); color: #fff; box-shadow: var(--shadow-lg); font-weight: 550; max-width: 420px; animation: pop .25s var(--ease) both; }
.toast.err { background: var(--red); } .toast.out { opacity: 0; transform: translateY(8px); transition: all .3s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 90; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: rise .2s both; }

/* ---------- Génération IA ---------- */
.gen-progress { display: grid; justify-items: center; gap: 14px; padding: 8px 0; }
.gen-orb { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--grad); animation: pulse 1.8s ease-in-out infinite; box-shadow: 0 0 0 10px color-mix(in srgb, var(--brand) 12%, transparent), 0 20px 40px -10px rgba(166, 77, 255, .6); }
.gen-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; width: 100%; max-width: 380px; }
.gen-steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 550; }
.gen-steps li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); flex: none; }
.gen-steps li.now { color: var(--text); } .gen-steps li.now::before { border-color: var(--brand); border-top-color: transparent; animation: spin .8s linear infinite; }
.gen-steps li.done { color: var(--green); } .gen-steps li.done::before { background: var(--green); border-color: var(--green); }

/* ---------- Contenu riche ---------- */
.rich p { margin: 0 0 10px; } .rich ul { margin: 0 0 10px; padding-left: 20px; } .rich li { margin: 3px 0; } .rich h4 { margin: 14px 0 6px; }
ul.clean { margin: 0; padding-left: 18px; } ul.clean li { margin: 4px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13.8px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 550; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-title .num { width: 28px; height: 28px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.quote { font-size: 17px; font-weight: 620; line-height: 1.45; padding: 16px 18px; border-left: 4px solid; border-image: var(--grad) 1; background: var(--surface-2); border-radius: 0 12px 12px 0; }
.swot { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.swot > div { border-radius: 14px; padding: 14px 16px; }
.swot .s { background: var(--green-soft); } .swot .w { background: var(--red-soft); } .swot .o { background: var(--blue-soft); } .swot .t { background: var(--amber-soft); }
.swot h4 { margin-bottom: 6px; }
.persona { display: grid; gap: 10px; }
.persona-head { display: flex; gap: 12px; align-items: center; }
.funnel { display: grid; gap: 8px; }
.funnel > div { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.funnel b { display: block; }
.timeline { position: relative; display: grid; gap: 16px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.timeline > div { position: relative; }
.timeline > div::before { content: ""; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px var(--surface); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 10px; min-height: 200px; display: flex; flex-direction: column; gap: 8px; }
.kcol.over { border-color: var(--brand); background: var(--brand-soft); }
.kcol-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 4px; font-weight: 700; font-size: 13px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 10px 11px; cursor: grab; box-shadow: var(--shadow-xs); display: grid; gap: 6px; }
.kcard:hover { border-color: var(--border-strong); }
.kcard.dragging { opacity: .5; }
.kcard b { font-size: 13.5px; line-height: 1.35; }
.kmeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }

/* ---------- Calendrier ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--border); gap: 1px; }
.cal-h { background: var(--surface-2); padding: 8px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: var(--muted); text-align: center; }
.cal-d { background: var(--surface); min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cal-d.out { background: var(--surface-2); } .cal-d.out .cal-n { opacity: .45; }
.cal-d.today .cal-n { background: var(--brand); color: #fff; }
.cal-d.over { background: var(--brand-soft); }
.cal-n { font-size: 12px; font-weight: 700; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-add { opacity: 0; margin-left: auto; } .cal-d:hover .cal-add { opacity: 1; }
.cpost { display: flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 7px; font-size: 11.8px; font-weight: 560; background: var(--surface-3); cursor: pointer; overflow: hidden; border-left: 3px solid var(--net, var(--brand)); }
.cpost span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpost.published { opacity: .7; } .cpost.failed { background: var(--red-soft); }
.cpost .t { color: var(--muted); flex: none; }
.post-card { display: grid; gap: 8px; }
.post-preview { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.post-preview .pp-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.post-preview .pp-body { padding: 0 12px 12px; white-space: pre-wrap; font-size: 14px; }
.post-preview .pp-media { background: var(--surface-3); aspect-ratio: 1.6; display: grid; place-items: center; color: var(--muted); font-size: 12.5px; padding: 14px; text-align: center; overflow: hidden; }
.post-preview .pp-media img, .post-preview .pp-media video { width: 100%; height: 100%; object-fit: cover; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
.media-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-3); border: 1px solid var(--border); }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb button { position: absolute; top: 4px; right: 4px; background: rgba(0, 0, 0, .55); color: #fff; }
.media-thumb.sel { outline: 3px solid var(--brand); outline-offset: -3px; }

/* ---------- Graphiques ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.chart .target { stroke: var(--brand-2); stroke-dasharray: 5 4; stroke-width: 1.5; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.legend.col { flex-direction: column; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-center { font-size: 16px; font-weight: 800; fill: var(--text); }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .track { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-row .track span { display: block; height: 100%; background: var(--grad); border-radius: 99px; }

/* ---------- Assistant ---------- */
.chat-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 18px; }
@media (max-width: 900px) { .chat-wrap { grid-template-columns: minmax(0, 1fr); } .chat { height: calc(100vh - 150px); } }
.chat { display: flex; flex-direction: column; height: calc(100vh - 170px); min-height: 460px; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 6px 4px 16px; }
.msg { max-width: 82%; padding: 12px 15px; border-radius: 16px; line-height: 1.55; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.chat-input { display: flex; gap: 8px; padding: 10px; border: 1px solid var(--border-strong); border-radius: 16px; background: var(--surface); }
.chat-input textarea { flex: 1; border: 0; resize: none; background: none; outline: none; min-height: 24px; max-height: 160px; padding: 6px; }
.suggests { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 99px; padding: 7px 13px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-2); }
.suggest:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Assistant de création (wizard) ---------- */
.wizard { max-width: 860px; margin: 0 auto; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps span { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-3); }
.steps span.on { background: var(--grad); }
.wizard-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 600; font-size: 13.5px; transition: all .15s; height: 100%; }
.choice span small { font-weight: 450; color: var(--muted); font-size: 12px; }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }

/* ---------- Authentification ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side { position: relative; overflow: hidden; padding: 48px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(700px 400px at 100% 0%, rgba(255, 79, 139, .55), transparent 60%), radial-gradient(600px 400px at 0% 100%, rgba(16, 180, 160, .4), transparent 60%), #160e38; }
.auth-side h2 { font-size: 34px; line-height: 1.15; letter-spacing: -.035em; max-width: 480px; }
.auth-side ul { list-style: none; padding: 0; display: grid; gap: 12px; margin: 26px 0 0; }
.auth-side li { display: flex; gap: 10px; align-items: center; color: rgba(255, 255, 255, .86); }
.auth-side li .ic { color: #ffb3cd; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-box { width: min(420px, 100%); }
.auth-box h1 { font-size: 27px; margin-bottom: 6px; }
.auth-box .stack { margin-top: 22px; }
.auth-box .alt { margin-top: 18px; text-align: center; color: var(--muted); }

/* ---------- Divers ---------- */
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .grow small { color: var(--muted); }
.score { font-size: 42px; font-weight: 800; letter-spacing: -.04em; }
.pill-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); display: inline-block; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); padding: 12px 0; display: flex; justify-content: flex-end; gap: 8px; z-index: 5; }
.inline-edit { border: 1px dashed transparent; border-radius: 8px; padding: 2px 4px; margin: -2px -4px; }
.inline-edit:hover { border-color: var(--border-strong); }
.inline-edit:focus { outline: none; border-color: var(--brand); background: var(--surface-2); }

/* ---------- Mobile ---------- */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-side { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; z-index: 80; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 70; background: rgba(12, 8, 30, .4); }
  .topbar { padding: 0 14px; } .topbar .menu-btn { display: inline-grid; }
  .view { padding: 16px 16px 60px; }
  .g2, .g3 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .auth { grid-template-columns: 1fr; } .auth-side { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .swot { grid-template-columns: 1fr; }
  .funnel > div { grid-template-columns: 1fr; gap: 6px; }
  .cal-d { min-height: 74px; } .cpost span { display: none; }
  .bar-row { grid-template-columns: 100px 1fr 70px; }
  .msg { max-width: 92%; }
  h1 { font-size: 22px; }
  .hide-m { display: none !important; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr 1fr; } .stat-value { font-size: 19px; } .toasts { left: 12px; right: 12px; } }
@media print {
  .sidebar, .topbar, .page-head .actions, .no-print { display: none !important; }
  .shell { display: block; } .view { padding: 0; max-width: none; } .card { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}
