/* Ledger CRM — warm paper, ink sidebar, terracotta accent. */
:root {
  --paper: #f4f1ea; --card: #fffdf8; --ink: #1c1b18; --ink-2: #4f4b43; --muted: #8a857a;
  --line: #e6dfd0; --line-2: #d6cdbb; --hover: #f8f4ec;
  --accent: #c2410c; --accent-ink: #9a3412; --accent-soft: #fbe9dd;
  --s-lead: #f0c3a6; --s-qualified: #e49a6f; --s-proposal: #d26f3c; --s-negotiation: #a8380b;
  --good: #2f7d4f; --good-soft: #e3f1e7; --critical: #b42318; --critical-soft: #fbe5e2; --lost: #9b968b;
  --serif: 'Fraunces', Georgia, serif; --sans: 'Instrument Sans', -apple-system, 'Segoe UI', sans-serif;
  --r: 10px; --shadow: 0 1px 0 rgba(28,27,24,.04), 0 8px 24px -12px rgba(28,27,24,.18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 14.5px/1.5 var(--sans); color: var(--ink); background: var(--paper);
  background-image: radial-gradient(rgba(28,27,24,.035) 1px, transparent 1px); background-size: 4px 4px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sm { font-size: 12.5px; }
.pad { padding: 14px 18px; }
.grow { flex: 1; }
.hint { color: var(--muted); font-size: 12.5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { flex: none; vertical-align: -3px; }
.status-critical { color: var(--critical); font-weight: 600; }

/* ── Buttons & inputs ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid transparent; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: var(--accent); color: #fff; }
.btn.ghost { background: var(--card); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn.ghost.danger { color: var(--critical); }
.btn.ghost.danger:hover { border-color: var(--critical); background: var(--critical-soft); }
.btn.ghost.good { color: var(--good); }
.btn.ghost.good:hover { border-color: var(--good); background: var(--good-soft); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 44px; justify-content: center; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; border: 0; background: none; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: rgba(28,27,24,.07); color: var(--ink); }
.icon-btn.xs { width: 24px; height: 24px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.field input, .field select, .field textarea, .composer textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea, .composer textarea { resize: vertical; min-height: 44px; }
.field input:focus, .field select:focus, .field textarea:focus, .composer textarea:focus, .filter:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-error { color: var(--critical); background: var(--critical-soft); padding: 8px 12px; border-radius: 8px; font-size: 13px; }

/* ── Auth ─────────────────────────────────────────────────────────── */
.boot, .loading { display: grid; place-items: center; min-height: 60vh; }
.spinner { width: 26px; height: 26px; border: 2.5px solid var(--line-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; }
.auth-art {
  background: var(--ink); color: #f4f1ea; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(244,241,234,.06) 31px 32px);
}
.auth-quote { font: 400 44px/1.1 var(--serif); letter-spacing: -.02em; }
.auth-quote em { color: #e8743f; }
.auth-foot { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(244,241,234,.55); }
.auth-card { align-self: center; justify-self: center; width: min(420px, 100% - 48px); padding: 48px 0; animation: rise .5s ease both; }
.auth-card h1 { font: 500 34px/1.15 var(--serif); letter-spacing: -.02em; margin-bottom: 6px; }
.auth-card > p { margin-bottom: 28px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }

/* ── Layout ───────────────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--ink); color: #d9d4c8; display: flex; flex-direction: column; padding: 18px 12px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; text-decoration: none; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #2c2a25; color: #e8743f; font: italic 600 21px/1 var(--serif); flex: none; }
.brand-mark.lg { width: 52px; height: 52px; font-size: 32px; border-radius: 12px; }
.brand-name { display: flex; flex-direction: column; font-weight: 600; line-height: 1.2; overflow: hidden; }
.brand-name small { font-weight: 400; font-size: 11.5px; color: #8a857a; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; text-decoration: none; color: #bdb7a9; font-weight: 500; }
.side nav a:hover { background: #29271f; color: #fff; }
.side nav a.active { background: #f4f1ea; color: var(--ink); }
.side nav a.active .i { color: var(--accent); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 2px; border-top: 1px solid #2f2d27; }
.side-foot .who { flex: 1; display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.side-foot .who strong { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who small { color: #8a857a; font-size: 11.5px; }
.side-foot .icon-btn { color: #8a857a; }
.side-foot .icon-btn:hover { background: #29271f; color: #fff; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 32px; background: rgba(244,241,234,.86); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; background: var(--card); border: 1px solid var(--line-2); border-radius: 9px; color: var(--muted); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; border: 0; outline: 0; background: none; color: var(--ink); min-width: 0; }
kbd { font: 11px var(--sans); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; color: var(--muted); }
.search-results { position: absolute; top: 44px; left: 0; right: 0; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px; max-height: 70vh; overflow: auto; color: var(--ink); }
.sr-group h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 8px 10px 4px; }
.sr-group a, .people a, .person { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; text-decoration: none; }
.sr-group a:hover, .people a:hover { background: var(--hover); color: var(--ink); }
.sr-group a span:not(.avatar), .people span:not(.avatar), .name-cell span:not(.avatar) { display: flex; flex-direction: column; line-height: 1.25; }
small { color: var(--muted); font-size: 12px; }

/* ── Page ─────────────────────────────────────────────────────────── */
.page { padding: 28px 32px 56px; max-width: 1240px; animation: rise .35s ease both; }
.page.wide { max-width: none; }
.page.narrow { max-width: 900px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.title { font: 500 34px/1.1 var(--serif); letter-spacing: -.025em; font-variation-settings: 'opsz' 96; }
.title em { font-style: italic; color: var(--accent); }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 500; margin-bottom: 14px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); min-height: 52px; }
.panel-head h3 { font: 600 15px var(--sans); }
.link-sm { font-size: 12.5px; font-weight: 600; color: var(--ink-2); text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.empty { padding: 44px 24px; text-align: center; }
.empty h3 { font: 500 20px var(--serif); margin-bottom: 4px; }
.empty p { color: var(--muted); }

/* ── Dashboard ────────────────────────────────────────────────────── */
.kpis { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; box-shadow: var(--shadow); }
.kpi.link:hover { border-color: var(--ink); color: var(--ink); }
.kpi-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.kpi-value { font: 500 32px/1.15 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi.hero { background: var(--ink); color: #f4f1ea; border-color: var(--ink); }
.kpi.hero .kpi-label { color: #bdb7a9; }
.kpi.hero .kpi-value { color: #fff; font-size: 38px; }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
.dash-grid .panel + .panel { margin-top: 0; }
.chart-panel { padding-bottom: 8px; }
.hbar { padding: 12px 18px 10px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 12px; height: 40px; outline: none; cursor: default; }
.bar-label { font-weight: 500; font-size: 13px; color: var(--ink-2); }
.bar-value { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.bar-count { color: var(--muted); font-weight: 400; }
.bar-track { display: block; height: 18px; border-radius: 4px; background: #f1ece2; overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 4px; background: var(--accent); transition: background .15s; }
.bar-row:hover .bar, .bar-row:focus-visible .bar { background: var(--accent-ink); }
.bar-row:hover .bar-label { color: var(--ink); }
.bar-row:focus-visible { box-shadow: 0 0 0 2px var(--accent); border-radius: 6px; }
@media (max-width: 500px) { .bar-row { grid-template-columns: 78px 1fr auto; gap: 8px; } }
.closing li a, .mini-deals li a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; text-decoration: none; border-bottom: 1px solid var(--line); }
.closing li:last-child a, .mini-deals li:last-child a { border-bottom: 0; }
.closing li a:hover, .mini-deals li a:hover { background: var(--hover); color: var(--ink); }
.cl-title, .mini-deals span { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cl-right { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
ul, ol { list-style: none; }

/* ── Tables & toolbars ────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filter { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; color: var(--muted); width: min(360px, 100%); }
.filter input { border: 0; outline: 0; background: none; flex: 1; color: var(--ink); min-width: 0; }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fbf8f1; }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { cursor: pointer; transition: background .1s; }
.table tbody tr:hover { background: var(--hover); }
.table .r { text-align: right; }
.table td a { text-decoration: none; }
.table td a:hover { text-decoration: underline; }
.name-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.name-cell small { font-weight: 400; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: #efe9dd; color: var(--ink-2); text-decoration: none; margin: 1px 4px 1px 0; }
.chip:hover { background: var(--accent-soft); color: var(--accent-ink); }
.chip.active { background: var(--ink); color: #fff; }
.chips { margin-top: 6px; }
.tabs, .seg-links { display: inline-flex; background: #ebe5d8; border-radius: 9px; padding: 3px; gap: 2px; }
.tabs a, .seg-links a { padding: 5px 12px; border-radius: 7px; text-decoration: none; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.tabs a.active, .seg-links a.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(28,27,24,.12); }

/* ── Avatars ──────────────────────────────────────────────────────── */
.avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: #e8dfcf; color: var(--ink-2); font-weight: 600; font-size: 12.5px; letter-spacing: .02em; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; margin-left: auto; }
.avatar.xl { width: 64px; height: 64px; font: 500 24px var(--serif); background: var(--ink); color: #e8743f; }
.avatar.sq { border-radius: 8px; }
.avatar.sq.xl { border-radius: 14px; }
.side-foot .avatar { background: #2c2a25; color: #e8743f; }

/* ── Record pages ─────────────────────────────────────────────────── */
.record-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.record-head .sub { color: var(--ink-2); margin-top: 4px; }
.record-head .sub a { text-decoration: none; font-weight: 500; }
.record { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; padding: 16px 18px; }
.facts dt { color: var(--muted); font-size: 12.5px; }
.facts dd { font-weight: 500; overflow-wrap: anywhere; }
.notes { border-top: 1px solid var(--line); padding: 14px 18px; }
.notes h4 { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.notes p { white-space: pre-wrap; }
.people { padding: 6px; }
.people.big li { display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 4px; border-bottom: 1px solid var(--line); }
.people.big li:last-child { border-bottom: 0; }
.people.big .person { flex: 1; }
.role { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: #efe9dd; }
.role.admin { background: var(--ink); color: #fff; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.two .panel + .panel { margin-top: 0; }
.deal-badge { background: var(--accent) !important; color: #fff !important; }

.stage-pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); width: fit-content; }
.stage-pill.s-won { background: var(--good-soft); color: var(--good); }
.stage-pill.s-lost { background: #eeebe5; color: var(--ink-2); }

.stepper { display: flex; gap: 4px; margin-bottom: 22px; }
.stepper li { flex: 1; }
.step { width: 100%; height: 34px; border: 0; background: #e9e3d6; color: var(--ink-2); font-weight: 600; font-size: 12.5px; cursor: pointer; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); transition: background .15s; }
.stepper li:first-child .step { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 8px 0 0 8px; }
.step:hover { background: #ddd4c2; }
.step.past { background: var(--accent-soft); color: var(--accent-ink); }
.step.current { background: var(--accent); color: #fff; cursor: default; }
.step.current.s-won { background: var(--good); }
.step.current.s-lost { background: var(--lost); }

/* ── Composer, timeline, tasks ────────────────────────────────────── */
.composer { padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--ink-2); }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; }
.related-cols { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-top: 16px; align-items: start; }
.related-cols .panel + .panel { margin-top: 0; }

.timeline { padding: 8px 18px 14px; }
.tl-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 0; position: relative; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 13.5px; top: 38px; bottom: -10px; width: 1px; background: var(--line); }
.tl-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #efe9dd; color: var(--ink-2); }
.tl-call .tl-icon { background: var(--accent-soft); color: var(--accent-ink); }
.tl-meeting .tl-icon { background: #e6ebf5; color: #34518a; }
.tl-email .tl-icon { background: #e9efe6; color: #3c6440; }
.tl-body { position: relative; min-width: 0; }
.tl-head { font-size: 13px; line-height: 1.5; padding-right: 72px; padding-top: 4px; }
.tl-head > * + * { margin-left: 5px; }
.tl-head a { text-decoration: none; font-weight: 500; color: var(--ink-2); }
.tl-head time { position: absolute; right: 0; top: 5px; font-size: 12px; white-space: nowrap; margin: 0; }
.tl-head .icon-btn { opacity: 0; position: absolute; right: -4px; top: 0; margin: 0; }
.tl-item:has(.icon-btn) .tl-head { padding-right: 96px; }
.tl-item:has(.icon-btn) .tl-head time { right: 26px; }
.tl-item:hover .icon-btn { opacity: 1; }
.tl-body p { margin-top: 3px; color: var(--ink); overflow-wrap: anywhere; }
.timeline.compact .tl-body p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); }

.task-list { padding: 4px 0; }
.task { display: flex; align-items: flex-start; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--hover); }
.check { flex: none; display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border-radius: 6px; border: 1.5px solid var(--line-2); background: #fff; cursor: pointer; color: #fff; }
.check:hover { border-color: var(--accent); }
.task.done .check { background: var(--good); border-color: var(--good); }
.task-main { flex: 1; min-width: 160px; text-align: left; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.task-title { font-weight: 500; }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.due.overdue { color: var(--critical); font-weight: 600; }
.due.today { color: var(--accent-ink); font-weight: 600; }
.task-links { display: flex; gap: 8px; font-size: 12.5px; }
.task-links a { text-decoration: none; color: var(--ink-2); background: #efe9dd; padding: 1px 8px; border-radius: 99px; }
.task-list.big .task { padding: 12px 18px; }

/* ── Pipeline board ───────────────────────────────────────────────── */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(172px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 8px; align-items: start; }
.col { background: #ebe5d8; border-radius: 12px; display: flex; flex-direction: column; min-height: 200px; transition: background .15s, box-shadow .15s; }
.col.over { background: #e3dac8; box-shadow: inset 0 0 0 2px var(--accent); }
.col header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.col h3 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.col .count { color: var(--muted); font-weight: 500; }
.col-total { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.s-lead { --stage: var(--s-lead); } .s-qualified { --stage: var(--s-qualified); } .s-proposal { --stage: var(--s-proposal); }
.s-negotiation { --stage: var(--s-negotiation); } .s-won { --stage: var(--good); } .s-lost { --stage: var(--lost); }
.dot { background: var(--stage); }
.col-body { display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 10px; flex: 1; min-height: 120px; }
.deal-card { background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; cursor: grab; box-shadow: 0 1px 2px rgba(28,27,24,.06); display: flex; flex-direction: column; gap: 2px; transition: box-shadow .15s, transform .15s; }
.deal-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.deal-card.dragging { opacity: .45; transform: rotate(1.5deg); }
.dc-title { font-weight: 600; text-decoration: none; line-height: 1.3; }
.dc-org { font-size: 12.5px; color: var(--muted); }
.deal-card footer { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: 13px; }
.dc-date { font-size: 11.5px; color: var(--muted); display: inline-flex; gap: 3px; align-items: center; white-space: nowrap; }
.deal-card footer .avatar { margin-left: auto; flex-shrink: 0; }
.dc-date.overdue { color: var(--critical); font-weight: 600; }
.col-add { border: 1px dashed var(--line-2); background: none; border-radius: 8px; padding: 7px; color: var(--muted); cursor: pointer; font-size: 12.5px; font-weight: 500; display: flex; gap: 5px; justify-content: center; align-items: center; }
.col-add:hover { border-color: var(--ink); color: var(--ink); background: rgba(255,255,255,.5); }
.col-won .col-body, .col-lost .col-body { opacity: .92; }

/* ── Modal & toasts ───────────────────────────────────────────────── */
.modal-wrap { position: fixed; inset: 0; z-index: 100; background: rgba(28,27,24,.42); display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(600px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--card); border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(28,27,24,.5); animation: rise .2s ease; }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px 6px; }
.modal h2 { font: 500 22px var(--serif); letter-spacing: -.01em; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px 22px; }
.form-grid .span2 { grid-column: span 2; }
.modal .form-error { margin: 0 22px; }
.modal footer { display: flex; gap: 8px; padding: 14px 22px 20px; }
#toasts { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 9px; box-shadow: var(--shadow); font-weight: 500; animation: rise .2s ease; transition: opacity .3s, transform .3s; }
.toast.err { background: var(--critical); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .dash-grid, .record, .related-cols { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(28,27,24,.4); }
  .menu-btn { display: inline-grid; }
  .topbar, .page { padding-left: 16px; padding-right: 16px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .two, .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: auto; }
  .title { font-size: 28px; }
  .stepper { overflow-x: auto; }
  .step { min-width: 90px; }
}
