/* Wivo CRM — same family as Geogen Scan (font stack, violet accent), calmer and denser for all-day work. */

:root {
  --font: -apple-system, "SF Pro Text", system-ui, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: -apple-system, "SF Pro Display", system-ui, "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.22, 1.2, .36, 1);
  --side-w: 236px;
  --top-h: 60px;
  --r: 12px; --r-sm: 8px; --r-lg: 16px;
  --brand: linear-gradient(120deg, #7cf7ff 0%, #8b7bff 50%, #ff6ad5 100%);

  color-scheme: dark;
  --bg: #07070f;
  --side: #0b0b16;
  --surface: #10101c;
  --surface-2: #161626;
  --surface-3: #1d1d31;
  --hover: rgba(255, 255, 255, .04);
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .13);
  --ink: #f2f3fb;
  --ink-2: rgba(235, 237, 255, .72);
  --ink-3: rgba(225, 228, 255, .47);
  --accent: #8b7bff;
  --accent-strong: #7564ff;
  --accent-soft: rgba(139, 123, 255, .16);
  --on-accent: #fff;
  --danger: #ff6b7d;
  --ok: #34d399;
  --warn: #fbbf24;
  --focus: 0 0 0 3px rgba(139, 123, 255, .45);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 18px 50px -20px rgba(0, 0, 0, .7);
  --shadow-pop: 0 24px 70px -18px rgba(0, 0, 0, .8), 0 0 0 1px var(--line-2);
  --bar: #8b7bff;
  --bar-track: rgba(139, 123, 255, .14);

  --slate: #94a3b8; --gray: #a1a1aa; --red: #f87171; --orange: #fb923c; --amber: #fbbf24; --green: #34d399;
  --teal: #2dd4bf; --cyan: #22d3ee; --blue: #60a5fa; --violet: #a78bfa; --pink: #f472b6;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f4f9; --side: #eaecf5; --surface: #ffffff; --surface-2: #f6f7fc; --surface-3: #eceef7;
    --hover: rgba(12, 14, 50, .035); --line: rgba(12, 14, 50, .085); --line-2: rgba(12, 14, 50, .15);
    --ink: #0d0f24; --ink-2: rgba(14, 16, 46, .7); --ink-3: rgba(14, 16, 46, .5);
    --accent: #6253f0; --accent-strong: #5141e6; --accent-soft: rgba(98, 83, 240, .1);
    --danger: #d61f3b; --ok: #047857; --warn: #b45309;
    --focus: 0 0 0 3px rgba(98, 83, 240, .3);
    --shadow: 0 1px 2px rgba(20, 20, 60, .05), 0 12px 32px -18px rgba(30, 30, 90, .22);
    --shadow-pop: 0 24px 60px -20px rgba(30, 30, 90, .35), 0 0 0 1px var(--line-2);
    --bar: #6253f0; --bar-track: rgba(98, 83, 240, .12);
    --slate: #64748b; --gray: #71717a; --red: #dc2626; --orange: #ea580c; --amber: #d97706; --green: #059669;
    --teal: #0d9488; --cyan: #0891b2; --blue: #2563eb; --violet: #7c3aed; --pink: #db2777;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f9; --side: #eaecf5; --surface: #ffffff; --surface-2: #f6f7fc; --surface-3: #eceef7;
  --hover: rgba(12, 14, 50, .035); --line: rgba(12, 14, 50, .085); --line-2: rgba(12, 14, 50, .15);
  --ink: #0d0f24; --ink-2: rgba(14, 16, 46, .7); --ink-3: rgba(14, 16, 46, .5);
  --accent: #6253f0; --accent-strong: #5141e6; --accent-soft: rgba(98, 83, 240, .1);
  --danger: #d61f3b; --ok: #047857; --warn: #b45309;
  --focus: 0 0 0 3px rgba(98, 83, 240, .3);
  --shadow: 0 1px 2px rgba(20, 20, 60, .05), 0 12px 32px -18px rgba(30, 30, 90, .22);
  --shadow-pop: 0 24px 60px -20px rgba(30, 30, 90, .35), 0 0 0 1px var(--line-2);
  --bar: #6253f0; --bar-track: rgba(98, 83, 240, .12);
  --slate: #64748b; --gray: #71717a; --red: #dc2626; --orange: #ea580c; --amber: #d97706; --green: #059669;
  --teal: #0d9488; --cyan: #0891b2; --blue: #2563eb; --violet: #7c3aed; --pink: #db2777;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: var(--accent-soft); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.sub { color: var(--ink-2); }
.small { font-size: 12.5px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s { width: 14px; height: 14px; }
svg.i.l { width: 18px; height: 18px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 560; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-strong); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--hover); color: var(--ink); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; gap: 5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .kbd { margin-left: 4px; }
.kbd { font: 11px/1 var(--mono); padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--ink-3); background: var(--surface); }

