/* Relwyn Office — design system (DA Relwyn : nuit, violet, Bricolage Grotesque + Source Sans 3) */
@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2'); font-weight: 200 800; 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: 'Bricolage'; src: url('/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2') format('woff2'); font-weight: 200 800; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'SourceSans'; src: url('/fonts/source-sans-3-latin-wght-normal.woff2') format('woff2'); font-weight: 200 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: 'SourceSans'; src: url('/fonts/source-sans-3-latin-ext-wght-normal.woff2') format('woff2'); font-weight: 200 900; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'SourceSans'; src: url('/fonts/source-sans-3-latin-wght-italic.woff2') format('woff2'); font-weight: 200 900; font-style: italic; font-display: swap; }

:root {
  --bg: #0b0a0f; --bg-2: #0f0d15; --panel: #14121b; --panel-2: #1a1724; --panel-3: #221e2e; --hover: rgba(244, 242, 238, .05);
  --line: rgba(244, 242, 238, .08); --line-2: rgba(244, 242, 238, .14); --line-3: rgba(244, 242, 238, .22);
  --ink: #f4f2ee; --ink-2: #d6d1de; --soft: #a7a2b0; --dim: #6e6a79;
  --violet: #a78bfa; --violet-2: #8b5cf6; --violet-3: #7c3aed; --violet-bg: rgba(139, 92, 246, .14); --violet-line: rgba(167, 139, 250, .35);
  --green: #34d399; --green-bg: rgba(52, 211, 153, .12); --amber: #fbbf24; --amber-bg: rgba(251, 191, 36, .12);
  --red: #f87171; --red-bg: rgba(248, 113, 113, .12); --blue: #60a5fa; --blue-bg: rgba(96, 165, 250, .12); --pink: #f472b6; --cyan: #22d3ee;
  --grad: linear-gradient(135deg, #7c3aed 0%, #a855f7 45%, #ec4899 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 58, 237, .22), rgba(236, 72, 153, .12));
  --shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 40px -18px rgba(0, 0, 0, .7);
  --shadow-pop: 0 24px 80px -20px rgba(0, 0, 0, .8), 0 0 0 1px var(--line-2);
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px;
  --font: 'SourceSans', system-ui, -apple-system, 'Segoe UI', sans-serif; --display: 'Bricolage', 'SourceSans', system-ui, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --side: 252px; --top: 60px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f4f0; --bg-2: #efece6; --panel: #ffffff; --panel-2: #faf9f6; --panel-3: #f2efe9; --hover: rgba(20, 18, 27, .045);
  --line: rgba(20, 18, 27, .08); --line-2: rgba(20, 18, 27, .13); --line-3: rgba(20, 18, 27, .22);
  --ink: #16131d; --ink-2: #2e2a37; --soft: #5e5869; --dim: #8b8695;
  --violet: #6d28d9; --violet-2: #7c3aed; --violet-3: #6d28d9; --violet-bg: rgba(124, 58, 237, .09); --violet-line: rgba(124, 58, 237, .3);
  --green: #059669; --green-bg: rgba(5, 150, 105, .1); --amber: #b45309; --amber-bg: rgba(217, 119, 6, .1);
  --red: #dc2626; --red-bg: rgba(220, 38, 38, .08); --blue: #2563eb; --blue-bg: rgba(37, 99, 235, .08);
  --shadow: 0 1px 2px rgba(20, 18, 27, .04), 0 10px 30px -18px rgba(20, 18, 27, .25);
  --shadow-pop: 0 24px 70px -24px rgba(20, 18, 27, .35), 0 0 0 1px var(--line-2);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; } html { background: var(--bg); }
body { background: transparent; color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
.space-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before { display: none; content: ''; position: fixed; inset: -20vmax; z-index: -1; pointer-events: none; opacity: .55;
  background: radial-gradient(40vmax 30vmax at 12% 0%, rgba(124, 58, 237, .16), transparent 60%), radial-gradient(36vmax 28vmax at 100% 10%, rgba(236, 72, 153, .08), transparent 60%), radial-gradient(40vmax 30vmax at 70% 110%, rgba(37, 99, 235, .09), transparent 60%); }
:root[data-theme="light"] body::before { opacity: .35; }
a { color: var(--violet); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 650; letter-spacing: -.015em; margin: 0; line-height: 1.2; }
h1 { font-size: 26px; } h2 { font-size: 19px; } h3 { font-size: 16px; } h4 { font-size: 14px; }
p { margin: 0 0 8px; }
code, pre, kbd { font-family: var(--mono); font-size: .88em; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin: 6px 0; overflow: auto; }
::selection { background: rgba(167, 139, 250, .35); }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; } ::-webkit-scrollbar-track { background: transparent; }
.muted { color: var(--soft); } .dim { color: var(--dim); } .small { font-size: 13px; } .tiny { font-size: 12px; } .mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; } .row.wrap { flex-wrap: wrap; } .row.top { align-items: flex-start; } .col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.spacer { flex: 1; } .gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.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)); }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Coquille ── */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 70%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); overflow-y: auto; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.brand img { width: 30px; height: 30px; }
.brand b { font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.02em; } .brand b span { color: var(--violet); font-weight: 600; }
.ws-switch { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; margin-bottom: 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; text-align: left; }
.ws-switch:hover { border-color: var(--line-2); }
.ws-switch .ws-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--grad); color: #fff; font-family: var(--display); font-weight: 700; font-size: 13px; flex: none; }
.nav-sec { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 550; cursor: pointer; text-decoration: none !important; position: relative; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.active { background: var(--violet-bg); color: var(--ink); }
.nav-item.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-item .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--violet-3); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.nav-item .count.warn { background: var(--amber); color: #1b1300; }
.side-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 22px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 55%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.search-btn { display: flex; align-items: center; gap: 10px; min-width: 260px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--soft); cursor: pointer; font: inherit; }
.search-btn:hover { border-color: var(--line-2); color: var(--ink-2); }
.search-btn kbd { margin-left: auto; }
.page { padding: 24px 26px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { display: flex; align-items: center; gap: 10px; }
.page-head .sub { color: var(--soft); margin-top: 4px; }
.kill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(248, 113, 113, .4); background: var(--red-bg); color: var(--red); font-weight: 700; cursor: pointer; font-family: var(--font); font-size: 14px; }
.kill:hover { background: rgba(248, 113, 113, .2); }
.kill.on { background: var(--red); color: #fff; border-color: var(--red); animation: pulse-red 2s infinite; }
@keyframes pulse-red { 0%, 100% { box-shadow: 0 0 0 0 rgba(248, 113, 113, .5); } 50% { box-shadow: 0 0 0 8px rgba(248, 113, 113, 0); } }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r); border: 1px solid; margin-bottom: 18px; }
.banner.red { border-color: rgba(248, 113, 113, .4); background: var(--red-bg); } .banner.amber { border-color: rgba(251, 191, 36, .35); background: var(--amber-bg); } .banner.violet { border-color: var(--violet-line); background: var(--violet-bg); }

