:root {
  --bg: #f4f5f8;
  --panel: #ffffff;
  --line: #e4e7ec;
  --line-soft: #eef0f4;
  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --soft: #98a2b3;
  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --side: #0b1220;
  --side-2: #151e30;
  --side-text: #c7cfdd;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --bad: #d92d20;
  --bad-bg: #fef3f2;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14), 0 4px 8px rgba(16, 24, 40, .06);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--text); }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--muted); }
.soft { color: var(--soft); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.tight { gap: 6px; }
.gap-lg { gap: 16px; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 20px; }
.mb { margin-bottom: 12px; }
.svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.svg.sm { width: 14px; height: 14px; }
.svg.lg { width: 20px; height: 20px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side);
  color: var(--side-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 12px;
  gap: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 6px; color: #fff; font-weight: 700; font-size: 15px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #22d3ee);
  display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 800;
}
.brand small { display: block; font-weight: 500; font-size: 11px; color: #8a96ab; }
.proj-switch {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  background: var(--side-2); border: 1px solid #243049; color: #e8edf6;
  border-radius: 10px; padding: 9px 10px; cursor: pointer; font: inherit;
}
.proj-switch:hover { border-color: #33415f; }
.proj-switch .lbl { font-size: 11px; color: #8a96ab; display: block; }
.proj-switch .nm { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6b778c; padding: 10px 10px 4px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--side-text); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: #172136; color: #fff; }
.nav a.active { background: #1f2a44; color: #fff; }
.nav a.active .svg { color: #a5b4fc; }
.nav .cnt { margin-left: auto; font-size: 11.5px; background: #243049; color: #cbd5e1; padding: 1px 7px; border-radius: 999px; }
.nav .cnt.alert { background: #7a271a; color: #fecdca; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.ai-pill { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--side-2); color: var(--side-text); cursor: pointer; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); flex: none; }
.dot.ok { background: #12b76a; box-shadow: 0 0 0 3px rgba(18, 183, 106, .18); }
.dot.bad { background: #f04438; }
.side-user { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px; color: #8a96ab; }
.side-user button { background: none; border: 0; color: #8a96ab; cursor: pointer; font: inherit; }
.side-user button:hover { color: #fff; }

.main { min-width: 0; }
.page { padding: 24px 28px 96px; max-width: 1500px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; color: var(--muted); max-width: 70ch; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); font: 600 13.5px/1 var(--font); cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05); white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: #f9fafb; border-color: #d0d5dd; text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-600); }
.btn.ai { background: linear-gradient(135deg, #4f46e5, #7c3aed); border-color: transparent; color: #fff; }
.btn.ai:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: #eef0f4; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); border-color: #fecdca; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.icon.sm { width: 30px; }
.btn.block { width: 100%; }
.btn .spin { width: 14px; height: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; font: 14px/1.4 var(--font); color: var(--text); background: #fff;
  border: 1px solid #d0d5dd; border-radius: 9px; padding: 8px 11px; outline: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: border-color .12s, box-shadow .12s;
}
.input, .select { height: 36px; }
.input.sm, .select.sm { height: 30px; font-size: 13px; padding: 4px 9px; border-radius: 8px; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: #a5b4fc; box-shadow: 0 0 0 4px rgba(99, 102, 241, .14); }
.select { appearance: none; padding-right: 30px; background: #fff 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='%23667085' stroke-width='2.2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.switch { position: relative; width: 34px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #d0d5dd; border-radius: 99px; cursor: pointer; transition: .15s; }
.switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(14px); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.seg-ctl { display: inline-flex; background: #eef0f4; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-ctl button { border: 0; background: transparent; padding: 6px 11px; border-radius: 7px; font: 600 12.5px var(--font); color: var(--muted); cursor: pointer; }
.seg-ctl button.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* ---------- surfaces ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.card-body { padding: 16px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; align-items: center; }
.cols { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); color: #3730a3; font-size: 13px; }
.callout.warn { background: var(--warn-bg); border-color: #fedf89; color: #93370d; }
.callout.bad { background: var(--bad-bg); border-color: #fecdca; color: #912018; }
.callout .svg { margin-top: 2px; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; }
.kpi .k { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.kpi .v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 4px; }
.kpi .d { font-size: 12px; color: var(--muted); }
.kpi .d.up { color: var(--ok); }
.kpi .d.alert { color: var(--bad); }

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  background: #f2f4f7; color: var(--text-2); font-size: 12px; font-weight: 500; border: 1px solid transparent; white-space: nowrap;
}
.chip.click { cursor: pointer; }
.chip.click:hover { background: #e9ecf1; }
.chip.on { background: var(--brand-50); color: var(--brand-600); border-color: var(--brand-100); }
.chip.off { background: #fff; color: var(--soft); border-color: var(--line); text-decoration: line-through; }
.chip .x { cursor: pointer; opacity: .6; margin-right: -3px; }
.chip .x:hover { opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: #f2f4f7; color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.brand { background: var(--brand-50); color: var(--brand-600); }
.seg-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.score {
  display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 6px; border-radius: 8px;
  font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; border: 1px solid transparent; cursor: default;
}
.score.hot { background: #dcfae6; color: #067647; border-color: #abefc6; }
.score.warm { background: #fef0c7; color: #93370d; border-color: #fedf89; }
.score.cold { background: #f2f4f7; color: #667085; border-color: #e4e7ec; }
.score.none { background: #fff; color: var(--soft); border: 1px dashed #d0d5dd; }
.score.pre::after { content: "≈"; font-size: 10px; margin-left: 1px; opacity: .6; }
.score.lg { min-width: 54px; height: 40px; font-size: 18px; border-radius: 11px; }
.stage-pill {
  appearance: none; border: 1px solid transparent; border-radius: 999px; font: 600 12px var(--font);
  padding: 3px 24px 3px 10px; cursor: pointer; background-repeat: no-repeat; background-position: right 7px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.st-new { background-color: #f2f4f7; color: #344054; }
.st-work { background-color: #eff8ff; color: #175cd3; }
.st-contacted { background-color: #f4f3ff; color: #5925dc; }
.st-talks { background-color: #fffaeb; color: #b54708; }
.st-won { background-color: #ecfdf3; color: #067647; }
.st-lost { background-color: #fef3f2; color: #b42318; }

/* ---------- table ---------- */
.tbl-wrap { overflow: auto; border-radius: var(--radius-lg); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th {
  position: sticky; top: 0; z-index: 1; background: #f9fafb; text-align: left; font-size: 12px; font-weight: 600;
  color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
.tbl th.sort { cursor: pointer; }
.tbl th.sort:hover { color: var(--text); }
.tbl th .arr { opacity: .5; margin-left: 3px; }
.tbl th.sorted { color: var(--brand-600); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .08s; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl tbody tr.sel td { background: #f5f7ff; }
.tbl .w-check { width: 36px; padding-right: 0; }
.tbl .nm { font-weight: 600; color: var(--text); }
.tbl .cat { font-size: 12px; color: var(--muted); max-width: 380px; }
.c-icons { display: flex; gap: 4px; }
.c-icon { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: #f2f4f7; color: var(--muted); }
.c-icon.on { background: var(--brand-50); color: var(--brand-600); }
.overdue { color: var(--bad); font-weight: 600; }

.quick-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.quick-tabs button {
  border: 0; background: none; padding: 9px 12px; font: 600 13px var(--font); color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: flex; gap: 6px; align-items: center;
}
.quick-tabs button:hover { color: var(--text); }
.quick-tabs button.on { color: var(--brand-600); border-bottom-color: var(--brand); }
.quick-tabs .n { font-size: 11.5px; background: #f2f4f7; color: var(--muted); border-radius: 99px; padding: 0 7px; }
.quick-tabs button.on .n { background: var(--brand-50); color: var(--brand-600); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px; border-bottom: 1px solid var(--line-soft); }
.filters .input.search { width: 260px; padding-left: 32px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2398a2b3' stroke-width='2.2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center; }
.filters .select { width: auto; min-width: 130px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }

.bulkbar {
  position: fixed; left: calc(252px + 50%); transform: translateX(calc(-50% - 126px)); bottom: 20px; z-index: 30;
  background: #101828; color: #fff; border-radius: 14px; padding: 8px 8px 8px 16px; display: flex; gap: 6px; align-items: center;
  box-shadow: var(--shadow-lg); max-width: calc(100vw - 300px); flex-wrap: wrap;
}
.bulkbar .btn { background: #1d2939; border-color: #344054; color: #f2f4f7; box-shadow: none; }
.bulkbar .btn:hover { background: #283548; }
.bulkbar .btn.ai { background: linear-gradient(135deg, #4f46e5, #7c3aed); border: 0; }
.bulkbar .cnt { font-weight: 600; margin-right: 6px; white-space: nowrap; }

/* ---------- segments ---------- */
.seg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.seg-card { display: flex; flex-direction: column; overflow: hidden; position: relative; }
.seg-card .bar { height: 4px; }
.seg-card.off { opacity: .6; }
.seg-card .body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.seg-card .title { display: flex; align-items: flex-start; gap: 8px; justify-content: space-between; }
.seg-card .title h3 { font-size: 15px; }
.seg-card .sect { font-size: 13px; color: var(--text-2); }
.seg-card .sect b { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--soft); font-weight: 600; margin-bottom: 2px; }
.seg-card ul { margin: 0; padding-left: 18px; }
.seg-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); padding: 10px 16px; border-top: 1px solid var(--line-soft); background: #fcfcfd; }
.seg-stats b { color: var(--text); font-weight: 650; }
.prio-1 { background: #dcfae6; color: #067647; }
.prio-2 { background: #eff8ff; color: #175cd3; }
.prio-3 { background: #f2f4f7; color: #475467; }
.proposal { border: 1px dashed #a5b4fc; background: #fbfbff; }
.proposal.picked { border-style: solid; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }

/* ---------- search ---------- */
.steps { display: flex; flex-direction: column; gap: 14px; }
.step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.seg-pick { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.seg-pick.on { border-color: #c7d2fe; background: #fafaff; }
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); z-index: 20; overflow: hidden; }
.ac-list div { padding: 8px 12px; cursor: pointer; }
.ac-list div:hover, .ac-list div.hl { background: var(--brand-50); }
.progress { height: 8px; border-radius: 99px; background: #eef0f4; overflow: hidden; }
.progress > div { height: 100%; background: linear-gradient(90deg, #6366f1, #22d3ee); transition: width .3s; }
.job { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13px; }
.job:last-child { border-bottom: 0; }
.job .st { width: 18px; display: grid; place-items: center; }

/* ---------- pipeline ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: #eceef2; border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 240px; }
.col.drop { background: #e0e7ff; outline: 2px dashed #a5b4fc; }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; font-weight: 650; font-size: 13px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; box-shadow: var(--shadow); cursor: grab; display: flex; flex-direction: column; gap: 6px; }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .45; }
.kcard .nm { font-weight: 600; font-size: 13px; line-height: 1.3; }

/* ---------- drawer / modal ---------- */
.shade { position: fixed; inset: 0; background: rgba(16, 24, 40, .38); z-index: 40; animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: #fff; z-index: 41;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out;
}
.drawer-head { padding: 18px 20px 0; border-bottom: 1px solid var(--line); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 40px; }
.tabs { display: flex; gap: 2px; margin-top: 14px; }
.tabs button { border: 0; background: none; padding: 10px 12px; font: 600 13px var(--font); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 6px; }
.tabs button.on { color: var(--brand-600); border-bottom-color: var(--brand); }
.stage-steps { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 12px; }
.stage-steps button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 10px; font: 600 12px var(--font); color: var(--muted); cursor: pointer; }
.stage-steps button:hover { border-color: #c7d2fe; color: var(--text); }
.stage-steps button.on { border-color: transparent; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.inline-field { display: flex; gap: 6px; align-items: center; }
.inline-field .input { flex: 1; }
.sect-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); font-weight: 650; margin: 18px 0 8px; }
.sect-title:first-child { margin-top: 0; }
.insight-block { padding: 12px 14px; border-radius: 12px; background: #f9fafb; border: 1px solid var(--line-soft); }
.insight-block h4 { font-size: 12.5px; color: var(--brand-600); margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.insight-block ul { margin: 4px 0 0; padding-left: 18px; }
.qa { border-left: 3px solid #c7d2fe; padding: 2px 0 2px 10px; margin-top: 8px; }
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.tl .ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #f2f4f7; color: var(--muted); }
.tl .txt { white-space: pre-wrap; font-size: 13.5px; }
.modal {
  position: fixed; left: 50%; top: 7vh; transform: translateX(-50%); width: min(640px, calc(100vw - 32px)); max-height: 86vh;
  background: #fff; border-radius: 16px; z-index: 51; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .16s ease-out;
}
.modal.wide { width: min(980px, calc(100vw - 32px)); }
.modal-head { padding: 18px 20px 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.modal-head p { color: var(--muted); margin-top: 4px; font-size: 13px; }
.modal-body { padding: 4px 20px 16px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 8px; }
.modal-shade { z-index: 50; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: #101828; color: #fff; padding: 11px 14px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: 420px; animation: pop .15s; display: flex; gap: 8px; align-items: flex-start; }
.toast.bad { background: #b42318; }
.toast.ok { background: #067647; }

[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%);
  background: #101828; color: #fff; font: 500 12px/1.4 var(--font); padding: 6px 9px; border-radius: 7px;
  white-space: normal; width: max-content; max-width: 280px; z-index: 70; pointer-events: none; text-transform: none; letter-spacing: 0;
}
[data-tip].tip-right:hover::after { left: auto; right: 0; transform: none; }
[data-tip].tip-left:hover::after { left: 0; transform: none; }
.help-i { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #eef0f4; color: var(--muted); font-size: 10.5px; font-weight: 700; cursor: help; }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin: 0 auto 14px; }
.empty h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }
.empty p { max-width: 46ch; margin: 0 auto 16px; }

.checklist { display: flex; flex-direction: column; gap: 4px; }
.ck { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; }
.ck:hover { background: #f9fafb; }
.ck .n { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #d0d5dd; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.ck.done .n { background: #12b76a; border-color: #12b76a; color: #fff; }
.ck.done .t { color: var(--muted); text-decoration: line-through; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 70px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.funnel-bar { height: 22px; border-radius: 6px; background: #eef0f4; overflow: hidden; }
.funnel-bar > div { height: 100%; border-radius: 6px; min-width: 2px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.list-row:last-child { border-bottom: 0; }
.list-row:hover .nm { color: var(--brand-600); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 20% 0%, #e0e7ff, transparent 60%), radial-gradient(700px 400px at 100% 100%, #cffafe, transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); padding: 28px; }
.wizard { max-width: 860px; margin: 0 auto; }
.example-chips .chip { cursor: pointer; background: #fff; border-color: var(--line); height: auto; padding: 5px 10px; white-space: normal; text-align: left; }
.example-chips .chip:hover { border-color: #a5b4fc; color: var(--brand-600); }
.tpl-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.tpl-item { padding: 10px 12px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.tpl-item:hover { background: #f9fafb; }
.tpl-item.on { background: var(--brand-50); }
.prov-row { display: grid; grid-template-columns: 30px 38px minmax(150px, 1fr) minmax(200px, 1.4fr) 120px 150px; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.prov-row:last-child { border-bottom: 0; }
.prov-row.head { font-size: 12px; color: var(--muted); font-weight: 600; background: #f9fafb; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: currentColor; border-radius: 50%; animation: rot .7s linear infinite; display: inline-block; }
.btn:not(.primary):not(.ai) .spin { border-color: rgba(79,70,229,.2); border-top-color: var(--brand); }
.loading { display: flex; justify-content: center; padding: 40px; color: var(--muted); gap: 10px; align-items: center; }
.loading .spin { border-color: rgba(79,70,229,.2); border-top-color: var(--brand); }
.kbd { font: 600 11px var(--font); background: #f2f4f7; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); }

@keyframes rot { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } }
@keyframes pop { from { transform: translateX(-50%) scale(.97); opacity: 0; } }
.toast { animation: none; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .cols, .cols-even { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-title, .side-foot { display: none; }
  .page { padding: 16px; }
  .kpis, .grid-2, .grid-3 { grid-template-columns: 1fr 1fr; }
  .tpl-layout { grid-template-columns: 1fr; }
  .bulkbar { left: 50%; transform: translateX(-50%); max-width: calc(100vw - 24px); }
}
