/* Northstar Sales CRM — monochrome to match the Northstar logo, with colour kept for meaning
   (overdue, warnings, brand chips). */
:root {
  --navy: #111111; --navy-2: #2b2b2b; --ink: #18181b; --muted: #6b6f76; --line: #e7e7e4; --bg: #f4f4f1; --card: #fff;
  --red: #c0262d; --amber: #9a5b00; --green: #1f7a52; --tint: #f1f1ee; --link: #1d4ed8; --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .04), 0 2px 8px rgba(17, 17, 17, .04);
  --shadow-lg: 0 10px 30px rgba(17, 17, 17, .10);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; letter-spacing: -.02em; margin: 2px 0; font-weight: 700; }
h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; font-weight: 700; }
h3 { font-size: 13px; margin: 18px 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
code { background: var(--tint); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.over { color: var(--red); font-weight: 600; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }

/* buttons and inputs */
.btn { border: 1px solid #d9d9d4; background: #fff; color: var(--ink); border-radius: 10px; padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: #b9b9b3; background: #fafaf8; text-decoration: none; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #2b2b2b; }
.btn.ghost { color: var(--red); }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; }
.link:hover { text-decoration: underline; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: #3f3f46; margin-bottom: 12px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
label.inline { flex-direction: row; align-items: center; gap: 8px; margin: 0; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--ink); border: 1px solid #d6d6d0; border-radius: 10px; padding: 9px 11px; background: #fff; width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: #2563eb; flex: none; }
input[type=file] { padding: 7px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #111; box-shadow: 0 0 0 3px rgba(17, 17, 17, .08); }
textarea { resize: vertical; line-height: 1.5; }
textarea.bignote { min-height: 220px; font-size: 15px; }
select.mini { padding: 4px 8px; font-size: 12px; width: 100%; margin-top: 10px; color: var(--muted); border-radius: 8px; background: #fafaf8; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; }
legend { font-size: 13px; font-weight: 600; color: #3f3f46; padding: 0 4px; }
.err { background: #fdecea; color: var(--red); border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.notice { background: #fff8e8; border: 1px solid #f1dca8; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: #ececea; color: #3f3f46; vertical-align: middle; white-space: nowrap; }
.pill.good { background: #e3f5ea; color: #15803d; }
.pill.n-call { background: #e8f0fe; color: #1d4ed8; } .pill.n-sms { background: #e3f5ea; color: #15803d; } .pill.n-email { background: #eef0ff; color: #4338ca; } .pill.n-visit { background: #f3e8ff; color: #7e22ce; } .pill.n-drive { background: #fde7f3; color: #be185d; } .pill.n-int { background: #ececea; color: #44444a; } .pill.n-stage { background: #fff4e0; color: #b45309; } .pill.n-lost { background: #fdecea; color: var(--red); }
.pill.warn { background: #fff1d6; color: var(--amber); }
.pill.bad { background: #fdecea; color: var(--red); }
.pill.quiet { background: #ececea; color: #44444a; }
.count { font-size: 12px; font-weight: 600; color: var(--muted); background: #ececea; border-radius: 99px; padding: 1px 9px; }
.brand-chip { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 7px; border-radius: 6px; background: #ececea; color: #333; vertical-align: 1px; }
.brand-chip.gwm { background: #fbe9ea; color: #a3151e; }
.brand-chip.nissan { background: #ececee; color: #1c1c1f; }
.brand-chip.mg { background: #fdeee6; color: #9b3412; }
.brand-chip.byd { background: #e6effc; color: #1b4f9c; }
.brand-chip.bmw { background: #e5effc; color: #0b4fa8; }
.brand-chip.hyundai { background: #e4ebf3; color: #002c5f; }
.brand-chip.mazda { background: #f6e6ea; color: #8a1538; }

/* sign-in */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow-x: auto; }
.auth { width: 100%; max-width: 420px; padding: 32px 32px 26px; box-shadow: var(--shadow-lg); border: 0; }
.auth .btn.primary { width: 100%; justify-content: center; margin-top: 6px; padding: 11px; font-size: 15px; }
.auth .link { margin-top: 14px; }
.center:has(.auth) { background: radial-gradient(1200px 600px at 50% -10%, #ffffff 0%, var(--bg) 60%); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .logo { height: 20px; width: auto; display: block; }
.brand .loc { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; border-left: 1px solid var(--line); padding-left: 12px; }
.brand.big { flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 24px; }
.brand.big .logo { height: 30px; }
.brand.big .loc { border: 0; padding: 0; text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; }
.qr { text-align: center; } .qr img { width: 180px; height: 180px; }

/* shell: black sidebar down the left (like the Commercial CRM), page title bar across the top */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; background: linear-gradient(to right, #0f0f10 236px, transparent 236px); }
.more { padding: 10px 18px; border-top: 1px solid #f3f3f0; }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .seg::-webkit-scrollbar { display: none; } .seg button { white-space: nowrap; flex: none; }
.side { background: #0f0f10; color: #c9c9cc; padding: 20px 12px 16px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; }
.sbrand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 4px 10px 22px; color: #fff; text-decoration: none; }
.sbrand:hover { text-decoration: none; }
.sbrand img { width: 170px; height: auto; }
.sbrand span { font-size: 11.5px; font-weight: 600; color: #8e8e93; letter-spacing: .06em; text-transform: uppercase; }
.snav { display: flex; flex-direction: column; gap: 3px; }
.snav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 9px; color: #c9c9cc; font-weight: 600; font-size: 14.5px; text-decoration: none; transition: background .15s, color .15s; }
.snav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.snav a.on { background: rgba(255, 255, 255, .12); color: #fff; box-shadow: inset 3px 0 0 #fff; }
.snav .ic { width: 20px; text-align: center; font-size: 15px; opacity: .9; }
.snav .ct { margin-left: auto; background: #dc2626; color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.sfoot { margin-top: auto; padding: 10px 12px; font-size: 12.5px; color: #8e8e93; line-height: 1.6; }
.sfoot b { color: #fff; }
.slinks { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 8px; }
.sfoot .link { color: #c9c9cc; font-size: 13px; }
.sfoot .link:hover { color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
header.top { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 14px; padding: 12px 26px; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
header.top .ptitle { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
header.top .sp { flex: 1; }
.mbrand { display: none; }
.me { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
main { width: 100%; max-width: 1400px; padding: 22px 26px 40px; }
.me { flex-direction: row; }
.avatar { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; flex: none; box-shadow: 0 0 0 2px #fff; vertical-align: middle; }
.avatar.none { background: #c9c9c4; }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; background-color: #fff; }
.filters .search { min-width: 320px; }
.seg { display: inline-flex; background: #e9e9e5; border-radius: 99px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 16px; border-radius: 99px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: #52525b; }
.seg button.on { background: #fff; color: #111; box-shadow: var(--shadow); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid #f0f0ed; }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .grow a b { color: var(--ink); }
.row .when { font-size: 13px; text-align: right; white-space: nowrap; }
.row.quiet { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.back { display: inline-block; color: var(--muted); font-size: 13px; margin-bottom: 10px; }

/* my day (like the Commercial CRM): big numbers that take you to the list, warning strip, lists with tick boxes */
.dayhead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.greet { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.statgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat { position: relative; padding: 16px 18px; margin: 0; }
.stat .v { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-weight: 600; font-size: 13px; margin-top: 2px; }
.statlink { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.statlink:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); border-color: #cfcfca; }
.statlink .go { font-size: 12.5px; font-weight: 700; color: #1d4ed8; margin-top: 8px; }
.statlink.red .v { color: #dc2626; } .statlink.red { border-top: 3px solid #dc2626; } .statlink.red .go { color: #dc2626; }
.statlink.blue .v { color: #1d4ed8; } .statlink.blue { border-top: 3px solid #2563eb; }
.statlink.violet .v { color: #6d28d9; } .statlink.violet { border-top: 3px solid #7c3aed; } .statlink.violet .go { color: #6d28d9; }
.flag, .replybar { display: flex; gap: 10px; align-items: baseline; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-weight: 600; font-size: 14px; }
.flag { background: #fff7e6; border: 1px solid #f3d9a4; color: #7a4a06; }
.replybar { background: #eef5ff; border: 1px solid #c9dcfb; color: #1e3a8a; }
.flag a, .replybar a { color: inherit; text-decoration: underline; }
.col2 { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid2 > .col2 > .card { margin: 0; }
.pane { padding: 0; overflow: hidden; }
.pane > .hd { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid #f0f0ed; font-weight: 700; font-size: 15px; }
.pane > .hd .sub { font-weight: 600; color: var(--muted); font-size: 12.5px; }
.pane > .hd .rt { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pane > .bd { padding: 16px 18px; }
.hd-red { color: #dc2626; }
.list .it { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid #f3f3f0; color: inherit; text-decoration: none; }
.list .it:first-child { border-top: 0; }
.list a.it:hover, .list .it:hover { background: #fafaf8; text-decoration: none; }
.list .grow { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.list .grow:hover { text-decoration: none; }
.list .ttl { font-weight: 600; font-size: 14.5px; }
.list .tm { font-weight: 700; width: 70px; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.list .dueslot { white-space: nowrap; text-align: right; min-width: 120px; }
.list .empty { padding: 20px 16px; }
.chk { width: 20px; height: 20px; border-radius: 6px; border: 2px solid #c2c2bc; background: #fff; cursor: pointer; flex: none; transition: border-color .15s; }
.chk:hover { border-color: #16a34a; background: #f0fdf4; }

/* dashboard (like the Commercial CRM, cars sold instead of commission) */
.dashbar { padding: 14px 16px; margin-bottom: 14px; }
.dashbar .row1, .dashbar .row2 { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dashbar .row2 { margin-top: 10px; }
.dashbar .rt { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.dashbar select, .dashbar input { padding: 7px 10px; font-size: 13.5px; }
.dashbar .seg button { padding: 6px 12px; font-size: 13px; }
.ink { color: var(--ink); }
.btn.xl { color: #15803d; border-color: #bfe3cc; }
.tile2 { border-top: 3px solid var(--tc, #111); }
.tile2 .ico { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: var(--tc); background: color-mix(in srgb, var(--tc) 13%, #fff); }
.tile2 .l { color: #52525b; margin: 0 0 4px; }
.t-gr { --tc: #16a34a; } .t-bl { --tc: #2a78d6; } .t-vi { --tc: #6250d6; } .t-or { --tc: #eb6834; } .t-sky { --tc: #0284c7; } .t-pk { --tc: #db2777; } .t-gr2 { --tc: #0d9488; } .t-am { --tc: #d97706; }
.t-gr .v { color: #15803d; }
.soldstrip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 16px 20px; margin-bottom: 16px; background: linear-gradient(90deg, #111 0%, #2b2b2e 100%); color: #fff; border: 0; }
.soldstrip .small { color: #c9c9cc; font-weight: 700; }
.soldstrip b { font-size: 24px; font-variant-numeric: tabular-nums; }
.soldstrip .sm { color: #a1a1a6; font-size: 12.5px; margin-left: 6px; }
.grid2 + .grid2 { margin-top: 16px; }
.grid2 > .pane { margin: 0; }
.funnel td, .funnel th { padding: 9px 14px; }
.funnel tr.hi td { background: #ecfdf3; color: #15803d; font-weight: 700; }
.funnel tr.lo td { color: var(--muted); }
.pane .funnel { margin: -16px -18px; width: calc(100% + 36px); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: #52525b; margin-bottom: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #efefeb; } .chart .base { stroke: #d4d4cf; } .chart .tick { font-size: 10.5px; fill: #8a8a85; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hb { display: grid; grid-template-columns: minmax(120px, 32%) 1fr minmax(120px, auto); align-items: center; gap: 12px; font-size: 14px; }
.hbl { display: flex; align-items: center; gap: 7px; min-width: 0; }
.hbt { position: relative; height: 11px; background: #f0f0ec; border-radius: 99px; overflow: hidden; }
.hbt i, .hbt s { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; text-decoration: none; }
.hbt s { background: repeating-linear-gradient(45deg, #dcdcd6, #dcdcd6 3px, #ececE7 3px, #ececE7 6px); }
.hbv { white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 13.5px; text-align: right; }
.tg { margin-bottom: 14px; } .tg:last-child { margin-bottom: 0; }
.tgh { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.tgp { margin-left: auto; font-weight: 700; color: #52525b; } .tgp.ok { color: #15803d; }
.fu3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.fu3 > div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; }
.fu3 b { font-size: 24px; } .fu3 span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.fu3 .bad { background: #fef2f2; border-color: #fbd0d0; } .fu3 .bad b { color: #dc2626; }
.fu3 .due { background: #fff7e6; border-color: #f3d9a4; } .fu3 .due b { color: #b45309; }
.fu3 .done { background: #ecfdf3; border-color: #bbe5cb; } .fu3 .done b { color: #15803d; }
p.foot { margin-top: 18px; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafaf8; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid #f0f0ed; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr[data-open] { cursor: pointer; transition: background .1s; }
.tbl tr[data-open]:hover td { background: #fafaf8; }
.tbl tr.limited td { color: var(--muted); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.card .tbl td input { padding: 7px 9px; }
.bar { display: inline-block; width: 120px; height: 8px; background: #ececea; border-radius: 99px; overflow: hidden; vertical-align: middle; }
.bar span { display: block; height: 100%; background: #111; border-radius: 99px; }

/* pipeline board (same layout as the Cashflow CRM): plain columns, no scroll bar, the board fills the screen,
   each stage scrolls on its own; slide sideways by dragging the board or with the arrows */
main.pipe { max-width: none; padding: 16px 16px 0; }
.pipehead { align-items: center; margin-bottom: 12px; }
.pipehead h1 { margin-right: 6px; }
.pipehead .check { margin: 0; }
.boardwrap { position: relative; }
.board { display: flex; gap: 10px; overflow-x: auto; align-items: stretch; height: calc(100vh - 170px); padding-bottom: 6px; scrollbar-width: none; cursor: grab; scroll-snap-type: x mandatory; }
.board::-webkit-scrollbar { display: none; }
body.panning, body.panning .board { cursor: grabbing; user-select: none; }
body.panning .board, body.dragging .board { scroll-snap-type: none; }
.col { flex: 0 0 var(--colw, 232px); max-width: var(--colw, 232px); min-width: 0; display: flex; flex-direction: column; height: 100%; background: #e9e9e5; border-radius: 12px; scroll-snap-align: start; }
.col.over { outline: 2px dashed #555; outline-offset: -3px; background: #e0e0db; }
.col .ch { padding: 11px 12px 9px; font-weight: 700; font-size: 13px; display: flex; gap: 6px; align-items: center; }
.col .ch .n { margin-left: auto; color: var(--muted); font-weight: 600; }
.col .cb { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 8px; display: flex; flex-direction: column; gap: 7px; scrollbar-width: thin; scrollbar-color: #c9c9c3 transparent; }
.col .cb::-webkit-scrollbar { width: 6px; } .col .cb::-webkit-scrollbar-thumb { background: #c9c9c3; border-radius: 6px; }
.kc { background: #fff; border: 1px solid var(--line); border-left: 3px solid #c9c9c4; border-radius: 9px; padding: 9px 10px; cursor: pointer; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); min-width: 0; }
.kc:hover { border-color: #c9c9c4; box-shadow: var(--shadow-lg); }
.kc.gwm { border-left-color: #c8202a; } .kc.nissan { border-left-color: #3b3b40; } .kc.mg { border-left-color: #d0571f; } .kc.byd { border-left-color: #2f6fd1; } .kc.bmw { border-left-color: #1c69d4; } .kc.hyundai { border-left-color: #002c5f; } .kc.mazda { border-left-color: #8a1538; }
.kc.dragging { opacity: .4; }
.kc .b { font-weight: 700; font-size: 13.5px; }
.kc .vd { color: #52525b; margin-top: 2px; }
.kc .m { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 7px; }
.kc .m .small { min-width: 0; }
.kc .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board.compact .col .cb { gap: 5px; }
.board.compact .kc { padding: 6px 8px; }
.board.compact .kc .vd { display: none; }
.board.compact .kc .m { margin-top: 2px; }
.board.compact .kc .b { font-size: 12.5px; }
.board.compact .kc .avatar { width: 18px; height: 18px; font-size: 8.5px; }
.bnav { display: none; position: absolute; top: 50%; transform: translateY(-50%); z-index: 6; width: 36px; height: 64px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-lg); font-size: 28px; line-height: 1; color: #52525b; cursor: pointer; padding: 0 0 4px; }
.bnav:hover { background: #fff; color: #111; }
.bnav.on { display: grid; place-items: center; }
.bnav.l { left: -8px; } .bnav.r { right: -8px; }
.dropbar { display: none; position: fixed; top: 70px; left: 16px; right: 16px; z-index: 40; background: #111; border-radius: 12px; padding: 8px; gap: 6px; align-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); flex-wrap: wrap; }
.dropbar > .small { color: #fff; font-weight: 700; margin: 0 4px; }
body.dragging .dropbar { display: flex; }
.dz { flex: 1 1 100px; min-height: 44px; display: grid; place-items: center; text-align: center; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .1); color: #fff; font-weight: 700; font-size: 12px; border: 2px dashed rgba(255, 255, 255, .35); }
.dz.over { background: #fff; color: #111; border-color: #fff; outline: 0; }
.dz.lost { border-color: rgba(255, 120, 110, .7); }
@media (max-width: 860px) { .board { height: auto; } .col { height: auto; max-height: 75vh; } }

/* customer file */
.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px; }
.hero-main { display: flex; align-items: center; gap: 16px; min-width: 0; }
.hero h1 { margin: 0 0 6px; }
.bigav { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 19px; flex: none; }
.contacts { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 4px 11px; border-radius: 99px; background: #f1f1ee; color: var(--ink); font-weight: 500; }
a.chip:hover { background: #e7e7e3; text-decoration: none; }
.chip.quiet { color: #52525b; }
.owner { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 14px; }
.owner > div { display: flex; align-items: center; gap: 8px; }
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--line); margin-bottom: 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs .on { color: #111; border-bottom-color: #111; }
.tabs a:hover, .tabs button:hover { color: #111; text-decoration: none; }
.form2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form2 .full, .form3 .full, .form2 fieldset { grid-column: 1 / -1; }
.deal { padding: 20px 22px; }
.deal.closed { opacity: .7; }
.dealhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.dealhead b { font-size: 16px; }
details { border-top: 1px solid #f0f0ed; padding: 10px 0; }
summary { cursor: pointer; font-weight: 700; font-size: 14px; padding: 4px 0; }
.dealfoot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.act { padding: 12px 0; border-top: 1px solid #f0f0ed; }
.act:first-child { border-top: 0; }

/* stage stepper on a deal, and the stage picker */
.stepper { list-style: none; display: flex; margin: 0 0 18px; padding: 6px 0 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.stepper li { flex: 1; min-width: 92px; position: relative; }
.stepper li::before { content: ''; position: absolute; top: 14px; left: -50%; right: 50%; height: 2px; background: #e3e3df; }
.stepper li:first-child::before { display: none; }
.stepper li.past::before, .stepper li.now::before { background: var(--sc); }
.stepper button { position: relative; z-index: 1; width: 100%; background: none; border: 0; padding: 0 4px; display: flex; flex-direction: column; align-items: center; gap: 6px; font: inherit; cursor: pointer; color: var(--muted); }
.stepper button:disabled { cursor: default; }
.stepper .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: #fff; border: 2px solid #d9d9d4; transition: border-color .15s, background .15s; }
.stepper .sl { font-size: 11.5px; font-weight: 600; text-align: center; line-height: 1.25; }
.stepper button:not(:disabled):hover .dot { border-color: var(--sc); color: var(--sc); }
.stepper button:not(:disabled):hover .sl { color: #111; }
.stepper li.past .dot { background: var(--sc); border-color: var(--sc); color: #fff; }
.stepper li.now .dot { background: var(--sc); border-color: var(--sc); box-shadow: 0 0 0 5px color-mix(in srgb, var(--sc) 20%, #fff); color: #fff; }
.stepper li.now .sl { color: var(--sc); font-weight: 700; }
.stagepick { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 12px; }
.stagepick button { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-weight: 600; cursor: pointer; transition: border-color .15s, background .15s; }
.stagepick button:hover:not(:disabled) { border-color: #111; background: #fafaf8; }
.stagepick button:disabled { cursor: default; background: #f4f4f1; }
.stagepick .dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 2px solid #d9d9d4; flex: none; }
.stagepick .past .dot { background: #111; border-color: #111; color: #fff; }
.stagepick .now .dot { border-color: #111; }

/* dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { --tc: #111; background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 9%, #fff), #fff 70%); border: 1px solid var(--line); border-top: 3px solid var(--tc); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tl { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.tv { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--tc); }
.bars { display: flex; flex-direction: column; gap: 10px; }
.brow { display: grid; grid-template-columns: minmax(110px, 30%) 1fr auto; align-items: center; gap: 12px; font-size: 14px; }
.bl { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btrack { position: relative; height: 12px; background: #f0f0ec; border-radius: 99px; overflow: hidden; }
.bfill, .bghost { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.bghost { background: repeating-linear-gradient(45deg, #d9d9d3, #d9d9d3 3px, #ebebe6 3px, #ebebe6 6px); }
.bfill { min-width: 3px; }
.br { white-space: nowrap; font-variant-numeric: tabular-nums; }
.legend { margin-left: auto; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.lg { display: inline-block; width: 14px; height: 8px; border-radius: 4px; background: #111; }
.lg.ghost { background: repeating-linear-gradient(45deg, #d9d9d3, #d9d9d3 3px, #ebebe6 3px, #ebebe6 6px); }
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--sc, #64748b); margin-right: 7px; flex: none; }
.stage-pill { --sc: #64748b; display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 99px; color: var(--sc); background: color-mix(in srgb, var(--sc) 12%, #fff); vertical-align: middle; }
.progress { height: 12px; background: #f0f0ec; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #2563eb, #16a34a); border-radius: 99px; transition: width .3s; }
.kinds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.kind { flex-direction: row; align-items: flex-start; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0; cursor: pointer; font-weight: 500; }
.kind:has(input:checked) { border-color: #2563eb; background: #eff5ff; }
.kind > span { display: flex; flex-direction: column; gap: 2px; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(10, 10, 10, .45); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 20px 16px; z-index: 20; overflow: hidden; animation: fade .12s ease-out; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 580px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; padding: 0 24px 20px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); animation: pop .14s ease-out; scrollbar-width: thin; scrollbar-color: #d4d4cf transparent; }
.modal label { margin-bottom: 10px; }
.modal .mfoot { position: sticky; bottom: -20px; background: #fff; margin: 4px -24px -20px; padding: 12px 24px 18px; border-top: 1px solid #f0f0ed; }
.modal.wide { max-width: 880px; }
.modal.stagemodal { max-width: 480px; }
.mhead { display: flex; justify-content: space-between; align-items: center; margin: 0 -24px 14px; padding: 18px 24px 12px; gap: 12px; position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 1px solid #f0f0ed; }
.mhead h2 { margin: 0; font-size: 18px; }
.mfoot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; grid-column: 1 / -1; }
.recent { border-top: 1px solid var(--line); margin-top: 14px; }
.recent .act { font-size: 14px; }
.temp code { font-size: 18px; padding: 8px 12px; display: inline-block; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.99); } }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 30; }
.toast { background: #111; color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.toast.bad { background: var(--red); }

@media (max-width: 980px) { .stats { grid-template-columns: repeat(3, 1fr); } .kinds { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  .form3 { grid-template-columns: 1fr 1fr; }
  .hide-sm { display: none; }
  header.top { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  header nav { order: 3; flex-basis: 100%; }
  main { padding: 16px 12px; }
  .filters .search { min-width: 0; width: 100%; }
  .owner { align-items: flex-start; }
}
@media (max-width: 520px) {
  .form2, .form3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .row { flex-wrap: wrap; row-gap: 4px; }
  .row .grow { flex-basis: 100%; }
  .row .when { flex: 1; text-align: left; }
  .tbl th, .tbl td { padding: 9px; }
  h1 { font-size: 22px; }
  .modal { padding: 18px; }
}

/* SMS and email */
.msgs { padding: 0; overflow: hidden; }
.thread { max-height: 52vh; min-height: 140px; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; background: #fafaf8; }
.msg { max-width: 72%; display: flex; flex-direction: column; gap: 3px; }
.msg.in { align-self: flex-start; } .msg.out { align-self: flex-end; align-items: flex-end; }
.msg .bubble { padding: 10px 13px; border-radius: 14px; font-size: 14.5px; line-height: 1.45; white-space: normal; word-break: break-word; }
.msg.in .bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.out .bubble { background: #2563eb; color: #fff; border-bottom-right-radius: 4px; }
.msg.out.email .bubble { background: #eef4ff; color: var(--ink); border: 1px solid #cfdcf7; }
.msg .meta { font-size: 11.5px; color: var(--muted); }
.composer { border-top: 1px solid var(--line); padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
.composer .crow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.composer textarea.bignote { min-height: 110px; }
.bellwrap { position: relative; }
.bell { position: relative; border: 1px solid var(--line); background: #fff; border-radius: 10px; width: 38px; height: 36px; cursor: pointer; font-size: 15px; }
.bell .dot { position: absolute; top: -6px; right: -6px; background: #dc2626; color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 99px; padding: 1px 6px; }
.bellbox { position: absolute; right: 0; top: 44px; width: 340px; max-height: 420px; overflow-y: auto; padding: 4px; z-index: 30; box-shadow: var(--shadow-lg); }
.nitem { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; font: inherit; font-size: 13.5px; cursor: pointer; }
.nitem:hover { background: #f4f4f1; } .nitem.unread span:first-child { font-weight: 700; }
.linklike { border: 0; background: none; cursor: pointer; font: inherit; color: inherit; padding: 0; }
.tpl { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 4px; margin-bottom: 12px; }
@media (max-width: 520px) { .msg { max-width: 90%; } .bellbox { position: fixed; left: 10px; right: 10px; width: auto; top: 60px; } }

/* customer page */
.btn .bi { font-size: 13px; line-height: 1; opacity: .85; }
.tabhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.tabhead h2 { margin: 0; }
.empty { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.link.danger { color: var(--red); }
.timeline { list-style: none; margin: 6px 0 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: #efefeb; }
.timeline li { position: relative; display: flex; gap: 14px; padding: 10px 0; }
.tl-ic { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 14px; font-weight: 700; background: #fff; border: 2px solid #e4e4df; color: #52525b; }
.n-call .tl-ic { border-color: #bfd3fb; color: #1d4ed8; } .n-sms .tl-ic { border-color: #b7e4c7; color: #15803d; } .n-email .tl-ic { border-color: #c7c9f7; color: #4338ca; } .n-visit .tl-ic { border-color: #e0c6fb; color: #7e22ce; } .n-drive .tl-ic { border-color: #f9c4dd; color: #be185d; } .n-stage .tl-ic { border-color: #fbd9a5; color: #b45309; } .n-lost .tl-ic { border-color: #f6c0bb; color: var(--red); }
.tl-main { flex: 1; min-width: 0; padding-top: 4px; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-act { margin-left: auto; display: inline-flex; gap: 12px; }
.tl-body { margin-top: 5px; font-size: 14.5px; line-height: 1.5; word-break: break-word; }
.tl-body .tl-act { margin-left: 12px; }
/* phones: bottom menu like the Cashflow CRM, customer list as cards, actions in a grid */
.bottomnav { display: none; }
@media (max-width: 860px) {
  header.top nav { display: none; }
  header.top .link[data-act=signout] { font-size: 13px; }
  main { padding-bottom: 88px; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; background: #111; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #a1a1a6; font-size: 10.5px; font-weight: 600; padding: 5px 2px; text-decoration: none; }
  .bottomnav a.on { color: #fff; }
  .bottomnav .ic { font-size: 18px; line-height: 1.1; }
  .cust-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cust-actions .btn { justify-content: center; }
  .cust-actions .btn.primary { grid-column: 1 / -1; }
  table.tbl.resp thead { display: none; }
  table.tbl.resp tr { display: block; padding: 10px 12px; border-bottom: 1px solid #f0f0ed; }
  table.tbl.resp td { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 0; padding: 3px 0; }
  table.tbl.resp td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: 12px; font-weight: 600; }
  table.tbl.resp td:first-child { font-size: 15px; }
  table.tbl.resp td.hide-sm { display: none; }
  .dealcell { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .modal { padding: 0 18px 16px; } .mhead { margin: 0 -18px 12px; padding: 16px 18px 10px; } .modal .mfoot { margin: 4px -18px -16px; padding: 10px 18px 14px; bottom: -16px; }
}

/* phones: no sidebar (bottom menu instead), logo in the top bar */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; background: none; }
  .side { display: none; }
  header.top { padding: 10px 14px; gap: 10px; }
  header.top .ptitle { display: none; }
  .mbrand { display: block; } .mbrand .logo { height: 17px; display: block; }
  main { padding: 16px 12px 96px; }
  .statgrid { grid-template-columns: 1fr 1fr; }
  .soldstrip { grid-template-columns: 1fr; gap: 10px; }
  .hb { grid-template-columns: 1fr; gap: 4px; } .hbv { text-align: left; }
  .dashbar .rt { margin-left: 0; }
  .list .dueslot { min-width: 0; }
  .list .it { flex-wrap: wrap; row-gap: 4px; }
  .list .it .grow { flex: 1 1 calc(100% - 40px); }
  .list .it .avslot { margin-left: 32px; }
  .list .it .avslot:empty { display: none; }
  .list .it .avslot:empty + .dueslot { margin-left: 32px; }
  .list .it .dueslot { text-align: left; }
}

/* ---------- My account / Outlook ---------- */
.acct { display: grid; gap: 16px; max-width: 820px; }
.acct .card { margin: 0; }
.olstate { display: flex; gap: 14px; align-items: flex-start; padding: 14px; border: 1px solid var(--line, #e6e6e3); border-radius: 12px; background: #fafaf8; }
.olstate.ok { background: #f1faf4; border-color: #cbe9d5; }
.olstate .grow { flex: 1; min-width: 0; }
.olic { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: #0f6cbd; color: #fff; }
.olstate.ok .olic { background: #15803d; }
ul.ticks { margin: 8px 0 0; padding-left: 18px; }
ul.ticks li { margin: 3px 0; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin-bottom: 12px; font-size: 14px; }
.kv > span { color: var(--muted); }
.kv > b { font-weight: 600; overflow-wrap: anywhere; }
.pill.olpill { background: #e5f0fb; color: #0f6cbd; }
.mailbody { border: 1px solid var(--line, #e6e6e3); border-radius: 10px; padding: 14px; background: #fff; max-height: 55vh; overflow: auto; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
@media (max-width: 640px) { .olstate { flex-wrap: wrap; } .olstate .btn { width: 100%; } }

/* dashboard: two independent columns so cards of different heights stack without gaps */
.dcols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dcol > .card { margin: 0; }
.brand-chip.used { background: #fdece2; color: #b4461a; }
@media (max-width: 900px) { .dcols { grid-template-columns: 1fr; } }

/* dashboard: arrange mode */
.dcols.editing .dcol { min-height: 120px; border-radius: 16px; outline: 2px dashed transparent; outline-offset: 6px; }
.dcols.editing .dcol.overcol { outline-color: #2a78d6; }
.dw { position: relative; border-radius: 16px; }
.dw > .card { margin: 0; pointer-events: none; }
.dwbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin-bottom: 6px; background: #111; color: #fff; border-radius: 10px; cursor: grab; }
.dwbar .grip { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.dwbar .sp { flex: 1; }
.dwbar .btn { padding: 2px 9px; min-height: 0; background: #2b2b2e; color: #fff; border-color: #3a3a3e; }
.dwbar .btn:disabled { opacity: .35; }
.dw.dragging { opacity: .35; }
.dw.before { box-shadow: 0 -4px 0 0 #2a78d6; }
.dw.after { box-shadow: 0 4px 0 0 #2a78d6; }
.dwend { border: 2px dashed #d4d4d0; border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.dwnote { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dwnote b { margin-right: 4px; }
.card.roles { margin-top: 16px; }
.card.roles h3 { margin-top: 0; }
.card.roles .kv { grid-template-columns: max-content 1fr; }
.card.roles .kv > b { font-weight: 400; }
.card.roles .kv > span { font-weight: 700; color: var(--ink); }
