/* ============================================================
   PRODIFY — Thème noir (v2) — accent piloté par --accent
   ============================================================ */
:root {
  --accent: #0797f6;
  --accent-soft: rgba(7, 151, 246, 0.14);
  --accent-border: rgba(7, 151, 246, 0.45);

  --bg: #0a0a0b;
  --rail: #0d0d0e;
  --surface: #131315;
  --surface-2: #18181b;
  --surface-3: #1f1f23;
  --border: #262629;
  --border-soft: #1d1d20;

  --text: #f4f4f5;
  --muted: #8a8a90;
  --muted-2: #6a6a70;

  --danger: #ef4444;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --brand-font: "Montserrat", var(--font);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; font-size: 14px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a2e; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- Layout : UNE seule barre ---------------- */
.app { display: grid; grid-template-columns: 268px 1fr; height: 100vh; overflow: hidden; }

.sidebar { background: linear-gradient(180deg, #0f0f13 0%, var(--rail) 100%); border-right: 1px solid var(--border-soft); display: flex; flex-direction: column; overflow: hidden; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 16px; }
.brand-logo-wrap { border-radius: 11px; overflow: hidden; flex: none; background: #000; display: grid; place-items: center; box-shadow: 0 0 16px rgba(7,151,246,.2); }
.brand-logo { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-fallback { width: 100%; height: 100%; background: var(--accent); color: #04121f; font-weight: 800; display: grid; place-items: center; font-size: 18px; }
.brand-name { font-family: var(--brand-font); font-style: italic; font-weight: 800; font-size: 21px; letter-spacing: -.01em; background: linear-gradient(120deg, #ffffff 40%, var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

.side-nav { flex: 1; overflow-y: auto; padding: 8px 12px 12px; }
.group-head { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 11px; border: none; background: transparent; color: var(--text); cursor: pointer; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; text-align: left; transition: .14s; font-family: inherit; margin-top: 2px; }
.group-head:hover { background: var(--surface-2); }
.group-head .nav-icon { display: grid; place-items: center; color: var(--muted); }
.group-head.open .nav-icon { color: var(--accent); }
.group-head svg { width: 18px; height: 18px; }
.group-label { flex: 1; }
.chevron { display: grid; place-items: center; color: var(--muted-2); }
.chevron svg { width: 15px; height: 15px; transition: transform .2s ease; }
.group-head.open .chevron svg { transform: rotate(90deg); }

.group-children { max-height: 0; overflow: hidden; transition: max-height .25s ease; padding-left: 6px; }
.group-children.open { max-height: 360px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 11px 9px 18px; border: none; background: transparent; color: var(--muted); cursor: pointer; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; text-align: left; transition: .14s; font-family: inherit; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; border-left: 2px solid var(--accent); padding-left: 16px; }
.leaf-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .45; flex: none; }
.nav-item.active .leaf-dot { opacity: 1; }

.sidebar-foot { border-top: 1px solid var(--border-soft); padding: 12px; }
.user { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #3a3a3f, #1c1c1f); border: 1px solid var(--border); }
.user-name { font-weight: 600; font-size: 13px; }
.user-role { color: var(--muted-2); font-size: 11px; }
.logout { color: var(--muted-2); padding-left: 11px; }
.logout svg { width: 18px; height: 18px; }

/* ---------------- Main ---------------- */
.main { overflow: hidden; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 30px 16px; border-bottom: 1px solid var(--border-soft); }
.page-title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0; background: linear-gradient(120deg, #ffffff 50%, var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.page-sub { font-size: 11px; color: var(--muted-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 20px; margin-left: 12px; vertical-align: middle; }
.topbar-left { display: flex; align-items: baseline; }
.view { flex: 1; overflow-y: auto; padding: 24px 30px 60px; }
.loading { color: var(--muted); padding: 40px; }

.topbar-right { display: flex; align-items: center; gap: 14px; }

.bell-btn { position: relative; border: 1px solid var(--border); background: var(--surface-2); width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; cursor: pointer; color: var(--muted); transition: .14s; }
.bell-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bell-btn:hover { color: var(--text); border-color: var(--accent-border); }
.bell-btn.has-unread { color: var(--accent); }
.bell-btn.syncing { opacity: .6; cursor: wait; }
.bell-btn.syncing svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bell-badge { position: absolute; top: -5px; right: -5px; background: var(--accent); color: #04121f; font-size: 10.5px; font-weight: 700; line-height: 1; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.notif-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.notif-item { border: 1px solid var(--border-soft); background: var(--surface-2); border-radius: 10px; padding: 12px 14px; }
.notif-item.unread { border-color: var(--accent-border); background: var(--accent-soft); }
.notif-title { font-weight: 650; font-size: 13.5px; }
.notif-msg { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.notif-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--muted-2); }

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.segmented button { border: none; background: transparent; color: var(--muted); padding: 7px 15px; border-radius: 8px; cursor: pointer; font-size: 12.5px; font-weight: 500; font-family: inherit; transition: .15s; }
.segmented button:hover { color: var(--text); background: var(--surface-3); }
.segmented button.active { background: linear-gradient(135deg, rgba(7,151,246,.2), rgba(7,151,246,.08)); color: var(--accent); font-weight: 600; box-shadow: inset 0 0 0 1px var(--accent-border); }

/* ---------------- KPI ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; transition: border-color .18s, box-shadow .18s; }
.kpi:hover { border-color: var(--border-soft); box-shadow: 0 4px 20px rgba(0,0,0,.35); }
.kpi.accent { border-color: var(--accent-border); background: linear-gradient(160deg, var(--accent-soft), var(--surface) 65%); border-top: 2px solid var(--accent); }
.kpi.accent:hover { box-shadow: 0 4px 24px rgba(7,151,246,.15); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-title { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi-value { font-size: 27px; font-weight: 750; letter-spacing: -.02em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted-2); font-size: 11.5px; margin-top: 4px; }
.delta { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 20px; }
.delta.up { color: var(--accent); background: var(--accent-soft); }
.delta.down { color: #f87171; background: rgba(239,68,68,.12); }
.add-tile { border: 1.5px dashed var(--border); background: transparent; color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-family: inherit; font-size: 13px; transition: .15s; }
.add-tile:hover { border-color: var(--accent); color: var(--accent); }
.add-plus { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 24px; }
.add-tile:hover .add-plus { background: var(--accent-soft); }

/* ---------------- Panels ---------------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 22px; overflow: hidden; box-shadow: 0 1px 8px rgba(0,0,0,.25); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border-soft); }
.panel-head h2 { font-size: 16px; font-weight: 650; margin: 0; padding-left: 10px; border-left: 2px solid var(--accent); }
.panel-actions { display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 18px 20px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.chart-wrap { position: relative; height: 320px; }
.chart-wrap.sm { height: 280px; }

/* ---------------- Tables ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted-2); font-weight: 600; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 0 14px 14px; border-bottom: 1px solid var(--border-soft); }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border-soft); color: var(--text); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: rgba(7,151,246,.04); }
.table tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.table tr.clickable { cursor: pointer; }
.table .muted-row td { color: var(--muted-2); }
.row-actions { text-align: right; white-space: nowrap; }
.rank-badge { font-weight: 700; color: var(--accent); }

/* Avatar + cellule client */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; font-weight: 700; flex: none; overflow: hidden; vertical-align: middle; }
.client-cell { display: inline-flex; align-items: center; gap: 10px; }

/* Tags */
.tag { font-size: 11px; padding: 3px 10px; border-radius: 20px; background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); letter-spacing: .01em; font-weight: 500; }
.tag.soft { background: transparent; }
.ctag { font-size: 11.5px; padding: 3px 10px; border-radius: 20px; border: 1px solid; font-weight: 600; display: inline-block; }

/* ---------------- Buttons ---------------- */
.btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); padding: 9px 15px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 550; font-family: inherit; transition: .14s; }
.btn:hover { background: var(--surface-3); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btn.primary { background: linear-gradient(135deg, #1aa3ff, var(--accent) 60%, #0566c4); border-color: var(--accent); color: #fff; font-weight: 650; box-shadow: 0 2px 12px rgba(7,151,246,.3); }
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 4px 18px rgba(7,151,246,.45); }
.btn.ghost { background: transparent; }
.btn.danger, .btn.primary.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost.danger { background: transparent; color: #f87171; border-color: rgba(239,68,68,.3); }
.icon-btn { border: 1px solid transparent; background: transparent; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px; transition: .14s; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.danger:hover { background: rgba(239,68,68,.14); color: #f87171; }

/* ---------------- Forms ---------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 16px; }
.form-grid .span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.field-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field-hint { font-size: 11.5px; color: var(--muted-2); }
.input, select.input { width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 10px 12px; border-radius: 10px; font-size: 13.5px; font-family: inherit; transition: .14s; }
.input:focus, select.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a90' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form-actions { margin: 18px 0 8px; }
.checkbox-field { cursor: pointer; flex-direction: row; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; transition: border-color .14s, background .14s; user-select: none; }
.checkbox-field:hover { border-color: var(--accent-border); background: var(--accent-soft); }
.checkbox-field span { display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 500; }
.subform { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.subform-title { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 12px; letter-spacing: .03em; }
.stepper { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: border-color .14s, box-shadow .14s; }
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stepper-btn { flex-shrink: 0; width: 44px; height: 44px; border: none; background: transparent; color: var(--muted); font-size: 20px; font-weight: 400; cursor: pointer; display: grid; place-items: center; transition: background .14s, color .14s, transform .14s; font-family: inherit; line-height: 1; }
.stepper-btn:hover { background: var(--accent-soft); color: var(--accent); }
.stepper-btn.stepper-inc { border-left: 1px solid var(--border); }
.stepper-btn:first-child { border-right: 1px solid var(--border); }
.stepper-btn.pop { transform: scale(.82); background: var(--accent-soft); color: var(--accent); }
.stepper-input { flex: 1; min-width: 0; background: transparent; border: none; outline: none; color: var(--text); text-align: center; font-size: 15px; font-weight: 650; font-family: inherit; padding: 10px 4px; -moz-appearance: textfield; }
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Photo client */
.photo-block { display: flex; align-items: center; gap: 16px; }
.photo-preview .avatar { width: 56px; height: 56px; font-size: 22px; }
.photo-btns { display: flex; gap: 8px; margin-top: 6px; }

/* Saisie */
.note { background: var(--surface-2); border: 1px solid var(--border-soft); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 14px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.note b { color: var(--text); }
.saisie-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.saisie-right { display: flex; align-items: center; gap: 16px; }
.saisie-date-label { font-size: 12px; color: var(--muted-2); }
.saisie-date { font-size: 20px; font-weight: 700; text-transform: capitalize; }
.save-status { font-size: 12.5px; color: var(--muted-2); min-width: 110px; }
.save-status.saving { color: var(--muted); }
.save-status.ok { color: var(--accent); font-weight: 600; }

/* Rate grid */
.rate-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.rate { background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px; transition: border-color .15s, box-shadow .15s; }
.rate:hover { border-color: var(--accent-border); box-shadow: 0 2px 12px rgba(7,151,246,.1); }
.rate-val { font-size: 22px; font-weight: 750; color: var(--accent); font-variant-numeric: tabular-nums; }
.rate-label { font-size: 12.5px; color: var(--text); margin-top: 4px; font-weight: 500; }
.rate-sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; }

/* Ranking list */
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--border-soft); }
.rank-row:last-child { border-bottom: none; }
.rank-name { flex: 1; font-size: 13.5px; }
.rank-pct { color: var(--muted-2); font-weight: 600; font-size: 12.5px; }
.rank-val { color: var(--text); font-weight: 700; }
.mrr-total { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 16px; }
.mrr-total b { font-size: 18px; color: var(--accent); }

/* Empty / placeholders */
.empty { text-align: center; padding: 40px 20px; }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; color: var(--accent); }
.empty-icon svg { width: 28px; height: 28px; }
.empty h3 { margin: 0 0 6px; font-size: 16px; }
.muted { color: var(--muted); }
.badge { display: inline-block; margin-top: 14px; font-size: 11px; color: var(--muted-2); border: 1px dashed var(--border); padding: 4px 12px; border-radius: 20px; }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 1fr); gap: 14px; overflow-x: auto; }
.kanban-col { --sc: #64748b; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px; min-height: 240px; display: flex; flex-direction: column; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 13px 10px; border-top: 3px solid var(--sc); border-bottom: 1px solid var(--border-soft); border-radius: 11px 11px 0 0; font-size: 12.5px; font-weight: 600; }
.kch-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.kch-count { flex-shrink: 0; background: color-mix(in srgb, var(--sc) 18%, transparent); color: var(--sc); border-radius: 20px; padding: 1px 7px; font-size: 11px; font-weight: 700; line-height: 18px; }
.kch-bar { height: 3px; background: var(--border-soft); }
.kch-bar-fill { height: 100%; background: var(--sc); border-radius: 0 2px 2px 0; transition: width .5s cubic-bezier(.4,0,.2,1); }
.kanban-col-body { padding: 14px; }
.kanban-empty { border: 1.5px dashed var(--border); border-radius: 10px; padding: 24px; text-align: center; color: var(--muted-2); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 20px; animation: fade .15s ease; }
.import-dropzone { border: 2px dashed var(--border); border-radius: 12px; padding: 32px 20px; text-align: center; color: var(--muted); font-size: 13.5px; cursor: pointer; transition: border-color .15s, background .15s; margin-bottom: 20px; }
.import-dropzone:hover, .import-dropzone.drag-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); animation: pop .16s ease; max-height: 90vh; display: flex; flex-direction: column; }
.modal.wide { max-width: 760px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head .icon-btn { font-size: 22px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--border-soft); }
.settings-row { display: flex; gap: 10px; margin: 4px 0 12px; flex-wrap: wrap; }
code { background: var(--surface-3); padding: 1px 6px; border-radius: 6px; font-size: 12px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface-3); color: var(--text); border: 1px solid var(--border); padding: 12px 20px; border-radius: 12px; font-size: 13.5px; font-weight: 500; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { border-left: 3px solid var(--accent); }

@media print {
  .sidebar, .topbar-right, .panel-actions, .add-tile { display: none !important; }
  .app { display: block; height: auto; }
  body { background: #fff; color: #000; }
  .panel, .kpi { break-inside: avoid; border-color: #ccc; background: #fff; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------------- Données : cartes-stats + filtres ---------------- */
.kpi.stat { cursor: pointer; text-align: left; font-family: inherit; position: relative; color: var(--text); }
.kpi.stat:hover { border-color: var(--accent-border); }
.kpi.stat .kpi-value { font-size: 24px; margin-top: 8px; }
.stat-dot { position: absolute; top: 16px; right: 16px; width: 10px; height: 10px; border-radius: 50%; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); padding: 7px 13px; border-radius: 20px; cursor: pointer; font-size: 12.5px; font-weight: 500; font-family: inherit; transition: .14s; }
.chip:hover { color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #04121f; font-weight: 650; }
.table.recap th, .table.recap td { white-space: nowrap; }
.kanban-card { cursor: pointer; }
.kc-tagrow { margin-top: 8px; }
.kc-contact { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.social-label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.social-link { font-size: 11.5px; color: var(--accent); text-decoration: none; font-weight: 600; white-space: nowrap; }
.social-link:hover { text-decoration: underline; }
a.kc-tag { text-decoration: none; cursor: pointer; }
a.kc-tag:hover { filter: brightness(1.2); text-decoration: underline; }

/* ---------------- Pipeline (kanban interactif) ---------------- */
.kanban-col { min-width: 200px; }
.kanban-col-body { padding: 12px; flex: 1; min-height: 120px; display: flex; flex-direction: column; gap: 10px; transition: background .14s; border-radius: 0 0 12px 12px; }
.kanban-col-body.drop { background: var(--accent-soft); outline: 1.5px dashed var(--accent-border); outline-offset: -6px; }
.kanban-card { background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 10px 11px; cursor: grab; transition: .12s; }
.kanban-card:hover { border-color: var(--accent-border); }
.kanban-card.dragging { opacity: .45; cursor: grabbing; }
.kanban-card.opluo { background: rgba(249, 115, 22, 0.14); border-color: rgba(249, 115, 22, 0.5); }
.kanban-card.opluo:hover { border-color: #f97316; }
.expense-toggle { font-size: 11px; font-weight: 600; border-radius: 20px; padding: 2px 9px; border: 1px solid; cursor: pointer; transition: .14s; }
.expense-toggle.on { background: #10b98120; color: #10b981; border-color: #10b98150; }
.expense-toggle.on:hover { background: #10b98135; }
.expense-toggle.off { background: var(--surface-3); color: var(--muted-2); border-color: var(--border); }
.expense-toggle.off:hover { background: var(--border); }
tr.expense-inactive td { opacity: .38; }
tr.expense-inactive td:first-child b { text-decoration: line-through; }
.kc-relance { font-size: 11px; color: var(--muted); margin-top: 4px; }
.kc-relance.overdue { color: #f97316; font-weight: 600; }
.relance-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s; }
.relance-row:hover { background: var(--surface-3); }
.relance-name { font-weight: 600; flex: 1; }
.relance-stage { font-size: 12px; color: var(--muted); }
.relance-date { font-size: 12px; font-weight: 600; color: var(--accent); margin-left: auto; }
.relance-date.overdue { color: #f97316; }
.kc-head { display: flex; align-items: center; gap: 8px; }
.kc-name { flex: 1; font-size: 13px; }
.kc-del { border: none; background: transparent; color: var(--muted-2); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; border-radius: 6px; }
.kc-del:hover { color: #f87171; background: rgba(239,68,68,.14); }
.kc-handles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kc-tag { font-size: 11px; padding: 2px 8px; border-radius: 14px; font-weight: 600; }
.kc-tag.ig { background: rgba(236,72,153,.16); color: #ec4899; }
.kc-tag.li { background: rgba(10,102,194,.18); color: #3b9bff; }

/* ---------------- Templates / Documents ---------------- */
.chip.chip-add { border-style: dashed; color: var(--muted); }
.chip.chip-add:hover { color: var(--accent); border-color: var(--accent); }
.doc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.doc-search { flex: 1; min-width: 220px; }
.doc-search .input { width: 100%; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.doc-card { position: relative; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 12px; overflow: hidden; cursor: pointer; transition: .14s; }
.doc-card:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.doc-thumb { height: 96px; display: grid; place-items: center; }
.doc-ext { font-weight: 800; font-size: 22px; letter-spacing: .05em; }
.doc-thumb.big { width: 90px; height: 90px; border-radius: 14px; margin: 0 auto 14px; }
.doc-info { padding: 12px 13px 14px; }
.doc-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 11.5px; margin-top: 5px; }
.doc-typedot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.doc-cat-badge { display: inline-block; margin-top: 8px; font-size: 10.5px; color: var(--muted); background: var(--surface-3); border: 1px solid var(--border); padding: 2px 8px; border-radius: 20px; }
.doc-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; opacity: 0; transition: .14s; background: rgba(10,10,11,.6); border-radius: 8px; backdrop-filter: blur(4px); }
.doc-card:hover .doc-actions { opacity: 1; }
.doc-preview { min-height: 200px; }
.doc-frame { width: 100%; height: 68vh; border: none; border-radius: 10px; background: #fff; }
.doc-html { background: #fff; color: #111; border-radius: 10px; padding: 24px; max-height: 68vh; overflow: auto; font-size: 13px; line-height: 1.5; }
.doc-html.doc-sheet table { border-collapse: collapse; }
.doc-html.doc-sheet td, .doc-html.doc-sheet th { border: 1px solid #ddd; padding: 4px 8px; }

.notes-link { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent); cursor: pointer; text-decoration: none; margin-top: 4px; }
.notes-link:hover { text-decoration: underline; }
.notes-box { margin-top: 8px; }
.notes-textarea { width: 100%; resize: vertical; font-family: inherit; font-size: 13px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }

.doc-card.inline { display: flex; align-items: center; gap: 12px; padding: 10px 12px; cursor: pointer; }
.doc-card.inline .doc-thumb { height: 48px; width: 48px; border-radius: 10px; flex: none; }
.doc-card.inline .doc-info { padding: 0; flex: 1; }
.doc-noprev { text-align: center; padding: 30px 10px; }
.doc-noprev .btn { margin-top: 8px; }
.doc-history { margin-top: 18px; border-top: 1px solid var(--border-soft); padding-top: 14px; }
.doc-history-title { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 10px; letter-spacing: .03em; }
.doc-version { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
.doc-version:last-child { border-bottom: none; }

/* ---------------- Automations ---------------- */
.auto-stats { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.auto-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 20px; display: flex; flex-direction: column; align-items: center; min-width: 80px; }
.auto-stat-val { font-size: 22px; font-weight: 700; color: var(--accent); }
.auto-stat-lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }

.auto-connectors { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 0; }
.auto-conn { display: flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13px; }
.conn-ok { border-color: #22c55e44; background: #22c55e11; }
.conn-off { opacity: .5; }
.conn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.conn-ok .conn-dot { background: #22c55e; }
.conn-name { font-weight: 500; }

.auto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 16px; }
.auto-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.auto-card-head { display: flex; align-items: center; justify-content: space-between; }
.auto-tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.auto-title { font-size: 14.5px; font-weight: 600; margin: 0; }
.auto-desc { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.5; }

.auto-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; background: var(--surface-3); border-radius: 10px; padding: 10px 12px; }
.auto-step { display: flex; align-items: center; gap: 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 5px 9px; }
.step-icon { font-size: 14px; }
.step-lbl { font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.step-arrow { color: var(--muted); font-size: 13px; }

.auto-card-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.auto-meta { font-size: 11.5px; color: var(--muted); }
.auto-actions { display: flex; gap: 6px; }
.btn-ghost-sm { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-family: inherit; }
.btn-ghost-sm:hover { background: var(--surface-3); }

.badge-green { background: #22c55e22; color: #22c55e; border-color: #22c55e44; }
.badge-orange { background: #f9731622; color: #f97316; border-color: #f9731644; }
.badge-muted { background: var(--surface-3); color: var(--muted); }

/* --- Automations liste --- */
.auto-row { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.auto-row:last-child { border-bottom: none; }
.auto-row-icon { font-size: 22px; min-width: 32px; text-align: center; margin-top: 2px; }
.auto-row-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.auto-row-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.auto-row-title { font-size: 14px; font-weight: 600; }
.auto-zone-badge { font-size: 11px; color: var(--muted); background: var(--surface-3); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; }
.auto-row-desc { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.55; }
.auto-row-status { font-size: 12px; font-weight: 500; white-space: nowrap; padding-top: 2px; }
.auto-locked { opacity: .6; }

/* ---------------- To-do ---------------- */
.todo-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-height: 20px; }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; transition: opacity .2s; }
.todo-item.todo-done { opacity: .5; }
.todo-item.todo-done .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-check { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border); background: var(--surface-3); cursor: pointer; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--accent); flex: none; transition: .14s; }
.todo-check:hover { border-color: var(--accent); background: var(--accent-soft); }
.todo-body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.todo-title { font-size: 13.5px; font-weight: 500; }
.todo-sub { font-size: 11.5px; color: var(--muted); }
.todo-add-row { display: flex; gap: 8px; margin-top: 4px; }
.todo-add-input { flex: 1; }

/* ---------------- WhatsApp ---------------- */
.wa-wrap { margin-bottom: 14px; }
.wa-textarea { font-size: 13.5px; line-height: 1.65; resize: vertical; min-height: 260px; font-family: var(--font); }
.wa-actions { display: flex; gap: 10px; }

/* ============================================================
   TRANSITIONS & POLISH (v76)
   ============================================================ */

/* --- Barre de progression --- */
#pf-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 9999; pointer-events: none; background: linear-gradient(90deg, var(--accent), #60c4ff); border-radius: 0 2px 2px 0; opacity: 0; transition: opacity .2s; }
.pf-progress-run { width: 75% !important; opacity: 1 !important; transition: width .4s cubic-bezier(.1,0,.2,1), opacity .2s !important; }
.pf-progress-done { width: 100% !important; opacity: 0 !important; transition: width .15s ease, opacity .3s .1s !important; }

/* --- Transition d'entrée de page --- */
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.view-enter { animation: viewIn .2s cubic-bezier(.22,1,.36,1) both; }

/* --- Modal : entrée plus douce --- */
@keyframes pop { from { transform: translateY(10px) scale(.97); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal { animation: pop .2s cubic-bezier(.22,1,.36,1) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal-overlay { animation: fade .18s ease both; }

/* --- KPI hover lift --- */
.kpi { transition: border-color .18s, box-shadow .18s, transform .18s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.45); }
.kpi.accent:hover { box-shadow: 0 8px 28px rgba(7,151,246,.2); }

/* --- Panels hover subtil --- */
.panel { transition: box-shadow .2s; }
.panel:hover { box-shadow: 0 4px 24px rgba(0,0,0,.35); }

/* --- Row hover plus marqué --- */
.table tbody tr { transition: background .12s, transform .12s; }
.table tbody tr:hover { background: rgba(7,151,246,.055); }
.table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* --- Kanban card hover --- */
.kanban-card { transition: border-color .14s, transform .14s, box-shadow .14s; box-shadow: inset 3px 0 0 var(--sc, transparent); }
.kanban-card:hover { transform: translateY(-2px); box-shadow: inset 3px 0 0 var(--sc, transparent), 0 6px 18px rgba(0,0,0,.4); }

/* --- Nav item hover slide --- */
.nav-item { transition: background .14s, color .14s, padding-left .14s; }

/* --- Badge pulse (todo & bell) --- */
@keyframes badgePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(7,151,246,.5); } 50% { box-shadow: 0 0 0 5px rgba(7,151,246,0); } }
.bell-badge, .todo-badge { animation: badgePulse 2s ease-in-out infinite; }

/* --- Skeleton loader --- */
@keyframes shimmer { from { background-position: -600px 0; } to { background-position: 600px 0; } }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 600px 100%; animation: shimmer 1.4s infinite linear; border-radius: 8px; }
.skeleton-line { height: 14px; margin: 8px 0; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.w-40 { width: 40%; }

/* --- Buttons : micro-interaction --- */
.btn { transition: background .14s, box-shadow .14s, filter .14s, transform .1s; }
.btn:active { transform: scale(.97); }
.btn.primary:active { transform: scale(.97); }
.icon-btn { transition: background .14s, color .14s, transform .1s; }
.icon-btn:active { transform: scale(.88); }

/* --- Topbar sticky blur --- */
.topbar { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); background: rgba(10,10,11,.82); transition: box-shadow .2s; }

/* --- Input focus glow amélioré --- */
.input:focus, select.input:focus { box-shadow: 0 0 0 3px rgba(7,151,246,.18), 0 1px 6px rgba(7,151,246,.1); }

/* --- Chip hover --- */
.chip { transition: background .14s, color .14s, border-color .14s, transform .1s; }
.chip:active { transform: scale(.96); }

/* --- Scrollbar fine --- */
.view::-webkit-scrollbar { width: 6px; }
.view::-webkit-scrollbar-thumb { background: #2a2a2e; border-radius: 6px; border: none; }

/* ---------------- Prévisions (sliders) ---------------- */
.prev-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.prev-grid.prev-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 700px) { .prev-grid { grid-template-columns: 1fr; } }
.prev-control { margin-bottom: 18px; }
.prev-control:last-child { margin-bottom: 0; }
.prev-control-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.prev-control-head label { font-size: 13px; color: var(--muted); font-weight: 500; }
.prev-value { font-size: 14.5px; font-weight: 700; color: var(--accent); }
.prev-range {
  width: 100%; height: 6px; border-radius: 4px; background: var(--surface-3);
  -webkit-appearance: none; appearance: none; outline: none; cursor: pointer;
}
.prev-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer; box-shadow: 0 0 0 3px var(--accent-soft);
}
.prev-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: none; cursor: pointer;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.prev-result { border-radius: var(--radius-sm); padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--border); }
.prev-result h3 { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); font-weight: 600; }
.prev-result .montant { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.prev-result .prev-sub { font-size: 11.5px; color: var(--muted-2); margin: 2px 0 14px; }
.prev-result .prev-sub:last-child { margin-bottom: 0; }
.prev-result.haut .montant { color: var(--accent); }
.pastille { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.pastille.b { background: var(--muted); }
.pastille.m { background: #a78bfa; }
.pastille.h { background: var(--accent); }

/* ---------------- Prévisions — sub-tabs ---------------- */
.prev-subtabs { display: flex; gap: 8px; margin-bottom: 20px; }
.prev-subtab-btn {
  padding: 9px 20px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-family: inherit; font-size: 13px;
  font-weight: 500; cursor: pointer; transition: .15s;
}
.prev-subtab-btn:hover { color: var(--text); border-color: var(--border-soft); }
.prev-subtab-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); font-weight: 600; }
.prev-zone { display: flex; flex-direction: column; gap: 20px; }

/* ---------------- Prévision Jauge ---------------- */
.gauge-section { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.gauge-block { flex: 1; min-width: 220px; }
.gauge-block-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; }
.gauge-row { display: flex; gap: 8px; justify-content: center; }
.gauge-svg { width: 128px; height: 128px; }
.gauge-divider { width: 1px; background: var(--border); align-self: stretch; min-height: 100px; }
.gauge-block.haut .gauge-svg circle[stroke="#22d3a0"] { stroke: #22d3a0; }

/* ---------------- Prévision Arbre ---------------- */
.arbre-wrap { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 8px 0 16px; }

/* ROOT */
.arbre-root { display: flex; justify-content: center; }
.arbre-node--root { background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 28px; text-align: center; cursor: default; }
.arbre-node--root .arbre-node-icon { font-size: 22px; margin-bottom: 4px; }
.arbre-node--root .arbre-node-label { font-weight: 700; font-size: 13px; color: var(--text); }

/* vertical connector from root to self */
.arbre-root::after, .arbre-self-row::after {
  content: ""; display: block; width: 2px; height: 24px; background: var(--border);
  margin: 0 auto;
}

/* SELF node */
.arbre-self-row { display: flex; flex-direction: column; align-items: center; }
.arbre-node--self {
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-2));
  border: 1.5px solid var(--accent-border); border-radius: 14px;
  padding: 12px 28px; text-align: center; cursor: pointer; transition: .15s;
}
.arbre-node--self:hover { box-shadow: 0 0 0 3px var(--accent-soft); }
.arbre-node--self .arbre-node-icon  { font-size: 22px; margin-bottom: 4px; }
.arbre-node--self .arbre-node-label { font-weight: 700; font-size: 13px; color: var(--accent); }
.arbre-node--self .arbre-node-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* horizontal bar connecting self to coaches */
.arbre-coaches-row {
  display: flex; gap: 16px; align-items: flex-start; justify-content: center;
  flex-wrap: wrap; position: relative; padding-top: 0; margin-top: 0;
}
.arbre-coaches-row::before {
  content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 2px;
  background: var(--border); z-index: 0;
}

/* COACH column */
.arbre-coach-col {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  position: relative; padding-top: 24px; min-width: 160px;
}
.arbre-coach-col::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 2px; height: 24px;
  background: var(--border); transform: translateX(-50%);
}

/* COACH node */
.arbre-node--coach {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 16px; text-align: center; width: 100%; transition: .15s;
}
.arbre-node--coach:hover { border-color: var(--accent-border); }
.arbre-coach-name  { font-weight: 700; font-size: 13px; color: var(--text); }
.arbre-coach-rate  { font-size: 11px; color: var(--accent); margin-top: 3px; font-weight: 600; }
.arbre-coach-price { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* connector between coach node and result block */
.arbre-connector { width: 2px; height: 16px; background: #e8401c55; margin: 0 auto; flex-shrink: 0; }

/* RESULT block (red zone) */
.arbre-result-block {
  background: rgba(232, 64, 28, 0.07); border: 1px solid rgba(232, 64, 28, 0.25);
  border-radius: 10px; padding: 10px 14px; text-align: center; width: 100%;
}
.arbre-result-row   { font-size: 10.5px; color: var(--muted-2); margin-bottom: 4px; }
.arbre-result-brute { font-size: 11px; color: var(--muted); font-weight: 500; }
.arbre-result-tom   { font-size: 13px; color: #e8401c; font-weight: 700; margin-top: 4px; }

/* actions */
.arbre-coach-actions { display: flex; gap: 6px; margin-top: 8px; }
.arbre-edit-btn, .arbre-del-btn { font-size: 11px; padding: 4px 8px; }
.arbre-del-btn { color: var(--muted-2); }
.arbre-del-btn:hover { color: #f87171; border-color: #f8717155; }

/* ADD button */
.arbre-add-col { justify-content: flex-start; }
.arbre-add-btn {
  margin-top: 0; border: 1.5px dashed var(--border); background: transparent; color: var(--muted);
  border-radius: 12px; padding: 24px 20px; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 6px; transition: .15s;
  min-height: 80px; width: 140px; justify-content: center;
}
.arbre-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.arbre-add-icon { font-size: 22px; font-weight: 300; }

/* TOTAL bar */
.arbre-total-bar { width: 100%; margin-top: 24px; }
.arbre-total {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-2));
  border: 1.5px solid var(--accent-border); border-radius: 14px; padding: 16px 28px;
}
.arbre-total-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.arbre-total-value { font-size: 26px; font-weight: 750; color: var(--accent); letter-spacing: -.02em; }
.arbre-brand-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; display: block; }
.arbre-logo-wrap { width: 52px; height: 52px; margin: 0 auto 6px; }
.arbre-brand-name { font-size: 16px; margin-top: 4px; }

/* ---------------- Setter block ---------------- */
.arbre-setter-block {
  background: rgba(139,92,246,.08); border: 1px solid rgba(139,92,246,.25);
  border-radius: 10px; padding: 10px 14px; text-align: center; width: 100%; margin-top: 8px;
}
.arbre-setter-title  { font-size: 11px; font-weight: 600; color: #a78bfa; margin-bottom: 3px; }
.arbre-setter-detail { font-size: 10.5px; color: var(--muted-2); }
.arbre-setter-cost   { font-size: 11.5px; color: #f87171; font-weight: 600; margin-top: 4px; }
.arbre-setter-net    { font-size: 13px; color: #a78bfa; font-weight: 700; margin-top: 3px; }
.arbre-setter-actions { display: flex; gap: 4px; justify-content: center; margin-top: 6px; }
.arbre-setter-add { margin-top: 8px; text-align: center; }
.arbre-setter-add-btn {
  border: 1.5px dashed rgba(139,92,246,.35); background: transparent; color: rgba(139,92,246,.7);
  border-radius: 8px; padding: 6px 14px; cursor: pointer; font-family: inherit;
  font-size: 11.5px; font-weight: 500; transition: .15s; width: 100%;
}
.arbre-setter-add-btn:hover { border-color: #a78bfa; color: #a78bfa; }
.setter-type-row { display: flex; gap: 20px; margin: 10px 0 6px; }
.setter-radio { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; color: var(--muted); }
.setter-radio input { accent-color: var(--accent); }

/* ---------------- Total bar multi-lignes ---------------- */
.arbre-totals { display: flex; flex-direction: column; gap: 10px; padding: 18px 28px; }
.arbre-total-row { display: flex; align-items: center; justify-content: space-between; }
.arbre-total-row .arbre-total-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.arbre-total-row .arbre-total-value { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.arbre-total-setters .arbre-total-value.neg { color: #f87171; font-size: 18px; }
.arbre-total-net { border-top: 1px solid var(--border); padding-top: 10px; margin-top: 2px; }
.arbre-total-net .arbre-total-label { font-size: 14px; font-weight: 600; color: var(--text); }
.arbre-total-net .arbre-total-value.accent { font-size: 26px; font-weight: 750; color: var(--accent); letter-spacing: -.02em; }

/* ================================================================
   FUNNEL VIEW
   ================================================================ */
.funnel-view { display: flex; flex-direction: column; gap: 28px; }

/* KPI row */
.funnel-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.funnel-kpis .kpi-card { background: var(--card); border-radius: 14px; padding: 18px 20px; border: 1px solid var(--border-soft); }

/* Section titles */
.funnel-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 16px; }

/* Main funnel */
.funnel-main-section { background: var(--card); border-radius: 16px; border: 1px solid var(--border-soft); padding: 24px 28px; }
.funnel-chart { display: flex; flex-direction: column; gap: 6px; }
.funnel-row { display: flex; align-items: center; gap: 20px; min-height: 44px; }

.funnel-label-col { width: 220px; flex-shrink: 0; }
.funnel-stage-name { font-size: 13px; font-weight: 600; color: var(--text); display: block; }
.funnel-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.funnel-n { font-size: 18px; font-weight: 750; color: var(--text); letter-spacing: -.02em; }
.funnel-pct-total { font-size: 11px; color: var(--muted); }
.funnel-drop { font-size: 11px; font-weight: 600; color: #f87171; background: rgba(248,113,113,.12); border-radius: 4px; padding: 1px 5px; }

.funnel-bar-col { flex: 1; }
.funnel-bar-track { height: 32px; background: var(--bg); border-radius: 8px; overflow: hidden; position: relative; }
.funnel-bar { height: 100%; border-radius: 8px; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; transition: width .4s cubic-bezier(.25,.46,.45,.94); min-width: 32px; }
.funnel-bar-label { font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3); }

/* Side/dropout section */
.funnel-side-section { background: var(--card); border-radius: 16px; border: 1px solid var(--border-soft); padding: 24px 28px; }
.funnel-side-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.funnel-side-card { background: var(--bg); border-radius: 10px; padding: 14px 16px; border-left: 4px solid var(--border); }
.funnel-side-top { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.funnel-side-icon { font-size: 14px; }
.funnel-side-name { font-size: 12px; font-weight: 600; color: var(--muted); }
.funnel-side-n { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1; }
.funnel-side-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }

@media (max-width: 900px) {
  .funnel-kpis { grid-template-columns: repeat(2, 1fr); }
  .funnel-side-grid { grid-template-columns: repeat(2, 1fr); }
  .funnel-label-col { width: 160px; }
}