/* ── Boutons ── */
.btn { --b: var(--panel-2); display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--b); color: var(--ink); font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: transform .1s, background .15s, border-color .15s, opacity .15s; user-select: none; }
.btn:hover { border-color: var(--line-3); background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 24px -10px rgba(124, 58, 237, .8); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.danger { background: var(--red-bg); border-color: rgba(248, 113, 113, .35); color: var(--red); }
.btn.success { background: var(--green-bg); border-color: rgba(52, 211, 153, .35); color: var(--green); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; } .btn.sm svg { width: 15px; height: 15px; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn.icon { width: 38px; padding: 0; } .btn.icon.sm { width: 30px; }
.btn.block { width: 100%; }
.icon-svg { display: inline-flex; } .icon-svg svg { width: 18px; height: 18px; }

/* ── Cartes ── */
.card { background: color-mix(in srgb, var(--panel) 80%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.card.pad { padding: 18px; } .card .card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.card .card-h h3 { font-size: 15px; } .card .card-b { padding: 16px; } .card .card-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.card.hoverable { transition: border-color .15s, transform .15s; cursor: pointer; } .card.hoverable:hover { border-color: var(--line-2); transform: translateY(-1px); }
.card.glow { position: relative; } .card.glow::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; pointer-events: none; }
.section-title { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 650; font-size: 15px; margin: 0 0 10px; }
.section-title .muted { font-family: var(--font); font-weight: 500; font-size: 13px; }

/* ── Badges, puces ── */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--panel-3); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.violet { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-line); }
.badge.green { background: var(--green-bg); color: var(--green); border-color: rgba(52, 211, 153, .3); }
.badge.amber { background: var(--amber-bg); color: var(--amber); border-color: rgba(251, 191, 36, .3); }
.badge.red { background: var(--red-bg); color: var(--red); border-color: rgba(248, 113, 113, .3); }
.badge.blue { background: var(--blue-bg); color: var(--blue); border-color: rgba(96, 165, 250, .3); }
.badge svg { width: 13px; height: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; display: inline-block; }
.dot.green { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); } .dot.amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.dot.red { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); } .dot.violet { background: var(--violet); box-shadow: 0 0 0 3px var(--violet-bg); }
.dot.live { animation: live 1.6s infinite; } @keyframes live { 50% { opacity: .35; } }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink-2); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: var(--font); }
.chip:hover { border-color: var(--line-3); color: var(--ink); } .chip.active { background: var(--violet-bg); border-color: var(--violet-line); color: var(--ink); }
.prov { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--ink-2); }
.prov i { width: 16px; height: 16px; border-radius: 5px; display: grid; place-items: center; font-style: normal; font-size: 9.5px; font-weight: 800; color: #111; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--soft); font-size: 11.5px; font-family: var(--font); }

/* ── Avatars ── */
.av { --c: #7c3aed; position: relative; flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -.02em;
  background: radial-gradient(120% 120% at 0% 0%, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 45%, color-mix(in srgb, var(--c) 70%, #000) 100%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 6px 18px -10px var(--c); }
.av.human { border-radius: 50%; }
.av .emo { font-size: .95em; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; }
.av.xs { width: 22px; height: 22px; border-radius: 7px; font-size: 10px; } .av.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; }
.av.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 21px; } .av.xl { width: 84px; height: 84px; border-radius: 22px; font-size: 32px; }
.av .st { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--panel); background: var(--dim); }
.av.xs .st, .av.sm .st { width: 9px; height: 9px; border-width: 2px; }
.av .st.working { background: var(--green); animation: live 1.4s infinite; } .av .st.waiting { background: var(--amber); } .av .st.idle { background: var(--violet); } .av .st.paused { background: var(--dim); } .av .st.chatting { background: var(--blue); }
.av-stack { display: flex; } .av-stack .av { margin-left: -8px; box-shadow: 0 0 0 2px var(--panel); } .av-stack .av:first-child { margin-left: 0; }

/* ── Formulaires ── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--dim); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink); font: 15px/1.4 var(--font); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--violet-line); box-shadow: 0 0 0 3px var(--violet-bg); }
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a7a2b0' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input.sm, .select.sm { height: 32px; font-size: 14px; border-radius: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.check input { width: 17px; height: 17px; accent-color: var(--violet-2); }
.switch { position: relative; width: 40px; height: 23px; flex: none; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-2); cursor: pointer; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: var(--soft); transition: transform .2s var(--ease), background .2s; }
.switch.on { background: var(--violet-3); border-color: var(--violet-3); } .switch.on::after { transform: translateX(17px); background: #fff; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--soft); font: 600 13px var(--font); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.seg button:hover { color: var(--ink); } .seg button.on { background: var(--panel-3); color: var(--ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 2px 8px -4px rgba(0, 0, 0, .5); }
.seg button.on.off { color: var(--soft); } .seg button.on.ask { color: var(--amber); } .seg button.on.auto { color: var(--green); }
.seg button svg { width: 14px; height: 14px; }

/* ── Onglets ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 14px; border: 0; background: none; color: var(--soft); font: 600 14px var(--font); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--ink); } .tab.on { color: var(--ink); border-bottom-color: var(--violet-2); } .tab svg { width: 16px; height: 16px; }
.tab .badge { height: 18px; padding: 0 6px; font-size: 11px; }

/* ── Tableaux ── */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; } .table tbody tr:hover td { background: var(--hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ── Superpositions ── */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(5, 4, 8, .62); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } } @keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.985); } } @keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow-pop); animation: rise .2s var(--ease); }
.modal.wide { width: min(860px, 100%); } .modal.xwide { width: min(1100px, 100%); }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; } .modal-h h2 { font-size: 18px; }
.modal-b { padding: 6px 20px 18px; overflow-y: auto; } .modal-f { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.drawer-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(5, 4, 8, .45); animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 100vw); z-index: 91; background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; animation: slide .22s var(--ease); }
.drawer-h { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); } .drawer-b { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }
.menu { position: absolute; z-index: 60; min-width: 220px; padding: 6px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); animation: rise .12s var(--ease); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); font: 500 14px var(--font); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--hover); color: var(--ink); } .menu-item svg { width: 16px; height: 16px; } .menu-item.danger { color: var(--red); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel-3); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); animation: rise .2s var(--ease); font-size: 14px; }
.toast.error { border-color: rgba(248, 113, 113, .5); } .toast.ok { border-color: rgba(52, 211, 153, .45); }
.toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 20px; color: var(--soft); }
.empty .ill { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--violet-bg); color: var(--violet); }
.empty .ill svg { width: 26px; height: 26px; } .empty h3 { color: var(--ink); }
.skel { background: linear-gradient(90deg, var(--panel-2), var(--panel-3), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--violet); animation: spin .7s linear infinite; display: inline-block; } @keyframes spin { to { transform: rotate(360deg); } }
.typing { display: inline-flex; gap: 3px; align-items: center; } .typing i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: typing 1.2s infinite; opacity: .4; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; } @keyframes typing { 30% { opacity: 1; transform: translateY(-2px); } }
.progress { height: 6px; border-radius: 6px; background: var(--panel-3); overflow: hidden; } .progress > div { height: 100%; background: var(--grad); border-radius: 6px; transition: width .4s var(--ease); }
.tip { position: relative; } .copy-box { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; height: 38px; border-radius: 10px; border: 1px dashed var(--line-2); background: var(--panel-2); font-family: var(--mono); font-size: 13px; }
.copy-box span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── KPI ── */
.kpi { padding: 16px 18px; } .kpi .k-label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--soft); font-weight: 600; }
.kpi .k-label svg { width: 15px; height: 15px; } .kpi .k-val { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: 12.5px; color: var(--dim); margin-top: 2px; }

