/* VOLT : thème unique de la plateforme, chargé en dernier. Neutre (graphite), sobre, identique pour tous les comptes.
   Principes : une seule couleur d'accent utilisée avec retenue, bordures fines, aucun dégradé, halo ni décor,
   une échelle de tailles et d'espacements régulière, états de survol et de focus cohérents. */

:root {
  --bg: #0c0c0e;
  --bg2: #111113;
  --card: #151517;
  --card2: #1b1b1e;
  --line: #26262a;
  --line-strong: #36363c;
  --text: #ededf0;
  --muted: #9c9ca6;
  --faint: #85858f;
  --accent: #7aa2ff;
  --accent-strong: #5b8def;
  --accent-soft: rgba(122, 162, 255, .14);
  --violet: #7aa2ff;
  --violet2: #a9c4ff;
  --violet-soft: rgba(255, 255, 255, .06);
  --green: #3ecf8e;
  --amber: #f5b84b;
  --red: #f26d6d;
  --radius: 12px;
  --radius-sm: 9px;
  --pop: 0 18px 50px rgba(0, 0, 0, .55);
}

/* Base */
html { background: var(--bg); }
body { background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; font-feature-settings: "cv11", "ss03"; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { font-weight: 650; letter-spacing: -.015em; }
a { color: var(--violet2); text-underline-offset: 3px; }
a:hover { color: #fff; }
::selection { background: rgba(122, 162, 255, .35); }
* { scrollbar-width: thin; scrollbar-color: #3a3a40 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2e2e33; border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #45454c; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }

/* Aucun décor : ronds, halos, voiles */
.kpi::after, .today-brief::after, .kpi span::before { content: none !important; display: none !important; }

/* Boutons */
.btn { align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card2); background-image: none; color: var(--text); font-weight: 550; font-size: 14px; line-height: 1; white-space: nowrap; box-shadow: none !important; transition: background-color .14s ease, border-color .14s ease, color .14s ease, opacity .14s ease; }
.btn:hover { background: #232327; border-color: var(--line-strong); filter: none; }
.btn:active { background: #1d1d20; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-small { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 44px; padding: 0 20px; font-size: 15px; }
.btn-primary, .today-brief .btn-primary, .modal-card .btn-primary { background: var(--text); background-image: none; border-color: var(--text); color: #0c0c0e; }
.btn-primary:hover, .today-brief .btn-primary:hover, .modal-card .btn-primary:hover { background: #fff; background-image: none; border-color: #fff; color: #0c0c0e; filter: none; }
.btn-ghost, .today-brief-actions .btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .05); }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(242, 109, 109, .35); }
.btn-danger:hover { background: rgba(242, 109, 109, .1); border-color: var(--red); }
.link-btn { color: var(--violet2); }

/* Champs */
.input, .select, .message, textarea.input { background: #0f0f11; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 11px; font-size: 14px; transition: border-color .14s ease, box-shadow .14s ease; }
.input:hover, .select:hover, .message:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .message:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .message::placeholder { color: var(--faint); }
label { color: var(--text); }
label small { color: var(--muted); font-weight: 400; }
input[type="checkbox"] { accent-color: var(--accent); }

/* Structure */
.app { grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { background: var(--bg2); background-image: none; border-right: 1px solid var(--line); padding: 18px 12px 14px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand-mark { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--text); color: #0c0c0e; display: grid; place-items: center; }
.brand-mark svg { width: 16px; height: 16px; }
.brand-name { display: block; font-size: 14px; font-weight: 700; letter-spacing: .1em; line-height: 1.1; }
.brand-agent { display: block; margin: 2px 0 0; color: var(--muted); font-size: 11px; font-weight: 500; letter-spacing: 0; }
nav { gap: 2px; }
.nav-item { gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; background: none; box-shadow: none; text-align: left; transition: background-color .14s ease, color .14s ease; }
.nav-item:hover { color: var(--text); background: rgba(255, 255, 255, .045); border-color: transparent; }
.nav-item.active { color: var(--text); background: rgba(255, 255, 255, .08); background-image: none; border-color: transparent; box-shadow: none; font-weight: 600; }
.nav-item .ico { flex: none; width: 18px; height: 18px; display: grid; place-items: center; color: currentColor; }
.nav-item .ico svg { width: 16px; height: 16px; display: block; }
.nav-item.active .ico { color: var(--text); }
.badge { margin-left: auto; min-width: 20px; text-align: center; background: rgba(255, 255, 255, .1); color: var(--text); font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 99px; }
.client { background: transparent; border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 0; }
.client > div:last-child { min-width: 0; }
.client b, .client small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { background: #26262b; background-image: none; color: var(--text); border-radius: 8px; flex: none; }

.main { max-width: none; width: 100%; padding: 30px 36px 64px; }
.topbar { margin-bottom: 24px; align-items: center; }
.topbar h2 { font-size: 24px; font-weight: 650; letter-spacing: -.025em; line-height: 1.2; }
.topbar .muted { margin-top: 4px; font-size: 14px; }
.topbar-actions .btn, #runBtn { box-shadow: none; }
.time-chip { color: var(--green); border: 1px solid var(--line); background: transparent; font-weight: 550; padding: 0 12px; min-height: 32px; display: inline-flex; align-items: center; border-radius: 99px; font-size: 13px; }

/* Cartes, panneaux, chiffres */
.kpi, .panel, .col, .crm-table, .cal-day, .welcome-steps div { background: var(--card); background-image: none; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; }
.kpis { gap: 12px; margin-bottom: 16px; }
.kpi, #view-today .kpi { padding: 16px 18px; min-height: 0; overflow: visible; }
.kpi small, #view-today .kpi small { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi b { font-size: 28px; font-weight: 650; letter-spacing: -.03em; line-height: 1.2; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--faint); font-size: 12px; }
.kpi.accent { background: var(--card); background-image: none; border-color: var(--line); }
.panel { padding: 18px 20px; }
.panel-head { margin-bottom: 14px; }
.panel-head h3 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.settings-stack, .today-grid { gap: 16px; }
.banner { border-radius: 10px; background: rgba(245, 184, 75, .08); border: 1px solid rgba(245, 184, 75, .3); color: #f3cf8a; }
.banner.warn { background: rgba(242, 109, 109, .08); border-color: rgba(242, 109, 109, .3); color: #f3a3a3; }

/* Accueil */
.today-brief { background: var(--card); background-image: none; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 22px 24px 18px; }
.today-kicker { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.today-brief h3 { font-size: 22px; letter-spacing: -.02em; margin: 8px 0 6px; }
.today-brief-copy > p { color: var(--muted); font-size: 14px; }
.today-brief-side { background: transparent; border: 1px solid var(--line); border-radius: 10px; }
.today-brief-side small { color: var(--muted); font-size: 12px; }
.today-brief-side b { font-size: 13px; }
.today-orb { background: rgba(62, 207, 142, .12); background-image: none; color: var(--green); box-shadow: none; border-radius: 9px; }
.today-flow { border-top: 1px solid var(--line); }
.today-flow i { background: rgba(255, 255, 255, .07); color: var(--text); font-style: normal; }
.today-flow small { color: var(--muted); }
.signal, #view-today .signal { background: transparent; background-image: none; border: 1px solid var(--line); border-radius: 10px; transition: background-color .14s ease, border-color .14s ease; }
.signal:hover, #view-today .signal:hover { background: rgba(255, 255, 255, .03); border-color: var(--line-strong); transform: none; }
.signal.active, #view-today .signal.active { background: rgba(255, 255, 255, .05); background-image: none; border-color: var(--line-strong); box-shadow: inset 2px 0 0 var(--accent); }
.signal-main span { color: #c9c9d0; }
.score { background: rgba(62, 207, 142, .1); color: var(--green); border-radius: 9px; font-variant-numeric: tabular-nums; }

/* Étiquettes */
.tag, .pill { background: rgba(255, 255, 255, .07); color: var(--text); font-weight: 550; }
.chip { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { background: rgba(255, 255, 255, .08); border-color: var(--line-strong); color: var(--text); }

/* Fenêtres et messages */
.modal { background: rgba(0, 0, 0, .66); backdrop-filter: blur(6px); }
.modal-card { background: var(--card2); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop); }
.modal-card p, .modal-card li, .modal-card small, .modal-card label { color: inherit; }
.modal-card .muted, .modal-card small { color: var(--muted); }
.modal-close { color: var(--muted); }
.modal-close:hover { color: var(--text); }
.toast { background: var(--text); color: #0c0c0e; border-radius: 10px; box-shadow: var(--pop); }
.tour-card { background: var(--card2); border: 1px solid var(--line-strong); box-shadow: var(--pop); }

/* Connexion */
.welcome-card, .auth-card { max-width: 420px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; }
.auth-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.auth-brand .brand-mark svg { width: 19px; height: 19px; }
.auth-brand .brand-name { font-size: 17px; }
.lead { color: var(--muted); }

/* Espaces clients */
.ws-avatar { background: #26262b; background-image: none; color: var(--text); }
.ws-card { background: var(--card); }
.ws-card:hover { border-color: var(--line-strong); }
.ws-step.ok { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, .06); }

/* Téléphone */
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { display: none; }
  .brand { padding: 0 6px 0 2px; }
  .brand-agent { display: none; }
  nav { flex-direction: row; gap: 2px; }
  .nav-item { white-space: nowrap; padding: 8px 10px; }
  .main { padding: 20px 16px 40px; }
  .topbar h2 { font-size: 21px; }
  .panel { padding: 16px; }
  .kpi b { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Rythme vertical : 16 px entre tous les blocs d'un écran, sans marges particulières */
.view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.view > * { margin-top: 0 !important; margin-bottom: 0 !important; min-width: 0; }
.pilot-grid, .report-grid, .kpis, .ap-kpis { gap: 12px; margin: 0; }
.today-grid { align-items: start; }
.today-grid .panel { min-height: 0; }
.settings-stack { max-width: none; }
.ap-kpis .kpi b, .ap-kpis .kpi.accent b { font-size: 24px; }
textarea.message, textarea.input { field-sizing: content; min-height: 96px; max-height: 460px; line-height: 1.55; resize: vertical; }
.li-compose textarea, .li-compose textarea.input { min-height: 44px; max-height: 200px; resize: none; }

/* Messagerie */
.li-msg { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; }
.li-msg.mine { background: rgba(122, 162, 255, .13); border-color: rgba(122, 162, 255, .22); }
.li-msg small { color: var(--muted); }

/* Résultats : deux panneaux côte à côte, puis l'activité sur toute la largeur */
.results-grid { align-items: start; }
.results-grid > .results-volt { order: 1; }
.gain-row { border-bottom: 1px solid var(--line); padding: 11px 0; }
.gain-row:last-of-type { border-bottom: 0; }
.gain-row b { color: var(--text); font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.volt-activity li { border-top: 1px solid var(--line); }

/* Suivi : les cinq étapes sur une seule ligne quand la place le permet */
@media (min-width: 1180px) { .kanban { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.kanban .col { padding: 12px; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; }

/* Contrôles natifs (cases à cocher, listes, barres de défilement) en sombre */
:root { color-scheme: dark; }
.kpi > span { display: block; }
.kpi > span span { display: inline; }

/* Conversation sur téléphone : le nom garde sa place, les boutons passent dessous s'il le faut */
@media (max-width: 820px) {
  .li-head { flex-wrap: wrap; row-gap: 8px; }
  .li-head div { flex: 1 1 150px; }
  .li-head .btn, .li-head a.btn { flex: 0 0 auto; }
}

/* Très petits écrans : le badge de contrôle passe à la ligne au lieu de dépasser */
.ws-iso { white-space: normal; border-radius: 12px; line-height: 1.35; }

/* Pleine largeur : chaque page occupe tout l'écran, les formulaires se répartissent au lieu de s'étirer */
.panel > p.muted:not(:last-child) { margin-bottom: 14px; }
.link-box { margin-bottom: 12px; }
.form { align-items: end; }
.ws-grid { grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.results-grid { align-items: stretch; }
.li-auto { flex: 1 1 auto; }
.li-limit { margin-left: auto; }
@media (min-width: 1400px) {
  .ap-limits { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-flow: dense; }
  .ap-limits > label:nth-of-type(-n+2) { grid-column: span 2; }
}

/* Publications du jour : le sujet du jour sous la rubrique */
.ap-slots li small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }

/* Pistes : mode détecté pour chaque conversation (confrère, prospect, sortie élégante, hors cible) et raison */
.ap-leads li .lvl { vertical-align: 1px; margin-left: 2px; }
.ap-leads li small.mode-why { color: var(--faint); font-size: 12px; }

/* ------------------------------------------------------------------ Refonte : Aujourd'hui, Agenda, Messagerie en grand */
/* Aujourd'hui : tuiles cliquables, rendez-vous et choses à traiter côte à côte */
.kpi-link { text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%; transition: border-color .15s, background-color .15s; }
.kpi-link:hover { border-color: var(--line-strong); background: var(--card2); }
.kpi-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.today-kpis .kpi.accent b { color: var(--violet2); }
.today-top { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; margin: 16px 0; }
.agd-mini, .todo-mini, .agd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.todo-mini li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg2); font-size: 14px; }
.todo-mini li span { min-width: 0; }
.todo-mini li small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-mini li .badge { margin-left: 6px; font-style: normal; }
.agd-mini li.muted, .todo-mini li.muted { display: block; background: none; border: 0; padding: 4px 0; font-size: 13.5px; }

/* Agenda */
.agd-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.agd-bar .crm-tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.agd-form { margin-bottom: 16px; }
.agd-form .row-actions { justify-content: flex-end; align-items: center; gap: 10px; margin-top: 12px; }
.agd-form .row-actions .muted { margin-right: auto; }
.agd-group { margin-bottom: 16px; }
.agd-group h4 { margin: 0 0 12px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.agd-group h4 small { color: var(--muted); font-weight: 500; }
.agd-group.today { border-color: rgba(122, 162, 255, .35); }
.agd-item { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg2); }
.agd-item.undated { border-style: dashed; }
.agd-time b { display: block; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.agd-time small, .agd-who small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.agd-who b { display: block; font-size: 15px; }
.agd-sum { margin: 6px 0 0; color: #c9c9d1; font-size: 13.5px; line-height: 1.5; }
.agd-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.agd-mini .agd-item { grid-template-columns: 130px minmax(0, 1fr) auto; padding: 10px 12px; }
.agd-past summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.agd-past .agd-list { margin-top: 12px; opacity: .8; }
.cal-day .agd-item { grid-template-columns: 1fr; gap: 6px; padding: 10px; }
.cal-day .agd-act { justify-content: flex-start; }
#navAgenda { background: var(--accent-soft); color: var(--violet2); }

/* Messagerie : boîte de réception en premier, sur toute la hauteur, textes plus grands */
#view-linkedin .li-inbox { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); margin-bottom: 12px; }
#view-linkedin .li-list-head { padding: 12px; }
#view-linkedin .li-list-head .input { padding: 10px 14px; font-size: 14.5px; }
#view-linkedin .li-chat { padding: 14px 16px; gap: 12px; }
#view-linkedin .li-av { width: 46px; height: 46px; font-size: 15px; }
#view-linkedin .li-chat b { font-size: 15.5px; }
#view-linkedin .li-chat small { font-size: 13.5px; }
#view-linkedin .li-chat > div:last-child { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.li-rdv { display: inline-block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: var(--green); border: 1px solid rgba(62, 207, 142, .35); border-radius: 99px; padding: 1px 8px; }
#view-linkedin .li-head { min-height: 72px; padding: 14px 18px; gap: 12px; }
#view-linkedin .li-head b { font-size: 16.5px; }
#view-linkedin .li-head small { font-size: 13px; }
#view-linkedin .li-msgs { padding: 20px 24px; gap: 10px; }
#view-linkedin .li-msg { font-size: 15.5px; line-height: 1.55; padding: 11px 15px; max-width: min(72%, 680px); }
#view-linkedin .li-msg small { font-size: 12px; }
#view-linkedin .li-compose { padding: 14px 18px; }
#view-linkedin .li-compose textarea { font-size: 15px; min-height: 52px; }
#view-linkedin .li-bar { margin-bottom: 12px; }
.li-thread-note { flex-shrink: 0; padding: 8px 18px; font-size: 12.5px; color: #fde68a; background: rgba(251, 191, 36, .08); border-bottom: 1px solid rgba(251, 191, 36, .25); }
#liStale { margin-bottom: 12px; }

@media (max-width: 1100px) {
  .today-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .agd-item, .agd-mini .agd-item { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .agd-act { justify-content: flex-start; }
  .agd-bar .crm-tools { margin-left: 0; width: 100%; }
  #view-linkedin .li-inbox { grid-template-columns: minmax(0, 1fr); }
  #view-linkedin .li-msg { max-width: 88%; font-size: 15px; }
}

/* Bilan */
.bl-kpis { margin-bottom: 16px; }
.bl-kpis .kpi.accent b { color: var(--violet2); }
.bl-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.bl-note { display: block; color: var(--faint); font-size: 12px; margin-top: 1px; }
.bl-sub { margin-top: 18px; }
#view-bilan > #blBody > .panel { margin-bottom: 16px; }
.bl-table td small { display: block; color: var(--muted); font-size: 12px; }
.bl-table td .btn { margin-left: 6px; }
.bl-notes { margin-top: 4px; }
@media (max-width: 1000px) { .bl-grid { grid-template-columns: minmax(0, 1fr); } }
.pause-banner:not(.hidden) { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Aujourd'hui, « À traiter » : sur téléphone, le bouton passe sous le texte au lieu de dépasser */
#view-today .panel, #todayTodo, #todayMeetings { min-width: 0; }
#todayTodo li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
#todayTodo li > span { flex: 1 1 160px; min-width: 0; }
