/* Client acquisition CRM demo: one stylesheet, system fonts, no external assets. */
:root {
  --charcoal: #1B2838;
  --mint: #00D4AA;
  --mint-dark: #00B894;
  --mint-light: #E6FAF6;
  --ink: #1B2838;
  --muted: #64748B;
  --faint: #94A3B8;
  --page: #F7F8FA;
  --alt: #F1F5F9;
  --edge: #E2E6EB;
  --edge-strong: #CBD5E1;
  --good: #047857; --good-bg: #ECFDF5; --good-line: #6EE7B7;
  --mid: #B45309; --mid-bg: #FFFBEB; --mid-line: #FCD34D;
  --bad: #DC2626; --bad-bg: #FEF2F2; --bad-line: #FCA5A5;
  --bar-h: 64px;
}
@media (max-width: 640px) { :root { --bar-h: 112px; } }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  padding-bottom: var(--bar-h);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-radius: 2px; }
.faint { color: var(--faint); font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- Shell: sidebar + main ---------- */
.shell { display: flex; min-height: calc(100vh - var(--bar-h)); }
.side { position: sticky; top: 0; align-self: flex-start; height: calc(100vh - var(--bar-h)); overflow-y: auto; width: 220px; flex-shrink: 0; background: var(--charcoal); color: #fff; display: flex; flex-direction: column; padding: 20px 0; }
.side .brand { padding: 0 20px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.side .brand b { font-size: 18px; font-weight: 700; }
.side .brand b span { color: var(--mint); }
.side .brand div { font-size: 11px; color: var(--muted); margin-top: 2px; color: #94A3B8; }
.side nav { flex: 1; padding: 8px 0; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; font-size: 14px; color: #CBD5E1; border-left: 3px solid transparent; }
.side nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.side nav a.on { color: var(--mint); background: rgba(255,255,255,.05); border-left-color: var(--mint); font-weight: 600; }
.side nav svg { width: 16px; height: 16px; flex-shrink: 0; }
.side .user { padding: 12px 20px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; color: #CBD5E1; }
.side .user div { font-size: 11px; color: #94A3B8; }
.side .reset { display: inline-block; margin: 8px 20px 0; font-size: 12px; color: #94A3B8; text-decoration: underline; text-underline-offset: 2px; }
.side .reset:hover { color: #fff; }
main { flex: 1; min-width: 0; padding: 24px 28px 32px; }

.head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.head .sub { color: var(--muted); margin-top: 4px; }
.crumb { display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.crumb:hover { color: var(--ink); }

/* ---------- Buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--edge-strong); background: #fff; border-radius: 6px; padding: 8px 14px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--mint); border-color: var(--mint); color: var(--charcoal); }
.btn.primary:hover { background: var(--mint-dark); border-color: var(--mint-dark); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn[disabled] { opacity: .6; cursor: default; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 600; }
.input, .select { background: #fff; border: 1px solid var(--edge); border-radius: 6px; padding: 8px 12px; min-height: 40px; color: var(--ink); font-weight: 400; }
.select { padding-right: 28px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.filters .select, .filters .input { min-width: 200px; }
.filters input.input { min-width: 280px; }
.show-sm { display: none; }

/* ---------- Panels ---------- */
.panel { background: #fff; border: 1px solid var(--edge); border-radius: 8px; padding: 18px 20px; margin-bottom: 16px; }
.panel > h2, .panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-h h2 { font-size: 16px; }
.label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--edge); border-radius: 8px; padding: 12px 16px; }
.kpi .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.kpi .n { font-size: 12px; color: var(--muted); }

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; align-items: start; }
.col { min-height: 120px; border-radius: 8px; transition: background .15s; }
.col.over { background: var(--mint-light); outline: 2px dashed var(--mint); outline-offset: 4px; }
.col-h { display: flex; justify-content: space-between; align-items: baseline; padding: 0 12px 10px; }
.col-h .t { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.col-h .s { font-size: 12px; color: var(--faint); }
.deal { display: block; background: #fff; border: 1px solid var(--edge); border-radius: 6px; padding: 14px 18px; margin-bottom: 10px; cursor: grab; transition: box-shadow .15s, border-color .15s; }
.deal:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); border-color: var(--edge-strong); }
.deal.dragging { opacity: .45; }
.deal .c { font-size: 15px; font-weight: 500; }
.deal .t { color: var(--muted); font-size: 13px; margin-top: 2px; }
.deal .a { font-weight: 600; margin-top: 6px; font-size: 14px; }
.deal .n { color: var(--muted); font-size: 13px; margin-top: 6px; }
.deal .r { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--bad); background: var(--bad-bg); padding: 1px 8px; border-radius: 999px; }
.deal.fresh { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-light); }
.empty-col { border: 1px dashed var(--edge-strong); border-radius: 6px; padding: 18px; text-align: center; color: var(--faint); font-size: 13px; }
.hint { color: var(--muted); font-size: 13px; margin: -8px 0 16px; }

/* ---------- Status pills and fit chips ---------- */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.pill.new { color: #1D4ED8; background: #EFF6FF; border-color: #BFDBFE; }
.pill.working { color: var(--mid); background: var(--mid-bg); border-color: var(--mid-line); }
.pill.won { color: var(--good); background: var(--good-bg); border-color: var(--good-line); }
.pill.lost { color: var(--muted); background: var(--alt); border-color: var(--edge-strong); }
.fit { display: inline-block; min-width: 38px; text-align: center; font-weight: 700; font-size: 13px; padding: 2px 8px; border-radius: 999px; border: 1px solid; }
.fit-good { color: var(--good); background: var(--good-bg); border-color: var(--good-line); }
.fit-mid { color: var(--mid); background: var(--mid-bg); border-color: var(--mid-line); }
.fit-bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.fit-none { color: var(--faint); background: var(--alt); border-color: var(--edge); font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--edge-strong); border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 8px 14px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--muted); border-right: 1px solid var(--edge); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--charcoal); color: #fff; }

/* ---------- Tables ---------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--edge); background: var(--alt); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--edge); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #FAFBFC; }
.tbl .name { font-weight: 600; }
.tbl .name:hover { color: var(--mint-dark); }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; background: var(--alt); }
.tbl tr.added td { background: var(--mint-light); }

/* ---------- Detail bits ---------- */
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; }
.score { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.score .big { font-size: 44px; font-weight: 700; line-height: 1; }
.score .of { color: var(--faint); font-size: 14px; }
.part { margin-bottom: 12px; }
.part .top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.part .bar, .complete .bar { height: 8px; background: var(--alt); border-radius: 999px; overflow: hidden; margin: 4px 0 2px; }
.part .bar span, .complete .bar span { display: block; height: 100%; background: var(--mint); border-radius: 999px; transition: width .5s ease; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.flag { font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.flag.g { color: var(--good); background: var(--good-bg); }
.flag.r { color: var(--bad); background: var(--bad-bg); }
.complete { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.complete .bar { flex: 1; margin: 0; }
.profile { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 14px; margin: 0; }
.profile dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.profile dd { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--alt); border: 1px solid var(--edge); border-radius: 999px; padding: 1px 10px; font-size: 13px; }
.tagline { margin-top: 6px; font-style: italic; }
.donts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.donts span { font-size: 12px; color: var(--bad); background: var(--bad-bg); border-radius: 999px; padding: 1px 10px; }
ul.tight { margin: 0; padding-left: 18px; }
.contact { padding: 10px 0; border-bottom: 1px solid var(--edge); }
.contact:last-child { border-bottom: 0; padding-bottom: 0; }
.contact:first-child { padding-top: 0; }
.contact .nm { font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--edge); }
.feed li:last-child { border-bottom: 0; }
.feed .ic { width: 28px; height: 28px; border-radius: 50%; background: var(--alt); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.feed .ic.call { background: #EFF6FF; color: #1D4ED8; }
.feed .ic.email { background: var(--mid-bg); color: var(--mid); }
.feed .ic.status { background: var(--good-bg); color: var(--good); }
.feed .meta { font-size: 12px; color: var(--faint); }
.feed li.fresh { background: var(--mint-light); }
.addnote { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.addnote .input { flex: 1; min-width: 180px; }
.eng-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--edge); }
.eng-row:last-child { border-bottom: 0; }
.eng-row:hover .tt { color: var(--mint-dark); }
.eng-row .tt { font-weight: 600; }
.note-box { background: var(--mid-bg); border: 1px solid var(--mid-line); border-radius: 6px; padding: 10px 12px; font-size: 13px; }
.callout { background: var(--mint-light); border: 1px solid #A7F3D0; border-radius: 6px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }

/* ---------- Proposal ---------- */
.proposal { border: 1px solid var(--edge); border-radius: 6px; padding: 18px 20px; background: #FCFDFD; max-height: 640px; overflow-y: auto; }
.proposal h2 { font-size: 20px; margin-bottom: 8px; }
.proposal h3 { font-size: 15px; margin: 18px 0 6px; padding-top: 12px; border-top: 1px solid var(--edge); }
.proposal h4 { font-size: 14px; margin: 10px 0 2px; }
.proposal p, .proposal li { font-size: 14px; }
.proposal ul { margin: 4px 0 8px; padding-left: 20px; }
.ptable { margin: 6px 0 10px; font-size: 13px; }
.ptable th, .ptable td { border: 1px solid var(--edge); padding: 6px 10px; text-align: left; }
.ptable th { background: var(--alt); }
.sample { font-size: 12px; color: var(--faint); margin-top: 12px; }
.busy-row { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 14px 0; }
.spin { width: 16px; height: 16px; border: 2px solid var(--edge); border-top-color: var(--mint); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps { list-style: none; padding: 0; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.steps li::before { content: "\2713  "; color: var(--mint-dark); font-weight: 700; }

/* ---------- Calls ---------- */
.calls { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; align-items: start; }
.call-item { display: block; width: 100%; text-align: left; background: #fff; border: 1px solid var(--edge); border-radius: 6px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.call-item:hover { border-color: var(--edge-strong); }
.call-item.on { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-light); }
.call-item .c { font-weight: 600; }
.call-item .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.call-item .pill { margin-top: 6px; }
.transcript { white-space: pre-wrap; background: var(--alt); border-radius: 6px; padding: 14px 16px; max-height: 360px; overflow-y: auto; font-size: 13px; line-height: 1.6; }
.audio { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--alt); border-radius: 6px; padding: 12px 14px; }
.audio .wave { flex: 1; min-width: 140px; height: 28px; background: repeating-linear-gradient(90deg, var(--edge-strong) 0 3px, transparent 3px 6px); border-radius: 4px; opacity: .8; }
.quotes { margin: 12px 0 0; padding: 0; list-style: none; }
.quotes li { font-size: 13px; border-left: 3px solid var(--mint); padding: 2px 0 2px 10px; margin-bottom: 6px; }
.quotes b { color: var(--muted); font-weight: 600; }

/* ---------- Leads ---------- */
.leads { list-style: none; padding: 0; margin: 0; }
.leads li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--edge); }
.leads li:last-child { border-bottom: 0; }
.leads .why { font-size: 13px; color: var(--muted); }
.leads .act { display: flex; align-items: center; gap: 10px; }

/* ---------- Toast + modal ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bar-h) + 16px); background: var(--charcoal); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.18); z-index: 2147483100; font-size: 14px; max-width: calc(100vw - 32px); transition: opacity .3s; }
.toast.out { opacity: 0; }
.modal-back { position: fixed; inset: 0; background: rgba(15,23,32,.5); display: grid; place-items: center; padding: 16px 16px calc(var(--bar-h) + 16px); z-index: 2147483050; }
.modal { background: #fff; border-radius: 10px; width: min(460px, 100%); max-height: calc(100vh - var(--bar-h) - 32px); overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--edge); }
.modal-head .x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { padding: 16px 20px 20px; display: grid; gap: 12px; }
.modal-body .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-body .actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Demo bar (same pattern as the other portfolio demos) ---------- */
#tkbsDemoBar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147483000;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px;
  padding: 9px 16px; background: #0F1720; color: #E6EDF5;
  font: 500 13px/1.35 system-ui, -apple-system, "Segoe UI", Arial, sans-serif; border-top: 2px solid #3DDC97;
}
#tkbsDemoBar b { color: #3DDC97; letter-spacing: .06em; font-weight: 700; }
#tkbsDemoBar a { color: #fff; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
#tkbsDemoBar a.cta { background: #3DDC97; color: #0F1720; text-decoration: none; font-weight: 700; padding: 6px 12px; border-radius: 999px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board { gap: 16px; }
}
@media (max-width: 980px) {
  .grid2, .calls { grid-template-columns: minmax(0, 1fr); }
  .board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 14px; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
  .col { flex: 0 0 280px; scroll-snap-align: start; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .side { position: static; height: auto; align-self: auto; width: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; gap: 6px 14px; }
  .side .brand { padding: 0; border: 0; order: 0; }
  .side .reset { order: 1; margin: 0 0 0 auto; }
  .side nav { order: 2; }
  .side .brand div, .side .user { display: none; }
  .side nav { display: flex; flex: 1 1 100%; padding: 0; gap: 4px; overflow-x: auto; }
  .side nav a { padding: 8px 12px; border-left: 0; border-radius: 6px; }
  .side nav a.on { border-left: 0; background: rgba(0,212,170,.12); }
  main { padding: 18px 16px 24px; }
  h1 { font-size: 22px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 19px; }
  .filters .select, .filters .input { min-width: 0; flex: 1 1 100%; }
  .panel { padding: 14px 16px; }
  .kv { grid-template-columns: 110px minmax(0, 1fr); }
  .profile { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .profile dd { margin-bottom: 8px; }
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .filters input.input { min-width: 0; }
  .seg button { padding: 8px 10px; }
  .modal-body .row2 { grid-template-columns: minmax(0, 1fr); }
}
