/* Black Fox CRM. One stylesheet, no framework. */

:root {
  color-scheme: dark;
  --bg: #0a0a0c;
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .035);
  --text: #f4efe9;
  --text-2: rgba(244, 239, 233, .8);
  --muted: rgba(244, 239, 233, .55);
  --border: rgba(255, 255, 255, .1);
  --border-2: rgba(255, 255, 255, .17);
  --brand: #d39a6b;
  --brand-700: #e8b88e;
  --brand-ink: #1b120b;
  --brand-50: rgba(211, 154, 107, .12);
  --brand-200: rgba(211, 154, 107, .35);
  --gold: #e8b88e;
  --gold-700: #d39a6b;
  --plum: #5c3a58;
  --side: #0c0a0d;
  --side-2: rgba(255, 255, 255, .07);
  --side-text: rgba(244, 239, 233, .72);
  --side-dim: rgba(244, 239, 233, .42);
  --danger: #f87171;
  --danger-50: rgba(239, 68, 68, .12);
  --warn: #fbbf24;
  --warn-50: rgba(245, 158, 11, .12);
  --good: #4ade80;
  --good-50: rgba(34, 197, 94, .12);
  --wa: #1f9d57;
  --call: #2563eb;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 22px 44px -26px rgba(0, 0, 0, .8);
  --shadow-lg: inset 0 1px 0 rgba(255, 255, 255, .08), 0 28px 64px rgba(0, 0, 0, .6);
  --font: Jost, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --side-w: 236px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0 0 .6em; }
