:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1a1d21;
  --ink-2: #565b64;
  --ink-3: #8b8f97;
  --line: #e7e4dd;
  --line-2: #d9d5cc;
  --accent: #0e6b5c;
  --accent-hover: #0b5a4d;
  --accent-weak: #e4f1ee;
  --accent-ink: #0b5246;
  --side: #14201d;
  --side-ink: #b9c6c2;
  --side-active: #223430;
  --danger: #b4372f;
  --danger-weak: #fbeceb;
  --warn: #9a6200;
  --warn-weak: #fdf3e1;
  --ok: #1f7a3f;
  --ok-weak: #e6f4ea;
  --wa: #128c4b;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(20, 24, 22, .05), 0 1px 3px rgba(20, 24, 22, .04);
  --shadow-lg: 0 12px 40px rgba(20, 24, 22, .18), 0 2px 8px rgba(20, 24, 22, .08);
  --font: ui-sans-serif, -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --st-new-bg: #eef0f3; --st-new: #4a5361;
  --st-contacted-bg: #e7effb; --st-contacted: #2459a8;
  --st-interested-bg: #fdf1dc; --st-interested: #8a5700;
  --st-proposal-bg: #efe9fb; --st-proposal: #5b3ea8;
  --st-won-bg: #e3f3e8; --st-won: #1d6e3a;
  --st-lost-bg: #f8e9e8; --st-lost: #9c3a33;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: #fff; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-name { font-weight: 650; font-size: 14.5px; line-height: 1.2; }