/* ── Le bureau (plateau) ── */
.floor { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.room { border-radius: var(--r-lg); border: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); background: linear-gradient(180deg, color-mix(in srgb, var(--rc, #a78bfa) 10%, color-mix(in srgb, var(--panel) 80%, transparent)), color-mix(in srgb, var(--panel) 78%, transparent) 70%); padding: 12px; position: relative; overflow: hidden; }
.room::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--rc, #a78bfa); opacity: .8; }
.room-h { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; font-family: var(--display); font-weight: 650; font-size: 14px; }
.room-h .n { margin-left: auto; font-family: var(--font); font-size: 12px; color: var(--dim); font-weight: 600; }
.desks { display: grid; gap: 8px; }
.desk { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, background .15s; position: relative; }
.desk:hover { border-color: var(--line-2); background: var(--panel-3); }
.desk.working { border-color: rgba(52, 211, 153, .35); } .desk.waiting { border-color: rgba(251, 191, 36, .35); } .desk.paused { opacity: .6; }
.desk .who { min-width: 0; flex: 1; } .desk .who > b { display: block; font-size: 14.5px; } .desk .who > span { display: block; font-size: 12.5px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk .doing { font-size: 12.5px; margin-top: 3px; display: flex; align-items: center; gap: 6px; color: var(--ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.desk .acts { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; } .desk:hover .acts { opacity: 1; }

/* ── Organigramme ── */
.org-wrap { overflow: auto; padding: 10px 4px 40px; border-radius: var(--r-lg); }
.org { display: inline-flex; flex-direction: column; align-items: center; min-width: 100%; }
.org ul { display: flex; justify-content: center; padding: 22px 0 0; margin: 0; position: relative; list-style: none; }
.org li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 22px 8px 0; }
.org li::before, .org li::after { content: ''; position: absolute; top: 0; height: 22px; border-top: 1.5px solid var(--line-3); width: 50%; }
.org li::before { right: 50%; } .org li::after { left: 50%; border-left: 1.5px solid var(--line-3); }
.org li:only-child::before, .org li:only-child::after { display: none; } .org li:only-child { padding-top: 0; }
.org li:first-child::before, .org li:last-child::after { border: 0 none; } .org li:last-child::before { border-right: 1.5px solid var(--line-3); border-radius: 0 10px 0 0; } .org li:first-child::after { border-radius: 10px 0 0 0; }
.org ul ul::before { content: ''; position: absolute; top: 0; left: 50%; height: 22px; border-left: 1.5px solid var(--line-3); }
.org > ul { padding-top: 0; } .org > ul > li { padding-top: 0; } .org > ul > li::before, .org > ul > li::after { display: none; }
.node { width: 196px; padding: 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line-2); box-shadow: var(--shadow); text-align: center; cursor: pointer; transition: transform .15s, border-color .15s; position: relative; }
.node:hover { transform: translateY(-2px); border-color: var(--violet-line); }
.node.drop { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-bg); } .node.dragging { opacity: .4; }
.node .av { margin: 0 auto 8px; } .node b { display: block; font-size: 14.5px; } .node .t { font-size: 12.5px; color: var(--soft); line-height: 1.3; min-height: 32px; }
.node .dept { position: absolute; top: 0; left: 14px; right: 14px; height: 3px; border-radius: 0 0 3px 3px; }
.node .meta { display: flex; justify-content: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ── Kanban ── */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kcol { background: color-mix(in srgb, var(--panel) 55%, transparent); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; min-height: 120px; }
.kcol-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 700; font-size: 13.5px; }
.kcol-h .n { color: var(--dim); font-weight: 600; } .kcards { display: flex; flex-direction: column; gap: 8px; }
.tcard { padding: 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s, transform .12s; }
.tcard:hover { border-color: var(--line-2); transform: translateY(-1px); }
.tcard .tt { font-weight: 650; font-size: 14px; line-height: 1.35; margin: 2px 0 8px; } .tcard .num { font-size: 12px; color: var(--dim); font-weight: 700; }
.tcard .tf { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--soft); }
.prio { width: 7px; height: 7px; border-radius: 2px; display: inline-block; } .prio.p0 { background: var(--dim); } .prio.p1 { background: var(--blue); } .prio.p2 { background: var(--amber); } .prio.p3 { background: var(--red); }

/* ── Journal (timeline) ── */
.feed { display: flex; flex-direction: column; } .ev { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ev:last-child { border-bottom: 0; } .ev .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--panel-3); color: var(--soft); }
.ev .ico svg { width: 14px; height: 14px; } .ev .ico.tool { color: var(--blue); background: var(--blue-bg); } .ev .ico.approval { color: var(--amber); background: var(--amber-bg); }
.ev .ico.error, .ev .ico.denied { color: var(--red); background: var(--red-bg); } .ev .ico.final, .ev .ico.result { color: var(--green); background: var(--green-bg); } .ev .ico.alert { color: var(--red); background: var(--red-bg); }
.ev .ico.note, .ev .ico.text { color: var(--violet); background: var(--violet-bg); }
.ev .body { min-width: 0; flex: 1; } .ev .body .txt { color: var(--ink-2); word-break: break-word; white-space: pre-wrap; } .ev .when { font-size: 11.5px; color: var(--dim); white-space: nowrap; }
.log .ev .txt { font-family: var(--font); max-height: 220px; overflow: auto; }

/* ── Discussions ── */
.chat { display: grid; grid-template-columns: 300px 1fr; height: calc(100vh - var(--top)); }
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; padding: 12px; } .chat-main { display: flex; flex-direction: column; min-width: 0; }
.th-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; cursor: pointer; }
.th-item:hover { background: var(--hover); } .th-item.on { background: var(--violet-bg); } .th-item .l { min-width: 0; flex: 1; } .th-item b { font-size: 14px; }
.th-item .s { font-size: 12.5px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-h { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; max-width: 820px; } .msg.me { margin-left: auto; flex-direction: row-reverse; }
.bubble { padding: 10px 14px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line); line-height: 1.5; word-break: break-word; min-width: 0; }
.msg.me .bubble { background: var(--violet-bg); border-color: var(--violet-line); border-top-right-radius: 6px; } .msg:not(.me) .bubble { border-top-left-radius: 6px; }
.msg.system .bubble { background: var(--amber-bg); border-color: rgba(251, 191, 36, .3); font-size: 14px; }
.bubble .meta { font-size: 11.5px; color: var(--dim); margin-top: 4px; }
.composer { display: flex; gap: 10px; align-items: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); }
.composer .textarea { min-height: 46px; max-height: 220px; resize: none; }
.md p { margin: 0 0 8px; } .md p:last-child { margin-bottom: 0; } .md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; } .md li { margin: 2px 0; }
.md h1, .md h2, .md h3 { margin: 12px 0 6px; font-size: 16px; } .md code { background: var(--panel-3); padding: 1px 5px; border-radius: 5px; } .md pre code { background: none; padding: 0; }
.md table { border-collapse: collapse; margin: 6px 0; font-size: 14px; } .md td, .md th { border: 1px solid var(--line-2); padding: 5px 8px; } .md blockquote { margin: 6px 0; padding-left: 12px; border-left: 3px solid var(--violet-line); color: var(--soft); }

