/* Iris by Solvia : charte Solvia (or sur noir, Inter + Poppins) */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-v20.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('/fonts/poppins-latin-400-v21.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #0f0f0f;
  --panel: #141414;
  --card: #1a1a1a;
  --card-2: #212121;
  --hover: #262626;
  --border: #2e2e2e;
  --border-2: #3a3a3a;
  --text: #fafafa;
  --text-2: #d6d6d6;
  --muted: #a3a3a3;
  --gold: #e4b444;
  --gold-light: #f5d36a;
  --gold-deep: #c8871e;
  --gold-ink: #2c2410;
  --gold-soft: rgba(228, 180, 68, .12);
  --gold-grad: linear-gradient(135deg, #f5d36a 0%, #e4b444 45%, #c8871e 100%);
  --red: #ef6b5b;
  --red-soft: rgba(239, 107, 91, .14);
  --green: #6cc08b;
  --blue: #5b9bd5;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45), 0 4px 14px rgba(0, 0, 0, .3);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Poppins', 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-light); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: -.01em; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; margin: 10px 0 0; }
.strong { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.grow { flex: 1; }
.gold-t { color: var(--gold); }
.warn { color: var(--red); }
[hidden] { display: none !important; }
::selection { background: rgba(228, 180, 68, .35); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Marque */
.brand-word { font-family: var(--display); font-size: 30px; line-height: 1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .02em; }
.brand-word.big { font-size: 64px; }
.by { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.boot { min-height: 100vh; display: grid; place-items: center; text-align: center; color: var(--muted); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--card-2); color: var(--text); font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--hover); border-color: #4a4a4a; color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--gold-grad); border-color: transparent; color: var(--gold-ink); box-shadow: 0 6px 20px rgba(228, 180, 68, .22); }
.btn.primary:hover { filter: brightness(1.06); color: var(--gold-ink); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--card-2); }
.btn.danger { background: var(--red); border-color: transparent; color: #fff; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; height: 44px; }
.danger-text { color: var(--red) !important; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--card-2); color: var(--text); }
.icon-btn.xs { width: 24px; height: 24px; border-radius: 6px; }
.icon-btn.xs .ic { width: 14px; height: 14px; }
.icon-btn:disabled { opacity: .3; cursor: default; }
.chip-btn { border: 1px solid var(--border-2); background: transparent; border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--text-2); }
.chip-btn:hover { border-color: var(--gold); color: var(--gold-light); }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.row-gap.end { justify-content: flex-end; }
.row-gap.center { justify-content: center; }
.col-gap { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }

/* Champs */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.field .lbl { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field .lbl b { color: var(--gold); font-weight: 600; }
.field.invalid input, .field.invalid select { border-color: var(--red); }
.hint { color: var(--muted); font-size: 11.5px; }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select, textarea {
  width: 100%; height: 40px; padding: 0 12px; background: #111; border: 1px solid var(--border-2); border-radius: var(--radius-sm); outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 70px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(228, 180, 68, .15); }
input:disabled, select:disabled { opacity: .5; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' 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; background-size: 16px; cursor: pointer; }
input[type=color] { width: 54px; height: 36px; padding: 2px; border: 1px solid var(--border-2); border-radius: 8px; background: #111; cursor: pointer; }
input[type=date], input[type=time] { color-scheme: dark; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--gold); margin: 0; }
.field > .check { margin-top: 26px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; margin-top: 16px; }
.span2 { grid-column: 1 / -1; }

/* Authentification */
.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(ellipse at 20% 0%, rgba(245, 211, 106, .12), transparent 55%), radial-gradient(ellipse at 100% 100%, rgba(200, 135, 30, .10), transparent 50%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 36px 30px 30px; box-shadow: var(--shadow); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.auth-sub { text-align: center; color: var(--muted); margin: 14px 0 26px; }
.auth-error { color: var(--red); min-height: 20px; margin: 0 0 10px; font-size: 13px; }

/* Coquille */
.shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 12px 12px; z-index: 30; }
.logo { display: flex; flex-direction: column; gap: 5px; padding: 4px 12px 22px; }
.logo:hover { color: inherit; }
#nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
#nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; position: relative; }
#nav a:hover { background: var(--card-2); color: var(--text); }
#nav a.active { background: var(--gold-soft); color: var(--gold-light); }
#nav a.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--gold); }
.badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px; }
.side-foot { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--border); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; flex: 1; padding: 6px 8px; border-radius: 10px; min-width: 0; }
.me:hover { background: var(--card-2); color: inherit; }
.me span:last-child { display: flex; flex-direction: column; min-width: 0; }
.me b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--muted); font-size: 11.5px; }
.main { flex: 1; margin-left: 232px; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 28px; background: rgba(15, 15, 15, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.burger { display: none; }
.search { position: relative; margin-left: auto; width: min(380px, 40vw); }
.search > .ic { position: absolute; left: 12px; top: 11px; color: var(--muted); width: 17px; height: 17px; }
.search input { padding-left: 38px !important; height: 38px !important; background: var(--card) !important; }
.search-results { position: absolute; top: 46px; left: 0; right: 0; background: var(--card); border: 1px solid var(--border-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; max-height: 70vh; overflow: auto; }
.sr { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.sr span { display: flex; flex-direction: column; min-width: 0; }
.sr small { color: var(--muted); font-size: 12px; }
.sr .ic { color: var(--gold); }
.sr.sel, .sr:hover { background: var(--card-2); }
.sr-empty { padding: 10px; color: var(--muted); }
.new-wrap { position: relative; }
.menu { position: absolute; right: 0; top: 46px; background: var(--card); border: 1px solid var(--border-2); border-radius: 12px; padding: 6px; min-width: 190px; box-shadow: var(--shadow); z-index: 40; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.menu button:hover { background: var(--card-2); color: var(--gold-light); }
#view { padding: 26px 28px 60px; max-width: 1500px; width: 100%; }
.scrim { display: none; }

/* Cartes */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.card + .card, .col > .card + .card { margin-top: 0; }
.card h3 { font-size: 16px; margin-bottom: 12px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h3 { margin: 0; }
.count { color: var(--muted); font-family: var(--font); font-size: 13px; margin-left: 4px; }
h3.sub { font-size: 15px; margin: 18px 0 10px; color: var(--text-2); }
.more-link { display: inline-block; margin-top: 12px; color: var(--gold); font-size: 13px; font-weight: 500; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty .ic { width: 28px; height: 28px; color: var(--gold); opacity: .7; }
.empty p { margin: 10px auto 4px; max-width: 420px; }
.empty .row-gap { justify-content: center; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Avatars, pastilles */
.avatar { --c: var(--gold); display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--c) 22%, #111); color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); font-size: 12px; font-weight: 700; flex: none; letter-spacing: .02em; vertical-align: middle; }
.avatar.sm { width: 28px; height: 28px; font-size: 10.5px; }
.avatar.xs { width: 22px; height: 22px; font-size: 9px; }
.avatar.ghost { --c: #8a8a8a; }
.pill { --c: var(--gold); display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 70%, #fff); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.status { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-prospect { background: rgba(91, 155, 213, .15); color: #8fc0ec; }
.st-client { background: rgba(108, 192, 139, .15); color: #8fdcab; }
.st-ancien { background: rgba(154, 165, 177, .15); color: #b8c0c8; }
.st-non { background: var(--red-soft); color: #f39a8e; }
.stage { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--card-2); color: var(--text-2); border: 1px solid var(--border-2); white-space: nowrap; }
.stage.k-won { background: rgba(108, 192, 139, .15); border-color: transparent; color: #8fdcab; }
.stage.k-lost { background: var(--red-soft); border-color: transparent; color: #f39a8e; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; background: var(--card-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); white-space: nowrap; margin: 2px 4px 2px 0; }
.chip.more { color: var(--muted); }
.chips { max-width: 340px; }
.dots { display: inline-flex; gap: 2px; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: #444; }
.dots.l1 i:nth-child(-n+1), .dots.l2 i:nth-child(-n+2), .dots.l3 i:nth-child(-n+3) { background: var(--gold); }
.due { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.due .ic { width: 13px; height: 13px; }
.due.today { color: var(--gold-light); font-weight: 600; }
.due.late { color: var(--red); font-weight: 600; }
.amount { font-weight: 650; white-space: nowrap; }
small { font-size: .82em; color: var(--muted); font-weight: 400; }

/* Tableau de bord */
.hello { margin-bottom: 20px; }
.hello h2 { font-size: 26px; margin-bottom: 4px; }
.hello p { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.kpi { display: flex; flex-direction: column; gap: 6px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; transition: border-color .15s, transform .15s; }
.kpi:hover { border-color: #4a4a4a; color: inherit; transform: translateY(-1px); }
.kpi .k-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.kpi .k-label .ic { color: var(--gold); width: 16px; height: 16px; }
.kpi b { font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: -.01em; }
.kpi b small { font-family: var(--font); font-size: 13px; }
.kpi > small { font-size: 12px; }
.kpi.gold { background: linear-gradient(160deg, rgba(245, 211, 106, .14), rgba(200, 135, 30, .05)), var(--card); border-color: rgba(228, 180, 68, .35); }
.kpi.gold b { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kpi.alert { border-color: rgba(239, 107, 91, .45); }
.kpi.alert b { color: var(--red); }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.dash-grid:first-child { margin-top: 0; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.bar-l { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { position: relative; height: 9px; background: #262626; border-radius: 6px; overflow: hidden; }
.bar i, .bar em { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.bar i { background: rgba(228, 180, 68, .38); }
.bar em { background: var(--gold-grad); }
.bar-row .bar i { background: var(--gold-grad); }
.bar-v { white-space: nowrap; font-weight: 600; text-align: right; min-width: 90px; }
.svc-list { display: flex; flex-direction: column; gap: 4px; }
.svc { display: grid; grid-template-columns: 175px 1fr; grid-template-areas: 'n b' 'n v'; column-gap: 12px; padding: 7px 8px; border-radius: 8px; }
.svc:hover { background: var(--card-2); color: inherit; }
.svc-name { grid-area: n; align-self: center; font-weight: 550; font-size: 13px; }
.svc .bar { grid-area: b; align-self: end; height: 7px; }
.svc-v { grid-area: v; font-size: 12px; color: var(--muted); }
.svc-v b { color: var(--text); }
.svc-v b.gold-t { color: var(--gold); }
.legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin: 10px 0 0; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.legend .lg1 { background: rgba(228, 180, 68, .38); margin-left: 0; }
.legend .lg2 { background: var(--gold-grad); }

/* Tâches */
.task { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 10px; }
.task:hover { background: var(--card-2); }
.tick { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid #555; background: transparent; display: grid; place-items: center; cursor: pointer; color: transparent; transition: all .15s; }
.tick .ic { width: 15px; height: 15px; }
.tick:hover { border-color: var(--gold); color: var(--gold); }
.task.done .tick { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { display: flex; align-items: center; gap: 7px; font-weight: 550; }
.ttype .ic { width: 15px; height: 15px; color: var(--muted); }
.prio .ic { width: 14px; height: 14px; color: var(--red); }
.task-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; font-size: 12px; color: var(--muted); }
.task-meta .links a { color: var(--text-2); }
.task-meta .links a:hover { color: var(--gold-light); }
.tgroup + .tgroup { margin-top: 10px; }
.tgroup h4 { font-family: var(--font); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: 4px 8px 4px; }
.tgroup h4 span { color: var(--text-2); margin-left: 4px; }
.tgroup.late h4 { color: var(--red); }
.tgroup.today h4 { color: var(--gold); }
.task-list { padding: 8px; }
.quick-dates { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* Listes */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar select { width: auto; min-width: 150px; height: 38px; }
.search-in { position: relative; flex: 1 1 260px; max-width: 360px; }
.search-in .ic { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--muted); }
.search-in input { padding-left: 36px !important; height: 38px !important; }
.list-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.card .table-wrap { border: 0; background: none; margin: -6px -8px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--panel); }
.card .table th { background: none; }
.table td { padding: 11px 14px; border-bottom: 1px solid #242424; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr[data-href] { cursor: pointer; }
.table tbody tr:hover td { background: #1f1f1f; }
.table .num { text-align: right; white-space: nowrap; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.row-item:hover { background: var(--card-2); color: inherit; }
.row-item + .row-item { border-top: 1px solid #242424; }

/* Fiche détail */
.back { display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dh-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dh-title h2 { font-size: 26px; }
.dh-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; color: var(--text-2); }
.dh-meta a { display: inline-flex; align-items: center; gap: 6px; }
.dh-meta .ic { width: 15px; height: 15px; }
.dh-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.status-select { width: auto !important; height: 32px !important; font-weight: 600; font-size: 13px; border-radius: 8px !important; }
.status-select.st-prospect { color: #8fc0ec; } .status-select.st-client { color: #8fdcab; } .status-select.st-ancien { color: #b8c0c8; } .status-select.st-non { color: #f39a8e; }
.mini-select { width: auto !important; height: 32px !important; font-size: 13px; }
.detail-grid { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.coords { display: flex; flex-direction: column; gap: 9px; }
.coords > * { display: flex; align-items: center; gap: 10px; word-break: break-word; }
.coords .ic { color: var(--gold); width: 16px; height: 16px; }
.notes { white-space: pre-wrap; background: #141414; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 12px; color: var(--text-2); font-size: 13px; }
.interest-grid { display: flex; flex-direction: column; gap: 6px; }
.int-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 9px; }
.int-row.on { background: var(--gold-soft); }
.int-name { font-size: 13px; font-weight: 550; display: flex; flex-direction: column; min-width: 0; }
.int-name small { font-size: 11px; }
.lvl-seg { display: inline-flex; background: #111; border: 1px solid var(--border-2); border-radius: 8px; padding: 2px; flex: none; }
.lvl-seg button { border: 0; background: none; padding: 3px 7px; font-size: 11.5px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.lvl-seg button:hover { color: var(--text); }
.lvl-seg button.sel { background: var(--card-2); color: var(--text); }
.lvl-seg button.sel.l1 { background: rgba(228, 180, 68, .2); color: var(--gold-light); }
.lvl-seg button.sel.l2 { background: rgba(228, 180, 68, .38); color: #fff3cf; }
.lvl-seg button.sel.l3 { background: var(--gold-grad); color: var(--gold-ink); font-weight: 700; }
.danger-zone { text-align: right; margin: 0; }

/* Composer & historique */
.composer textarea { margin: 10px 0; }
.seg { display: inline-flex; background: #111; border: 1px solid var(--border-2); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 7px; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg span .ic { width: 15px; height: 15px; }
.seg input:checked + span { background: var(--card-2); color: var(--gold-light); }
.seg input:focus-visible + span { outline: 2px solid var(--gold); }
.composer-f { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.composer-f input[type=date] { width: 160px !important; height: 34px !important; }
@media (max-width: 1640px) { .detail-grid .two { grid-template-columns: 1fr; } }
.timeline { display: flex; flex-direction: column; }
.act { display: flex; gap: 12px; padding: 11px 0; border-top: 1px solid #242424; }
.act:first-child { border-top: 0; padding-top: 2px; }
.act-ic { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--card-2); color: var(--muted); }
.act-ic .ic { width: 15px; height: 15px; }
.t-appel .act-ic { color: var(--green); } .t-email .act-ic { color: var(--blue); } .t-rdv .act-ic { color: #b48edb; } .t-note .act-ic { color: var(--gold); } .t-etape .act-ic { color: var(--gold-light); background: var(--gold-soft); }
.act-body { flex: 1; min-width: 0; }
.act-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; }
.act-ctx { color: var(--muted); }
.act-ctx a { color: var(--text-2); }
.act-time { margin-left: auto; color: var(--muted); font-size: 12px; }
.act-text { white-space: pre-wrap; word-break: break-word; margin-top: 3px; color: var(--text-2); }
.timeline.compact .act { padding: 8px 0; }
.timeline.compact .act-text { font-size: 13px; }
.t-systeme .act-text, .t-tache .act-text, .t-etape .act-text { color: var(--muted); font-size: 13px; }

/* Pipeline */
.hint-line { margin: -6px 0 12px; }
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: 60vh; }
.col-k { flex: 1 0 228px; max-width: 320px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 210px); transition: border-color .15s, background .15s; }
.col-k.over { border-color: var(--gold); background: #1a1710; }
.col-h { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 2px; }
.col-name { font-weight: 650; }
.col-n { background: var(--card-2); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--muted); align-self: center; }
.col-sum { grid-column: 1 / -1; font-size: 13px; color: var(--gold); font-weight: 600; }
.k-won .col-name { color: #8fdcab; } .k-lost .col-name { color: #f39a8e; }
.k-won .col-sum { color: #8fdcab; } .k-lost .col-sum { color: var(--muted); }
.col-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.kcard { background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px; cursor: grab; transition: border-color .15s, transform .1s, box-shadow .15s; }
.kcard:hover { border-color: #4a4a4a; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.kcard.dragging { opacity: .45; transform: rotate(1.5deg); }
.kc-title { font-weight: 600; margin-bottom: 2px; }
.kc-co { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.kc-f { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.kc-f b { margin-right: auto; }
.kc-lost { font-size: 12px; color: #f39a8e; margin-top: 6px; }
.add-k { border: 1px dashed var(--border-2); background: none; color: var(--muted); border-radius: 10px; padding: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.add-k:hover { border-color: var(--gold); color: var(--gold-light); }
.add-k .ic { width: 15px; height: 15px; }

/* Onglets segmentés */
.seg-tabs { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 3px; flex-wrap: wrap; gap: 2px; }
.seg-tabs > * { border: 0; background: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); cursor: pointer; font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; gap: 7px; }
.seg-tabs > *:hover { color: var(--text); }
.seg-tabs > .sel { background: var(--card-2); color: var(--gold-light); }
.seg-tabs span { background: #2a2a2a; border-radius: 999px; padding: 0 7px; font-size: 11.5px; color: var(--muted); }
.seg-tabs .warn span { background: var(--red); color: #fff; }
.page-tabs { margin-bottom: 16px; }

/* Segmentation */
.matrix { border-collapse: separate; border-spacing: 3px; width: 100%; }
.matrix thead th { font-size: 11.5px; font-weight: 600; color: var(--muted); padding: 6px; vertical-align: bottom; text-align: center; min-width: 84px; }
.matrix thead th:first-child { text-align: left; }
.matrix thead th span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.matrix tbody th { text-align: left; padding: 6px 8px 6px 0; white-space: nowrap; font-weight: 500; }
.matrix td { text-align: center; padding: 8px 6px; border-radius: 8px; }
.matrix .num { text-align: center; }
.matrix .cell { --a: 0; background: rgba(228, 180, 68, var(--a)); background-color: color-mix(in srgb, #e4b444 calc(var(--a) * 100%), #1f1f1f); cursor: pointer; transition: outline-color .1s; outline: 1px solid transparent; }
.matrix .cell:hover { outline-color: var(--gold); }
.matrix .cell.zero { color: #4a4a4a; cursor: default; background: #191919; }
.matrix .cell b { font-size: 14px; }
.matrix .cell em { font-style: normal; font-size: 11px; color: var(--gold-ink); background: var(--gold-light); border-radius: 999px; padding: 0 5px; margin-left: 4px; font-weight: 700; }
.matrix tfoot th, .matrix tfoot td { padding-top: 10px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.matrix tfoot th { text-align: left; }

/* Import */
.import-card { max-width: 900px; }
.steps { color: var(--text-2); padding-left: 20px; margin: 0 0 18px; }
.steps li { margin-bottom: 6px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; border: 2px dashed var(--border-2); border-radius: var(--radius); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone .ic { width: 30px; height: 30px; color: var(--gold); }
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: var(--gold-soft); }
.map-table select { min-width: 220px; height: 34px; }
.big-ok { width: 64px; height: 64px; border-radius: 50%; background: var(--gold-grad); color: var(--gold-ink); display: grid; place-items: center; margin: 6px auto 14px; }
.big-ok .ic { width: 30px; height: 30px; }
.result-list { list-style: none; padding: 0; margin: 16px 0; display: inline-flex; flex-direction: column; gap: 6px; text-align: left; }

/* Paramètres */
.ref-list { display: flex; flex-direction: column; }
.ref-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-top: 1px solid #242424; }
.ref-row:first-child { border-top: 0; }
.ord { display: flex; flex-direction: column; }
.swatch { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.int-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.int-pick label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.int-pick select { width: 110px; height: 34px; }

/* Modale */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .62); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; overflow-y: auto; animation: fade .15s ease; }
.modal { width: 100%; max-width: 520px; background: var(--card); border: 1px solid var(--border-2); border-radius: 18px; box-shadow: var(--shadow); animation: pop .18s ease; }
.modal.wide { max-width: 760px; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px 22px; }
.modal header h2 { font-size: 19px; }
.modal-body { padding: 8px 22px 6px; }
.modal footer { display: flex; align-items: center; gap: 8px; padding: 14px 20px 18px; border-top: 1px solid var(--border); margin-top: 10px; flex-wrap: wrap; }
.confirm-msg { color: var(--text-2); margin: 0 0 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } }

/* Notifications */
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #262626; border: 1px solid var(--border-2); color: var(--text); padding: 10px 16px; border-radius: 11px; box-shadow: var(--shadow); font-weight: 500; animation: pop .2s ease; transition: opacity .4s, transform .4s; max-width: 90vw; }
.toast.ok { border-left: 3px solid var(--gold); }
.toast.error { border-left: 3px solid var(--red); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* Responsive */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .dash-grid, .two { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 25; }
  .main { margin-left: 0; }
  .burger { display: inline-grid; }
  .topbar { padding: 0 16px; gap: 10px; }
  #view { padding: 18px 16px 50px; }
  .grid3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; }
  .topbar h1 { flex: 1; font-size: 17px; }
  .search { order: 3; width: 100%; margin-left: 0; }
  .new-wrap .btn span { display: none; }
  .new-wrap .btn { width: 38px; padding: 0; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi b { font-size: 20px; }
  .grid2, .int-pick { grid-template-columns: 1fr; }
  .toolbar select { flex: 1 1 45%; min-width: 0; }
  .search-in { max-width: none; flex-basis: 100%; }
  .bar-row { grid-template-columns: 96px 1fr auto; }
  .svc { grid-template-columns: 1fr; grid-template-areas: 'n' 'b' 'v'; row-gap: 4px; }
  .col-k { flex-basis: 250px; }
  .hello h2, .dh-title h2 { font-size: 21px; }
  .modal-backdrop { padding: 0; }
  .modal, .modal.wide { border-radius: 0; min-height: 100vh; max-width: none; border: 0; }
  .card { padding: 14px; }
  .int-row { flex-direction: column; align-items: stretch; }
  .lvl-seg { justify-content: space-between; }
}