.inp, .sel, .ta {
  height: 34px; padding: 0 11px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface);
  outline: none; transition: border-color .15s, box-shadow .15s; min-width: 0;
}
.inp:focus, .sel:focus, .ta:focus { border-color: var(--accent); box-shadow: var(--focus); }
.inp::placeholder, .ta::placeholder { color: var(--ink-3); }
.ta { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; width: 100%; }
.sel { padding-right: 28px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; background-size: 5px 5px; background-repeat: no-repeat; }
.inp.err, .ta.err { border-color: var(--danger); }
.field-err { color: var(--danger); font-size: 12.5px; margin-top: 4px; }
label.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; cursor: pointer; }

/* ---------- pills, chips, avatars ---------- */
.c-slate { --c: var(--slate); } .c-gray { --c: var(--gray); } .c-red { --c: var(--red); } .c-orange { --c: var(--orange); }
.c-amber { --c: var(--amber); } .c-green { --c: var(--green); } .c-teal { --c: var(--teal); } .c-cyan { --c: var(--cyan); }
.c-blue { --c: var(--blue); } .c-violet { --c: var(--violet); } .c-pink { --c: var(--pink); }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px; border-radius: 99px; font-size: 12px; font-weight: 560;
  background: color-mix(in srgb, var(--c, var(--slate)) 15%, transparent); color: var(--ink); white-space: nowrap; border: 0;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--slate)); flex: none; }
