/* 360Sharing CRM — feuille de style (aucune dépendance, charte 360Sharing) */

/* ---------- Polices du site (Inter + Poppins), servies depuis le serveur ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/poppins-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 800; font-display: swap; src: url('../fonts/poppins-latin-800-normal.woff2') format('woff2'); }

/* ---------- Thème clair (couleurs du site 360sharing.fr) ---------- */
:root {
  --bg: #F2F6F7;
  --surface: #FFFFFF;
  --surface-2: #F7FAFB;
  --column: #E7EEF0;
  --line: #E2EAED;
  --line-strong: #CBD8DD;
  --ink: #0B3C5D;
  --ink-2: #37546B;
  --muted: #5A7484;
  --accent: #00A99B;
  --accent-hover: #018E83;
  --accent-soft: #E2F6F3;
  --accent-2: #E1347C;
  --accent-2-soft: #FCE7F0;
  --grad: linear-gradient(90deg, #00B8A9 0%, #E1347C 100%);
  --grad-glow: 0 2px 12px rgba(0, 184, 169, .32);
  --nav: #0B3C5D;
  --nav-2: #14547E;
  --nav-text: #A9C6D6;
  --focus: #007D73;
  --critical: #C4302B;
  --critical-soft: #FDECEA;
  --warning: #9A6200;
  --warning-soft: #FFF4DB;
  --good: #0E8F6F;
  --good-soft: #E3F5EF;
  --bar: #0E9A8E;
  --bar-hover: #007D73;
  --c0: #5A7484; --c1: #00A99B; --c2: #D4531E; --c3: #1F8F4E; --c4: #2F6FE0;
  --c5: #B07000; --c6: #E1347C; --c7: #7A5AF8; --c8: #C43D3D;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 60, 93, .06), 0 1px 3px rgba(11, 60, 93, .05);
  --shadow-lg: 0 18px 48px rgba(11, 60, 93, .20);
  --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-title: 'Poppins', var(--font);
  color-scheme: light;
}

/* ---------- Thème sombre ---------- */
:root[data-theme="dark"] {
  --bg: #081A24;
  --surface: #10222E;
  --surface-2: #162C3A;
  --column: #0C1F2B;
  --line: #1E3747;
  --line-strong: #2C4A5C;
  --ink: #EAF2F5;
  --ink-2: #C3D6DE;
  --muted: #8CA8B6;
  --accent: #22BDAE;
  --accent-hover: #46D0C1;
  --accent-soft: #113740;
  --accent-2: #FF5E9E;
  --accent-2-soft: #3A1B2A;
  --grad: linear-gradient(90deg, #00B8A9 0%, #E1347C 100%);
  --grad-glow: 0 2px 14px rgba(0, 184, 169, .28);
  --nav: #0A2A3C;
  --nav-2: #16465F;
  --nav-text: #A6C3D1;
  --focus: #46D0C1;
  --critical: #FF7B72;
  --critical-soft: #34191A;
  --warning: #E3A93B;
  --warning-soft: #33280F;
  --good: #3FC79E;
  --good-soft: #10302A;
  --bar: #35C7BA;
  --bar-hover: #5FE0D3;
  --c0: #7C98A9; --c1: #46D0C1; --c2: #FF7846; --c3: #4BB570; --c4: #5195FF;
  --c5: #D89439; --c6: #FF5EA0; --c7: #9C81FF; --c8: #F0635F;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .3);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[v-cloak] { display: none; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-family: var(--font-title); }
h1 { font-size: 25px; font-weight: 700; letter-spacing: -.02em; }
h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* Les zones qui défilent contiennent leurs éléments positionnés (sinon ils agrandissent la page) */
.board, .cards, .table-wrap, .dialog-body, .palette-results, .avatar, .tag, .shot { position: relative; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 8px; }
.between { justify-content: space-between; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ---------- Mise en page ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar { background: var(--nav); color: var(--nav-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 16px 12px; gap: 4px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 8px 20px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
/* Logo officiel : version couleur sur fond clair, version blanche sur fond sombre */
.logo-wrap { display: block; height: 38px; }
.logo-wrap img { height: 100%; width: auto; display: block; }
.logo-wrap .logo-white { display: none; }
:root[data-theme="dark"] .logo-wrap .logo-color { display: none; }
:root[data-theme="dark"] .logo-wrap .logo-white { display: block; }
.logo-wrap.on-dark .logo-color { display: none; }
.logo-wrap.on-dark .logo-white { display: block; }
.brand-sub { font-family: var(--font-title); font-weight: 600; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--nav-text); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: -.02em; color: #fff; }
.brand-name { font-family: var(--font-title); font-weight: 700; font-size: 15px; line-height: 1.15; }
.brand-name small { display: block; font-family: var(--font); font-weight: 500; font-size: 12px; color: var(--muted); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--nav-text); text-decoration: none; font-weight: 550; position: relative; }
.nav-link:hover { background: var(--nav-2); color: #fff; }
.nav-link.active { background: var(--nav-2); color: #fff; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--grad); }
.nav-link .badge { margin-left: auto; }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 4px; }
.nav-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.search-trigger { flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--muted); cursor: text; text-align: left; }
.search-trigger kbd { margin-left: auto; }
.search-trigger, .search-trigger > span { min-width: 0; }
.tabbar a { min-width: 0; }
kbd { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.page { padding: 24px 28px 48px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.mobile-bar, .tabbar { display: none; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; min-height: 36px; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--grad-glow); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: 0 4px 18px rgba(0, 184, 169, .45); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--accent-soft); border-color: transparent; }
.btn.danger { color: var(--critical); }
.btn.danger:hover { background: var(--critical-soft); border-color: var(--critical); color: var(--critical); }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: 13px; }
.btn.icon { padding: 7px; min-width: 36px; }
.btn.sm.icon { padding: 5px; min-width: 30px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--ink); color: var(--surface); }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); color: var(--ink); min-height: 36px; }
.textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.filters .input, .filters .select { width: auto; min-width: 150px; }
.filters .search-input { min-width: 220px; flex: 1; max-width: 340px; }
.filters-more { display: contents; }
.filters-toggle, .show-sm, .show-sm-inline { display: none !important; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: 13px; cursor: pointer; font-weight: 550; }
.chip:hover { background: var(--accent-soft); border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Cartes, badges ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-body { padding: 14px 18px; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent-2); color: #fff; }
.badge.soft { background: rgba(255,255,255,.14); color: #fff; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; max-width: 100%; }
.tag .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tag.stage { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink-2); }
.tag.won { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); color: var(--good); }
.tag.lost { background: #F1EFEB; color: var(--muted); }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 650; padding: 2px 7px; border-radius: 6px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.due.late { background: var(--critical-soft); color: var(--critical); border-color: color-mix(in srgb, var(--critical) 35%, transparent); }
.due.today { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 40%, transparent); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; letter-spacing: -.02em; }
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }
.avatar.none { background: var(--line-strong); color: var(--ink-2); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty > svg { color: var(--line-strong); margin-bottom: 8px; }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.alert { border-radius: 10px; padding: 10px 14px; border: 1px solid; font-size: 13px; }
.alert.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); }
.alert.warn { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 40%, transparent); color: var(--warning); }
.alert.error { background: var(--critical-soft); border-color: color-mix(in srgb, var(--critical) 35%, transparent); color: var(--critical); }
.alert.ok { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 35%, transparent); color: var(--good); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th { text-align: left; font-weight: 650; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--ink); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: var(--accent-soft); }
table.data td.num, table.data th.num { text-align: right; }