/* ── Validation ── */
.appr { border-radius: var(--r-lg); border: 1px solid rgba(251, 191, 36, .3); background: linear-gradient(180deg, var(--amber-bg), var(--panel) 60%); padding: 14px 16px; }
.appr .what { white-space: pre-wrap; font-size: 14.5px; line-height: 1.5; margin: 8px 0 10px; }
.appr .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Droits (matrice) ── */
.matrix { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.matrix th, .matrix td { padding: 6px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.matrix th.cap { writing-mode: vertical-rl; text-orientation: sideways; transform: rotate(180deg); white-space: nowrap; font-weight: 600; color: var(--soft); font-size: 12.5px; padding: 10px 4px; cursor: pointer; height: 170px; }
.matrix th.cap:hover { color: var(--ink); } .matrix th.grp { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); border-left: 1px solid var(--line); }
.matrix td.who { text-align: left; position: sticky; left: 0; background: var(--panel); z-index: 1; min-width: 190px; } .matrix td.gstart, .matrix th.gstart { border-left: 1px solid var(--line); }
.mcell { width: 30px; height: 26px; border-radius: 7px; border: 1px solid var(--line-2); display: grid; place-items: center; cursor: pointer; margin: 0 auto; background: var(--panel-2); color: var(--dim); }
.mcell svg { width: 14px; height: 14px; } .mcell.ask { background: var(--amber-bg); border-color: rgba(251, 191, 36, .45); color: var(--amber); } .mcell.auto { background: var(--green-bg); border-color: rgba(52, 211, 153, .45); color: var(--green); }
.perm-row { display: flex; align-items: center; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); } .perm-row:last-child { border-bottom: 0; }
.perm-row .pi { flex: 1; min-width: 0; } .perm-row .pi b { font-size: 14px; display: flex; align-items: center; gap: 6px; } .perm-row .pi span { font-size: 12.5px; color: var(--soft); }
.risk { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; }
.risk.r2 { background: var(--amber-bg); color: var(--amber); } .risk.r3 { background: var(--red-bg); color: var(--red); }