.pill.plain::before { display: none; }
button.pill { cursor: pointer; }
button.pill:hover { background: color-mix(in srgb, var(--c, var(--slate)) 24%, transparent); }
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 520;
  background: color-mix(in srgb, var(--c, var(--slate)) 13%, transparent); color: var(--ink-2); white-space: nowrap;
  box-shadow: inset 2px 0 0 var(--c, var(--slate));
}
.tag button { border: 0; background: none; padding: 0; margin-right: -3px; color: var(--ink-3); display: inline-flex; }
.tag button:hover { color: var(--danger); }
.tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.temp { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.temp.hot { color: var(--danger); } .temp.warm { color: var(--warn); } .temp.cold { color: var(--blue); }
.av {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none;
  background: color-mix(in srgb, var(--c, var(--violet)) 22%, var(--surface-2)); color: var(--ink); letter-spacing: 0;
}
.av.lg { width: 52px; height: 52px; font-size: 18px; }
.av.sm { width: 22px; height: 22px; font-size: 10px; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--on-accent); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.badge.soft { background: var(--surface-3); color: var(--ink-2); }
.badge.warn { background: color-mix(in srgb, var(--danger) 85%, transparent); color: #fff; }
.agent { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; margin-left: 4px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 14px 10px; gap: 2px; z-index: 20;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font: 700 17px/1 var(--font-display); letter-spacing: -.02em; }
.logo img { width: 28px; height: 28px; border-radius: 8px; }
.logo small { font: 600 11px/1 var(--font); color: var(--ink-3); letter-spacing: .02em; margin-left: auto; }
.nav { display: flex; align-items: center; gap: 11px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 540; position: relative; }
.nav:hover { background: var(--hover); color: var(--ink); }
.nav.on { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.nav.on::before { content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav .badge { margin-left: auto; }
.side .spacer { flex: 1; }
.side .me { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: var(--r-sm); margin-top: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.side .me .nm { font-weight: 600; font-size: 13px; line-height: 1.2; }
.side .me .rl { font-size: 11.5px; color: var(--ink-3); }
.side .me .btn { margin-left: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 15; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.top h1 { font: 700 18px/1 var(--font-display); letter-spacing: -.02em; margin: 0; display: flex; align-items: center; gap: 10px; min-width: 0; }
.top h1 .count { font: 600 13px/1 var(--font); color: var(--ink-3); }
.top .grow { flex: 1; }
.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 34px; width: min(320px, 34vw); padding: 0 8px 0 11px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-3); cursor: text;
}
.search-trigger span { flex: 1; text-align: left; }
.page { padding: 22px 24px 60px; max-width: 1480px; width: 100%; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); }
.live-dot.pulse { animation: pulse 1.2s var(--ease); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); } 100% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.card-h h2, .card-h h3 { margin: 0; font: 650 14px/1.2 var(--font); letter-spacing: -.005em; }
.card-h .badge, .card-h .count { margin-left: 2px; }
.card-h .act { margin-left: auto; display: flex; gap: 6px; }
.card-b { padding: 4px 16px 16px; }
.empty { padding: 26px 16px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; }
.sec-title { font: 650 11.5px/1 var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 10px; }

/* ---------- today ---------- */
.hello { margin: 2px 0 18px; }
.hello h2 { font: 700 24px/1.15 var(--font-display); letter-spacing: -.025em; margin: 0 0 4px; }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; min-height: 92px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.kpi:hover { border-color: var(--line-2); transform: translateY(-1px); }
.kpi .k-l { font-size: 12.5px; color: var(--ink-2); font-weight: 560; display: flex; align-items: center; gap: 6px; }
.kpi .k-v { font: 700 28px/1 var(--font-display); letter-spacing: -.03em; margin-top: auto; font-variant-numeric: proportional-nums; }
.kpi .k-h { font-size: 12px; color: var(--ink-3); }
.kpi.alert .k-v { color: var(--danger); }
.today-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.today-grid > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); min-width: 0; }
.row-link:hover { background: var(--hover); }
.row-link .grow { flex: 1; min-width: 0; }
.row-link .t1 { font-weight: 600; }
.row-link .t2 { font-size: 12.5px; color: var(--ink-2); }
.quote { font-size: 13px; color: var(--ink-2); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pipe-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 36px 70px; align-items: center; gap: 10px; padding: 6px 16px; font-size: 13px; }
.pipe-row:hover { background: var(--hover); }
.pipe-row .bar { height: 8px; border-radius: 0 4px 4px 0; background: var(--bar); }
.pipe-row .track { background: var(--bar-track); border-radius: 0 4px 4px 0; height: 8px; overflow: hidden; }
.pipe-row .v { text-align: right; color: var(--ink-3); font-size: 12px; }