/* ---------- Tableau de bord ---------- */
.kpis { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi .value { font-family: var(--font-title); font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi.hero .value { font-size: 40px; font-weight: 800; }
.kpi .sub { font-size: 12.5px; color: var(--muted); }
.kpi.alertish .value { color: var(--critical); }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.dash-grid.two { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr; align-items: center; gap: 10px; position: relative; }
.bar-row .bar-label { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar { height: 14px; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 2px; transition: width .3s ease; }
.bar-row:hover .bar, .bar-row:focus-within .bar { background: var(--bar-hover); }
.bar-value { font-size: 12.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-row .tip { position: absolute; left: 38%; top: -34px; background: var(--ink); color: var(--surface); font-size: 12px; padding: 5px 9px; border-radius: 7px; white-space: nowrap; pointer-events: none; opacity: 0; transform: translateY(4px); transition: .12s; z-index: 5; }
.bar-row:hover .tip, .bar-row:focus-within .tip { opacity: 1; transform: none; }
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; }
.list-item.click:hover { background: var(--accent-soft); }

/* ---------- Pipeline ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; min-height: 60vh; scroll-snap-type: x proximity; }
.column { flex: 0 0 272px; background: var(--column); border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 210px); scroll-snap-align: start; }
.column-head { padding: 10px 12px 8px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); }
.column-head .name { font-weight: 700; font-size: 13.5px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.column-head .meta { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.column-head .prob { font-size: 11.5px; font-weight: 650; color: var(--muted); background: var(--surface); padding: 1px 7px; border-radius: 999px; }
.column.won .column-head { box-shadow: inset 0 3px 0 var(--good); border-radius: 14px 14px 0 0; }
.column.lost .column-head { box-shadow: inset 0 3px 0 var(--muted); border-radius: 14px 14px 0 0; }
.cards { padding: 8px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 80px; flex: 1; }
.deal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; box-shadow: var(--shadow); cursor: grab; display: flex; flex-direction: column; gap: 6px; }
.deal-card:hover { border-color: var(--line-strong); }
.deal-card .company { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.deal-card .amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.deal-card .foot { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.deal-card .next { font-size: 12px; color: var(--ink-2); display: flex; gap: 6px; align-items: flex-start; }
.deal-card .next.none { color: var(--critical); font-weight: 600; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: var(--shadow-lg); cursor: grabbing; }
.column-add { margin: 0 8px 8px; }

/* ---------- Relances ---------- */
.task-group { margin-bottom: 18px; }
.task-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.task-group h3.late { color: var(--critical); }
.task-row { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
.task-row:first-of-type { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.task-row:last-of-type { border-bottom: 0; }
.task-title { font-weight: 600; }
.task-sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.done-btn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: transparent; padding: 0; }
.done-btn:hover { border-color: var(--good); color: var(--good); }

/* ---------- Fiche société ---------- */
.company-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 18px; }
.company-title { display: flex; flex-direction: column; gap: 8px; }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: 13.5px; }
.meta-line span, .meta-line a { display: inline-flex; align-items: center; gap: 6px; }
.company-grid { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: start; }
.contact-card { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.contact-card:last-child { border-bottom: 0; }
.contact-links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.contact-links a { display: inline-flex; align-items: center; gap: 5px; }
.deal-line { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 18px; border-bottom: 1px solid var(--line); cursor: pointer; }
.deal-line:hover { background: var(--accent-soft); }
.deal-line:last-child { border-bottom: 0; }
.timeline { display: flex; flex-direction: column; }
.tl-item { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }
.tl-item.sys .tl-icon { background: transparent; border-style: dashed; color: var(--muted); }
.tl-item.sys .tl-text { color: var(--ink-2); font-size: 13px; }
.tl-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; display: flex; gap: 8px; align-items: center; }
.composer { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
details.raw summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-2); }

/* ---------- Fenêtres ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 22, 40, .45); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fade .15s ease; }
.overlay.drawer-overlay { justify-content: flex-end; padding: 0; align-items: stretch; overflow: hidden; }
.dialog { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; display: flex; flex-direction: column; max-height: 88vh; animation: rise .18s ease; }
.dialog.wide { max-width: 760px; }
.dialog.narrow { max-width: 420px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dialog-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.dialog-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
.drawer { background: var(--surface); width: min(620px, 100vw); height: 100vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .2s ease; }
.drawer .dialog-body { flex: 1; }
.drawer .dialog-foot { border-radius: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }

/* Palette de recherche */
.palette { max-width: 640px; }
.palette input { border: 0; padding: 16px 18px; font-size: 16px; width: 100%; border-bottom: 1px solid var(--line); background: transparent; }
.palette input:focus { outline: none; }
.palette-results { max-height: 60vh; overflow-y: auto; padding: 6px 0; }
.palette-group { padding: 8px 18px 4px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 9px 18px; cursor: pointer; }
.palette-item.on, .palette-item:hover { background: var(--accent-soft); }

/* Entité recherchable */
.picker { position: relative; }
.picker-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; }
.picker-item { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.picker-item:hover, .picker-item.on { background: var(--accent-soft); }

/* Notifications */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { background: var(--nav); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; font-weight: 550; animation: rise .18s ease; }
.toast.error { background: #96231D; }
.toast button { background: rgba(255,255,255,.14); border: 0; color: #fff; padding: 4px 10px; border-radius: 7px; cursor: pointer; font-weight: 650; }

/* Scanner */
.scan-grid { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 16px; align-items: start; }
.shot { border: 2px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); min-height: 150px; display: grid; place-items: center; text-align: center; padding: 14px; cursor: pointer; position: relative; }
.shot:hover { border-color: var(--accent); }
.shot img { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; }
.shot-tools { display: flex; gap: 6px; justify-content: center; margin-top: 8px; }
.progress { height: 8px; background: var(--column); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--bar); transition: width .2s; }

/* Import */
.map-table td { padding: 6px 8px; }
.map-table .select { min-width: 190px; }
.preview-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 12.5px; }