/* ── Agenda ── */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--panel); }
.cal .dh { padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--dim); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.cal .day { min-height: 112px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.cal .day:nth-child(7n) { border-right: 0; } .cal .day.other { background: var(--bg-2); opacity: .55; } .cal .day:hover { background: var(--hover); }
.cal .day .dn { font-size: 13px; font-weight: 700; color: var(--soft); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal .day.today .dn { background: var(--grad); color: #fff; }
.cal .evt { font-size: 12px; padding: 2px 6px; border-radius: 6px; margin-top: 3px; background: var(--violet-bg); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid var(--violet); }
.cal .evt.google { background: var(--blue-bg); border-left-color: var(--blue); }

/* ── Fichiers ── */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.fcard { border-radius: 14px; border: 1px solid var(--line); background: var(--panel); overflow: hidden; cursor: pointer; transition: border-color .15s; }
.fcard:hover { border-color: var(--line-2); } .fcard .th { height: 110px; display: grid; place-items: center; background: var(--panel-2); color: var(--dim); overflow: hidden; }
.fcard .th img, .fcard .th video { width: 100%; height: 100%; object-fit: cover; } .fcard .th svg { width: 30px; height: 30px; }
.fcard .fi { padding: 8px 10px; } .fcard .fi b { font-size: 13px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .fcard .fi span { font-size: 12px; color: var(--dim); }
.dropzone { border: 1.5px dashed var(--line-3); border-radius: var(--r-lg); padding: 20px; text-align: center; color: var(--soft); transition: border-color .15s, background .15s; }
.dropzone.over { border-color: var(--violet); background: var(--violet-bg); }

/* ── Graphiques ── */
.chart { width: 100%; height: auto; display: block; } .chart text { fill: var(--soft); font: 11.5px var(--font); }
.chart .grid-line { stroke: var(--line); } .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--soft); } .legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 6px; vertical-align: -1px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 90px; gap: 10px; align-items: center; font-size: 13.5px; padding: 5px 0; }
.bar-row .bar { height: 10px; border-radius: 6px; background: var(--panel-3); overflow: hidden; } .bar-row .bar > div { height: 100%; border-radius: 6px; }

/* ── Connexion ── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; padding: 40px; display: flex; flex-direction: column; justify-content: space-between; background: transparent; color: var(--ink); }
.auth-art h1 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.05; letter-spacing: -.03em; max-width: 560px; }
.auth-art .mini-office { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 520px; }
.auth-art .mini-office .desk { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .1); cursor: default; }
.auth-form { display: grid; place-items: center; padding: 30px; background: color-mix(in srgb, var(--bg) 62%, transparent); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); border-left: 1px solid var(--line); }
.auth-card { width: min(410px, 100%); }
.auth-card h2 { font-size: 26px; margin-bottom: 6px; }
.otp { letter-spacing: .5em; text-align: center; font-size: 22px; font-family: var(--mono); }

/* ── Mobile ── */
.mobile-nav { display: none; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-pop); }
  .sidebar.open { transform: none; } .side-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .5); }
  .topbar { padding: 0 14px; } .search-btn { min-width: 0; flex: 1; } .search-btn kbd { display: none; }
  .page { padding: 18px 16px 90px; } .auth { grid-template-columns: 1fr; } .auth-art { display: none; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - var(--top) - 64px); } .chat.has-th .chat-list { display: none; } .chat:not(.has-th) .chat-main { display: none; }
  .mobile-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 64px; padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--soft); font-size: 11px; font-weight: 650; text-decoration: none; position: relative; }
  .mobile-nav a.active { color: var(--violet); } .mobile-nav a svg { width: 21px; height: 21px; }
  .mobile-nav a .count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--violet-3); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; }
  .drawer { width: 100vw; } .modal { border-radius: 18px; } .form-grid { grid-template-columns: 1fr; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .kanban { grid-auto-columns: 82vw; } .hide-m { display: none !important; }
  .toasts { bottom: 76px; }
}
@media (min-width: 901px) { .show-m { display: none !important; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.split { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.split.wide-side { grid-template-columns: minmax(0, 1fr) 420px; }
@media (max-width: 1180px) { .split, .split.wide-side { grid-template-columns: minmax(0, 1fr); } }
/* ── Graphiques (palette validée : bleu = série 1, orange = série 2) ── */
.viz { --s1: #3987e5; --s2: #d95926; --grid: rgba(244, 242, 238, .09); --axis: var(--dim); position: relative; }
:root[data-theme="light"] .viz { --s1: #2a78d6; --s2: #eb6834; --grid: rgba(20, 18, 27, .08); }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz .gl { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.viz .ax { fill: var(--axis); font: 11.5px var(--font); }
.viz .hit { fill: transparent; cursor: pointer; outline: none; } .viz .hit:hover, .viz .hit:focus { fill: var(--hover); }
.viz .tt { position: absolute; z-index: 5; pointer-events: none; min-width: 170px; padding: 10px 12px; border-radius: 10px; background: var(--panel-3); border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); font-size: 13px; transform: translate(-50%, -100%); }
.viz .tt .k { display: inline-block; width: 12px; height: 2px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.viz .tt b { font-variant-numeric: tabular-nums; }
.viz-legend { display: flex; gap: 16px; font-size: 13px; color: var(--soft); } .viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.hbar { display: grid; grid-template-columns: minmax(110px, 170px) 1fr minmax(84px, auto); gap: 12px; align-items: center; padding: 6px 0; font-size: 14px; }
.hbar .track { height: 14px; position: relative; } .hbar .track > div { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--s1); min-width: 2px; }
.hbar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.leaf-grid { display: grid; grid-template-columns: repeat(2, auto); gap: 10px; padding: 10px; border-radius: 18px; border: 1px dashed var(--line-2); background: color-mix(in srgb, var(--panel) 40%, transparent); }

/* ── Organigramme par unités ── */
.org2 { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 18px; align-items: start; }
.tree-nav { padding: 8px; position: sticky; top: calc(var(--top) + 16px); max-height: calc(100vh - var(--top) - 40px); overflow: auto; }
.tree-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: 500 13.5px var(--font); cursor: pointer; text-align: left; }
.tree-item:hover { background: var(--hover); color: var(--ink); } .tree-item.on { background: var(--violet-bg); color: var(--ink); font-weight: 650; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; color: var(--dim); }
.crumb { border: 0; background: none; color: var(--soft); font: 600 13.5px var(--font); cursor: pointer; padding: 4px 6px; border-radius: 7px; } .crumb:hover { background: var(--hover); color: var(--ink); } .crumb.on { color: var(--ink); }
.unit-hero { padding: 20px; position: relative; overflow: hidden; }
.unit-hero::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--uc); }
.unit-hero::after { content: ''; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--uc) 26%, transparent), transparent); pointer-events: none; }
.uh-badge { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font: 700 20px var(--display); color: #fff; background: linear-gradient(135deg, var(--uc), color-mix(in srgb, var(--uc) 55%, #1e1b4b)); box-shadow: 0 10px 30px -12px var(--uc); flex: none; }
.uc-kind { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.uc-lead { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); }
.uh-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 18px; }
.uh-m { position: relative; display: flex; align-items: center; padding: 10px 12px; border-radius: 13px; background: color-mix(in srgb, var(--panel-2) 85%, transparent); border: 1px solid var(--line); cursor: grab; min-width: 0; }
.uh-m:hover { border-color: var(--line-2); } .uh-x { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 7px; border: 0; background: var(--panel-3); color: var(--soft); display: none; place-items: center; cursor: pointer; } .uh-m:hover .uh-x { display: grid; }
.uh-add { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 13px; border: 1.5px dashed var(--line-3); background: transparent; color: var(--soft); font: 600 13.5px var(--font); cursor: pointer; min-height: 58px; } .uh-add:hover { color: var(--ink); border-color: var(--violet); }
.uh-add svg { width: 17px; height: 17px; }
.org-link { width: 2px; height: 22px; margin: 0 auto; background: linear-gradient(var(--line-3), transparent); }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.unit-card { position: relative; padding: 14px 14px 10px; border-radius: 16px; border: 1px solid var(--line); cursor: pointer; overflow: hidden; transition: transform .15s, border-color .15s, box-shadow .15s;
  background: linear-gradient(160deg, color-mix(in srgb, var(--uc) 12%, color-mix(in srgb, var(--panel) 84%, transparent)), color-mix(in srgb, var(--panel) 82%, transparent) 60%); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.unit-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--uc); }
