:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fd;
  --line: #e4e8f2;
  --line-strong: #d3d9e8;
  --ink: #172033;
  --ink-2: #5a6478;
  --ink-3: #8b93a7;
  --accent: #4f6ef7;
  --accent-ink: #2f47b8;
  --accent-soft: #eef1fe;
  --good: #128a5b;
  --good-soft: #e5f6ef;
  --warn: #b26a00;
  --warn-soft: #fff4e0;
  --bad: #c0392b;
  --bad-soft: #fdeeec;
  --purple: #7a4bd1;
  --purple-soft: #f2ecfe;
  --navy: #0e1726;
  --navy-2: #15213a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(21, 33, 58, .04), 0 8px 24px -12px rgba(21, 33, 58, .18);
  --shadow-lg: 0 24px 60px -20px rgba(15, 25, 45, .35);
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
svg { width: 18px; height: 18px; display: block; }
.hidden { display: none !important; }

.app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: radial-gradient(120% 80% at 0% 0%, #1a2743 0%, var(--navy) 55%);
  color: #c7d0e2;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px; }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #6a85ff, #3f5ce6);
  color: #fff; font-weight: 700; font-size: 19px;
  box-shadow: 0 8px 18px -8px rgba(79, 110, 247, .9);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { color: #fff; font-size: 15.5px; letter-spacing: .2px; }
.brand-text span { font-size: 11.5px; color: #7f8cab; letter-spacing: .3px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 0; border-radius: 10px;
  background: transparent;
  color: #a7b2c8;
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
  transition: background .15s ease, color .15s ease;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: rgba(79, 110, 247, .18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(121, 145, 255, .28);
}
.nav-item.active .nav-ico { color: #9db0ff; }
.nav-ico { color: #6e7c99; display: flex; }
.nav-count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: #c7d0e2;
  font-size: 11.5px;
  text-align: center;
}
.nav-count.alert { background: rgba(240, 106, 90, .18); color: #ff9c8f; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.due-card {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 12px;
  padding: 12px 13px;
  cursor: pointer;
  transition: background .15s ease;
}
.due-card:hover { background: rgba(255, 255, 255, .08); }
.due-card-top { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #98a5bf; text-transform: uppercase; letter-spacing: .5px; }
.due-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff8a75; box-shadow: 0 0 0 3px rgba(255, 138, 117, .16); }
.due-card strong { display: block; font-size: 26px; color: #fff; margin: 6px 0 1px; font-weight: 650; }
.due-sub { font-size: 11.5px; color: #8592ad; }
.sidebar-note { margin: 0; padding: 0 4px; font-size: 10.5px; color: #5c6a86; line-height: 1.5; }

/* ---------- main / topbar ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 14px 30px;
  background: rgba(244, 246, 251, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.search-wrap input {
  width: 100%;
  padding: 9px 44px 9px 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap input:focus { border-color: #b9c4f5; box-shadow: 0 0 0 4px rgba(79, 110, 247, .1); }
.search-wrap kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: inherit; font-size: 11px; color: var(--ink-3);
  border: 1px solid var(--line-strong); border-radius: 5px; padding: 1px 5px;
  background: var(--surface-2);
}
.topbar-actions { display: flex; gap: 8px; margin-left: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--surface);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .06s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 18px -10px rgba(79, 110, 247, .9); }
.btn-primary:hover { background: #4260ee; }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); }
.btn-soft:hover { background: #e4e9fe; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface); border-color: var(--line-strong); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-danger:hover { background: #fbe0dc; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn {
  display: grid; place-items: center;
  width: 30px; height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }

/* ---------- view ---------- */
.view { padding: 26px 30px 60px; max-width: 1440px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -.3px; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.page-head .spacer { flex: 1; }

.alert-banner {
  margin: 18px 30px 0;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--warn-soft);
  border: 1px solid #f6ddb0;
  color: #7a4a00;
  font-size: 13px;
}
.alert-banner .btn { margin-left: auto; }

/* ---------- cards / kpi ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 0;
}
.card-head h3 { font-size: 14.5px; font-weight: 620; }
.card-head .spacer { flex: 1; }
.card-body { padding: 14px 18px 18px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 17px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .5px; font-weight: 550; }
.kpi-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.kpi-value { font-size: 27px; font-weight: 650; letter-spacing: -.5px; }
.kpi-sub { font-size: 12px; color: var(--ink-3); }
.kpi.accent .kpi-ico { background: var(--accent-soft); color: var(--accent); }
.kpi.warn .kpi-ico { background: var(--warn-soft); color: var(--warn); }
.kpi.bad .kpi-ico { background: var(--bad-soft); color: var(--bad); }
.kpi.good .kpi-ico { background: var(--good-soft); color: var(--good); }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: #c9d2f7; }

.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- lists ---------- */
.row-list { display: flex; flex-direction: column; }
.row-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s;
}
.row-item:first-child { border-top: 0; }
.row-item:hover { background: #fafbff; }
.avatar {
  width: 36px; height: 36px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600; font-size: 13px;
  letter-spacing: .3px;
}
.avatar.round { border-radius: 50%; }
.row-main { min-width: 0; flex: 1; }
.row-title { font-weight: 560; font-size: 13.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row-meta { display: flex; align-items: center; gap: 6px; flex: none; }
.row-actions { display: flex; gap: 2px; flex: none; opacity: 0; transition: opacity .12s; }
.row-item:hover .row-actions { opacity: 1; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-nouveau { background: #eef1f7; color: #56607a; }
.st-contacte { background: #e8f0fe; color: #2160c4; }
.st-rdv { background: var(--warn-soft); color: #9a5b00; }
.st-proposition { background: var(--purple-soft); color: #6636b8; }
.st-gagne { background: var(--good-soft); color: var(--good); }
.st-perdu { background: var(--bad-soft); color: #a83326; }
.date-badge { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.date-badge.today { background: var(--accent-soft); color: var(--accent-ink); border-color: #d5dcfb; }
.date-badge.overdue { background: var(--bad-soft); color: var(--bad); border-color: #f6d5d0; }
.date-badge.none { color: var(--ink-3); }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.leads { width: 100%; border-collapse: collapse; min-width: 860px; }
table.leads th {
  text-align: left;
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--ink-3); font-weight: 600;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
table.leads th:first-child { padding-left: 18px; }
table.leads td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.leads td:first-child { padding-left: 18px; }
table.leads tbody tr { cursor: pointer; transition: background .12s; }
table.leads tbody tr:hover { background: #fafbff; }
table.leads tbody tr:last-child td { border-bottom: 0; }
.cell-person { display: flex; align-items: center; gap: 11px; min-width: 190px; }
.cell-person .name { font-weight: 560; }
.cell-person .sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .12s;
}
.chip:hover { border-color: var(--line-strong); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { opacity: .65; margin-left: 3px; font-size: 11.5px; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kcol { background: #eef1f9; border: 1px solid #e6eaf4; border-radius: 14px; padding: 10px; min-height: 200px; }
.kcol.drag-over { background: #e6ebfd; border-color: #becbf7; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.kcol-head .kdot { width: 8px; height: 8px; border-radius: 50%; }
.kcol-head strong { font-size: 12.5px; font-weight: 600; }
.kcol-head .n { margin-left: auto; font-size: 11.5px; color: var(--ink-3); background: #fff; border-radius: 999px; padding: 1px 8px; }
.kcol-total { padding: 0 4px 8px; font-size: 11.5px; color: var(--ink-3); }
.kcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  margin-bottom: 8px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(21, 33, 58, .05);
  transition: box-shadow .12s, transform .12s;
}
.kcard:hover { box-shadow: 0 6px 16px -8px rgba(21, 33, 58, .28); transform: translateY(-1px); }
.kcard.dragging { opacity: .4; }
.kcard .kname { font-weight: 570; font-size: 13px; margin-bottom: 2px; }
.kcard .kco { font-size: 11.8px; color: var(--ink-3); margin-bottom: 8px; }
.kcard .kfoot { display: flex; align-items: center; gap: 6px; }
.kcard .kval { margin-left: auto; font-size: 11.5px; font-weight: 600; color: var(--ink-2); }

/* ---------- calendar ---------- */
.ev-list { display: flex; flex-direction: column; }
.ev-item { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-top: 1px solid var(--line); }
.ev-item:first-child { border-top: 0; }
.ev-date {
  width: 54px; flex: none; text-align: center;
  border-radius: 10px; padding: 6px 0;
  background: var(--accent-soft); color: var(--accent-ink);
}
.ev-date .d { font-size: 19px; font-weight: 650; line-height: 1.1; }
.ev-date .m { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; }
.ev-main { flex: 1; min-width: 0; }
.ev-title { font-weight: 560; font-size: 13.8px; }
.ev-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 11.8px; font-weight: 600; color: var(--ink-2); letter-spacing: .2px; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #aab8f5; box-shadow: 0 0 0 3px rgba(79, 110, 247, .1);
}
.field textarea { resize: vertical; min-height: 74px; }
.field .hint { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.form-actions .left { margin-right: auto; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); }

/* ---------- drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(13, 22, 40, .38); z-index: 40; backdrop-filter: blur(1px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 94vw;
  background: var(--surface);
  z-index: 50;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slideIn .18s ease;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.drawer-head-top { display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h2 { font-size: 19px; font-weight: 650; }
.drawer-head .sub { color: var(--ink-2); font-size: 13px; margin-top: 2px; }
.drawer-body { overflow-y: auto; padding: 20px 22px 40px; flex: 1; }
.quick-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 14px; }
.drawer-section { margin-top: 22px; }
.drawer-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--ink-3); margin-bottom: 10px; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.tl-item:last-child { border-bottom: 0; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; background: #c3cbe0; margin-top: 6px; flex: none; }
.tl-dot.contact { background: var(--accent); }
.tl-dot.etape { background: var(--purple); }
.tl-main { flex: 1; min-width: 0; }
.tl-text { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.tl-time { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* ---------- modal ---------- */
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 50;
  width: 620px; max-width: 94vw; max-height: 90vh;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: pop .16s ease;
}
.modal.wide { width: 860px; }
@keyframes pop { from { transform: translate(-50%, -47%) scale(.985); opacity: .6; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 22px 0; }
.modal-head h2 { font-size: 18px; font-weight: 650; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 16px 22px 22px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 0 22px 20px; }

/* ---------- import ---------- */
.import-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.paste-area { min-height: 230px; font-family: Consolas, "Segoe UI", monospace; font-size: 12.8px; line-height: 1.55; }
.preview-list { display: flex; flex-direction: column; gap: 10px; }
.preview-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.preview-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.preview-top .pname { font-weight: 600; font-size: 13.5px; }
.preview-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preview-fields .field label { font-size: 10.5px; }
.preview-fields .field input { padding: 6px 8px; font-size: 12.5px; background: #fff; }
.preview-fields .full { grid-column: 1 / -1; }
.import-note { font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.drop-zone {
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  color: var(--ink-2);
  background: var(--surface-2);
  cursor: pointer;
  transition: all .15s;
}
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.drop-zone .big { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.drop-zone .small { font-size: 12px; color: var(--ink-3); }
.prompt-box {
  margin: 0;
  padding: 13px 15px;
  background: #f7f9ff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12.4px;
  line-height: 1.65;
  color: #35415c;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.settings-section + .settings-section { margin-top: 26px; }
.settings-section h3 { font-size: 15px; margin-bottom: 4px; }
.settings-section .desc { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; line-height: 1.55; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 34px 20px; color: var(--ink-2); }
.empty .empty-ico { width: 46px; height: 46px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; margin: 0 auto 12px; color: var(--ink-3); }
.empty h4 { font-size: 14.5px; margin-bottom: 5px; color: var(--ink); }
.empty p { margin: 0 auto; font-size: 12.5px; max-width: 340px; line-height: 1.55; color: var(--ink-3); }
.empty .btn { margin-top: 14px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 80;
  background: #16203a; color: #fff;
  padding: 11px 16px;
  border-radius: 11px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 9px;
  animation: rise .18s ease;
  max-width: 380px;
}
.toast.err { background: #8f2b20; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- progress bars ---------- */
.funnel { display: flex; flex-direction: column; gap: 11px; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 52px; align-items: center; gap: 10px; font-size: 12.5px; }
.funnel-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.funnel-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); opacity: .8; }
.funnel-count { text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 11.8px;
  background: #eef1f8;
  border: 1px solid #e1e6f1;
  border-radius: 5px;
  padding: 1px 5px;
  color: #3b4661;
  word-break: break-all;
}
.field input::placeholder, .field textarea::placeholder,
.search-wrap input::placeholder, textarea::placeholder { color: #a7aec0; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .import-grid, .settings-grid { grid-template-columns: 1fr; }
  .kanban { grid-auto-columns: minmax(228px, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 0; height: auto; z-index: 30;
    flex-direction: row; align-items: center; gap: 12px;
    padding: 10px 14px; overflow-x: auto;
  }
  .brand-text, .sidebar-foot, .nav-item span:not(.nav-ico):not(.nav-count) { display: none; }
  .brand { padding: 0; }
  .nav { flex-direction: row; gap: 2px; }
  .nav-item { padding: 9px; }
  .nav-count { display: none !important; }
  .view { padding: 18px 14px 50px; }
  .topbar { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
  .search-wrap { order: 2; flex-basis: 100%; max-width: none; }
  .alert-banner { margin: 12px 14px 0; }
  .hide-sm { display: none; }
  .drawer { width: 100%; max-width: none; }
  .form-grid, .preview-fields { grid-template-columns: 1fr; }
  .row-actions { opacity: 1; }
  .row-item { flex-wrap: wrap; }
  .row-meta { margin-left: auto; }
}
@media (max-width: 620px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar-actions .btn span:last-child { display: none; }
  .topbar-actions .btn { padding: 8px 10px; }
  .page-head h1 { font-size: 20px; }
}