/* Réglages */
.settings-row { display: grid; grid-template-columns: 28px 1fr 110px 150px 36px; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.settings-row.offer { grid-template-columns: 28px 1fr 130px 130px 90px 36px; }
.handle { cursor: grab; color: var(--muted); display: grid; place-items: center; }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--ink); }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 18% 12%, #14547E 0, #0B3C5D 52%, #072B43 100%); }
.login-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login-card .brand { color: var(--ink); padding: 0 0 4px; align-items: center; align-self: center; }
.login-card .logo-wrap { height: 54px; }
.boot .logo-wrap { height: 46px; }
.login-card .brand-sub { color: var(--muted); }

/* Aide */
.help h3 { margin: 6px 0 6px; }
.help ul { margin: 0; padding-left: 18px; }
.help li { margin: 3px 0; }
.shortcuts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; }
.shortcuts > span { min-width: 0; }
.dialog, .drawer { min-width: 0; }


/* ---------- Compléments (écrans) ---------- */
.page-wide { max-width: none; }
main:focus { outline: none; }
.strong { font-weight: 650; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--column); color: var(--ink-2); font-size: 12px; font-weight: 700; vertical-align: 1px; }
.task-group h3 .count { margin-left: 2px; }
.link-btn { border: 0; background: none; padding: 0; margin: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; max-width: 100%; }
.link-btn:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.link-btn.task-title { font-weight: 600; display: block; }
.select.sm, .input.sm { min-height: 30px; padding: 4px 8px; font-size: 13px; width: auto; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.back-link:hover { color: var(--accent); }
.kpi[role=link]:hover { border-color: var(--line-strong); box-shadow: 0 4px 14px rgba(22,33,58,.08); }
.small-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 0; }
.small-kpis .kpi .value { font-size: 22px; }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 10px 14px; font-weight: 650; }
.skip-link:focus { top: 12px; }
button.nav-link { width: 100%; border: 0; background: none; cursor: pointer; text-align: left; font: inherit; font-weight: 550; }
.nav-link.sm { padding: 7px 10px; font-size: 13px; }
.nav-user { display: flex; align-items: center; gap: 8px; padding: 12px 4px 2px 8px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 6px; color: var(--nav-text); }
.nav-user-name { color: #fff; font-weight: 650; font-size: 13px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-user .tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-acts { display: flex; gap: 2px; padding: 0 2px 0 4px; }
.tl-company { font-weight: 650; color: var(--ink); min-width: 0; flex: 1; }
.tl-foot { margin: 4px 0 0; }
.toasts.lifted { bottom: 108px; }
.dash-grid.two { align-items: start; }
.nav-icon { color: var(--nav-text); min-width: 34px; min-height: 34px; padding: 6px; }
.nav-icon:hover { background: var(--nav-2); color: #fff; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; animation: rise .12s ease; }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-weight: 550; text-align: left; color: var(--ink); }
.menu-item:hover, .menu-item:focus-visible { background: var(--accent-soft); outline: none; }
.field > span.hint { font-weight: 400; }
.column-head .prob { white-space: nowrap; flex: none; }
.bar-row .bar-label .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bar-value.zero { color: var(--muted); font-weight: 500; }
.bar-row.stacked { grid-template-columns: 1fr; gap: 4px; }
.bar-row .tip { white-space: normal; max-width: 62%; width: max-content; }
.bar-row.stacked .tip { left: 0; top: -30px; max-width: 100%; }
.task-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.deal-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.deal-card .company { min-width: 0; overflow-wrap: anywhere; }
.column-empty { margin: 4px 0; padding: 14px 8px; text-align: center; font-size: 12.5px; color: var(--muted); border: 1.5px dashed color-mix(in srgb, var(--ink) 16%, transparent); border-radius: 12px; }
.cards .deal-card ~ .column-empty { display: none; }
.dropbar { position: fixed; left: 232px; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--nav) 94%, transparent); transform: translateY(110%); transition: transform .18s ease; pointer-events: none; }
.dropbar.on { transform: none; pointer-events: auto; }
.drop { min-height: 64px; border-radius: 12px; border: 2px dashed rgba(255,255,255,.45); display: flex; align-items: center; justify-content: center; gap: 8px; color: #fff; font-weight: 700; font-size: 15px; overflow: hidden; }
.drop .deal-card { display: none !important; }
.drop.won { background: rgba(15,123,63,.35); }
.drop.lost { background: rgba(255,255,255,.08); }
.drop.won:has(.sortable-ghost) { background: var(--good); border-style: solid; }
.drop.lost:has(.sortable-ghost) { background: #5B6170; border-style: solid; }
.shot.filled { padding: 8px; border-style: solid; background: #fff; }
.progress.indeterminate > div { animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.dropzone { border: 2px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; color: var(--muted); }
.dropzone strong { color: var(--ink); font-size: 15px; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.settings-row.head { font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom-color: var(--line-strong); }
.settings-row .input, .settings-row .select { min-height: 34px; }
.settings-row.offer { grid-template-columns: 28px 1fr 120px 206px 84px 36px; }
button.handle { border: 0; background: none; padding: 4px; border-radius: 6px; }
button.handle:hover { background: var(--column); color: var(--ink); }
.savebar { position: sticky; bottom: 12px; z-index: 30; display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: var(--nav); color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; }
.savebar .btn:not(.primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
pre.code, code { font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; }
pre.code { margin: 0; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); overflow-x: auto; }
tr.inactive td { opacity: .6; }
.alert.row { display: flex; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi.hero { grid-column: 1 / -1; }
  .dash-grid, .dash-grid.two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 70; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { position: fixed; inset: 0; background: rgba(15,22,40,.4); z-index: 65; }
  .topbar { padding: 10px 16px; }
  .mobile-bar { display: inline-flex; }
  .page { padding: 16px 16px 96px; }
  .company-grid, .scan-grid { grid-template-columns: minmax(0, 1fr); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 0; position: relative; }
  .tabbar a.active { color: var(--accent); }
  .tabbar .badge { position: absolute; top: 0; left: 55%; height: 17px; min-width: 17px; font-size: 10.5px; }
  .toasts { bottom: 84px; }
  .column { flex-basis: 84vw; max-height: calc(100vh - 250px); }
  .hide-md { display: none !important; }
  .dropbar { left: 0; }
  .savebar { bottom: 76px; }
  .small-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  h1 { font-size: 21px; }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .kpi .value { font-size: 21px; }
  .kpi.hero .value { font-size: 32px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .overlay { padding: 0; align-items: stretch; }
  .dialog { max-width: none; max-height: none; min-height: 100vh; border-radius: 0; }
  .dialog-foot { border-radius: 0; position: sticky; bottom: 0; }
  .task-row { grid-template-columns: auto 1fr auto; }
  .task-row .hide-sm { display: none; }
  .filters .input, .filters .select { min-width: 0; flex: 1 1 140px; }
  .search-trigger kbd { display: none; }
  .settings-row, .settings-row.offer { grid-template-columns: 24px 1fr 80px 36px; }
  .settings-row .hide-sm { display: none; }
  .hide-sm { display: none !important; }
  .shortcuts { grid-template-columns: 1fr; gap: 2px; }
  .filters { flex-wrap: wrap; }
  .filters .search-input { min-width: 0; max-width: none; flex: 1 1 160px; }
  .filters-toggle { display: inline-flex !important; }
  .filters-more { display: none; }
  .filters.open .filters-more { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .show-sm { display: flex !important; }
  .show-sm-inline { display: inline !important; }
  table.data td.cell-main { width: 100%; max-width: 0 !important; }
  .shortcuts > span:nth-child(odd) { margin-top: 8px; }
  .task-row .task-actions { grid-column: 2 / -1; }
  .small-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .company-head h1 { font-size: 20px; }
  .deal-line { padding: 12px 14px; }
  .topbar .btn.primary { padding: 7px 10px; }
}
@media print {
  .sidebar, .topbar, .tabbar, .toasts { display: none !important; }
  .shell { display: block; }
}