.unit-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--uc) 50%, var(--line-2)); box-shadow: 0 16px 40px -22px var(--uc); }
.unit-card.drop { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-bg); }
.unit-card h3 { font-size: 17px; margin: 6px 0 6px; }
.uc-top { display: flex; align-items: center; gap: 8px; } .uc-live { margin-left: auto; font-size: 11.5px; color: var(--green); display: inline-flex; align-items: center; gap: 5px; font-weight: 650; }
.uc-members { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 10px 0 6px; min-height: 30px; } .uc-m { cursor: grab; } .uc-more { font-size: 12px; color: var(--soft); font-weight: 700; padding: 0 4px; }
.uc-foot { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.palette { padding: 12px 14px; } .palette .chip { cursor: grab; }
@media (max-width: 900px) { .org2 { grid-template-columns: 1fr; } .tree-nav { display: none; } }

/* ── Messagerie façon WhatsApp ── */
.wa { --wa-in: #1c1928; --wa-out: #3a1f73; --wa-green: #34d399; display: grid; grid-template-columns: 380px minmax(0, 1fr); height: calc(100vh - var(--top)); }
:root[data-theme="light"] .wa, :root[data-theme="light"] .wa-float { --wa-in: #ffffff; --wa-out: #e9ddff; --wa-green: #059669; }
.wa-float { --wa-in: #1c1928; --wa-out: #3a1f73; --wa-green: #34d399; }
.wa-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 72%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.wa-list-h { padding: 16px 18px 8px; } .wa-list-h h2 { font-size: 21px; }
.wa-search { margin: 4px 14px 8px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--panel-2); color: var(--dim); }
.wa-search input { flex: 1; border: 0; background: none; color: var(--ink); font: 14px var(--font); outline: none; }
.wa-tabs { display: flex; gap: 6px; padding: 0 14px 10px; flex-wrap: wrap; }
.wa-items { flex: 1; overflow-y: auto; }
.wa-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 16px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-bottom: 1px solid var(--line); }
.wa-item:hover { background: var(--hover); } .wa-item.on { background: var(--violet-bg); }
.wa-item .av { width: 46px; height: 46px; border-radius: 50%; font-size: 17px; } .wa-item .av .st { right: 0; bottom: 0; }
.wa-item-b { flex: 1; min-width: 0; } .wa-item-b b { font-size: 15px; } .wa-prev { font-size: 13.5px; color: var(--soft); }
.wa-green { color: var(--wa-green) !important; font-weight: 600; } .wa-badge { width: 10px; height: 10px; border-radius: 50%; background: var(--wa-green); flex: none; }
.wa-gav { border-radius: 50% !important; }
.wa-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.wa-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 62px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 70%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.wa-head .av { border-radius: 50%; }
.wa-body { flex: 1; overflow-y: auto; padding: 18px 6% 10px; display: flex; flex-direction: column; gap: 4px;
  background-color: color-mix(in srgb, var(--bg) 40%, transparent); background-image: radial-gradient(circle at 1px 1px, rgba(167, 139, 250, .14) 1px, transparent 0); background-size: 22px 22px; }
.wa-day { display: flex; justify-content: center; margin: 12px 0 6px; } .wa-day span { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 8px; background: var(--panel-2); color: var(--soft); text-transform: capitalize; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.wa-sys { align-self: center; max-width: 80%; text-align: center; font-size: 12.5px; padding: 7px 12px; margin: 8px 0; border-radius: 8px; background: color-mix(in srgb, var(--amber) 14%, var(--panel-2)); color: var(--ink-2); }
.wa-msg { display: flex; align-items: flex-end; gap: 6px; max-width: 72%; margin-top: 3px; } .wa-msg.out { align-self: flex-end; } .wa-msg.in { align-self: flex-start; }
.wa-bubble { position: relative; padding: 7px 10px 8px; border-radius: 10px; line-height: 1.45; font-size: 14.5px; word-break: break-word; min-width: 70px; box-shadow: 0 1px 1.5px rgba(0, 0, 0, .3); }
.wa-msg.in .wa-bubble { background: var(--wa-in); border-top-left-radius: 0; } .wa-msg.out .wa-bubble { background: var(--wa-out); border-top-right-radius: 0; }
.wa-msg.in .wa-bubble::before { content: ''; position: absolute; top: 0; left: -8px; border-top: 0 solid transparent; border-right: 8px solid var(--wa-in); border-bottom: 10px solid transparent; }
.wa-msg.out .wa-bubble::before { content: ''; position: absolute; top: 0; right: -8px; border-left: 8px solid var(--wa-out); border-bottom: 10px solid transparent; }
.wa-msg.in .av + .wa-bubble::before { display: none; } .wa-msg.in .av + .wa-bubble { border-top-left-radius: 10px; }
.wa-bubble .md p { margin: 0 0 4px; } .wa-author { font-size: 12.5px; font-weight: 700; margin-bottom: 2px; }
.wa-meta { float: right; margin: 6px 0 -4px 12px; font-size: 11px; color: var(--soft); white-space: nowrap; } .wa-ticks { margin-left: 4px; letter-spacing: -3px; color: var(--dim); } .wa-ticks.read { color: #60a5fa; }
.wa-appr { align-self: center; width: min(560px, 92%); margin: 8px 0; }
.wa-compose { display: flex; align-items: flex-end; gap: 10px; padding: 10px 14px; flex-wrap: wrap; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg-2) 70%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.wa-mentions { width: 100%; display: flex; gap: 6px; flex-wrap: wrap; } .wa-mentions .chip { height: 24px; font-size: 12px; }
.wa-bar { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 4px; padding: 4px 6px; border-radius: 22px; background: var(--panel-2); border: 1px solid var(--line); }
.wa-bar textarea { flex: 1; min-width: 0; resize: none; border: 0; background: none; color: var(--ink); font: 15px/1.4 var(--font); padding: 8px 4px; max-height: 160px; outline: none; }
.wa-ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; border: 0; background: none; color: var(--soft); cursor: pointer; flex: none; } .wa-ic:hover { color: var(--ink); background: var(--hover); } .wa-ic.rec { color: #fff; background: var(--red); }
.wa-ic svg { width: 20px; height: 20px; }
.wa-send { width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: var(--grad); cursor: pointer; flex: none; box-shadow: 0 8px 22px -10px rgba(124, 58, 237, .9); } .wa-send svg { width: 20px; height: 20px; }
.wa-empty { display: grid; place-items: center; background-image: radial-gradient(circle at 1px 1px, rgba(167, 139, 250, .12) 1px, transparent 0); background-size: 22px 22px; }
.wa-hello { text-align: center; max-width: 420px; padding: 20px; } .wa-hello h2 { margin-bottom: 8px; }
.wa-main.compact .wa-body { padding: 12px 12px 8px; } .wa-main.compact .wa-msg { max-width: 86%; }
.wa-float { position: fixed; right: 20px; bottom: 88px; z-index: 80; width: min(400px, calc(100vw - 24px)); height: min(600px, calc(100vh - 120px)); display: flex; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow-pop); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); animation: rise .2s var(--ease); }
.wa-float .wa-main { flex: 1; }
.wa-fab { position: fixed; right: 20px; bottom: 22px; z-index: 81; height: 54px; min-width: 54px; padding: 0 18px 0 16px; border-radius: 27px; border: 0; display: inline-flex; align-items: center; gap: 10px; color: #fff; font: 700 15px var(--font); background: var(--grad); cursor: pointer; box-shadow: 0 14px 34px -12px rgba(124, 58, 237, .95); }
.wa-fab svg { width: 22px; height: 22px; } .wa-fab:hover { filter: brightness(1.08); }
@media (max-width: 900px) {
  .wa { grid-template-columns: 1fr; height: calc(100vh - var(--top) - 64px); } .wa.has-th .wa-list { display: none; } .wa:not(.has-th) .wa-main { display: none; }
  .wa-msg { max-width: 88%; } .wa-body { padding: 12px 10px; } .wa-fab { bottom: 78px; right: 14px; padding: 0 15px; } .wa-float { bottom: 140px; right: 12px; }
}