code { font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
pre { white-space: pre-wrap; word-break: break-word; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; max-height: 360px; overflow: auto; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.late { color: var(--danger); font-weight: 600; }
.ok { color: var(--good); }
.nowrap { white-space: nowrap; }
.wrap { word-break: break-all; }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.big { width: 40px; height: 40px; stroke-width: 1.4; color: var(--border-2); }

/* ---------- app shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; flex: none; }
.brand-mark img { width: 38px; height: auto; display: block; }
.brand-name small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.brand-name { font-weight: 700; font-size: 15px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.side-nav { flex: 1; overflow-y: auto; padding: 6px 10px; }
.side-nav a, .side-user { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--side-text); font-weight: 500; }
.side-nav a:hover, .side-user:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.side-nav a.active, .side-user.active { background: rgba(212, 163, 115, .14); color: #fff; }
.side-nav a.active .i { color: var(--gold); }
.side-label { margin: 16px 10px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--side-dim); }
.side-foot { padding: 10px; border-top: 1px solid var(--side-2); display: grid; gap: 8px; }
.side-user span { display: grid; line-height: 1.25; min-width: 0; }
.side-user strong { color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { color: var(--side-dim); }
.side-foot .btn-ghost { color: var(--side-text); border-color: var(--side-2); background: transparent; }
.side-foot .btn-ghost:hover { background: var(--side-2); color: #fff; }

.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 12px 24px; background: rgba(244, 246, 248, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.page-title { font-size: 19px; font-weight: 700; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search { position: relative; width: min(340px, 34vw); }
.search .i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 34px; background: var(--surface); }
.bell { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--text-2); border: 1px solid var(--border); background: var(--surface); }
.bell:hover { text-decoration: none; background: var(--surface-2); }
.badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.content { padding: 20px 24px 40px; max-width: 1280px; width: 100%; }
.content > * + * { margin-top: 16px; }
.tabbar, .scrim { display: none; }

/* ---------- controls ---------- */
input, select, textarea { font: inherit; color: inherit; width: 100%; padding: 9px 11px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface); min-height: 40px; }
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(110, 74, 107, .18); }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }
input[disabled] { background: var(--surface-2); color: var(--muted); }
.field { display: grid; gap: 5px; margin: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 13px; margin: 0; }
.check-line { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.check-line input { margin-top: 4px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; min-height: 40px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; background: var(--surface); color: var(--text); line-height: 1.2; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-700); }
.btn-ghost { border-color: var(--border-2); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-call { background: var(--call); color: #fff; }
.btn-call:hover { filter: brightness(.92); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { filter: brightness(.92); }
.btn-danger-ghost { border-color: #fecaca; color: var(--danger); background: var(--surface); }
.btn-danger-ghost:hover { background: var(--danger-50); }
.btn-sm { padding: 6px 11px; min-height: 34px; font-size: 13.5px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; padding: 0; }
.icon-btn:hover { background: var(--surface-2); text-decoration: none; }
.icon-btn.call { color: var(--call); border-color: #bfdbfe; background: #eff6ff; }
.icon-btn.wa { color: var(--wa); border-color: #bbf7d0; background: #f0fdf4; }
.quick { display: flex; gap: 6px; justify-content: flex-end; }
.quick form { margin: 0; }
.link { font-size: 13.5px; font-weight: 600; }

.flash { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid; font-weight: 500; }
.flash-ok { background: var(--good-50); border-color: #bbf7d0; color: #14532d; }
.flash-error { background: var(--danger-50); border-color: #fecaca; color: #7f1d1d; }
.flash.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 200; width: max-content; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.call-info { margin: -4px 0 10px; font-weight: 600; color: var(--accent, #d4a373); }
.flash-x { margin-left: auto; background: none; border: 0; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }

.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; border: 1px solid transparent; }
.pill-blue { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.pill-amber { background: #fffbeb; color: #a16207; border-color: #fde68a; }
.pill-violet { background: #f5f3ff; color: #6d28d9; border-color: #ede9fe; }
.pill-teal { background: #f0fdfa; color: #0f766e; border-color: #ccfbf1; }
.pill-cyan { background: #ecfeff; color: #0e7490; border-color: #cffafe; }
.pill-orange { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.pill-green { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.pill-grey { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.pill-red { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.temp { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; vertical-align: 1px; }
.temp-hot { background: #fee2e2; color: #b91c1c; }
.temp-cold { background: #e0f2fe; color: #0369a1; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: 13px; flex: none; }

/* ---------- cards and layout ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head form { margin: 0; }
.card[id], section[id] { scroll-margin-top: 80px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.empty { color: var(--muted); margin: 6px 0; }
.empty-state { text-align: center; padding: 40px 20px; }
.empty-state h3 { margin: 10px 0 6px; font-size: 17px; }
.eyebrow { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 4px; }
.plain { margin: 8px 0 0; padding-left: 18px; }
.plain li { margin: 4px 0; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.stack { display: grid; gap: 14px; }
.toolbar { max-width: 280px; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form select { width: auto; flex: 1; }

.hello h2 { font-size: 22px; }
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { display: grid; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); border-top: 3px solid var(--border-2); }
a.kpi:hover { text-decoration: none; border-color: var(--border-2); }
.kpi-n { font-size: 28px; font-weight: 750; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi-l small { display: block; }
.kpi-danger { border-top-color: var(--danger); }
.kpi-danger .kpi-n { color: var(--danger); }
.kpi-warn { border-top-color: #f59e0b; }
.kpi-good { border-top-color: #22c55e; }

.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--border); }
.row:first-child { border-top: 0; }
.row.unread { background: var(--brand-50); margin: 0 -16px; padding: 10px 18px; }
.row-main { flex: 1; min-width: 0; display: flex; gap: 12px; align-items: baseline; color: var(--text); }
.row-main:hover { text-decoration: none; }
.row-main:hover .row-title { color: var(--brand); }
.row-text { display: grid; min-width: 0; }
.row-main > .row-title, .row-main > .row-sub { display: block; }
.row-main:not(:has(.row-text)) { flex-direction: column; gap: 1px; }
.row-title { font-weight: 600; }
.row-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.row-time { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 74px; color: var(--text-2); font-size: 13.5px; }
.row form { margin: 0; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.bars a { display: grid; grid-template-columns: 150px 1fr 40px; gap: 10px; align-items: center; color: var(--text-2); font-size: 13.5px; }
.bars a:hover { text-decoration: none; color: var(--brand); }
.bar { height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 5px; min-width: 2px; }
.bar-n { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.fill-blue { background: #3b82f6; } .fill-amber { background: #f59e0b; } .fill-violet { background: #8b5cf6; } .fill-teal { background: #14b8a6; }
.fill-cyan { background: #06b6d4; } .fill-orange { background: #f97316; } .fill-green { background: #22c55e; } .fill-grey { background: #94a3b8; } .fill-red { background: #ef4444; }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feed li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.feed .muted { display: block; font-size: 13px; }
.feed-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); color: var(--muted); flex: none; }
.feed-icon .i { width: 15px; height: 15px; }

/* ---------- tables ---------- */
.table-card { padding: 0; overflow: hidden; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-href] { cursor: pointer; }
.table tbody tr:hover { background: #fafcfd; }
.table tfoot th { background: var(--surface-2); border-top: 1px solid var(--border-2); border-bottom: 0; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .check { width: 36px; }
.table .actions { width: 1%; white-space: nowrap; text-align: right; }
.table tr.is-off td { opacity: .55; }
.leads-table { min-width: 1040px; }
.lead-cell { min-width: 180px; }
.lead-cell .sub { white-space: nowrap; }
.lead-cell .lead-name { font-weight: 650; color: var(--text); }
.lead-cell .lead-name:hover { color: var(--brand); }
.sub { display: block; font-size: 12.5px; color: var(--muted); }
.req { min-width: 200px; max-width: 280px; font-size: 13.5px; }
.map-table td { vertical-align: middle; }
.map-table select { min-width: 200px; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; color: var(--muted); font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab .count { font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; color: var(--muted); }
.tab.active .count { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand); }
.tab-alert .count { background: #fee2e2; border-color: #fecaca; color: #b91c1c; }

.filters summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters[open] summary { margin-bottom: 14px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.filter-actions { display: flex; gap: 8px; align-items: center; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.list-head p { margin: 0; }
.list-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bulk-bar { position: sticky; top: 66px; z-index: 20; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; background: var(--side); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.bulk-bar select, .bulk-bar input { width: auto; min-height: 34px; padding: 5px 10px; color: var(--text); background: var(--surface); }
.region-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.region-seg a { padding: 6px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: 14px; }
.region-seg a:hover { background: var(--surface-2); text-decoration: none; }
.region-seg a.active { background: var(--brand); color: #fff; }
.region-seg .count { font-weight: 500; opacity: .75; margin-left: 2px; }
/* Protected screens (agents): watermark, no selecting or copying, nothing when printed. */
.watermark { position: fixed; inset: 0; z-index: 90; pointer-events: none; background-repeat: repeat; }
body.guard { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.guard input, body.guard textarea { -webkit-user-select: text; user-select: text; }
body.guard.guard-away .main { filter: blur(14px); }
@media print { body.guard * { visibility: hidden !important; } body.guard::after { content: "Printing is turned off for your account."; visibility: visible; } }
.perm-box { border-top: 1px solid var(--border); padding-top: 10px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.perm-group { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px 10px; margin: 0; display: grid; gap: 6px; align-content: start; }
.perm-group legend { font-weight: 700; font-size: 13px; padding: 0 4px; color: var(--text-2); }
fieldset.bare { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 14px; }
fieldset.bare[disabled] input, fieldset.bare[disabled] select, fieldset.bare[disabled] textarea { background: var(--surface-2); color: var(--text); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 16px; }

/* ---------- forms ---------- */
.form-card { max-width: 920px; }
.form-card > * + * { margin-top: 14px; }
.form-section { font-size: 16px; font-weight: 700; }
.form-card .form-section:not(:first-of-type) { padding-top: 10px; border-top: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding-top: 4px; }
.tpl-row { display: grid; grid-template-columns: 220px 1fr; gap: 12px; }
.copy-row { display: flex; gap: 8px; margin: 6px 0 14px; }
.copy-row input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--surface-2); }
#integrations h3 { margin-top: 18px; }

/* ---------- lead page ---------- */
.lead-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.lead-id { display: flex; gap: 14px; align-items: center; min-width: 0; }
.lead-id .avatar { width: 48px; height: 48px; font-size: 17px; }
.lead-head h2 { font-size: 21px; }
.lead-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 0; }
.lead-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.next-step { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-left: 4px solid var(--brand); }
.next-step.is-late { border-left-color: var(--danger); background: #fffafa; }
.next-what { font-size: 17px; font-weight: 650; margin: 0; }
.next-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lead-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.side-col { display: grid; gap: 16px; }
.facts { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
.req-notes { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--border-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg-btn { border: 0; background: var(--surface); padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg-btn + .seg-btn { border-left: 1px solid var(--border-2); }
.seg-hot.on { background: #fee2e2; color: #b91c1c; }
.seg-warm.on { background: #fef3c7; color: #a16207; }
.seg-cold.on { background: #e0f2fe; color: #0369a1; }
.danger-zone { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.inline-form + .danger-zone { margin-top: 14px; }

.note-form { display: grid; gap: 8px; margin-bottom: 16px; }
.note-actions { display: flex; justify-content: space-between; gap: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl { position: relative; display: flex; gap: 12px; padding: 8px 0; }
.tl-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); color: var(--muted); flex: none; }
.tl-icon .i { width: 15px; height: 15px; }
.k-call .tl-icon { color: var(--call); border-color: #bfdbfe; }
.k-whatsapp .tl-icon { color: var(--wa); border-color: #bbf7d0; }
.k-status .tl-icon { color: var(--brand); border-color: var(--brand-200); }
.k-visit .tl-icon { color: var(--gold-700); border-color: #f1d9c2; }
.k-enquiry .tl-icon { color: #7c3aed; border-color: #ddd6fe; }
.k-note .tl-icon { color: #b45309; border-color: #fde68a; }
.tl-body { min-width: 0; flex: 1; padding-top: 4px; }
.tl-title { font-weight: 600; margin: 0; }
.tl-text { margin: 4px 0; font-size: 14px; color: var(--text-2); white-space: normal; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; max-height: 260px; overflow: auto; }
.tl-meta { font-size: 12.5px; color: var(--muted); margin: 2px 0 0; }

.matches { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.matches li { display: flex; gap: 10px; align-items: center; }
.matches form { margin: 0; }
.match { flex: 1; display: flex; gap: 10px; align-items: center; color: var(--text); min-width: 0; }
.match:hover { text-decoration: none; }
.match img, .match-ph { width: 56px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.match span { display: grid; min-width: 0; }
.match small { color: var(--muted); }

.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; width: min(360px, 88vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px; }
.menu-list form { margin: 0; }
.menu-item { display: grid; gap: 2px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; font: inherit; cursor: pointer; color: var(--text); }
.menu-item:hover { background: var(--surface-2); }
.menu-item small { color: var(--muted); font-size: 12.5px; }
.menu-custom { display: grid; gap: 6px; padding: 8px 6px 4px; border-top: 1px solid var(--border); margin-top: 4px !important; }

/* ---------- dialogs ---------- */
dialog.modal { margin: auto; }
.modal { border: 0; padding: 0; border-radius: 16px; width: min(520px, calc(100vw - 24px)); box-shadow: var(--shadow-lg); color: var(--text); }
.modal::backdrop { background: rgba(15, 23, 42, .45); }
.modal-body { padding: 20px; display: grid; gap: 14px; }
.modal h2 { font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.status-grid, .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.status-opt, .chip { cursor: pointer; }
.status-opt input, .chip input { position: absolute; opacity: 0; pointer-events: none; }
.status-opt .pill { padding: 6px 12px; font-size: 13px; opacity: .75; }
.status-opt input:checked + .pill { opacity: 1; box-shadow: 0 0 0 2px currentColor; }
.status-opt input:focus-visible + .pill, .chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.chip span, .chip-btn { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-2); font-size: 13.5px; font-weight: 600; background: var(--surface); color: var(--text-2); cursor: pointer; font-family: inherit; }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-btn:hover { background: var(--surface-2); }

/* ---------- inventory ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.project-card { color: var(--text); display: grid; gap: 4px; align-content: start; }
.project-card:hover, .prop-card:hover { text-decoration: none; border-color: var(--border-2); box-shadow: 0 4px 14px rgba(15, 23, 42, .08); }
.project-card .card-head { margin-bottom: 2px; }
.project-card p { margin: 0; }
.project-stats { display: flex; gap: 16px; margin-top: 8px !important; color: var(--muted); font-size: 13.5px; }
.project-stats strong { color: var(--text); }
.is-off { opacity: .6; }
.prop-card { padding: 0; overflow: hidden; color: var(--text); display: grid; }
.prop-img { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--surface-2); }
.prop-img img { width: 100%; height: 100%; object-fit: cover; }
.prop-img .pill { position: absolute; top: 10px; left: 10px; }
.prop-body { display: grid; gap: 2px; padding: 12px 14px 14px; font-size: 14px; }
.prop-price { font-size: 17px; font-weight: 700; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.photo-grid figure { position: relative; margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.photo-grid form { position: absolute; top: 6px; right: 6px; margin: 0; }
.upload-form input[type="file"] { min-height: 0; padding: 6px; }
.filter-inline { align-items: end; }
.report-note { margin-top: 8px !important; font-size: 13.5px; }
.log-list { list-style: none; padding: 0; }
.log-list li { padding: 14px 16px; border-top: 1px solid var(--border); }
.log-list li:first-child { border-top: 0; }
.log-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.log-head form { margin: 0 0 0 auto; }
.log-list details summary { cursor: pointer; color: var(--brand); font-size: 13.5px; font-weight: 600; }

/* ---------- auth and public pages ---------- */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: var(--side); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 28px; display: grid; gap: 14px; }
.auth-card h1 { font-size: 22px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.auth-foot { text-align: center; margin: 0; font-size: 14px; }

.share { background: var(--bg); }
.share-wrap { max-width: 720px; margin: 0 auto; background: var(--surface); min-height: 100vh; padding-bottom: 96px; }
.share-top { padding: 14px 18px; border-bottom: 1px solid var(--border); font-size: 16px; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 4px; background: #000; }
.gallery img { flex: 0 0 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; }
.share-body { padding: 18px; display: grid; gap: 10px; }
.share-body h1 { font-size: 22px; }
.share-price { font-size: 24px; font-weight: 750; color: var(--brand); margin: 0; }
.share-desc { color: var(--text-2); }
.share-cta { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(720px, 100%); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(15, 23, 42, .08); }
.share-cta p { margin: 0; font-weight: 600; }
.share-cta div { display: flex; gap: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 35; }
  .main { margin-left: 0; }
  .topbar { padding: 10px 16px; }
  .content { padding: 16px 16px 96px; }
  .search, .btn-add { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; align-items: center; }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; font: inherit; font-size: 11px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 4px 10px; cursor: pointer; }
  .tabbar a:hover { text-decoration: none; }
  .tabbar .active { color: var(--brand); }
  .tabbar .i { width: 22px; height: 22px; }
  .tabbar .tab-add { width: 50px; height: 50px; border-radius: 50%; background: var(--brand); color: #fff; place-items: center; box-shadow: 0 6px 16px rgba(110, 74, 107, .4); margin-top: -18px; }
  .lead-grid, .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .bulk-bar { top: 62px; }
}

@media (max-width: 720px) {
  body { font-size: 15px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 12px; }
  .kpi-n { font-size: 24px; }
  .form-grid, .tpl-row { grid-template-columns: minmax(0, 1fr); }
  .bars a { grid-template-columns: 110px 1fr 32px; }
  .page-title { font-size: 17px; }
  .lead-head h2 { font-size: 19px; }
  .lead-actions .btn { flex: 1; }
  .lead-actions .menu { flex: 1; }
  .lead-actions .menu summary { width: 100%; }
  .next-actions { width: 100%; }
  .next-actions .btn { flex: 1; }
  .copy-row { flex-direction: column; }
  .menu-list { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; max-height: 70vh; overflow-y: auto; }
  .card { padding: 14px; }

  /* Tables turn into cards on phones. */
  .table-card.as-cards { background: none; border: 0; box-shadow: none; padding: 0; }
  .as-cards .table td[data-label]:empty { display: none; }
  .as-cards .table thead { display: none; }
  .as-cards .table, .as-cards .table tbody { display: block; min-width: 0; }
  .as-cards .table-wrap { overflow: visible; }
  .as-cards .table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
  .as-cards .table td { display: block; padding: 0; border: 0; font-size: 13.5px; }
  .as-cards .table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-weight: 500; }
  .as-cards .table td.lead-cell { grid-column: 1; }
  .as-cards .table td.actions { grid-column: 2; grid-row: 1; width: auto; }
  .as-cards .table td.check { grid-column: 2; grid-row: 2; text-align: right; }
  .as-cards .table td[data-label] { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- v2: brand, pick lists, tags, sheets, sync, offline ---------- */
.auth-card { padding: 0; overflow: hidden; }
.auth-card > :not(.auth-logo) { margin-left: 28px; margin-right: 28px; }
.auth-card > :last-child { margin-bottom: 28px; }
.auth-logo { background: #000; display: grid; place-items: center; padding: 26px 20px 20px; }
.auth-logo img { width: 210px; height: auto; }
.auth-logo span { margin-top: 8px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); font-weight: 700; }

.pick { display: grid; gap: 6px; }
.pick-other { display: grid; gap: 6px; }
.pick-save { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); font-weight: 500; cursor: pointer; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-picker .chip span { padding: 4px 10px; font-size: 13px; }
.tag-new { display: grid; gap: 6px; margin-top: 8px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 4px; background: var(--brand-50); color: var(--brand); border: 1px solid var(--brand-200); margin: 2px 4px 0 0; white-space: nowrap; }
.tag-nri { background: #fdf3e8; color: var(--gold-700); border-color: #f1d9c2; }
.sub-status { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.details-list { display: grid; grid-template-columns: minmax(90px, 40%) 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.details-list dt { color: var(--muted); word-break: break-word; }
.details-list dd { margin: 0; word-break: break-word; }
.sheet-card .card-head { flex-wrap: wrap; }
.sheet-include { margin: 0; }
.att-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.att-grid img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.rule-row { display: grid; grid-template-columns: 150px 1fr 200px; gap: 8px; margin-bottom: 8px; }
.sub-lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.install-btn { color: var(--gold) !important; }
.sync-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: #fdf3e8; color: var(--gold-700); border: 1px solid #f1d9c2; }
.sync-chip.is-off { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.walkin-card { max-width: 640px; }
.walkin-card input, .walkin-card select { font-size: 17px; min-height: 48px; }

/* Offline app shell */
.off-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 16px calc(10px); padding-top: calc(10px + env(safe-area-inset-top)); background: var(--side); color: #fff; }
.off-top img { width: 30px; }
.off-top strong { flex: 1; }
.off-banner { padding: 8px 16px; font-size: 13.5px; font-weight: 600; background: #fdf3e8; color: var(--gold-700); border-bottom: 1px solid #f1d9c2; }
.off-banner.is-online { background: var(--good-50); color: #14532d; border-color: #bbf7d0; }
.off-main { padding: 14px 16px 96px; max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.off-nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
.off-nav a { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 12px; }
.off-nav a.active { color: var(--brand); }
.off-nav .i { width: 22px; height: 22px; }
.off-problems li { color: #7f1d1d; }
.auth-card > :first-child:not(.auth-logo) { margin-top: 28px; }
.form-grid { align-items: start; }

/* Back button on inner pages (a lead, a form, a sub-page) */
.back-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; margin-right: 4px; border-radius: 10px; font-size: 30px; line-height: 1; color: inherit; text-decoration: none; }
.back-btn:hover, .back-btn:focus-visible { background: rgba(127, 127, 127, .15); }

/* Several accounts on one device */
.accounts { display: grid; gap: 8px; }
.accounts form { margin: 0; }
.accounts .muted, .accounts-tip { margin: 0; font-size: 13px; }
.account-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.account-row span { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.account-row > .avatar { flex: none; display: grid; }
.account-row small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-row em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--brand); }
button.account-row:hover, button.account-row:focus-visible { border-color: var(--brand); }
.account-row.is-current { cursor: default; background: var(--surface-2); }
.account-row.is-current em { color: var(--muted); }

/* ---------- v2.7: glass look, matched to blackfoxrealestate.in ---------- */
/* Copper on near-black, frosted panels, Jost, pill buttons. Blur only on the chrome
   (sidebar, top bar, tab bar, menus, dialogs): cards stay cheap for long lists on phones. */
@font-face { font-family: Jost; src: url(fonts/jost.woff2) format("woff2"); font-weight: 300 600; font-display: swap; }
@font-face { font-family: Jost; src: url(fonts/jost-italic.woff2) format("woff2"); font-weight: 300 600; font-style: italic; font-display: swap; }
body {
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 700px at 100% -10%, rgba(211, 154, 107, .13), transparent 60%),
    radial-gradient(900px 650px at -10% 105%, rgba(92, 58, 88, .32), transparent 62%),
    var(--bg) fixed;
}
a { color: var(--gold); }
:focus-visible { outline-color: var(--brand); }
::selection { background: rgba(211, 154, 107, .35); }

/* glass surfaces */
.card, .kpi, .as-cards .table tr, .account-row, .region-seg {
  background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .03));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.kpi { border-top: 2px solid var(--border-2); }
.kpi-danger { border-top-color: var(--danger); }
.kpi-warn { border-top-color: var(--warn); }
.kpi-good { border-top-color: var(--good); }
a.kpi:hover, .project-card:hover, .prop-card:hover { border-color: rgba(211, 154, 107, .45); box-shadow: var(--shadow), 0 0 0 1px rgba(211, 154, 107, .12); }
.sidebar, .topbar, .tabbar, .off-nav, .off-top, .menu-list, .modal, .bulk-bar, .share-cta, .auth-card {
  -webkit-backdrop-filter: blur(22px) saturate(1.5);
  backdrop-filter: blur(22px) saturate(1.5);
}
.sidebar { background: rgba(12, 10, 13, .72); border-right: 1px solid var(--border); }
.topbar { background: rgba(10, 10, 12, .62); border-bottom-color: var(--border); }
.menu-list, .modal { background: rgba(26, 22, 26, .94); border: 1px solid var(--border-2); }
.modal::backdrop, .nav-open .scrim { background: rgba(5, 5, 7, .6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.bulk-bar { background: rgba(26, 22, 26, .92); border: 1px solid rgba(211, 154, 107, .3); }
.tabbar, .off-nav { background: rgba(12, 10, 13, .78); border-top-color: var(--border); }
.share-cta { background: rgba(12, 10, 13, .82); border-top-color: var(--border); box-shadow: 0 -10px 30px rgba(0, 0, 0, .4); }
.off-top { background: rgba(12, 10, 13, .78); }

/* type: light display weights, like the website */
.page-title { font-weight: 500; letter-spacing: -.01em; }
.hello h2 { font-size: 28px; font-weight: 300; letter-spacing: -.02em; }
.lead-head h2, .auth-card h1, .share-body h1 { font-weight: 400; letter-spacing: -.015em; }
.kpi-n { font-size: 32px; font-weight: 300; letter-spacing: -.02em; }
.eyebrow, .side-label { color: var(--brand); letter-spacing: .16em; font-weight: 500; }
.form-section, h3 { font-weight: 500; }

/* controls */
input, select, textarea { background: rgba(255, 255, 255, .045); border-color: var(--border-2); }
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 3px rgba(211, 154, 107, .22); }
input[disabled], fieldset.bare[disabled] input, fieldset.bare[disabled] select, fieldset.bare[disabled] textarea { background: rgba(255, 255, 255, .02); }
select option { background: #1a171a; color: var(--text); }
.btn { border-radius: 999px; font-weight: 500; transition: background .2s, border-color .2s, transform .2s; }
.btn:active { transform: scale(.98); }
.btn, .icon-btn, .bell, .chip span, .chip-btn, .seg-btn { background: rgba(255, 255, 255, .06); }
.btn-primary, .region-seg a.active, .chip input:checked + span, .tabbar .tab-add {
  background: var(--brand); color: var(--brand-ink); border-color: var(--brand); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-primary:hover { background: var(--brand-700); }
.tabbar .tab-add { box-shadow: 0 8px 22px rgba(211, 154, 107, .35); }
.btn-ghost { background: transparent; border-color: var(--border-2); }
.btn-ghost:hover, .icon-btn:hover, .bell:hover, .chip-btn:hover, .menu-item:hover { background: rgba(255, 255, 255, .09); }
.btn-ghost:hover { border-color: var(--brand); }
.btn-danger-ghost { background: transparent; border-color: rgba(248, 113, 113, .4); }
.btn-call { background: rgba(59, 130, 246, .18); color: #bfdbfe; border-color: rgba(96, 165, 250, .4); }
.btn-wa { background: rgba(34, 197, 94, .16); color: #bbf7d0; border-color: rgba(74, 222, 128, .38); }
.btn-call:hover, .btn-wa:hover { filter: brightness(1.25); }
.btn-danger-ghost:hover { background: var(--danger-50); }
.icon-btn.call { color: #93c5fd; border-color: rgba(96, 165, 250, .35); background: rgba(59, 130, 246, .12); }
.icon-btn.wa { color: #86efac; border-color: rgba(74, 222, 128, .35); background: rgba(34, 197, 94, .12); }
.badge { background: #e5484d; }
.seg { border-color: var(--border-2); }
.seg-btn + .seg-btn { border-left-color: var(--border-2); }

/* tinted states, re-made for a dark page */
.flash-ok { background: var(--good-50); border-color: rgba(74, 222, 128, .3); color: #bbf7d0; }
.flash-error { background: var(--danger-50); border-color: rgba(248, 113, 113, .35); color: #fecaca; }
.flash-ok a, .flash-error a { color: inherit; text-decoration: underline; }
.pill-blue   { background: rgba(59, 130, 246, .15); color: #93c5fd; border-color: rgba(59, 130, 246, .3); }
.pill-amber  { background: rgba(245, 158, 11, .15); color: #fcd34d; border-color: rgba(245, 158, 11, .3); }
.pill-violet { background: rgba(139, 92, 246, .16); color: #c4b5fd; border-color: rgba(139, 92, 246, .32); }
.pill-teal   { background: rgba(20, 184, 166, .15); color: #5eead4; border-color: rgba(20, 184, 166, .3); }
.pill-cyan   { background: rgba(6, 182, 212, .15); color: #67e8f9; border-color: rgba(6, 182, 212, .3); }
.pill-orange { background: rgba(249, 115, 22, .15); color: #fdba74; border-color: rgba(249, 115, 22, .3); }
.pill-green  { background: rgba(34, 197, 94, .14); color: #86efac; border-color: rgba(34, 197, 94, .3); }
.pill-grey   { background: rgba(255, 255, 255, .07); color: var(--text-2); border-color: var(--border-2); }
.pill-red    { background: rgba(239, 68, 68, .15); color: #fca5a5; border-color: rgba(239, 68, 68, .32); }
.temp-hot, .seg-hot.on { background: rgba(239, 68, 68, .2); color: #fca5a5; }
.seg-warm.on { background: rgba(245, 158, 11, .2); color: #fcd34d; }
.temp-cold, .seg-cold.on { background: rgba(14, 165, 233, .2); color: #7dd3fc; }
.tab-alert .count { background: rgba(239, 68, 68, .18); border-color: rgba(239, 68, 68, .35); color: #fca5a5; }
.tab .count { background: rgba(255, 255, 255, .06); }
.next-step { border-left-color: var(--brand); }
.next-step.is-late { background: linear-gradient(90deg, rgba(239, 68, 68, .1), rgba(255, 255, 255, .03)); }
.table th, .table tfoot th { background: rgba(255, 255, 255, .035); }
.table tbody tr:hover { background: rgba(211, 154, 107, .06); }
.tl-icon { background: #17141a; }
.k-call .tl-icon { color: #93c5fd; border-color: rgba(59, 130, 246, .4); }
.k-whatsapp .tl-icon { color: #86efac; border-color: rgba(34, 197, 94, .4); }
.k-status .tl-icon { color: var(--brand); border-color: var(--brand-200); }
.k-visit .tl-icon { color: var(--gold); border-color: rgba(232, 184, 142, .4); }
.k-enquiry .tl-icon { color: #c4b5fd; border-color: rgba(139, 92, 246, .4); }
.k-note .tl-icon { color: #fcd34d; border-color: rgba(245, 158, 11, .4); }
.tag-nri, .sync-chip, .off-banner { background: rgba(211, 154, 107, .12); color: var(--gold); border-color: rgba(211, 154, 107, .3); }
.sync-chip.is-off { background: rgba(239, 68, 68, .15); color: #fca5a5; border-color: rgba(239, 68, 68, .32); }
.off-banner.is-online { background: var(--good-50); color: #bbf7d0; border-color: rgba(74, 222, 128, .3); }
.off-problems li { color: #fca5a5; }
.account-row.is-current { background: rgba(255, 255, 255, .03); }

/* login and the public property page */
.auth { background: transparent; }
.auth-card { background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035)); border-color: var(--border-2); border-radius: 24px; }
.auth-logo { background: transparent; }
.share { background: transparent; }
.share-wrap { background: rgba(255, 255, 255, .03); }
.share-price { color: var(--gold); font-weight: 400; }
.prop-img, .match img, .match-ph { background: rgba(255, 255, 255, .04); }

/* ---------- v2.8: deeper dark, light mode, calmer touches ---------- */
/* Dark (default): blacker page, brighter warm-white text with a soft glow on headings. */
:root { --bg: #050506; --text: #fbf8f4; --text-2: rgba(251, 248, 244, .86); --muted: rgba(251, 248, 244, .62); --side-text: rgba(251, 248, 244, .8); }
.page-title, .hello h2, .lead-head h2, .kpi-n, .card h2, .card h3, .auth-card h1 { text-shadow: 0 0 18px rgba(255, 236, 214, .18); }
.theme-btn { cursor: pointer; padding: 0; font: inherit; }
.theme-btn .if-light, [data-theme="light"] .theme-btn .if-dark { display: none; }
[data-theme="light"] .theme-btn .if-light { display: inline; }

/* No blue flash when tapping on phones, and no focus ring after a mouse or finger click. */
html { -webkit-tap-highlight-color: transparent; }
:focus:not(:focus-visible) { outline: none; }

/* The add (+) button: solid copper, no glow. */
.tabbar .tab-add { background: linear-gradient(180deg, #9c6b47, #7d5235); color: #f6e6d6; border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 4px 12px rgba(0, 0, 0, .45); }

/* Reload loader: the logo with a turning copper ring, instead of a toast. */
.reloading { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(5, 5, 6, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.reloading > * { grid-area: 1 / 1; }
.reloading img { width: 46px; height: auto; animation: bf-pulse 1.4s ease-in-out infinite; }
.reloading-ring { width: 84px; height: 84px; border-radius: 50%; border: 2px solid rgba(211, 154, 107, .18); border-top-color: var(--brand); animation: bf-spin .9s linear infinite; }
@keyframes bf-spin { to { transform: rotate(360deg); } }
@keyframes bf-pulse { 50% { opacity: .55; transform: scale(.94); } }

/* Light mode: warm ivory paper, ink text, same copper. */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f1eb; --surface: rgba(255, 255, 255, .78); --surface-2: rgba(40, 28, 18, .04);
  --text: #1c1613; --text-2: rgba(28, 22, 19, .8); --muted: rgba(28, 22, 19, .56);
  --border: rgba(40, 28, 18, .1); --border-2: rgba(40, 28, 18, .18);
  --brand: #b8794a; --brand-700: #9c6238; --brand-ink: #fff;
  --brand-50: rgba(184, 121, 74, .1); --brand-200: rgba(184, 121, 74, .3);
  --gold: #9c6238; --gold-700: #8a5530;
  --side: #fbf8f4; --side-2: rgba(40, 28, 18, .06); --side-text: rgba(28, 22, 19, .75); --side-dim: rgba(28, 22, 19, .45);
  --danger: #c62828; --danger-50: #fdecec; --warn: #b45309; --good: #15803d; --good-50: #eaf7ee;
  --shadow: 0 1px 2px rgba(40, 28, 18, .06), 0 14px 32px -20px rgba(40, 28, 18, .25);
  --shadow-lg: 0 24px 56px rgba(40, 28, 18, .18);
}
[data-theme="light"] body { background: radial-gradient(1100px 700px at 100% -10%, rgba(211, 154, 107, .16), transparent 60%), radial-gradient(900px 650px at -10% 105%, rgba(92, 58, 88, .08), transparent 62%), var(--bg) fixed; }
[data-theme="light"] .page-title, [data-theme="light"] .hello h2, [data-theme="light"] .lead-head h2, [data-theme="light"] .kpi-n, [data-theme="light"] .card h2, [data-theme="light"] .card h3, [data-theme="light"] .auth-card h1 { text-shadow: none; }
[data-theme="light"] .card, [data-theme="light"] .kpi, [data-theme="light"] .as-cards .table tr, [data-theme="light"] .account-row, [data-theme="light"] .region-seg { background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(255, 255, 255, .72)); }
[data-theme="light"] .sidebar { background: rgba(251, 248, 244, .82); }
[data-theme="light"] .brand, [data-theme="light"] .side-nav a:hover, [data-theme="light"] .side-nav a.active, [data-theme="light"] .side-user strong, [data-theme="light"] .side-foot .btn-ghost:hover { color: var(--text); }
[data-theme="light"] .side-user:hover { color: var(--text); }
[data-theme="light"] .topbar { background: rgba(245, 241, 235, .78); }
[data-theme="light"] .tabbar, [data-theme="light"] .off-nav, [data-theme="light"] .off-top, [data-theme="light"] .share-cta { background: rgba(251, 248, 244, .88); }
[data-theme="light"] .off-top { color: var(--text); }
[data-theme="light"] .menu-list, [data-theme="light"] .modal { background: rgba(255, 255, 255, .96); }
[data-theme="light"] .bulk-bar { background: rgba(255, 255, 255, .95); color: var(--text); }
[data-theme="light"] .modal::backdrop, [data-theme="light"] .nav-open .scrim { background: rgba(28, 22, 19, .35); }
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea { background: rgba(255, 255, 255, .85); }
[data-theme="light"] select option { background: #fff; color: var(--text); }
[data-theme="light"] .btn, [data-theme="light"] .icon-btn, [data-theme="light"] .bell, [data-theme="light"] .chip span, [data-theme="light"] .chip-btn, [data-theme="light"] .seg-btn { background: rgba(255, 255, 255, .8); }
[data-theme="light"] .btn-ghost { background: transparent; }
[data-theme="light"] .btn-primary, [data-theme="light"] .region-seg a.active, [data-theme="light"] .chip input:checked + span { background: var(--brand); color: #fff; }
[data-theme="light"] .btn-ghost:hover, [data-theme="light"] .icon-btn:hover, [data-theme="light"] .bell:hover, [data-theme="light"] .chip-btn:hover, [data-theme="light"] .menu-item:hover { background: rgba(40, 28, 18, .06); }
[data-theme="light"] .tabbar .tab-add { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(40, 28, 18, .22); }
[data-theme="light"] .btn-call { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
[data-theme="light"] .btn-wa { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
[data-theme="light"] .btn-call:hover, [data-theme="light"] .btn-wa:hover { filter: brightness(.96); }
[data-theme="light"] .icon-btn.call { color: #2563eb; border-color: #bfdbfe; background: #eff6ff; }
[data-theme="light"] .icon-btn.wa { color: #1f9d57; border-color: #bbf7d0; background: #f0fdf4; }
[data-theme="light"] .flash-ok { background: #eaf7ee; border-color: #bbf7d0; color: #14532d; }
[data-theme="light"] .flash-error { background: #fdecec; border-color: #fecaca; color: #7f1d1d; }
[data-theme="light"] .pill-blue { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
[data-theme="light"] .pill-amber { background: #fffbeb; color: #a16207; border-color: #fde68a; }
[data-theme="light"] .pill-violet { background: #f5f3ff; color: #6d28d9; border-color: #ede9fe; }
[data-theme="light"] .pill-teal { background: #f0fdfa; color: #0f766e; border-color: #ccfbf1; }
[data-theme="light"] .pill-cyan { background: #ecfeff; color: #0e7490; border-color: #cffafe; }
[data-theme="light"] .pill-orange { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
[data-theme="light"] .pill-green { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
[data-theme="light"] .pill-grey { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
[data-theme="light"] .pill-red { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
[data-theme="light"] .temp-hot, [data-theme="light"] .seg-hot.on, [data-theme="light"] .tab-alert .count { background: #fee2e2; color: #b91c1c; }
[data-theme="light"] .seg-warm.on { background: #fef3c7; color: #a16207; }
[data-theme="light"] .temp-cold, [data-theme="light"] .seg-cold.on { background: #e0f2fe; color: #0369a1; }
[data-theme="light"] .tab .count { background: rgba(40, 28, 18, .05); }
[data-theme="light"] .table th, [data-theme="light"] .table tfoot th { background: rgba(40, 28, 18, .035); }
[data-theme="light"] .table tbody tr:hover { background: rgba(184, 121, 74, .06); }
[data-theme="light"] .tl-icon { background: #fff; }
[data-theme="light"] .k-call .tl-icon { color: #2563eb; border-color: #bfdbfe; }
[data-theme="light"] .k-whatsapp .tl-icon { color: #1f9d57; border-color: #bbf7d0; }
[data-theme="light"] .k-enquiry .tl-icon { color: #7c3aed; border-color: #ddd6fe; }
[data-theme="light"] .k-note .tl-icon { color: #b45309; border-color: #fde68a; }
[data-theme="light"] .sync-chip.is-off { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
[data-theme="light"] .off-banner.is-online { background: #eaf7ee; color: #14532d; border-color: #bbf7d0; }
[data-theme="light"] .off-problems li { color: #b91c1c; }
[data-theme="light"] .next-step.is-late { background: linear-gradient(90deg, #fdecec, rgba(255, 255, 255, .8)); }
[data-theme="light"] .auth-card { background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .8)); }
[data-theme="light"] .auth-logo { background: #0a0a0c; }
[data-theme="light"] .share-wrap { background: rgba(255, 255, 255, .7); }
[data-theme="light"] .watermark { filter: invert(1); }
[data-theme="light"] .reloading { background: rgba(245, 241, 235, .6); }
[data-theme="light"] .badge { color: #fff; }