/* ---------- filters / leads table ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters .inp.search { width: 240px; padding-left: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 10px 50%; }
.chip-f { height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 560; display: inline-flex; align-items: center; gap: 6px; }
.chip-f:hover { background: var(--hover); color: var(--ink); }
.chip-f.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--ink); }
.chip-f .n { color: var(--ink-3); font-weight: 600; }
.dd { position: relative; }
.dd-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 220px; max-height: 340px; overflow: auto; padding: 6px;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-pop);
}
.dd-menu.right { left: auto; right: 0; }
.dd-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border-radius: 7px; border: 0; background: none; text-align: left; font-size: 13px; }
.dd-item:hover, .dd-item.act { background: var(--hover); }
.dd-item .chk { width: 16px; color: var(--accent); display: inline-flex; }
.dd-item.danger { color: var(--danger); }
.dd-sep { height: 1px; background: var(--line); margin: 5px 2px; }
.dd-search { width: 100%; margin-bottom: 4px; }
.tbl-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: clip; box-shadow: var(--shadow); }
table.tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
.tbl th {
  position: sticky; top: var(--top-h); z-index: 5; text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 0 10px; height: 38px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
.tbl th.sortable { cursor: pointer; }
.tbl th.sortable:hover { color: var(--ink); }
.tbl th .arr { font-size: 10px; margin-left: 3px; }
.tbl td { padding: 0 10px; height: 54px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; overflow: hidden; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { cursor: pointer; transition: background .1s; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl tbody tr.sel { background: var(--accent-soft); }
.tbl td.ck, .tbl th.ck { width: 42px; padding-left: 14px; padding-right: 0; }
.tbl td .tags { flex-wrap: nowrap; overflow: hidden; }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-person .nm { font-weight: 600; }
.cell-person .ti { font-size: 12.5px; color: var(--ink-3); }
.cell-person .flag { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); flex: none; }
.touch { display: flex; align-items: center; gap: 5px; color: var(--ink-2); }
.touch .dir-in { color: var(--ok); } .touch .dir-out { color: var(--ink-3); }
.due.over { color: var(--danger); font-weight: 600; }
.due.today { color: var(--warn); font-weight: 600; }
.bulkbar {
  position: sticky; bottom: 18px; z-index: 30; margin: 14px auto 0; width: fit-content; max-width: 100%; display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--surface-3); box-shadow: var(--shadow-pop); animation: up .3s var(--spring);
}
.bulkbar .n { font-weight: 650; margin-right: 6px; }
@keyframes up { from { transform: translateY(14px); opacity: 0; } }
.loadmore { display: flex; justify-content: center; padding: 14px; }

/* ---------- lead page ---------- */
.lead-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.lead-head .who { flex: 1; min-width: 260px; }
.lead-head h2 { font: 700 24px/1.15 var(--font-display); letter-spacing: -.025em; margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lead-head .role { color: var(--ink-2); margin-top: 3px; }
.lead-head .role a { color: var(--ink); font-weight: 560; }
.lead-head .role a:hover { text-decoration: underline; }
.lead-head .meta-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.lead-head .acts { display: flex; gap: 8px; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; margin-bottom: 12px; }
.back:hover { color: var(--ink); }
.lead-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.lead-grid > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fields { display: grid; grid-template-columns: 1fr; }
.fld { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: start; gap: 8px; padding: 5px 0; min-height: 34px; }
.fld > .lbl { color: var(--ink-3); font-size: 12.5px; padding-top: 6px; }
.fld .val {
  padding: 5px 8px; margin: 0 -8px 0 -8px; border-radius: 7px; min-height: 30px; cursor: text; word-break: break-word; border: 1px solid transparent;
}
.fld .val:hover { background: var(--hover); border-color: var(--line); }
.fld .val.empty-v { color: var(--ink-3); }
.fld .val.has-edit { position: relative; padding-right: 34px; }
.fld .val .fld-edit { position: absolute; right: 2px; top: 1px; opacity: 0; transition: opacity .15s; }
.fld .val:hover .fld-edit, .fld .val:focus-visible .fld-edit { opacity: 1; }
@media (hover: none) { .fld .val .fld-edit { opacity: .7; } }
.fld .val a.ext { color: var(--accent); }
.fld .val a.ext:hover { text-decoration: underline; }
.fld .inp, .fld .sel { width: 100%; height: 32px; }
.fld.wide { grid-template-columns: 1fr; }
.summary-box .ta { min-height: 110px; }
.saved-tick { color: var(--ok); font-size: 12px; margin-left: 6px; opacity: 0; transition: opacity .3s; }
.saved-tick.show { opacity: 1; }
.tag-editor { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag-editor .inp { height: 26px; width: 130px; font-size: 12.5px; padding: 0 8px; }
.refs li { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; padding: 3px 0; }
.refs { list-style: none; margin: 0; padding: 0; }
.refs code, code.mono { font: 12px var(--mono); color: var(--ink-2); word-break: break-all; }

.composer { padding: 6px 16px 14px; }
.ctabs { display: flex; gap: 4px; padding: 10px 12px 0; flex-wrap: wrap; }
.ctab { height: 30px; padding: 0 11px; border-radius: 8px; border: 0; background: none; color: var(--ink-2); font-weight: 560; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.ctab:hover { background: var(--hover); color: var(--ink); }
.ctab.on { background: var(--surface-3); color: var(--ink); }
.crow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { height: 30px; padding: 0 11px; border: 0; background: none; color: var(--ink-2); font-size: 12.5px; font-weight: 560; display: inline-flex; align-items: center; gap: 5px; }
.seg button.on { background: var(--accent-soft); color: var(--ink); }
.seg button + button { border-left: 1px solid var(--line-2); }

.tasklist { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task:hover { background: var(--hover); }
.task .tt { flex: 1; min-width: 0; }
.task .tt .t1 { font-weight: 560; }
.task.done .t1 { text-decoration: line-through; color: var(--ink-3); }
.task .tt .t2 { font-size: 12.5px; color: var(--ink-3); display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.task .tt .t2 a:hover { color: var(--ink); text-decoration: underline; }
.task input[type="checkbox"] { margin-top: 2px; width: 17px; height: 17px; }
.task .ops { opacity: 0; transition: opacity .15s; display: flex; gap: 2px; }
.task:hover .ops, .task:focus-within .ops { opacity: 1; }
.addtask { display: flex; gap: 8px; padding: 10px 16px 14px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); }
.addtask .inp.t { flex: 1; min-width: 180px; }

.timeline { position: relative; padding: 6px 16px 16px; }
.tl-day { font: 650 11.5px/1 var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 18px 0 10px 38px; }
.tl-day:first-child { margin-top: 8px; }
.tl-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: 13.5px; top: 30px; bottom: 0; width: 1px; background: var(--line-2); }
.tl-item:last-child::before { display: none; }
.tl-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); z-index: 1; }
.tl-ic.in { background: color-mix(in srgb, var(--ok) 20%, var(--surface-2)); color: var(--ok); }
.tl-ic.out { background: var(--accent-soft); color: var(--accent); }
.tl-ic.ev { width: 28px; height: 22px; background: none; }
.tl-ic.ev::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.tl-box { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r); padding: 10px 12px; min-width: 0; }
.tl-box.in { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.tl-box.sched { border-style: dashed; }
.tl-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); flex-wrap: wrap; }
.tl-top .who { color: var(--ink); font-weight: 600; }
.tl-top .what { color: var(--ink-2); }
.tl-top .ops { margin-left: auto; display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.tl-box:hover .ops, .tl-box:focus-within .ops { opacity: 1; }
.tl-subj { font-weight: 600; margin-top: 5px; }
.tl-body { margin-top: 5px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.tl-body.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.tl-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.tl-more { border: 0; background: none; color: var(--accent); font-size: 12.5px; padding: 4px 0 0; }
.tl-ev { font-size: 12.5px; color: var(--ink-3); padding-top: 3px; }
.tl-ev .who { color: var(--ink-2); font-weight: 600; }
.status-chip { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--ink-2); }
.status-chip.scheduled { color: var(--warn); }
.status-chip.failed, .status-chip.canceled { color: var(--danger); }

/* ---------- pipeline board ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start; min-height: calc(100dvh - var(--top-h) - 120px); }
.col { flex: 0 0 272px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: calc(100dvh - var(--top-h) - 110px); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px; }
.col-h .nm { font-weight: 650; }
.col-h .n { color: var(--ink-3); font-weight: 600; font-size: 12.5px; }
.col-h .v { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.col-b { padding: 4px 8px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 60px; flex: 1; border-radius: 0 0 var(--r-lg) var(--r-lg); transition: background .15s; }
.col.over .col-b { background: var(--accent-soft); }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 11px; cursor: grab; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); transition: transform .15s var(--ease), box-shadow .15s, opacity .15s; }
.kcard:hover { border-color: var(--line-2); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .45; transform: rotate(1.5deg); }
.kcard .nm { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kcard .co { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.kcard .ft { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.kcard .ft .grow { flex: 1; }
.col-more { text-align: center; font-size: 12px; color: var(--ink-3); padding: 4px; }

/* ---------- feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 11px; padding: 10px 16px; border-top: 1px solid var(--line); align-items: flex-start; }
.feed li:first-child { border-top: 0; }
.feed .ft1 { font-size: 13px; }
.feed .ft1 .who { font-weight: 600; }
.feed .ft1 a { font-weight: 600; }
.feed .ft1 a:hover { text-decoration: underline; }
.feed .ft2 { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.feed .chg { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; word-break: break-word; }

/* ---------- settings ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 12px; color: var(--ink-2); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
.set-grid { display: grid; gap: 16px; max-width: 900px; }
.srow { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.srow:first-child { border-top: 0; }
.srow .grow { flex: 1; min-width: 160px; }
.srow .t1 { font-weight: 600; }
.srow .t2 { font-size: 12.5px; color: var(--ink-3); }
.secret { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px dashed var(--accent); font: 13px var(--mono); word-break: break-all; }
pre.code { margin: 8px 0 0; padding: 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font: 12.5px/1.55 var(--mono); white-space: pre-wrap; word-break: break-all; color: var(--ink-2); }
.callout { padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--ink-2); font-size: 13px; line-height: 1.55; }
.callout b { color: var(--ink); }

/* ---------- login ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; inset: -20%; background: radial-gradient(40% 35% at 30% 30%, rgba(139, 123, 255, .22), transparent 70%), radial-gradient(35% 30% at 72% 68%, rgba(124, 247, 255, .12), transparent 70%), radial-gradient(30% 30% at 60% 20%, rgba(255, 106, 213, .12), transparent 70%); pointer-events: none; }
.login { position: relative; width: min(400px, 100%); padding: 32px 28px 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.login img { width: 48px; height: 48px; border-radius: 13px; }
.login h1 { font: 700 26px/1.1 var(--font-display); letter-spacing: -.03em; margin: 16px 0 6px; }
.login p { color: var(--ink-2); margin: 0 0 20px; }
.login .inp.code { width: 100%; height: 48px; font: 600 19px/1 var(--mono); letter-spacing: .14em; text-align: center; text-transform: uppercase; }
.login .btn.primary { width: 100%; height: 44px; font-size: 15px; margin-top: 12px; }
.login .row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.login .err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.login .foot { margin-top: 18px; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ---------- modal, palette, toast ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); }
dialog.modal::backdrop { background: rgba(4, 4, 12, .55); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: pop .25s var(--spring); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.m-h { display: flex; align-items: center; padding: 18px 20px 6px; gap: 10px; }
.m-h h2 { margin: 0; font: 700 17px/1.2 var(--font-display); letter-spacing: -.015em; }
.m-h .btn { margin-left: auto; }
.m-b { padding: 8px 20px 4px; display: grid; gap: 12px; overflow: auto; }
.m-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px 18px; }
.f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fl label { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 560; margin-bottom: 5px; }
.fl .inp, .fl .sel { width: 100%; }
.dupe-hint { font-size: 12.5px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--ink); }
.dupe-hint a { font-weight: 650; text-decoration: underline; }
dialog.palette { margin-top: 12vh; width: min(620px, calc(100vw - 32px)); }
.pal-in { width: 100%; height: 52px; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 0 18px; font-size: 16px; outline: none; border-radius: 18px 18px 0 0; }
.pal-list { max-height: 50vh; overflow: auto; padding: 6px; }
.pal-item { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; cursor: pointer; min-width: 0; }
.pal-item.act { background: var(--hover); box-shadow: inset 0 0 0 1px var(--line-2); }
.pal-item .grow { flex: 1; min-width: 0; }
.pal-item .t2 { font-size: 12.5px; color: var(--ink-3); }
.pal-group { font: 650 11px/1 var(--font); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 10px 12px 6px; }
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 560; box-shadow: var(--shadow-pop); animation: up .3s var(--spring); max-width: min(560px, calc(100vw - 32px)); }
.toast.err { background: var(--danger); color: #fff; }
.toast button { border: 0; background: rgba(127, 127, 127, .22); color: inherit; border-radius: 7px; height: 26px; padding: 0 10px; font-weight: 650; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px; }
.skel { height: 54px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, transparent, var(--hover), transparent); background-size: 200% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today-grid { grid-template-columns: 1fr; }
  .lead-grid { grid-template-columns: 1fr; }
  .tbl .c-owner, .tbl .c-tags { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); justify-content: space-around; }
  .side .logo, .side .spacer, .side .me, .nav .lbl, .nav.opt { display: none; }
  .nav { flex-direction: column; height: 46px; padding: 6px 10px; gap: 2px; }
  .nav.on::before { display: none; }
  .nav .badge { position: absolute; top: 2px; right: 0; margin: 0; transform: scale(.85); }
  .main { padding-bottom: 72px; }
  .top { padding: 0 16px; }
  .search-trigger span, .search-trigger .kbd { display: none; }
  .search-trigger { width: 38px; padding: 0 10px; }
  .page { padding: 16px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tbl .c-company, .tbl .c-touch, .tbl th.ck, .tbl td.ck { display: none; }
  .tbl th:last-child { width: 34% !important; }
  .tbl th[data-sort="stage"] { width: 104px !important; }
  .filters .inp.search { width: 100%; }
  .f2 { grid-template-columns: 1fr; }
  .top .btn .lbl { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
