/* CRM des agents. Thème clair par défaut, thème sombre au choix (bouton en haut). Même design pour les deux marques :
   seule la couleur d'accent change (data-brand sur <html>). Polices hébergées ici (licence OFL). */
@font-face { font-family: 'Inter'; src: url(/fonts/inter-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/inter-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/inter-latin-600-normal.woff2) format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(/fonts/space-grotesk-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Space Grotesk'; src: url(/fonts/space-grotesk-latin-700-normal.woff2) format('woff2'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(/fonts/jetbrains-mono-latin-500-normal.woff2) format('woff2'); font-weight: 400 600; font-display: swap; }

:root {
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, Consolas, monospace;
  /* Clair */
  --bg: #f3f5f4; --panel: #ffffff; --panel2: #f2f5f4; --panel3: #e9eeec; --line: #e2e8e5; --line2: #d3dbd7;
  --text: #0f1613; --text2: #3d4944; --muted: #6b7772;
  --card-grad: linear-gradient(180deg, #ffffff 0%, #fbfcfc 100%);
  --shadow: 0 1px 2px rgba(16, 24, 20, .05), 0 4px 16px rgba(16, 24, 20, .04);
  --shadow-lg: 0 18px 50px rgba(16, 24, 20, .16);
  --ok: #16a34a; --ok-bg: #e8f7ee; --bad: #dc2626; --bad-bg: #fdecec; --warn: #b7791f; --warn-bg: #fdf4e3; --info: #2563eb; --info-bg: #eaf1fe;
  --radius: 16px; --radius-sm: 10px;
  color-scheme: light;
}
:root[data-brand='aipf'] { --brand: #14c9b9; --brand-text: #0a857a; --brand-ink: #032a26; --brand-soft: rgba(20, 201, 185, .12); }
:root[data-brand='cryp'] { --brand: #d4a843; --brand-text: #8b5e10; --brand-ink: #2a1c02; --brand-soft: rgba(212, 168, 67, .16); }
:root[data-theme='dark'] {
  --bg: #0a0d0c; --panel: #111614; --panel2: #161c19; --panel3: #1c2420; --line: #212a26; --line2: #2c3732;
  --text: #e8eeeb; --text2: #b9c4bf; --muted: #84908a;
  --card-grad: linear-gradient(180deg, #131a17 0%, #0f1412 100%);
  --shadow: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
  --ok: #3fd47a; --ok-bg: rgba(63, 212, 122, .12); --bad: #f8645a; --bad-bg: rgba(248, 100, 90, .13); --warn: #f5b84a; --warn-bg: rgba(245, 184, 74, .13); --info: #5b9bff; --info-bg: rgba(91, 155, 255, .13);
  color-scheme: dark;
}
:root[data-theme='dark'][data-brand='aipf'] { --brand-text: #3fe6d6; }
:root[data-theme='dark'][data-brand='cryp'] { --brand-text: #e2bf6a; }

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-text); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-head); letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg.sm { width: 15px; height: 15px; }

/* Boutons et champs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; font-weight: 500; transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--line2); background: var(--panel2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; font-weight: 600; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: transparent; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel2); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.icon { padding: 8px; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 11px; min-width: 0; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 1px; border-color: var(--brand); }
textarea { resize: vertical; min-height: 90px; width: 100%; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
label.f > input, label.f > select, label.f > textarea { color: var(--text); font-size: 14px; font-weight: 400; }
.form { display: grid; gap: 12px; }
.form.cols { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.search { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; color: var(--muted); }
.search input { border: 0; padding: 8px 0; background: transparent; outline: none; min-width: 240px; color: var(--text); }
.seg { display: inline-flex; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: transparent; border: 0; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 500; font-size: 13px; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }

/* Connexion */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .art { background: radial-gradient(1200px 600px at 20% 10%, var(--brand-soft), transparent 60%), var(--card-grad); border-right: 1px solid var(--line); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login .art h1 { font-size: 44px; line-height: 1.05; margin: 0; max-width: 460px; }
.login .pane { display: grid; place-items: center; padding: 24px; }
.login .box { width: min(380px, 100%); display: grid; gap: 18px; }
.login h2 { margin: 0; font-size: 26px; }

/* Structure */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.logo .mark { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 15px; }
.logo b { font-family: var(--font-head); font-size: 16px; display: block; line-height: 1.1; }
.logo .tag { font-size: 11px; color: var(--muted); font-family: var(--font-mono); letter-spacing: .1em; }
.logo .mark-img { width: 36px; height: 36px; flex: none; }
:root[data-brand='aipf'] .logo .mark-img { padding: 3px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); }
.wm { letter-spacing: -.02em; }
.wm-ai { background: linear-gradient(90deg, #19E3D2, #7B5CFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wm-gold { color: var(--brand-text); }
.login .art .logo .mark-img { width: 46px; height: 46px; }
.login .art .logo b { font-size: 22px; }
.nav .sep { padding: 16px 10px 6px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--text2); font-weight: 500; position: relative; }
.nav a:hover { background: var(--panel2); color: var(--text); }
.nav a.on { background: var(--panel2); color: var(--text); }
.nav a.on::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav a.on .svg { color: var(--brand-text); }
.nav .badge { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--bad-bg); color: var(--bad); }
.side .foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 14px 28px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; font-size: 20px; line-height: 1.15; }
.topbar .sub { font-size: 12px; color: var(--muted); }
.live { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 12px; color: var(--text2); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; position: relative; }
.user-chip b { display: block; font-size: 13px; line-height: 1.2; }
.user-chip .txt span { font-size: 11px; color: var(--muted); }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px; z-index: 40; }
.menu button { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; padding: 9px 10px; border-radius: 9px; cursor: pointer; text-align: left; color: var(--text2); }
.menu button:hover { background: var(--panel2); color: var(--text); }
.main { padding: 24px 28px 130px; min-width: 0; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }

/* Avatars */
.av { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; background: var(--panel3); color: var(--text2); position: relative; letter-spacing: .02em; }
.av.lg { width: 48px; height: 48px; border-radius: 14px; font-size: 16px; font-family: var(--font-head); }
.av.brand { background: var(--brand-soft); color: var(--brand-text); }
.av .st { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--panel); background: var(--muted); }
.av .st.active { background: var(--ok); } .av .st.call { background: var(--info); } .av .st.idle { background: var(--warn); } .av .st.offline { background: var(--line2); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > div > b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who > div > span { display: block; font-size: 12px; color: var(--muted); }

/* Cartes */
.card { background: var(--card-grad); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-h h3 { margin: 0; font-size: 15px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-3-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }
.stack { display: grid; gap: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--card-grad); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 10px; box-shadow: var(--shadow); display: grid; gap: 8px; min-width: 0; }
.kpi.alert { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.kpi .top { display: flex; align-items: center; gap: 10px; color: var(--text2); font-weight: 500; }
.kpi .tile { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); display: grid; place-items: center; color: var(--text2); }
.kpi.alert .tile { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.kpi .val { display: flex; align-items: baseline; gap: 8px; }
.kpi .val b { font-family: var(--font-head); font-size: 32px; font-weight: 700; letter-spacing: -.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .val span { font-size: 12px; color: var(--muted); }
.delta { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.delta.down { background: var(--bad-bg); color: var(--bad); }
.delta.flat { background: var(--panel2); color: var(--muted); }
.spark { width: 100%; height: 40px; display: block; }
.spark .ln { fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.spark .ar { fill: url(#gok); opacity: .9; }
.spark.bad .ln { stroke: var(--bad); }
.spark.brand .ln { stroke: var(--brand); }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini div { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.mini span { display: block; font-size: 12px; color: var(--muted); }
.mini b { font-family: var(--font-head); font-size: 18px; font-variant-numeric: tabular-nums; }

/* Graphique en barres */
.chart { width: 100%; height: 220px; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--brand); opacity: .85; }
.chart .bar.today { opacity: 1; }
.chart .ax { fill: var(--muted); font-size: 10px; font-family: var(--font-mono); }
.chart .ln2 { fill: none; stroke: var(--text2); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .6; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Anneau « à traiter » */
.ring-wrap { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
.ring { width: 120px; height: 120px; flex: none; }
.ring .bg { fill: none; stroke: var(--panel3); stroke-width: 12; }
.ring .seg { fill: none; stroke-width: 12; stroke-linecap: butt; }
.ring text { font-family: var(--font-head); font-weight: 700; font-size: 26px; fill: var(--text); }
.ring .lbl { font-family: var(--font); font-weight: 400; font-size: 10px; fill: var(--muted); }
.att { display: grid; gap: 4px; }
.att a { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 10px; color: var(--text2); }
.att a:hover { background: var(--panel2); color: var(--text); }
.att a i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.att a b { margin-left: auto; font-family: var(--font-head); color: var(--text); }
.att a .svg { color: var(--muted); }

/* Tableaux */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--panel2); position: sticky; top: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--panel2); }
tbody tr.click { cursor: pointer; }
tbody tr:last-child td { border-bottom: 0; }
td.wrap { white-space: normal; min-width: 240px; }
td.right, th.right { text-align: right; }
.empty { padding: 40px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; }

/* Pastilles */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--panel2); color: var(--text2); border: 1px solid var(--line); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.pill.plain::before { display: none; }
.pill.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill.bad { color: var(--bad); background: var(--bad-bg); border-color: transparent; }
.pill.info { color: var(--info); background: var(--info-bg); border-color: transparent; }
.pill.brand { color: var(--brand-text); background: var(--brand-soft); border-color: transparent; }
.flag { width: 20px; height: 15px; border-radius: 3px; vertical-align: -2px; object-fit: cover; box-shadow: 0 0 0 1px var(--line); }
.money { font-family: var(--font-head); font-weight: 600; font-variant-numeric: tabular-nums; }
.money.ok { color: var(--ok); }

/* Fiche client */
.profile { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; }
.profile h2 { margin: 0; font-size: 24px; }
.profile .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0; border-top: 1px solid var(--line); margin-top: 16px; }
.facts > div { padding: 12px 4px 10px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.facts .svg { color: var(--muted); }
.facts span { display: block; font-size: 11.5px; color: var(--muted); }
.facts b { font-weight: 600; font-size: 13.5px; }
.coords { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; color: var(--text2); font-size: 13px; margin-top: 12px; }
.coords > span { display: inline-flex; gap: 6px; align-items: center; }
.pipe-card { background: linear-gradient(135deg, var(--brand-soft), transparent 70%), var(--card-grad); }
.pipe-card .big { font-family: var(--font-head); font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.timeline { display: grid; max-height: 560px; overflow-y: auto; }
.tl { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--line); align-items: start; }
.tl:last-child { border-bottom: 0; }
.tl .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--panel2); color: var(--muted); }
.tl.deposit .ic { background: var(--ok-bg); color: var(--ok); }
.tl.note .ic { background: var(--brand-soft); color: var(--brand-text); }
.tl.call .ic, .tl.email .ic { background: var(--info-bg); color: var(--info); }
.tl.withdrawal .ic, .tl.withdrawal_request .ic { background: var(--warn-bg); color: var(--warn); }
.tl .body { white-space: pre-wrap; word-break: break-word; color: var(--text2); margin-top: 2px; }
.tabs { display: flex; gap: 2px; margin-bottom: 8px; flex-wrap: wrap; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; width: fit-content; }
.tabs button { background: none; border: 0; padding: 6px 12px; cursor: pointer; color: var(--muted); border-radius: 7px; font-weight: 500; font-size: 13px; }
.tabs button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.outcomes { display: flex; flex-wrap: wrap; gap: 6px; }
.outcomes button { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--text2); }
.outcomes button.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; font-weight: 600; }

/* Pipeline (colonnes) */
.board-cols { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.col { background: var(--panel2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-height: 220px; display: grid; gap: 8px; align-content: start; transition: background .15s, border-color .15s; }
.col.over { border-color: var(--brand); background: var(--brand-soft); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 4px 6px; }
.col-h b { font-family: var(--font-head); }
.col-h .money { margin-left: auto; font-size: 13px; color: var(--text2); }
.col-h .cnt { font-size: 11px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.opp { color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; display: grid; gap: 8px; cursor: grab; box-shadow: var(--shadow); }
.opp:hover { border-color: var(--line2); }
.opp.dragging { opacity: .5; }
.opp .r1 { display: flex; align-items: center; gap: 8px; }
.opp .r1 b { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp .r2 { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.opp .r2 .money { margin-left: auto; color: var(--text); font-size: 15px; }
.bars { display: grid; gap: 10px; }
.bars .b { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.bars .track { height: 8px; border-radius: 99px; background: var(--panel3); overflow: hidden; margin-top: 6px; }
.bars .fill { height: 100%; border-radius: 99px; background: var(--brand); }

/* Téléphone (bas droite) */
.phone { position: fixed; right: 20px; bottom: 20px; width: 310px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 30; overflow: hidden; }
.phone .ph-head { display: flex; align-items: center; gap: 9px; padding: 11px 14px; cursor: pointer; }
.phone .ph-body { padding: 4px 14px 14px; display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.phone.min .ph-body { display: none; }
.phone.min { width: auto; min-width: 220px; }
.phone .who { font-size: 16px; font-weight: 600; font-family: var(--font-head); }
.phone .timer { font-variant-numeric: tabular-nums; font-size: 26px; font-family: var(--font-head); font-weight: 700; }
.dot-s { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot-s.call { background: var(--info); box-shadow: 0 0 0 3px var(--info-bg); } .dot-s.active { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-bg); } .dot-s.idle { background: var(--warn); } .dot-s.offline { background: var(--line2); }
.ring-anim { animation: ringa 1s infinite; }
@keyframes ringa { 50% { opacity: .35; } }

/* Bandeaux, messages, fenêtres */
.banner { background: var(--bad-bg); border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner .tile { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--panel); color: var(--bad); }
.banner b { color: var(--text); }
.toast { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); padding: 11px 16px; border-radius: 12px; z-index: 60; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px); font-weight: 500; }
.toast.bad { border-color: var(--bad); color: var(--bad); }
.toast.ok { border-color: var(--ok); }
.modal-bg { position: fixed; inset: 0; background: rgba(8, 12, 10, .5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: min(580px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal h3 { margin: 0 0 14px; font-size: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.danger-card { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
.rank { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--panel2); border: 1px solid var(--line); font-weight: 700; font-size: 12px; font-family: var(--font-head); }
.rank.r1 { background: #f4c542; color: #3b2b00; border-color: transparent; } .rank.r2 { background: #c9d1d9; color: #1d252c; border-color: transparent; } .rank.r3 { background: #d99a63; color: #3a1d06; border-color: transparent; }
.err-line { color: var(--bad); min-height: 18px; }
.report-body { white-space: pre-wrap; margin: 12px 0 0; color: var(--text2); }
.upper { text-transform: uppercase; }
.gap16 { height: 16px; }
.mb12 { margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) { .ring-anim { animation: none; } * { transition: none !important; } }
@media (max-width: 1180px) { .grid2, .grid-3-1 { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; } .login .art { display: none; }
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .nav { display: flex; flex-wrap: wrap; gap: 2px; }
  .nav .sep, .side .foot { display: none; }
  .nav a.on::before { display: none; }
  .logo { padding-bottom: 8px; }
  .topbar { position: static; padding: 12px 16px; flex-wrap: wrap; }
  .topbar .live, .user-chip .txt { display: none; }
  .main { padding: 16px 16px 150px; }
  .search input { min-width: 0; width: 100%; }
  .profile { grid-template-columns: auto 1fr; } .profile .acts { grid-column: 1 / -1; }
  .phone { left: 16px; right: 16px; width: auto; bottom: 12px; }
  .board-cols { grid-template-columns: repeat(5, 78vw); }
}
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; }
.gap-top { margin-top: 12px; }
.line-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.line-row:last-child { border-bottom: 0; }
.brand-text { color: var(--brand-text); }
.big-n { font-size: 22px; }
.att a .push { margin-left: auto; }
.legend .lg-bar { background: var(--brand); }
.legend .lg-line { background: transparent; border-top: 2px dashed var(--text2); height: 0; width: 14px; vertical-align: 3px; }
.phone .ph-who { font-size: 16px; font-weight: 600; font-family: var(--font-head); }
.col .empty { padding: 22px 8px; }

.who > div > span.row { display: flex; gap: 6px; }
