/* ==========================================================================
   Vantage CRM — design system
   ========================================================================== */

:root {
  --ink: #0f1512;
  --ink-2: #26332e;
  --muted: #66756f;
  --muted-2: #8b9891;
  --line: #e4e9e7;
  --line-2: #eef1f0;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #fafbfb;
  --brand: #145e4d;
  --brand-600: #145e4d;
  --brand-500: #1c7d66;
  --brand-100: #e6f2ee;
  --brand-050: #f1f8f5;
  --amber: #b3541e;
  --amber-100: #fbeee5;
  --danger: #b3261e;
  --danger-100: #fdecea;
  --info: #2a5db0;
  --info-100: #eaf1fb;
  --gold: #a8823c;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 21, .06), 0 1px 3px rgba(16, 24, 21, .04);
  --shadow: 0 12px 32px -18px rgba(16, 24, 21, .32), 0 2px 6px rgba(16, 24, 21, .05);
  --shadow-lg: 0 30px 70px -30px rgba(16, 24, 21, .45);
  --sidebar: #0c1714;
  --sidebar-2: #132421;
  --sidebar-text: #cfdad5;
  --sidebar-muted: #7d918a;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sidebar-w: 244px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; font-weight: 650; line-height: 1.2; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--brand-600); }
button { font-family: inherit; }
svg { display: block; }
::selection { background: #cfe9df; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------- scrollbars ------------------------------ */
* { scrollbar-width: thin; scrollbar-color: #cfd8d4 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #cfd8d4; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #b6c3be; background-clip: content-box; }

/* ==========================================================================
   Shell
   ========================================================================== */
#app { min-height: 100%; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--sidebar) 0%, #0a1310 100%);
  color: var(--sidebar-text);
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  border-right: 1px solid rgba(255, 255, 255, .05);
  z-index: 30;
}
.brand-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px 20px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, #1f8a6d, #145e4d);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 16px -8px #0f5c4a;
}
.brand-name { color: #fff; font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-sub { color: var(--sidebar-muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-label {
  color: #5d716a; font-size: 10px; text-transform: uppercase; letter-spacing: .16em;
  padding: 16px 10px 8px; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; border-radius: 9px;
  color: var(--sidebar-text); text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
}
.nav-item svg { width: 17px; height: 17px; opacity: .72; flex: 0 0 auto; }
.nav-item:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-item.active { background: rgba(31, 138, 109, .18); color: #fff; box-shadow: inset 0 0 0 1px rgba(64, 190, 156, .22); }
.nav-item.active svg { opacity: 1; color: #57c9a6; }
.nav-item .count {
  margin-left: auto; font-size: 11px; font-weight: 600; color: var(--sidebar-muted);
  background: rgba(255, 255, 255, .06); border-radius: 99px; padding: 1px 7px;
}
.nav-item.active .count { background: rgba(87, 201, 166, .2); color: #bfe9dc; }

.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .07); padding-top: 12px; margin-top: 10px; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px;
  text-decoration: none; color: var(--sidebar-text); transition: background .15s;
}
.user-chip:hover { background: rgba(255, 255, 255, .055); }
.user-chip .who { font-size: 13px; color: #fff; font-weight: 550; line-height: 1.2; }
.user-chip .role { font-size: 11px; color: var(--sidebar-muted); text-transform: capitalize; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 650; font-size: 12.5px; color: #fff;
  background: var(--brand-500); letter-spacing: .02em;
}
.avatar.lg { width: 52px; height: 52px; font-size: 17px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.plan-badge {
  margin: 10px 8px 0; display: flex; align-items: center; gap: 8px; font-size: 11.5px;
  color: #9fb3ac; padding: 8px 10px; background: rgba(255, 255, 255, .04); border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .06);
}
.plan-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #57c9a6; box-shadow: 0 0 0 3px rgba(87, 201, 166, .16); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 62px; display: flex; align-items: center; gap: 16px;
  padding: 0 26px; background: rgba(245, 247, 246, .86);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar .crumbs { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.topbar .crumbs strong { color: var(--ink); font-weight: 600; }
.topbar .spacer { flex: 1; }
.search-box { position: relative; width: 260px; }
.search-box svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-2); }
.search-box input {
  width: 100%; padding: 8px 12px 8px 33px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13px; color: var(--ink);
}
.search-box input::placeholder { color: var(--muted-2); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  overflow: hidden; max-height: 340px; overflow-y: auto;
}
.search-results a {
  display: flex; gap: 10px; align-items: center; padding: 9px 12px; text-decoration: none; color: var(--ink); font-size: 13px;
}
.search-results a:hover { background: var(--brand-050); }
.search-results .kind { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted-2); margin-left: auto; }
.search-results .empty { padding: 14px 12px; color: var(--muted); font-size: 13px; }

.content { padding: 26px; max-width: 1440px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .titles { min-width: 0; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ==========================================================================
   Buttons / inputs
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid transparent;
  font-size: 13px; font-weight: 550; cursor: pointer; text-decoration: none;
  transition: transform .12s var(--ease), background .15s, border-color .15s, box-shadow .15s, color .15s;
  white-space: nowrap; background: var(--surface); color: var(--ink);
  border-color: var(--line); box-shadow: var(--shadow-sm);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: #d3dcd8; background: #fcfdfc; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 16px -10px #0f5c4a; }
.btn-primary:hover { background: #10513f; border-color: #10513f; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
.btn-ghost:hover { background: #ecefed; color: var(--ink); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #f2d6d4; background: #fff; }
.btn-danger:hover { background: var(--danger-100); border-color: #eabfbb; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-icon { padding: 7px; }
.btn-icon svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .03em; text-transform: uppercase; }
.field .help { font-size: 11.5px; color: var(--muted-2); }
.input, .select, .textarea {
  width: 100%; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface); font-size: 13.5px; color: var(--ink); font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(28, 125, 102, .13);
}
.textarea { resize: vertical; min-height: 78px; line-height: 1.5; }
.select {
  appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366756f' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.checkbox { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.checkbox input { margin-top: 2px; accent-color: var(--brand); width: 15px; height: 15px; }
.hint-box {
  display: flex; gap: 9px; padding: 10px 12px; border-radius: 9px; background: var(--brand-050);
  border: 1px solid #d8ebe4; font-size: 12.5px; color: #28604f;
}
.hint-box svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; }
.hint-box.warn { background: #fdf6ec; border-color: #f0e0c6; color: #7a5417; }

/* ==========================================================================
   Surfaces
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line-2); }
.card-head h2 { font-size: 14px; font-weight: 620; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; }

.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: 1.35fr 1fr; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }

.kpi-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.kpi-card .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; padding-right: 34px; }
.kpi-card .value { font-size: 24px; font-weight: 680; letter-spacing: -.03em; }
.kpi-card .meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi-card .icon-chip {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; background: var(--brand-050); color: var(--brand-600);
}
.kpi-card .icon-chip svg { width: 16px; height: 16px; }
.kpi-card.amber .icon-chip { background: var(--amber-100); color: var(--amber); }
.kpi-card.info .icon-chip { background: var(--info-100); color: var(--info); }
.kpi-card.gold .icon-chip { background: #faf3e3; color: var(--gold); }
.trend-up { color: #16794f; font-weight: 600; }
.trend-flat { color: var(--muted); }

/* ==========================================================================
   Badges & pills
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 99px; background: #eef1f0; color: var(--ink-2); white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.brand { background: var(--brand-100); color: #145e4d; }
.badge.amber { background: var(--amber-100); color: #8a4013; }
.badge.info { background: var(--info-100); color: #234c8f; }
.badge.danger { background: var(--danger-100); color: #8f2019; }
.badge.neutral { background: #eef1f0; color: #4b5b55; }
.badge.gold { background: #faf3e3; color: #7d5f1d; }
.tag {
  display: inline-flex; align-items: center; font-size: 11.5px; padding: 1px 7px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.tag button { border: 0; background: none; color: var(--muted-2); cursor: pointer; padding: 0 0 0 3px; font-size: 13px; line-height: 1; }
.tag button:hover { color: var(--danger); }
.pill-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.segmented { display: inline-flex; background: #eef1f0; border-radius: 9px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; padding: 5px 11px; border-radius: 7px; font-size: 12.5px;
  font-weight: 550; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.segmented button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
  font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2);
  white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr { cursor: pointer; transition: background .12s; }
table.data tbody tr:hover { background: var(--brand-050); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th.num { text-align: right; }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-person .name { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-person .email { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-actions { display: flex; gap: 4px; justify-content: flex-end; opacity: 0; transition: opacity .12s; }
tr:hover .cell-actions { opacity: 1; }

.toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--line-2); background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
}
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar .input, .toolbar .select { max-width: 210px; }
.toolbar-search { position: relative; flex: 1; min-width: 200px; max-width: 300px; }
.toolbar-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-2); }
.toolbar-search .input { padding-left: 32px; max-width: none; }

/* ==========================================================================
   Empty states
   ========================================================================== */
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty .mark {
  width: 46px; height: 46px; border-radius: 13px; background: var(--brand-050); color: var(--brand-600);
  display: grid; place-items: center; margin: 0 auto 14px;
}
.empty .mark svg { width: 22px; height: 22px; }
.empty h3 { color: var(--ink); margin-bottom: 5px; font-size: 15px; }
.empty p { font-size: 13px; max-width: 42ch; margin: 0 auto 16px; }

/* ==========================================================================
   Kanban
   ========================================================================== */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: flex-start; }
.kcol {
  flex: 0 0 292px; background: #f0f3f2; border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; max-height: calc(100vh - 268px); min-height: 180px;
}
.kcol-head { padding: 12px 13px 9px; display: flex; align-items: center; gap: 8px; }
.kcol-head .name { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); }
.kcol-head .count { font-size: 11px; color: var(--muted); background: #fff; border-radius: 99px; padding: 1px 7px; border: 1px solid var(--line); }
.kcol-head .total { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.kcol-head .stripe { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.kcol[data-stage="new"] .stripe { background: #4a93c9; }
.kcol[data-stage="nurturing"] .stripe { background: #7d6bc4; }
.kcol[data-stage="showing"] .stripe { background: #c98a2f; }
.kcol[data-stage="under_contract"] .stripe { background: #1f8a6d; }
.kcol[data-stage="closed_won"] .stripe { background: #16794f; }
.kcol[data-stage="closed_lost"] .stripe { background: #b3261e; }
.klist { padding: 0 9px 9px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; min-height: 60px; }
.kcol.drag-over { background: #e4f0eb; border-color: #9ecfbf; box-shadow: inset 0 0 0 2px #bfe3d7; }
.kcard {
  background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px;
  cursor: grab; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s, border-color .15s;
  position: relative;
}
.kcard:hover { box-shadow: var(--shadow); border-color: #d7e0dc; transform: translateY(-1px); }
/* Cover of the linked property (PRD-01 §E1) */
.kcard .kcover { margin: -11px -12px 9px; aspect-ratio: 16 / 9; border-radius: 11px 11px 0 0; overflow: hidden;
  background: #eef1f0; display: grid; place-items: center; color: #9aa8a3; }
.kcard .kcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kcard.dragging { opacity: .5; transform: rotate(1.2deg) scale(.99); cursor: grabbing; }
.kcard .title { font-size: 13.5px; font-weight: 580; margin-bottom: 3px; letter-spacing: -.01em; }
.kcard .person { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kcard .foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); }
.kcard .amount { font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kcard .date { margin-left: auto; font-size: 11.5px; color: var(--muted-2); }
.kcard .addr { font-size: 11.5px; color: var(--muted-2); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.kcard .addr svg { width: 12px; height: 12px; flex: 0 0 auto; }
.kadd {
  margin: 0 9px 10px; border: 1px dashed #cfd8d4; border-radius: 9px; padding: 7px; background: transparent;
  color: var(--muted); font-size: 12.5px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s, border-color .15s, color .15s;
}
.kadd:hover { background: #fff; border-color: var(--brand-500); color: var(--brand-600); }
.kcol-stats { padding: 8px 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.kcol-stats strong { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Data viz
   ========================================================================== */
.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 108px 1fr 88px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .track { height: 9px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #1f8a6d, #47b795); transition: width .5s var(--ease); }
.bar-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 56px; overflow: visible; }
.spark path.line { fill: none; stroke: var(--brand-500); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark path.area { fill: url(#spark-grad); stroke: none; }
.spark circle { fill: #fff; stroke: var(--brand-500); stroke-width: 2; }

.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 11px 18px; border-bottom: 1px solid var(--line-2); }
.feed-item:last-child { border-bottom: 0; }
.feed-icon {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: 0 0 auto;
  background: var(--brand-050); color: var(--brand-600);
}
.feed-icon svg { width: 15px; height: 15px; }
.feed-icon.call { background: #eaf1fb; color: #2a5db0; }
.feed-icon.email { background: #f2eefb; color: #6b4fbb; }
.feed-icon.sms { background: #fdf2e7; color: #a86a1e; }
.feed-icon.showing { background: #eaf5f0; color: #16794f; }
.feed-icon.site_visit { background: #eef1f0; color: #4b5b55; }
.feed-body { min-width: 0; flex: 1; }
.feed-body .top { display: flex; gap: 8px; align-items: baseline; }
.feed-body .who { font-weight: 580; font-size: 13px; }
.feed-body .when { margin-left: auto; font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }
.feed-body .text { font-size: 12.5px; color: var(--muted); margin-top: 1px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; gap: 11px; align-items: center; padding: 11px 18px; border-bottom: 1px solid var(--line-2); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .grow { flex: 1; min-width: 0; }
.list-plain .title { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-plain .sub { font-size: 12px; color: var(--muted); }
.list-plain .amount { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; }

/* ==========================================================================
   Drawer / modal / toast
   ========================================================================== */
.overlay {
  position: fixed; inset: 0; background: rgba(9, 17, 14, .38); backdrop-filter: blur(2px);
  z-index: 100; opacity: 0; animation: fadeIn .18s var(--ease) forwards;
  display: flex;
}
@keyframes fadeIn { to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideLeft { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal {
  margin: auto; background: #fff; border-radius: var(--radius-lg); width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 64px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: slideUp .22s var(--ease); overflow: hidden;
}
.modal.wide { width: min(860px, calc(100% - 32px)); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 16px; }
.modal-head .sub { font-size: 12.5px; color: var(--muted); }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); }

.drawer { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(9, 17, 14, .34); animation: fadeIn .16s var(--ease) forwards; }
.drawer .panel {
  position: relative; width: min(560px, 100%); background: #fff; height: 100%; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: slideLeft .22s var(--ease); border-left: 1px solid var(--line);
}
.drawer .panel-head { padding: 20px 22px 16px; border-bottom: 1px solid var(--line-2); }
.drawer .panel-body { overflow-y: auto; flex: 1; padding: 18px 22px; }
.drawer .panel-foot { padding: 13px 22px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; background: var(--surface-2); }

.toast-stack { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #101c18; color: #eaf3ef; padding: 11px 15px; border-radius: 10px; font-size: 13px;
  box-shadow: var(--shadow-lg); display: flex; gap: 9px; align-items: center; animation: slideUp .2s var(--ease);
  max-width: 380px;
}
.toast svg { width: 16px; height: 16px; flex: 0 0 auto; }
.toast.ok svg { color: #57c9a6; }
.toast.err { background: #3a1512; }
.toast.err svg { color: #ff9d92; }

/* ==========================================================================
   Tabs
   ========================================================================== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); padding: 0 18px; }
.tab {
  border: 0; background: none; padding: 11px 12px; font-size: 13px; font-weight: 550; color: var(--muted);
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-600); border-bottom-color: var(--brand-500); }

/* ==========================================================================
   Detail panels
   ========================================================================== */
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.detail-item .k { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }
.detail-item .v { font-size: 13.5px; margin-top: 2px; word-break: break-word; }
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -26px; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--brand-600);
}
.tl-dot svg { width: 11px; height: 11px; }
.tl-head { display: flex; gap: 8px; align-items: baseline; }
.tl-head .type { font-size: 12.5px; font-weight: 600; text-transform: capitalize; }
.tl-head .when { margin-left: auto; font-size: 11.5px; color: var(--muted-2); }
.tl-text { font-size: 13px; color: var(--ink-2); margin-top: 2px; white-space: pre-wrap; }
.tl-actions { opacity: 0; transition: opacity .12s; }
.tl-item:hover .tl-actions { opacity: 1; }

/* ==========================================================================
   Property cards
   ========================================================================== */
.property-card { overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .18s, transform .18s; cursor: pointer; }
.property-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.property-card .thumb { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #dbe6e1, #c7d6d0); position: relative; overflow: hidden; }
.property-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.property-card .thumb .status { position: absolute; top: 10px; left: 10px; backdrop-filter: blur(6px); }
.property-card .body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.property-card .price { font-size: 17px; font-weight: 680; letter-spacing: -.03em; }
.property-card .addr { font-size: 13px; font-weight: 550; }
.property-card .city { font-size: 12px; color: var(--muted); }
.property-card .specs { display: flex; gap: 12px; font-size: 12px; color: var(--muted); margin-top: 2px; padding-top: 9px; border-top: 1px solid var(--line-2); }
.property-card .specs span { display: flex; align-items: center; gap: 4px; }
.property-card .specs svg { width: 13px; height: 13px; }
.property-card .card-actions { display: flex; gap: 6px; margin-top: 10px; }

/* ==========================================================================
   Landing cards
   ========================================================================== */
.landing-card { display: flex; flex-direction: column; overflow: hidden; }
.landing-card .preview {
  height: 132px; background: linear-gradient(135deg, #123, #1f8a6d); position: relative; overflow: hidden;
  display: grid; place-items: center; color: #fff;
}
.landing-card .preview .glass { position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.25), transparent 60%); }
.landing-card .preview .tpl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; opacity: .8; }
.landing-card .preview .url { font-family: var(--mono); font-size: 11.5px; background: rgba(0,0,0,.28); padding: 4px 9px; border-radius: 6px; margin-top: 6px; }
.landing-card .live-dot { position: absolute; top: 11px; right: 11px; }

/* ==========================================================================
   Login
   ========================================================================== */
.auth-split { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }
.auth-art {
  position: relative; background: #0c1714; color: #fff; padding: 48px; display: flex; flex-direction: column;
  justify-content: space-between; overflow: hidden;
}
.auth-art::before {
  content: ""; position: absolute; inset: -20%; background:
    radial-gradient(circle at 20% 20%, rgba(31,138,109,.55), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(201,138,47,.28), transparent 50%);
  filter: blur(10px);
}
.auth-art > * { position: relative; z-index: 2; }
.auth-art h1 { font-size: clamp(26px, 3vw, 38px); line-height: 1.1; letter-spacing: -.03em; max-width: 20ch; }
.auth-art .lede { color: #b8c9c2; font-size: 15px; max-width: 42ch; margin-top: 14px; }
.auth-art .proof { display: grid; gap: 12px; margin-top: 34px; }
.auth-art .proof-item { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: #d6e4df; }
.auth-art .proof-item svg { width: 17px; height: 17px; color: #57c9a6; flex: 0 0 auto; margin-top: 2px; }
.auth-form-side { display: grid; place-items: center; padding: 40px 24px; background: #fff; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: 23px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.demo-box {
  margin-top: 18px; border: 1px dashed #cfe0d9; background: var(--brand-050); border-radius: 12px; padding: 13px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.demo-box .title { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #28604f; }
.demo-box code { font-family: var(--mono); font-size: 12px; color: #143f34; background: #fff; padding: 2px 6px; border-radius: 5px; border: 1px solid #d8ebe4; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.auth-switch a { font-weight: 550; text-decoration: none; }
.link-btn { border: 0; background: none; color: var(--brand-600); cursor: pointer; font-size: 13px; padding: 0; font-weight: 550; }
.form-error {
  display: none; background: var(--danger-100); color: #8f2019; border: 1px solid #f3cdc8;
  border-radius: 9px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px;
}
.form-error.show { display: block; }

/* ==========================================================================
   Misc
   ========================================================================== */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-col { display: flex; flex-direction: column; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.w-full { width: 100%; }
.divider { height: 1px; background: var(--line-2); margin: 16px 0; }
.skeleton { background: linear-gradient(90deg, #eef1f0 25%, #f6f8f7 50%, #eef1f0 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner {
  width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: grid; place-items: center; min-height: 60vh; color: var(--muted); font-size: 13px; gap: 12px; }
.loading-page .spinner { border-color: var(--line); border-top-color: var(--brand-500); width: 22px; height: 22px; border-width: 3px; }
.iframe-preview { width: 100%; height: 460px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--muted); background: var(--surface-2); }
.stat-inline { display: flex; gap: 20px; flex-wrap: wrap; }
.stat-inline .item .k { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 600; }
.stat-inline .item .v { font-size: 17px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Calendar and tasks
   ========================================================================== */
.cal-month { text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekday { padding: 8px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--line-2); }
.cal-day { min-height: 104px; padding: 6px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.other { background: var(--surface-2); color: var(--muted-2); }
.cal-num { font-size: 12px; font-weight: 600; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--brand); color: #fff; }
.cal-chip { all: unset; box-sizing: border-box; font-size: 11.5px; line-height: 1.35; padding: 2px 6px; border-radius: 6px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cal-chip:focus-visible { outline: 2px solid var(--brand-500); }
.cal-chip.open_house { background: var(--brand-100); color: var(--brand); }
.cal-chip.showing { background: var(--info-100); color: #234c8f; }
.cal-chip.call, .cal-chip.task { background: var(--amber-100); color: #8a4013; }
.cal-chip.done { text-decoration: line-through; opacity: .6; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }
.task-list { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; padding-bottom: 8px; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: var(--radius-sm); }
.task-row:hover { background: var(--surface-2); }
.task-check { width: 17px; height: 17px; accent-color: var(--brand); flex: none; cursor: pointer; }
.task-dot { width: 17px; display: inline-flex; justify-content: center; color: var(--muted); flex: none; }
.task-open { all: unset; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; flex: 1; min-width: 0; cursor: pointer; font-size: 13.5px; }
.task-open:focus-visible { outline: 2px solid var(--brand-500); border-radius: 6px; }
.cal-time { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; min-width: 44px; }
.cal-day-label { font-size: 12px; color: var(--muted); min-width: 92px; }
.cal-title.done { text-decoration: line-through; color: var(--muted); }
.cal-about { font-size: 12.5px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .grid.kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.two { grid-template-columns: 1fr; }
  .grid.three { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; bottom: 0; top: auto; left: 0; right: 0; width: 100%; height: auto;
    flex-direction: row; align-items: center; padding: 8px 10px; gap: 6px; border-right: 0;
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .sidebar .brand-row, .sidebar .nav-label, .sidebar-foot, .plan-badge { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .nav-item { flex-direction: column; gap: 3px; font-size: 10px; padding: 6px 10px; }
  .nav-item .count { display: none; }
  .content { padding: 18px 16px 86px; }
  .topbar { padding: 0 16px; }
  .search-box { width: 160px; }
  .auth-split { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .grid.kpi { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
}
@media (max-width: 560px) {
  .grid.kpi { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 12px 13px; gap: 5px; }
  .kpi-card .value { font-size: 19px; }
  .kpi-card .label { font-size: 10px; letter-spacing: .07em; }
  .kpi-card .meta { font-size: 10.5px; line-height: 1.35; }
  .kpi-card .icon-chip { width: 24px; height: 24px; top: 10px; right: 10px; border-radius: 7px; }
  .kpi-card .icon-chip svg { width: 13px; height: 13px; }
  .kcol { flex: 0 0 84vw; }
  .cal-day { min-height: 64px; padding: 3px; }
  .cal-chip { font-size: 0; height: 6px; padding: 0; border-radius: 3px; } /* a coloured bar per item; tap the day */
  .cal-weekday { padding: 6px 2px; font-size: 9.5px; letter-spacing: .02em; text-align: center; }
  .page-head .actions { width: 100%; }
  .search-box { display: none; }
}
@media print { .sidebar, .topbar { display: none; } }