.brand-sub { font-size: 11.5px; color: #7f938d; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; text-decoration: none; }
.nav a.active { background: var(--side-active); color: #fff; }
.nav a .count { margin-left: auto; font-size: 11.5px; background: var(--danger); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 18px; font-weight: 600; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #64776f; padding: 16px 10px 6px; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .07); padding-top: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.me-name { color: #fff; font-weight: 550; font-size: 13.5px; }
.me-role { font-size: 11.5px; color: #7f938d; text-transform: capitalize; }
.me button { margin-left: auto; background: none; border: 0; color: var(--side-ink); cursor: pointer; padding: 6px; border-radius: 6px; }
.me button:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: rgba(245, 244, 240, .92); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 20; }
.search { position: relative; flex: 1; max-width: 520px; }
.search input { width: 100%; padding: 8px 12px 8px 36px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); }
.search > svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink-3); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
kbd { font: 11px var(--mono); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--ink-3); background: var(--surface-2); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 30; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 9px 12px; color: var(--ink); border-bottom: 1px solid var(--line); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.sel { background: var(--accent-weak); text-decoration: none; }
.topbar .spacer { flex: 1; }
.view { padding: 24px 28px 64px; max-width: 1440px; width: 100%; }
.demo-banner { background: #fff7e0; border-bottom: 1px solid #f0dfb0; color: #6b4e00; font-size: 13px; padding: 7px 28px; display: flex; gap: 12px; align-items: center; }
.demo-banner button { margin-left: auto; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-2); margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 550; cursor: pointer; white-space: nowrap; line-height: 1.3; text-decoration: none !important; }
.btn:hover { background: var(--surface-2); border-color: #c9c4b9; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn-wa:hover { background: #0e7a40; border-color: #0e7a40; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-weak); border-color: #e8c2bf; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0, 0, 0, .04); border-color: transparent; }
.btn-sm { padding: 4px 9px; font-size: 13px; border-radius: 7px; }
.btn-lg { padding: 10px 16px; font-size: 15px; }
.icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.call:hover { color: var(--accent); background: var(--accent-weak); }
.icon-btn.wa:hover { color: var(--wa); background: #e5f5ec; }
.btn-group { display: inline-flex; }
.btn-group .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: -1px; }
.btn-group .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input, select.input, textarea.input { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); min-height: 36px; }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14, 107, 92, .15); }
select.input { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23656a73' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.multi-row { display: flex; gap: 6px; margin-bottom: 6px; }
.multi-row .input { flex: 1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.form-error { background: var(--danger-weak); color: var(--danger); border: 1px solid #efc9c6; padding: 9px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }
.callout { border-radius: 9px; padding: 11px 13px; font-size: 13.5px; margin-bottom: 14px; border: 1px solid; }
.callout.warn { background: var(--warn-weak); border-color: #f0dcb2; color: #6e4700; }
.callout.info { background: var(--accent-weak); border-color: #c5e2db; color: var(--accent-ink); }
.callout ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- cards ---------- */
.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: 8px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 14px; }
.card-head .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: 14px 16px; }
.card + .card { margin-top: 16px; }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }
.empty svg { width: 28px; height: 28px; margin-bottom: 6px; opacity: .6; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: block; color: var(--ink); }
a.stat:hover { border-color: var(--line-2); text-decoration: none; }
.stat-label { font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12px; color: var(--ink-3); }
.stat.alert .stat-value { color: var(--danger); }

/* ---------- pills, avatars, tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 18px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.st-new { background: var(--st-new-bg); color: var(--st-new); }
.st-contacted { background: var(--st-contacted-bg); color: var(--st-contacted); }
.st-interested { background: var(--st-interested-bg); color: var(--st-interested); }
.st-proposal { background: var(--st-proposal-bg); color: var(--st-proposal); }
.st-won { background: var(--st-won-bg); color: var(--st-won); }
.st-lost { background: var(--st-lost-bg); color: var(--st-lost); }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 650; color: #fff; flex: none; letter-spacing: .02em; }
.avatar.lg { width: 34px; height: 34px; font-size: 13px; }
.owner-cell { display: inline-flex; align-items: center; gap: 8px; }
.tag { display: inline-block; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; font-size: 12px; color: var(--ink-2); line-height: 20px; margin: 0 4px 4px 0; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 0 7px; border-radius: 999px; line-height: 19px; }
.badge.red { background: var(--danger-weak); color: var(--danger); }
.badge.amber { background: var(--warn-weak); color: var(--warn); }
.badge.green { background: var(--ok-weak); color: var(--ok); }
.badge.grey { background: #eeedea; color: var(--ink-2); }
.overdue { color: var(--danger); font-weight: 600; }
.stale-text { color: var(--warn); font-weight: 550; }

/* ---------- filters ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters .input { width: auto; min-width: 130px; }
.filters .search-inline { min-width: 240px; flex: 1; max-width: 340px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.chip:hover { border-color: #c9c4b9; color: var(--ink); }
.chip.on { background: var(--accent-weak); border-color: #b5d9d0; color: var(--accent-ink); }
.chip .n { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.chip.on .n { color: var(--accent-ink); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button, .tabs a { background: none; border: 0; padding: 9px 13px; cursor: pointer; font-weight: 550; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.tabs button:hover, .tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs .on { color: var(--accent-ink); border-bottom-color: var(--accent); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: #fbfaf7; }
.t tbody tr.sel td { background: var(--accent-weak) !important; }
.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.t .w-check { width: 36px; padding-right: 0; }
.lead-name { font-weight: 600; color: var(--ink); }
.lead-co { font-size: 12.5px; color: var(--ink-2); }
.row-actions { display: inline-flex; gap: 2px; opacity: .55; }
tr:hover .row-actions { opacity: 1; }
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 13px; }
.bulkbar { position: sticky; bottom: 16px; margin-top: 12px; display: flex; gap: 10px; align-items: center; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 15; }
.bulkbar .btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); color: #fff; }
.bulkbar .btn:hover { background: rgba(255, 255, 255, .18); }

/* ---------- dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.task-group-title { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 12px 16px 4px; }
.task-group-title.red { color: var(--danger); }
.task-row { display: flex; align-items: center; gap: 11px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row .ttl { font-weight: 550; }
.task-row .meta { font-size: 12.5px; color: var(--ink-2); }
.task-row .when { margin-left: auto; font-size: 12.5px; white-space: nowrap; text-align: right; }
.task-row.done .ttl { text-decoration: line-through; color: var(--ink-3); }
.task-check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; flex: none; display: grid; place-items: center; padding: 0; color: transparent; }
.task-check:hover { border-color: var(--accent); color: var(--accent); }
.task-check.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.task-check svg { width: 11px; height: 11px; }
.feed-item { display: flex; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .ic { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.feed-item .ic svg { width: 13px; height: 13px; }
.minipipe { display: flex; gap: 6px; }
.minipipe a { flex: 1; text-align: center; padding: 10px 4px; border-radius: 8px; color: var(--ink); }
.minipipe a:hover { text-decoration: none; filter: brightness(.97); }
.minipipe .n { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.minipipe .l { font-size: 11.5px; font-weight: 600; }

/* ---------- lead detail ---------- */
.crumb { font-size: 13px; margin-bottom: 10px; display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); }
.crumb svg { width: 14px; height: 14px; }
.lead-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 16px; }
.lead-head h1 { font-size: 24px; }
.lead-head .co { color: var(--ink-2); margin-top: 3px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.lead-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.stepper { display: flex; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.stepper button { flex: 1; border: 0; background: none; padding: 10px 6px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--ink-3); position: relative; border-right: 1px solid var(--line); }
.stepper button:last-child { border-right: 0; }
.stepper button:hover { background: var(--surface-2); color: var(--ink); }
.stepper button.past { color: var(--accent-ink); background: #f2f8f6; }
.stepper button.cur { background: var(--accent); color: #fff; }
.stepper button.cur.lost { background: var(--danger); }
.stepper button.cur.won { background: var(--ok); }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.composer .tabs { margin: 0; padding: 0 8px; }
.composer textarea { border: 0; border-radius: 0; box-shadow: none !important; min-height: 74px; padding: 12px 16px; }
.composer-foot { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.timeline { padding: 6px 0; }
.tl-item { display: flex; gap: 12px; padding: 10px 16px; position: relative; }
.tl-item::before { content: ""; position: absolute; left: 30px; top: 40px; bottom: -6px; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-ic { width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); z-index: 1; }
.tl-ic svg { width: 14px; height: 14px; }
.tl-ic.call { background: var(--accent-weak); color: var(--accent); border-color: #c5e2db; }
.tl-ic.wa { background: #e5f5ec; color: var(--wa); border-color: #bfe3cd; }
.tl-ic.note { background: #fdf6e3; color: #8a6400; border-color: #efdfae; }
.tl-ic.sys { background: var(--surface-2); color: var(--ink-3); }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-weight: 550; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-title .when { margin-left: auto; font-weight: 400; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.tl-text { margin-top: 4px; white-space: pre-wrap; word-wrap: break-word; color: var(--ink); }
.tl-text.bubble { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
.tl-text.bubble.out { background: #effaf3; border-color: #cfe9d9; }
.tl-sys { font-size: 13px; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 10px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); font-weight: 550; }
.kv dd { margin: 0; min-width: 0; word-wrap: break-word; }
.contact-line { display: flex; align-items: center; gap: 4px; }
.contact-line .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hist { font-size: 12.5px; color: var(--ink-2); padding: 6px 0; border-bottom: 1px dashed var(--line); }
.hist:last-child { border-bottom: 0; }

/* ---------- pipeline board ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: #eeece6; border-radius: 12px; padding: 8px; min-height: 200px; transition: background .12s; }
.col.over { background: var(--accent-weak); outline: 2px dashed #9ccbbf; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.col-head .n { margin-left: auto; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.bcard { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 10px 11px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.bcard:hover { border-color: var(--line-2); }
.bcard.dragging { opacity: .45; }
.bcard .nm { font-weight: 600; font-size: 13.5px; }
.bcard .co { font-size: 12.5px; color: var(--ink-2); }
.bcard .ft { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--ink-3); }
.bcard .ft .avatar { width: 20px; height: 20px; font-size: 9.5px; margin-left: auto; }

/* ---------- reports ---------- */
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 64px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .lbl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; position: relative; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 2px; }
.bar-row:hover .bar-fill { background: var(--accent-hover); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-row .val small { color: var(--ink-3); font-weight: 500; }

/* ---------- import ---------- */
.drop { border: 2px dashed var(--line-2); border-radius: 12px; padding: 36px; text-align: center; background: var(--surface); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-weak); }
.drop svg { width: 34px; height: 34px; color: var(--accent); }
.map-table td { vertical-align: top; }
.map-table .sample { font-size: 12.5px; color: var(--ink-2); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps-nav { display: flex; gap: 20px; margin-bottom: 18px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.steps-nav .on { color: var(--accent-ink); }

/* ---------- modal + toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 26, 24, .42); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; animation: fade .12s ease-out; }
.modal { background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; animation: pop .14s ease-out; }
.modal.wide { max-width: 720px; }
.modal.narrow { max-width: 420px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 18px 20px 6px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px 16px; }
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; font-size: 13.5px; animation: pop .15s ease-out; display: flex; gap: 10px; align-items: center; }
.toast.err { background: var(--danger); }
.outcomes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.outcomes button { padding: 10px 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 9px; cursor: pointer; font-weight: 550; font-size: 13px; }
.outcomes button:hover { border-color: var(--accent); }
.outcomes button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.calling { display: flex; gap: 14px; align-items: center; background: var(--accent-weak); border: 1px solid #c5e2db; border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.calling .ring { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none; animation: ring 1.6s infinite; }
.calling .ring svg { width: 20px; height: 20px; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(14, 107, 92, .45); } 70% { box-shadow: 0 0 0 12px rgba(14, 107, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(14, 107, 92, 0); } }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; }
.wa-preview { background: #e9f6ee; border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; font-size: 13.5px; border: 1px solid #cfe9d9; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: var(--side); color: #dfe8e5; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h2 { font-size: 30px; line-height: 1.2; color: #fff; max-width: 420px; letter-spacing: -.02em; }
.login-art p { color: #9fb2ac; max-width: 400px; }
.login-art .deco { position: absolute; right: -80px; bottom: -80px; width: 380px; height: 380px; border-radius: 50%; border: 60px solid rgba(14, 107, 92, .35); }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 370px; }
.login-card h1 { margin-bottom: 4px; }
.demo-users { display: grid; gap: 6px; margin-top: 8px; }
.demo-users button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; text-align: left; }
.demo-users button:hover { border-color: var(--accent); background: var(--accent-weak); }
.demo-users .r { margin-left: auto; font-size: 12px; color: var(--ink-3); text-transform: capitalize; }

.loading { padding: 60px; text-align: center; color: var(--ink-3); }
.spin { width: 22px; height: 22px; border: 2.5px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .lead-grid, .dash-grid, .rep-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; padding: 8px 10px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; }
  .brand-sub, .nav-label, .side-foot .me > div { display: none; }
  .nav { flex-direction: row; }
  .nav a span.lbl { display: none; }
  .side-foot { margin: 0 0 0 auto; border: 0; padding: 0; }
  .topbar, .view, .demo-banner { padding-left: 16px; padding-right: 16px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .outcomes { grid-template-columns: repeat(2, 1fr); }
}
@media print {
  .side, .topbar, .demo-banner, .btn, .filters { display: none !important; }
  .shell { display: block; }
}

/* ---------- fixes after visual review ---------- */
:where(svg[aria-hidden]) { width: 16px; height: 16px; flex: none; }
.chip svg { width: 14px; height: 14px; }
.callout svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 2px; }
.rep-grid > .card + .card { margin-top: 0; }
.owner-cell { white-space: nowrap; }
.board { grid-template-columns: repeat(6, minmax(176px, 1fr)); }
.bcard .ft { flex-wrap: wrap; row-gap: 2px; }
.bcard .ft > span { white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.mobile-only { display: none; }
@media (max-width: 860px) { .mobile-only { display: inline-flex; } .topbar .btn-primary { display: none; } }
.bcard .ft .avatar { width: 22px; height: 22px; font-size: 9px; }

/* ---------- Alif branding ---------- */
.brand-mark { background: none !important; width: auto !important; height: auto !important; }
.brand-name { line-height: 1.25; }
.login-logo { display: flex; align-items: center; gap: 18px; color: #fff; }
.login-logo img { height: 160px; width: auto; }
