/* ============================================
   PMS — Property Management System
   Design System & Global Stylesheet
   ============================================ */

/* -- Fonts -- */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Manrope:wght@300;400;500;600;700;800&display=swap');

/* -- Design Tokens -- */
:root {
  /* Brand colors */
  --teal-900: #0a3d36;
  --teal-800: #0d4f47;
  --teal-700: #126459;
  --teal-600: #1a7a6c;
  --teal-500: #2a9583;
  --teal-100: #d4e8e4;
  --teal-50:  #ecf5f2;

  /* Cream / warm neutrals */
  --cream-50:  #fdfcf7;
  --cream-100: #f8f6ee;
  --cream-200: #f3f0e4;
  --cream-300: #ebe7d8;
  --cream-400: #d8d2bd;

  /* Gold accent */
  --gold-500: #d4a72c;
  --gold-400: #e0bd5b;
  --gold-100: #f7eccb;

  /* Text */
  --ink-900: #11231f;
  --ink-700: #2d3f3a;
  --ink-500: #5a6b67;
  --ink-400: #7d8b87;
  --ink-300: #a4afac;

  /* Status */
  --success: #1f7a5a;
  --success-bg: #e3f1ea;
  --danger: #b8463c;
  --danger-bg: #fbe7e3;
  --warning: #c47e1a;
  --warning-bg: #fbecd0;
  --info: #2d6dba;
  --info-bg: #e0ecf9;

  /* Stage colors (for leads, matches, etc.) */
  --stage-new: #6b7d79;
  --stage-contacted: #2d6dba;
  --stage-interested: #c47e1a;
  --stage-visit: #7c3aa6;
  --stage-negotiation: #d97706;
  --stage-won: #1f7a5a;
  --stage-lost: #b8463c;

  /* UI */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(11, 35, 31, .04), 0 1px 1px rgba(11, 35, 31, .03);
  --shadow:    0 4px 14px rgba(11, 35, 31, .06), 0 1px 3px rgba(11, 35, 31, .04);
  --shadow-lg: 0 18px 40px rgba(11, 35, 31, .10), 0 4px 12px rgba(11, 35, 31, .05);
  --shadow-xl: 0 28px 60px rgba(11, 35, 31, .14), 0 6px 18px rgba(11, 35, 31, .07);

  --border: 1px solid var(--cream-300);
  --border-strong: 1px solid var(--cream-400);

  /* Layout */
  --sidebar-w: 264px;
  --topbar-h: 68px;

  /* Type */
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body: 'Manrope', system-ui, -apple-system, sans-serif;
}

/* -- Reset & Base -- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-900);
  background: var(--cream-100);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--ink-900);
  margin: 0;
}
h1 { font-size: 2.25rem; line-height: 1.15; }
h2 { font-size: 1.75rem; line-height: 1.2; }
h3 { font-size: 1.35rem; line-height: 1.3; }
h4 { font-size: 1.1rem;  line-height: 1.35; }

a { color: var(--teal-700); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--teal-900); }

::selection { background: var(--gold-100); color: var(--ink-900); }

/* -- Utility -- */
.text-muted { color: var(--ink-500) !important; }
.text-dim { color: var(--ink-400); }
.serif { font-family: var(--font-display); font-weight: 400; }
.serif-italic { font-family: var(--font-display); font-style: italic; font-weight: 400; }

.gold-underline {
  position: relative;
  display: inline-block;
}
.gold-underline::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 10px;
  background: linear-gradient(180deg, transparent 60%, var(--gold-100) 60%);
  z-index: -1;
}

.divider-soft { border-top: var(--border); }

/* -- Buttons -- */
.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
  cursor: pointer;
  letter-spacing: 0.01em;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--teal-800);
  color: var(--cream-50);
  border-color: var(--teal-800);
}
.btn-primary:hover {
  background: var(--teal-900);
  border-color: var(--teal-900);
  color: var(--cream-50);
  box-shadow: 0 6px 18px rgba(13, 79, 71, .25);
}
.btn-secondary {
  background: var(--cream-50);
  color: var(--ink-900);
  border-color: var(--cream-300);
}
.btn-secondary:hover {
  background: var(--cream-200);
  color: var(--ink-900);
  border-color: var(--cream-400);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-700);
}
.btn-ghost:hover { background: var(--cream-200); color: var(--ink-900); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: transparent;
}
.btn-danger:hover { background: #f3d3cd; color: var(--danger); }

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.btn-success:hover { background: #195f47; border-color: #195f47; color: white; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.82rem; border-radius: 8px; }
.btn-lg { padding: 0.85rem 1.4rem; font-size: 1rem; }

.btn-icon {
  width: 38px; height: 38px;
  padding: 0; justify-content: center;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-700);
  border: 1px solid transparent;
}
.btn-icon:hover { background: var(--cream-200); color: var(--ink-900); }

/* -- Forms -- */
.form-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-bottom: 0.45rem;
  display: block;
}
.form-control,
.form-select {
  font-family: var(--font-body);
  background: var(--cream-50);
  border: 1px solid var(--cream-300);
  border-radius: var(--radius);
  padding: 0.7rem 0.95rem;
  font-size: 0.95rem;
  color: var(--ink-900);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  width: 100%;
}
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--teal-600);
  background: white;
  box-shadow: 0 0 0 4px rgba(26, 122, 108, .12);
}
.form-control::placeholder { color: var(--ink-400); }
.form-control:disabled { background: var(--cream-200); color: var(--ink-400); }

.input-group-icon {
  position: relative;
}
.input-group-icon .form-control { padding-left: 2.6rem; }
.input-group-icon .icon-left {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  pointer-events: none;
}
.input-group-icon .icon-right {
  position: absolute;
  right: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
  cursor: pointer;
}

textarea.form-control { min-height: 90px; resize: vertical; }

.form-check-input {
  width: 1.05em; height: 1.05em;
  border: 1.5px solid var(--cream-400);
  border-radius: 4px;
  margin-top: 0.25em;
  background-color: var(--cream-50);
  cursor: pointer;
}
.form-check-input:checked {
  background-color: var(--teal-800);
  border-color: var(--teal-800);
}
.form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(26, 122, 108, .15);
  border-color: var(--teal-600);
}
.form-check-label { font-size: 0.9rem; color: var(--ink-700); cursor: pointer; }

/* -- Cards -- */
.card-soft {
  background: var(--cream-50);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.card-stat {
  background: var(--cream-50);
  border: var(--border);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem;
  position: relative;
  overflow: hidden;
}
.card-stat .stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.card-stat .stat-value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1;
  font-weight: 500;
  color: var(--ink-900);
  margin-top: 0.4rem;
  letter-spacing: -0.02em;
}
.card-stat .stat-meta {
  font-size: 0.8rem;
  color: var(--ink-500);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.card-stat .stat-trend-up { color: var(--success); font-weight: 600; }
.card-stat .stat-trend-down { color: var(--danger); font-weight: 600; }
.card-stat .stat-icon {
  position: absolute;
  top: 1.1rem; right: 1.1rem;
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--teal-50);
  color: var(--teal-700);
  display: grid; place-items: center;
}

/* -- Badges / Tags -- */
.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--cream-200);
  color: var(--ink-700);
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.badge-soft .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-teal    { background: var(--teal-50);    color: var(--teal-800); }
.badge-gold    { background: var(--gold-100);   color: #8a6816; }

/* Lead stage pills */
.stage-pill {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  display: inline-block;
}
.stage-NEW { background: #e8edec; color: var(--stage-new); }
.stage-CONTACTED { background: var(--info-bg); color: var(--stage-contacted); }
.stage-INTERESTED { background: var(--warning-bg); color: var(--stage-interested); }
.stage-VISIT { background: #f0e6f7; color: var(--stage-visit); }
.stage-NEGOTIATION { background: #fce6c8; color: var(--stage-negotiation); }
.stage-WON { background: var(--success-bg); color: var(--stage-won); }
.stage-LOST { background: var(--danger-bg); color: var(--stage-lost); }

/* -- Tables -- */
.table-soft {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.92rem;
}
.table-soft thead th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-500);
  padding: 0.85rem 1rem;
  background: var(--cream-100);
  border-bottom: 1px solid var(--cream-300);
}
.table-soft thead th:first-child { border-top-left-radius: var(--radius); }
.table-soft thead th:last-child  { border-top-right-radius: var(--radius); }
.table-soft tbody td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--cream-200);
  vertical-align: middle;
  color: var(--ink-700);
}
.table-soft tbody tr:hover { background: var(--cream-100); }
.table-soft tbody tr:last-child td { border-bottom: none; }
.table-soft .row-title { font-weight: 600; color: var(--ink-900); }
.table-wrap {
  background: var(--cream-50);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* -- Sidebar -- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--cream-50);
  border-right: var(--border);
  padding: 1.5rem 1.1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--cream-400); border-radius: 4px; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0.5rem;
  margin-bottom: 1.6rem;
}
.brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--teal-800);
  color: var(--cream-50);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  flex-shrink: 0;
}
.brand-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--ink-900);
  line-height: 1;
}
.brand-sub {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-500);
  margin-top: 3px;
}

.nav-section-label {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-400);
  font-weight: 700;
  padding: 0.5rem 0.9rem 0.4rem;
  margin-top: 0.6rem;
}

.nav-link-soft {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  color: var(--ink-700);
  font-weight: 500;
  font-size: 0.9rem;
  position: relative;
  margin-bottom: 2px;
}
.nav-link-soft:hover {
  background: var(--cream-200);
  color: var(--ink-900);
}
.nav-link-soft.active {
  background: var(--teal-800);
  color: var(--cream-50);
  box-shadow: 0 4px 14px rgba(13, 79, 71, .18);
}
.nav-link-soft.active:hover { background: var(--teal-900); color: var(--cream-50); }
.nav-link-soft .nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-link-soft .nav-badge {
  margin-left: auto;
  background: var(--gold-500);
  color: var(--ink-900);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
}
.nav-link-soft.active .nav-badge { background: var(--gold-400); }

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: var(--border);
}
.user-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem;
  border-radius: var(--radius);
  background: var(--cream-100);
}
.user-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-700), var(--teal-500));
  color: white;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.user-name { font-weight: 600; font-size: 0.86rem; color: var(--ink-900); line-height: 1.1; }
.user-role { font-size: 0.7rem; color: var(--ink-500); margin-top: 2px; }

/* -- Topbar -- */
.app-main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h);
  background: var(--cream-50);
  border-bottom: var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.8rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-bar input {
  background: var(--cream-100);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.55rem 0.95rem 0.55rem 2.4rem;
  width: 100%;
  font-size: 0.9rem;
  color: var(--ink-900);
  transition: all .15s ease;
}
.search-bar input:focus {
  outline: none;
  background: white;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px rgba(26, 122, 108, .10);
}
.search-bar .search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-400);
}
.topbar-actions { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-700);
  border: 1px solid transparent;
  display: grid; place-items: center;
  cursor: pointer;
  position: relative;
  transition: background .15s ease;
}
.icon-btn:hover { background: var(--cream-200); }
.icon-btn .badge-dot {
  position: absolute;
  top: 8px; right: 9px;
  width: 8px; height: 8px;
  background: var(--gold-500);
  border-radius: 50%;
  border: 2px solid var(--cream-50);
}

.role-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--cream-100);
  border-radius: 999px;
  padding: 0.25rem;
}
.role-switcher button {
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-500);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all .15s ease;
}
.role-switcher button.active {
  background: var(--teal-800);
  color: var(--cream-50);
  box-shadow: 0 2px 8px rgba(13, 79, 71, .2);
}

/* -- Page content -- */
.page {
  padding: 1.8rem 2rem 3rem;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.6rem;
}
.page-header h1 { font-size: 2rem; }
.page-header .lede { color: var(--ink-500); margin-top: 0.4rem; font-size: 0.95rem; }
.page-header .actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.section-title h3 { font-size: 1.2rem; }
.section-title .link { font-size: 0.85rem; color: var(--teal-700); font-weight: 600; }

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-500);
  display: inline-block;
}

/* Filter bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
  align-items: center;
}
.filter-pill {
  background: var(--cream-50);
  border: var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.84rem;
  color: var(--ink-700);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all .15s ease;
}
.filter-pill:hover { border-color: var(--cream-400); }
.filter-pill.active {
  background: var(--ink-900);
  color: var(--cream-50);
  border-color: var(--ink-900);
}
.filter-pill .count {
  background: var(--cream-200);
  color: var(--ink-500);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  margin-left: 0.2rem;
}
.filter-pill.active .count { background: rgba(255,255,255,0.15); color: var(--cream-100); }

/* Property card */
.prop-card {
  background: var(--cream-50);
  border: var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
}
.prop-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.prop-thumb {
  position: relative;
  height: 170px;
  background: linear-gradient(135deg, var(--teal-100), var(--cream-300));
  background-size: cover;
  background-position: center;
}
.prop-thumb .prop-type-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  background: rgba(255,255,255,0.95);
  color: var(--ink-900);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
}
.prop-thumb .prop-status {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
}
.prop-body { padding: 1.1rem 1.2rem 1.3rem; flex: 1; display: flex; flex-direction: column; }
.prop-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; color: var(--ink-900); margin-bottom: 0.25rem; line-height: 1.25; }
.prop-loc { font-size: 0.84rem; color: var(--ink-500); margin-bottom: 0.85rem; display: flex; align-items: center; gap: 0.3rem; }
.prop-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--ink-700); margin-bottom: 0.95rem; }
.prop-meta div { display: flex; align-items: center; gap: 0.3rem; }
.prop-meta strong { font-weight: 600; color: var(--ink-900); }
.prop-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 0.9rem; border-top: var(--border); }
.prop-price { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; color: var(--ink-900); }
.prop-price .price-unit { font-size: 0.75rem; color: var(--ink-500); margin-left: 0.2rem; font-family: var(--font-body); font-weight: 500; }

/* Match score ring */
.score-ring {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  position: relative;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.score-ring.good { background: var(--warning-bg); color: var(--warning); border: 2px solid var(--gold-400); }
.score-ring.very-good { background: #fadbb6; color: #b8650f; border: 2px solid #e89841; }
.score-ring.excellent { background: var(--danger-bg); color: var(--danger); border: 2px solid #db8479; }

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}
.step .step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--cream-200);
  color: var(--ink-500);
  font-weight: 700;
  font-size: 0.85rem;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-family: var(--font-body);
}
.step.active .step-num { background: var(--teal-800); color: var(--cream-50); }
.step.done .step-num { background: var(--success); color: white; }
.step .step-label { font-size: 0.85rem; font-weight: 600; color: var(--ink-500); }
.step.active .step-label { color: var(--ink-900); }
.step .step-line {
  height: 2px; flex: 1;
  background: var(--cream-300);
  border-radius: 1px;
  margin: 0 0.4rem;
}
.step.done .step-line { background: var(--success); }

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 11px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--cream-300);
}
.timeline-item {
  position: relative;
  padding-bottom: 1.4rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -1.65rem; top: 4px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--cream-50);
  border: 2px solid var(--teal-600);
  display: grid; place-items: center;
  color: var(--teal-700);
}
.timeline-dot.success { border-color: var(--success); color: var(--success); }
.timeline-dot.warning { border-color: var(--warning); color: var(--warning); }
.timeline-time { font-size: 0.78rem; color: var(--ink-500); margin-bottom: 0.2rem; }
.timeline-title { font-weight: 600; color: var(--ink-900); margin-bottom: 0.15rem; }
.timeline-desc { font-size: 0.88rem; color: var(--ink-700); }

/* Empty state */
.empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--ink-500);
}
.empty .empty-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--cream-200);
  color: var(--ink-400);
  display: inline-grid;
  place-items: center;
  margin-bottom: 1rem;
}
.empty h4 { color: var(--ink-900); margin-bottom: 0.4rem; font-family: var(--font-display); font-weight: 500; }

/* Modal-ish drawer (used inline) */
.drawer-bg {
  position: fixed; inset: 0;
  background: rgba(11, 35, 31, 0.32);
  backdrop-filter: blur(4px);
  display: none;
  z-index: 50;
}
.drawer-bg.show { display: block; animation: fadeIn .2s ease; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 480px;
  max-width: 92vw;
  background: var(--cream-50);
  z-index: 51;
  transform: translateX(100%);
  transition: transform .25s ease;
  display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  padding: 1.4rem 1.6rem;
  border-bottom: var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-body { padding: 1.4rem 1.6rem; overflow-y: auto; flex: 1; }
.drawer-foot {
  padding: 1rem 1.6rem;
  border-top: var(--border);
  display: flex; gap: 0.5rem; justify-content: flex-end;
  background: var(--cream-100);
}

/* Toggle between role-based content */
[data-role-only] { display: none; }
body[data-active-role="superadmin"] [data-role-only~="superadmin"],
body[data-active-role="employee"]   [data-role-only~="employee"],
body[data-active-role="leadgen"]    [data-role-only~="leadgen"],
body[data-active-role="broker"]     [data-role-only~="broker"] { display: revert; }

/* Charts placeholder */
.chart-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  height: 180px;
  padding: 0 0.5rem;
}
.chart-bar .bar {
  flex: 1;
  background: linear-gradient(180deg, var(--teal-500), var(--teal-800));
  border-radius: 6px 6px 0 0;
  position: relative;
  transition: opacity .2s ease;
  min-height: 4px;
}
.chart-bar .bar:hover { opacity: 0.85; }
.chart-bar .bar-label {
  position: absolute;
  bottom: -20px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--ink-500);
}
.chart-bar .bar-value {
  position: absolute;
  top: -20px; left: 50%;
  transform: translateX(-50%);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-900);
}

/* Donut placeholder */
.donut {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: conic-gradient(var(--teal-800) 0 60%, var(--gold-400) 60% 80%, var(--cream-300) 80% 100%);
  position: relative;
  display: grid; place-items: center;
}
.donut::after {
  content: '';
  position: absolute; inset: 22px;
  background: var(--cream-50);
  border-radius: 50%;
}
.donut-label {
  position: relative; z-index: 1;
  text-align: center;
}
.donut-label .v { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; }
.donut-label .l { font-size: 0.74rem; color: var(--ink-500); }

/* Animations */
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }
@keyframes slideUp { from { opacity:0; transform: translateY(10px);} to { opacity:1; transform: translateY(0);} }
.fade-in { animation: fadeIn .3s ease both; }
.slide-up { animation: slideUp .3s ease both; }
.stagger > * { animation: slideUp .4s ease both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .07s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .17s; }
.stagger > *:nth-child(5) { animation-delay: .22s; }
.stagger > *:nth-child(6) { animation-delay: .27s; }
.stagger > *:nth-child(7) { animation-delay: .32s; }
.stagger > *:nth-child(8) { animation-delay: .37s; }

/* Responsive */
@media (max-width: 992px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 100;
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(11,35,31,.35);
    z-index: 99;
    display: none;
  }
  .sidebar-overlay.show { display: block; }
  .topbar { padding: 0 1rem; }
  .page { padding: 1.2rem 1rem 2.5rem; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.65rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .role-switcher { display: none; }
  .search-bar { display: none; }
}

/* Scrollbars (subtle) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cream-300); border-radius: 5px; border: 2px solid var(--cream-100); }
::-webkit-scrollbar-thumb:hover { background: var(--cream-400); }

/* ============================================
   ADDITIONAL CLASSES — matches, leads, visits,
   deals, commissions, users, reports
   ============================================ */

/* Match cards */
.match-card { padding: 1.5rem; height: 100%; display: flex; flex-direction: column; }
.match-card .score-ring { width: 78px; height: 78px; flex-direction: column; }
.match-card .score-ring-num { font-size: 1.4rem; line-height: 1; font-family: var(--font-display); font-weight: 600; }
.match-card .score-ring-lbl { font-size: 0.65rem; opacity: 0.7; font-family: var(--font-body); font-weight: 500; letter-spacing: 0.04em; margin-top: 2px; }
.match-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 500; color: var(--ink-900); margin: 0.4rem 0 0.2rem; line-height: 1.3; }
.match-req { font-family: var(--font-body); color: var(--ink-700); font-weight: 500; font-size: 0.92rem; }

.score-pill {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.score-pill.good { background: var(--warning-bg); color: var(--warning); }
.score-pill.very-good { background: #fadbb6; color: #b8650f; }
.score-pill.excellent { background: var(--danger-bg); color: var(--danger); }

.score-breakdown { background: var(--cream-100); border-radius: 12px; padding: 0.85rem 1rem; margin-top: 0.5rem; }
.bd-row { display: flex; justify-content: space-between; padding: 0.32rem 0; font-size: 0.86rem; border-bottom: 1px dashed var(--cream-300); }
.bd-row:last-child { border-bottom: none; }
.bd-row span:first-child { color: var(--ink-600); }
.bd-row .pos { color: var(--success); font-weight: 600; }
.bd-row .zero { color: var(--ink-400); }

/* Kanban for leads */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.kanban-col { background: var(--cream-200); border-radius: 14px; padding: 0.85rem; min-height: 400px; }
.kanban-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.85rem; padding: 0 0.4rem; }
.kanban-title { font-family: var(--font-body); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-700); }
.kanban-count { background: white; color: var(--ink-700); border-radius: 999px; padding: 0.1rem 0.55rem; font-size: 0.72rem; font-weight: 600; }
.lead-card { background: white; border-radius: 12px; padding: 0.85rem 1rem; margin-bottom: 0.7rem; cursor: pointer; transition: all 0.15s ease; box-shadow: 0 1px 2px rgba(13, 79, 71, 0.04); }
.lead-card:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(13, 79, 71, 0.1); }
.lead-card .lc-cust { font-weight: 600; color: var(--ink-900); font-size: 0.92rem; }
.lead-card .lc-prop { color: var(--ink-600); font-size: 0.82rem; margin-top: 0.15rem; }
.lead-card .lc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 0.6rem; padding-top: 0.55rem; border-top: 1px dashed var(--cream-300); }
.lead-card .lc-val { font-weight: 600; color: var(--teal-800); font-size: 0.85rem; }

/* Interest pills */
.interest-pill { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em; }
.interest-pill.HOT { background: var(--danger-bg); color: var(--danger); }
.interest-pill.WARM { background: var(--warning-bg); color: var(--warning); }
.interest-pill.COLD { background: var(--info-bg); color: var(--info); }

/* Star rating */
.stars { display: inline-flex; gap: 2px; }
.stars svg { width: 14px; height: 14px; color: var(--cream-400); }
.stars svg.filled { color: var(--gold-500); fill: var(--gold-500); }

/* Stat tiles for reports */
.stat-tile { padding: 1.4rem 1.5rem; border-radius: 16px; }
.stat-tile .stat-lbl { color: var(--ink-500); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.stat-tile .stat-val { font-family: var(--font-display); font-size: 2.1rem; font-weight: 500; color: var(--ink-900); margin-top: 0.3rem; line-height: 1.1; }
.stat-tile .stat-trend { font-size: 0.78rem; font-weight: 600; margin-top: 0.5rem; }
.stat-tile .stat-trend.up { color: var(--success); }
.stat-tile .stat-trend.down { color: var(--danger); }

/* Avatars for users */
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--teal-100); color: var(--teal-800); display: inline-grid; place-items: center; font-weight: 600; font-size: 0.85rem; }
.avatar.lg { width: 52px; height: 52px; font-size: 1.05rem; }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--cream-300); transition: 0.2s; border-radius: 22px; }
.switch .slider::before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; transition: 0.2s; border-radius: 50%; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.switch input:checked + .slider { background: var(--teal-700); }
.switch input:checked + .slider::before { transform: translateX(16px); }

/* Visit detail row */
.visit-row { display: grid; grid-template-columns: 60px 1fr auto; gap: 1rem; padding: 1rem 1.25rem; border: var(--border); border-radius: 12px; background: white; margin-bottom: 0.7rem; transition: all 0.15s; }
.visit-row:hover { box-shadow: 0 2px 10px rgba(13, 79, 71, 0.06); }
.visit-date { background: var(--teal-50); border-radius: 10px; padding: 0.5rem 0.4rem; text-align: center; }
.visit-date .vd-day { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; color: var(--teal-800); line-height: 1; }
.visit-date .vd-mon { font-size: 0.65rem; color: var(--teal-700); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }
.visit-date .vd-time { font-size: 0.75rem; color: var(--ink-600); margin-top: 4px; font-weight: 600; }

/* Donut chart placeholder */
.donut-wrap { display: grid; grid-template-columns: 160px 1fr; gap: 1.2rem; align-items: center; }
.donut { width: 140px; height: 140px; border-radius: 50%; position: relative; background: conic-gradient(var(--teal-700) 0 60%, var(--gold-500) 60% 80%, var(--cream-300) 80% 100%); }
.donut::after { content: ""; position: absolute; inset: 22px; background: white; border-radius: 50%; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }
.donut-center .dc-num { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink-900); font-weight: 600; line-height: 1; }
.donut-center .dc-lbl { font-size: 0.7rem; color: var(--ink-500); margin-top: 2px; }
.donut-legend { font-size: 0.85rem; }
.donut-legend .dl-row { display: flex; justify-content: space-between; padding: 0.35rem 0; border-bottom: 1px dashed var(--cream-300); }
.donut-legend .dl-row:last-child { border-bottom: none; }
.donut-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 0.55rem; vertical-align: middle; }

/* Bar chart inline */
.bar-list { display: flex; flex-direction: column; gap: 0.85rem; }
.bar-row { font-size: 0.85rem; }
.bar-row .br-head { display: flex; justify-content: space-between; margin-bottom: 0.3rem; }
.bar-row .br-name { color: var(--ink-700); font-weight: 600; }
.bar-row .br-val { color: var(--ink-900); font-weight: 700; }
.bar-row .br-bar { height: 8px; background: var(--cream-200); border-radius: 4px; overflow: hidden; }
.bar-row .br-fill { height: 100%; background: var(--teal-700); border-radius: 4px; transition: width 0.4s ease; }
.bar-row .br-fill.gold { background: var(--gold-500); }

/* Section heading inside cards */
.sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.sec-head h3 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; color: var(--ink-900); margin: 0; }
.sec-head .sec-link { font-size: 0.85rem; color: var(--teal-700); font-weight: 600; text-decoration: none; }

@media (max-width: 1100px) {
  .kanban { grid-template-columns: repeat(3, minmax(220px, 1fr)); }
}
@media (max-width: 700px) {
  .kanban { grid-template-columns: 1fr; }
}

/* Chart bar wrap (reports page) */
.chart-bar-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 0.6rem;
  height: 200px;
  padding: 1.5rem 0.5rem 1.8rem;
  border-bottom: 1px dashed var(--cream-300);
  position: relative;
}
.chart-bar-wrap .chart-bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 0;
  padding: 0;
  position: relative;
}
.chart-bar-wrap .cb-fill {
  width: 70%;
  max-width: 50px;
  background: linear-gradient(180deg, var(--teal-500), var(--teal-800));
  border-radius: 6px 6px 0 0;
  transition: all 0.4s ease;
  min-height: 4px;
}
.chart-bar-wrap .cb-fill.cb-active {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-600));
}
.chart-bar-wrap .cb-label {
  position: absolute;
  bottom: -22px;
  font-size: 0.72rem;
  color: var(--ink-500);
  font-weight: 600;
}
.chart-bar-wrap .cb-val {
  position: absolute;
  top: -22px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-900);
  font-family: var(--font-display);
}

/* Lead detail timeline minor adjustments */
.timeline-item .timeline-dot.dot-warning { background: var(--gold-500); }
.timeline-item .timeline-dot.dot-success { background: var(--success); }
.timeline-item .timeline-dot.dot-info { background: var(--info); }
.timeline-item .timeline-dot.dot-danger { background: var(--danger); }
.timeline-item .timeline-content .timeline-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.2rem; }

/* Stepper "done" state */
.stepper .step.done .step-num { background: var(--success); color: white; border-color: var(--success); }
.stepper .step.done .step-label { color: var(--ink-700); }


/* =====================================================
   POLISH PASS — animations + comprehensive responsive
   ===================================================== */

/* Smoother global transitions */
* { -webkit-tap-highlight-color: transparent; }

/* Page entrance — fade up everything */
@keyframes pageFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.app-shell .page > * { animation: pageFadeUp 0.5s cubic-bezier(.2,.8,.2,1) both; }
.app-shell .page > *:nth-child(1) { animation-delay: 0.02s; }
.app-shell .page > *:nth-child(2) { animation-delay: 0.08s; }
.app-shell .page > *:nth-child(3) { animation-delay: 0.14s; }
.app-shell .page > *:nth-child(4) { animation-delay: 0.20s; }
.app-shell .page > *:nth-child(5) { animation-delay: 0.26s; }
.app-shell .page > *:nth-child(6) { animation-delay: 0.32s; }

/* Card lift on hover — feels premium */
.card-soft, .card-stat, .stat-tile, .prop-card, .visit-row, .lead-card, .match-card {
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease, border-color .2s ease;
}
.prop-card:hover, .stat-tile:hover, .match-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px -8px rgba(13, 79, 71, 0.15);
}

/* Buttons — micro-interaction */
.btn-primary, .btn-secondary, .btn-ghost {
  transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn-primary:hover, .btn-secondary:hover { transform: translateY(-1px); }
.btn-primary:active, .btn-secondary:active { transform: translateY(0); }

.btn-primary {
  box-shadow: 0 2px 0 rgba(11, 49, 44, 0.25), 0 6px 16px -4px rgba(13, 79, 71, 0.4);
}
.btn-primary:hover {
  box-shadow: 0 3px 0 rgba(11, 49, 44, 0.3), 0 10px 22px -4px rgba(13, 79, 71, 0.5);
}

/* Soft stage pill animation when entering */
.stage-pill, .badge-soft, .interest-pill, .score-pill {
  transition: all .2s ease;
}

/* Filter pill ripple-feel */
.filter-pill { transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .12s ease; }
.filter-pill:active { transform: scale(0.97); }

/* Sidebar nav link hover */
.nav-link-soft { transition: background-color .15s ease, color .15s ease; position: relative; }
.nav-link-soft:not(.active)::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 0; background: var(--gold-500); border-radius: 0 3px 3px 0;
  transition: height .2s ease;
}
.nav-link-soft:not(.active):hover::before { height: 60%; }

/* Table row hover */
.table-soft tbody tr { transition: background-color .15s ease; }

/* Form control focus ring — softer, more editorial */
.form-control:focus {
  box-shadow: 0 0 0 4px rgba(13, 79, 71, 0.08);
}

/* Score ring pulse on excellent */
@keyframes excellentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.4); }
  50%      { box-shadow: 0 0 0 10px rgba(192, 57, 43, 0); }
}
.score-ring.excellent { animation: excellentPulse 2.4s ease-in-out infinite; }

/* Stepper number — subtle bounce on active */
@keyframes stepActiveScale {
  from { transform: scale(0.8); opacity: 0.5; }
  to   { transform: scale(1); opacity: 1; }
}
.stepper .step.active .step-num { animation: stepActiveScale .35s cubic-bezier(.2,.8,.2,1) both; }

/* =====================================================
   COMPREHENSIVE RESPONSIVE
   ===================================================== */

/* Tablet: 992px and below — sidebar slides in */
@media (max-width: 992px) {
  .app-shell { grid-template-columns: 1fr; }
  .topbar .topbar-search,
  .topbar .search-bar { display: none; }
  .topbar .role-switcher .role-toggle-group { display: none; }
  .actions { gap: 8px; flex-wrap: wrap; }
  .page-header { gap: 1rem; }

  /* Stat tiles */
  .stat-tile .stat-val { font-size: 1.7rem; }

  /* Match cards */
  .match-card .score-ring { width: 64px; height: 64px; }
  .match-card .score-ring-num { font-size: 1.15rem; }

  /* Stepper — horizontal scroll */
  .stepper { overflow-x: auto; padding-bottom: 0.6rem; -webkit-overflow-scrolling: touch; }
  .stepper .step { flex: 0 0 auto; min-width: 90px; }

  /* Donut wrap stack */
  .donut-wrap { grid-template-columns: 1fr; text-align: center; }
  .donut-wrap > div:first-child { margin: 0 auto; }
}

/* Phone: 768px and below — heavier compaction */
@media (max-width: 768px) {
  h1 { font-size: 1.55rem; line-height: 1.15; }
  h2, h3 { font-size: 1.15rem; }
  .lede { font-size: 0.95rem; }
  .eyebrow { font-size: 0.7rem; }

  .page { padding: 1rem 0.9rem 2rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-header .actions { width: 100%; }
  .page-header .actions .btn { flex-grow: 1; }

  /* Filter pills become horizontal scroll */
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.6rem;
    scrollbar-width: none;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-pill { flex: 0 0 auto; }

  /* Login page stack */
  .login-shell { grid-template-columns: 1fr !important; }
  .login-left { padding: 2rem 1.5rem !important; min-height: 0 !important; border-right: none !important; border-bottom: 1px solid var(--cream-300); }
  .login-left h1 { font-size: 2rem !important; line-height: 1.1 !important; }
  .login-right { padding: 2rem 1.5rem !important; }

  /* Stat tiles 2-up on phone */
  .stat-tile { padding: 1rem 1.1rem; }
  .stat-tile .stat-val { font-size: 1.4rem; }
  .stat-tile .stat-lbl { font-size: 0.7rem; }

  /* Property cards 1-up */
  .prop-card .prop-img { height: 160px; }

  /* Visit row simplified */
  .visit-row { grid-template-columns: 56px 1fr; gap: 0.7rem; padding: 0.85rem; }
  .visit-row > div:last-child { grid-column: 1 / -1; flex-direction: row !important; flex-wrap: wrap; align-items: stretch !important; gap: 0.4rem; padding-top: 0.4rem; border-top: 1px dashed var(--cream-300); }
  .visit-row > div:last-child .btn { flex: 1; min-width: 0; }

  /* Stepper smaller */
  .stepper .step .step-num { width: 32px; height: 32px; font-size: 0.85rem; }
  .stepper .step .step-label { font-size: 0.7rem; }

  /* Match card cleanup */
  .match-card { padding: 1.15rem; }
  .match-card .match-title { font-size: 1.05rem; }

  /* Lead detail single column */
  .lead-card { padding: 0.7rem 0.9rem; }

  /* Tables become scroll on x */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; }
  .table-soft { min-width: 720px; }
  .table-soft th, .table-soft td { padding: 0.7rem 0.85rem; font-size: 0.85rem; white-space: nowrap; }

  /* Kanban — single column with horizontal scroll */
  .kanban {
    grid-template-columns: repeat(6, minmax(78vw, 78vw)) !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.8rem;
  }
  .kanban-col { scroll-snap-align: start; }

  /* Forms */
  .upload-zone { padding: 1.2rem 1rem; }

  /* Page footer for action bars on mobile */
  .actions .btn-group { width: 100%; }
  .actions .btn-group .btn { flex: 1; }

  /* Topbar role switcher hidden */
  .topbar { padding: 0 0.85rem; height: 60px; }
  .topbar .brand-mobile { display: flex !important; }

  /* Modals */
  .modal-dialog { margin: 0.6rem; }

  /* Reduce shadows on mobile (perf) */
  .card-soft, .card-stat { box-shadow: 0 1px 2px rgba(13, 79, 71, 0.05); }
}

/* Small phone: 480px and below */
@media (max-width: 480px) {
  .stat-tile .stat-val { font-size: 1.25rem; }
  .stat-tile .stat-lbl { font-size: 0.65rem; letter-spacing: 0.02em; }
  .badge-soft, .stage-pill, .interest-pill { font-size: 0.62rem; padding: 0.18rem 0.5rem; }
  .card-soft { padding: 1rem !important; }
  .card-soft[style*="padding"] { padding: 1.1rem !important; }
  h1 { font-size: 1.4rem; }

  /* Avatar smaller */
  .avatar { width: 32px; height: 32px; font-size: 0.75rem; }
  .avatar.lg { width: 44px; height: 44px; font-size: 0.95rem; }

  /* Bar chart smaller */
  .chart-bar-wrap { height: 160px; }
  .chart-bar-wrap .cb-val { font-size: 0.7rem; top: -18px; }
  .chart-bar-wrap .cb-label { font-size: 0.65rem; }

  /* Donut smaller */
  .donut { width: 110px !important; height: 110px !important; }
  .donut::after { inset: 18px; }

  /* Buttons full-width by default */
  .btn-sm { font-size: 0.78rem; padding: 0.4rem 0.75rem; }
}

/* Hint that horizontal scroll exists on tables */
@media (max-width: 768px) {
  .table-wrap::after {
    content: '';
    position: absolute;
    pointer-events: none;
  }
  .table-wrap { position: relative; }
}

/* =====================================================
   LOGIN PAGE — additional refinement to match screenshot
   ===================================================== */
.login-shell {
  background: linear-gradient(135deg, var(--cream-100) 0%, #ecf6ee 100%);
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  padding: 1.2rem;
  gap: 0;
}
.login-card-outer {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: linear-gradient(135deg, #f0f8f1 0%, #f8f6ee 100%);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(13, 79, 71, 0.18);
  border: 1px solid rgba(13, 79, 71, 0.06);
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  align-self: center;
  animation: pageFadeUp 0.7s cubic-bezier(.2,.8,.2,1) both;
}
.login-shell-bg { display: grid; place-items: center; min-height: 100vh; padding: 1.2rem; background: linear-gradient(135deg, #ecf6ee 0%, #f8f6ee 100%); }

@media (max-width: 768px) {
  .login-card-outer { grid-template-columns: 1fr; max-width: 100%; border-radius: 20px; }
  .login-shell-bg { padding: 0.6rem; }
}

/* Mobile brand strip in topbar (hidden on desktop) */
.brand-mobile { display: none; align-items: center; gap: 0.5rem; }
.brand-mobile .brand-mark-sm { width: 32px; height: 32px; border-radius: 8px; background: var(--teal-700); display: grid; place-items: center; color: var(--cream-100); }
.brand-mobile .brand-text-sm { font-family: var(--font-display); font-weight: 600; color: var(--ink-900); }

/* Topbar mobile menu toggle — make it more visible */
@media (max-width: 992px) {
  .btn-icon#sidebarToggle {
    background: var(--cream-100);
    border: 1px solid var(--cream-300);
    width: 38px; height: 38px;
    display: grid !important;
    place-items: center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =====================================================
   FINAL POLISH — login-grade editorial feel everywhere
   ===================================================== */

/* Soft gradient app background — same vibe as login */
body {
  background:
    radial-gradient(900px 600px at 100% 0%, #d8ebe5 0%, transparent 55%),
    radial-gradient(700px 500px at 0% 100%, #f7eccb 0%, transparent 50%),
    var(--cream-100);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Sidebar — slightly translucent so gradient shows through */
.sidebar {
  background: rgba(248, 246, 238, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Topbar — same translucent treatment */
.topbar {
  background: rgba(248, 246, 238, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(13, 79, 71, 0.06);
}

/* Page padding refinements + max width for readability */
.page {
  padding: 2.4rem 2.4rem 4rem;
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
}

/* Page header — bigger, more editorial like the login */
.page-header { margin-bottom: 2.2rem; }
.page-header h1 {
  font-size: 2.4rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 500;
  margin-top: 0.5rem;
}
.page-header .lede {
  color: var(--ink-600);
  margin-top: 0.55rem;
  font-size: 1rem;
  max-width: 620px;
  line-height: 1.55;
}

/* Eyebrow — more login-like */
.eyebrow {
  color: var(--teal-700);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Cards — softer borders, more breathing room */
.card-soft {
  border: 1px solid rgba(13, 79, 71, 0.08);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Stat cards — make the numbers feel editorial */
.stat-tile {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(13, 79, 71, 0.06);
}
.stat-tile .stat-val {
  letter-spacing: -0.025em;
  font-weight: 500;
}

/* Section heads inside cards — editorial feel */
.sec-head h3 {
  letter-spacing: -0.015em;
}

/* Match titles, lead names, property names — serif for that login feel */
.match-title, .row-title {
  letter-spacing: -0.01em;
}

/* Better focus visuals on form fields — like login */
.form-control {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(13, 79, 71, 0.15);
  transition: all 0.2s ease;
}
.form-control:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--teal-700);
}

/* Stage / interest pills — consistent rounded pill */
.stage-pill, .interest-pill, .badge-soft, .score-pill {
  font-family: var(--font-body);
}

/* Filter pills — softer */
.filter-pill {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(13, 79, 71, 0.1);
}
.filter-pill.active {
  background: var(--teal-800);
  color: white;
  border-color: var(--teal-800);
  box-shadow: 0 4px 14px -4px rgba(13, 79, 71, 0.4);
}

/* Tables — softer */
.table-wrap {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(13, 79, 71, 0.06);
}
.table-soft thead th {
  background: rgba(248, 246, 238, 0.7);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-600);
}

/* Kanban — softer */
.kanban-col {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(13, 79, 71, 0.06);
}

/* Login subtle gold underline accent — apply to gold-underline class */
.gold-underline {
  position: relative;
  display: inline-block;
}
.gold-underline::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 8px;
  background: linear-gradient(90deg, transparent, rgba(212, 167, 44, 0.5), transparent);
  border-radius: 4px;
  z-index: -1;
}

/* =====================================================
   ADDITIONAL DELIGHTFUL ANIMATIONS
   ===================================================== */

/* Fade-slide individual cards on entry */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card-soft, .card-stat, .stat-tile, .prop-card, .visit-row, .lead-card {
  animation: fadeSlideIn 0.55s cubic-bezier(.2,.8,.2,1) both;
}

/* Stagger inside grids automatically */
.row > [class*="col-"]:nth-child(1) > .card-soft,
.row > [class*="col-"]:nth-child(1) > .stat-tile { animation-delay: 0.05s; }
.row > [class*="col-"]:nth-child(2) > .card-soft,
.row > [class*="col-"]:nth-child(2) > .stat-tile { animation-delay: 0.10s; }
.row > [class*="col-"]:nth-child(3) > .card-soft,
.row > [class*="col-"]:nth-child(3) > .stat-tile { animation-delay: 0.15s; }
.row > [class*="col-"]:nth-child(4) > .card-soft,
.row > [class*="col-"]:nth-child(4) > .stat-tile { animation-delay: 0.20s; }
.row > [class*="col-"]:nth-child(5) > .card-soft { animation-delay: 0.25s; }
.row > [class*="col-"]:nth-child(6) > .card-soft { animation-delay: 0.30s; }

/* Smooth icon rotation on hover for action buttons */
.btn-primary svg, .btn-secondary svg {
  transition: transform 0.25s ease;
}
.btn-primary:hover svg { transform: translateX(2px); }

/* Sidebar entry */
@keyframes sidebarSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
.sidebar .nav-link-soft {
  animation: sidebarSlideIn 0.4s cubic-bezier(.2,.8,.2,1) both;
}
.sidebar .nav-link-soft:nth-of-type(1) { animation-delay: 0.05s; }
.sidebar .nav-link-soft:nth-of-type(2) { animation-delay: 0.08s; }
.sidebar .nav-link-soft:nth-of-type(3) { animation-delay: 0.11s; }
.sidebar .nav-link-soft:nth-of-type(4) { animation-delay: 0.14s; }
.sidebar .nav-link-soft:nth-of-type(5) { animation-delay: 0.17s; }
.sidebar .nav-link-soft:nth-of-type(6) { animation-delay: 0.20s; }
.sidebar .nav-link-soft:nth-of-type(7) { animation-delay: 0.23s; }
.sidebar .nav-link-soft:nth-of-type(8) { animation-delay: 0.26s; }
.sidebar .nav-link-soft:nth-of-type(9) { animation-delay: 0.29s; }
.sidebar .nav-link-soft:nth-of-type(10) { animation-delay: 0.32s; }

/* Number counter look — for KPIs */
.stat-val {
  font-variant-numeric: tabular-nums;
}

/* Donut subtle rotation on hover */
.donut { transition: transform 0.6s cubic-bezier(.2,.8,.2,1); }
.card-soft:hover .donut { transform: rotate(8deg); }

/* Avatar subtle glow on hover */
.avatar { transition: box-shadow 0.25s ease, transform 0.25s ease; }
.avatar:hover {
  box-shadow: 0 0 0 4px rgba(13, 79, 71, 0.1);
  transform: scale(1.05);
}

/* Score-ring entrance */
@keyframes ringPopIn {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
.score-ring { animation: ringPopIn 0.55s cubic-bezier(.2,.8,.2,1) both; }

/* Timeline dots subtle pulse on first dot only */
@keyframes dotPulseSubtle {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 167, 44, 0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(212, 167, 44, 0); }
}
.timeline-item:first-child .timeline-dot { animation: dotPulseSubtle 2.5s ease-in-out infinite; }

/* Page header accent line */
.page-header h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-300));
  border-radius: 2px;
  margin-top: 0.85rem;
  opacity: 0.7;
  transform-origin: left;
  animation: lineGrow 0.8s cubic-bezier(.2,.8,.2,1) 0.3s both;
}
@keyframes lineGrow {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 0.7; }
}

/* Mobile final tweaks */
@media (max-width: 768px) {
  .page { padding: 1.4rem 1.1rem 3rem; }
  .page-header h1 { font-size: 1.7rem; }
  .page-header h1::after { width: 40px; height: 2px; margin-top: 0.6rem; }
  .page-header .lede { font-size: 0.92rem; }
  .stat-tile .stat-val { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .page { padding: 1.1rem 0.85rem 2.5rem; }
  .page-header h1 { font-size: 1.5rem; }
  .page-header { margin-bottom: 1.4rem; }
}

/* Backdrop-filter fallback */
@supports not (backdrop-filter: blur(8px)) {
  .card-soft, .stat-tile, .table-wrap, .kanban-col,
  .filter-pill, .sidebar, .topbar { backdrop-filter: none; }
  .sidebar { background: var(--cream-100); }
  .topbar { background: var(--cream-50); }
  .card-soft { background: white; }
  .stat-tile { background: white; }
}

/* =====================================================
   LAYOUT FIX PASS — overrides any earlier conflicts
   ===================================================== */

/* Hard-reset the app shell grid */
#app.app-shell {
  display: grid !important;
  grid-template-columns: 264px minmax(0, 1fr) !important;
  min-height: 100vh;
  width: 100%;
  position: relative;
}

/* Sidebar: solid column 1, no backdrop tricks that break sticky */
#app.app-shell > .sidebar {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--cream-50);
  border-right: 1px solid rgba(13, 79, 71, 0.08);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 50;
}

/* App main: column 2 */
#app.app-shell > .app-main {
  grid-column: 2 / 3;
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

/* Topbar — solid, no backdrop-filter */
#app.app-shell .topbar {
  position: sticky;
  top: 0;
  background: var(--cream-50);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 40;
  border-bottom: 1px solid rgba(13, 79, 71, 0.06);
}

/* Page — full width inside main, no max-width that constrains grid */
#app.app-shell .page {
  max-width: none;
  margin: 0;
  width: 100%;
  padding: 2rem 2rem 3rem;
}

/* Body — keep the gradient but no fixed attachment (perf + glitch fix) */
body {
  background:
    radial-gradient(900px 600px at 100% 0%, #d8ebe5 0%, transparent 55%),
    radial-gradient(700px 500px at 0% 100%, #f7eccb 0%, transparent 50%),
    var(--cream-100);
  background-attachment: scroll;
  min-height: 100vh;
}

/* Sidebar overlay: only shows on mobile when toggled */
#app.app-shell > .sidebar-overlay {
  display: none;
}
#app.app-shell > .sidebar-overlay.show {
  display: block;
}

/* === MOBILE: ≤992px — sidebar slides over, not in grid === */
@media (max-width: 992px) {
  #app.app-shell {
    grid-template-columns: 1fr !important;
  }
  #app.app-shell > .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 280px;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
    z-index: 100;
    box-shadow: 0 20px 60px -10px rgba(13, 79, 71, 0.25);
    grid-column: auto;
    grid-row: auto;
  }
  #app.app-shell > .sidebar.open {
    transform: translateX(0);
  }
  #app.app-shell > .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 35, 31, 0.4);
    z-index: 99;
  }
  #app.app-shell > .sidebar-overlay.show {
    display: block;
  }
  #app.app-shell > .app-main {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
  }
  #app.app-shell .page {
    padding: 1.4rem 1.1rem 2.5rem;
  }
}

@media (max-width: 768px) {
  #app.app-shell .page {
    padding: 1.2rem 0.9rem 2rem;
  }
}

@media (max-width: 480px) {
  #app.app-shell .page {
    padding: 1rem 0.8rem 2rem;
  }
}

/* Disable the body-level pageFadeUp animation (caused FOUC + layout glitches) */
.app-shell .page > * {
  animation: none;
}
.app-shell .page > .stagger > * {
  animation: slideUp .4s ease both;
}

/* Stop child element animations from blocking visibility on slow connections */
.card-soft, .card-stat, .stat-tile, .prop-card, .visit-row, .lead-card {
  animation: none;
  opacity: 1;
  transform: none;
}

/* Re-add SUBTLE entrance only to first-time visible content (no opacity 0 default) */
@keyframes gentleRise {
  from { opacity: 0.6; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-header,
.filter-bar,
.row.g-3,
.row.g-4,
.table-wrap,
.kanban {
  animation: gentleRise 0.4s ease both;
}

/* Sidebar nav links — keep but ensure visible if animation fails */
.sidebar .nav-link-soft {
  animation: none;
  opacity: 1;
}

/* Fix sidebar font-display loading flash */
.sidebar { font-family: var(--font-body); }


/* =====================================================
   Notification dropdown
   ===================================================== */
.topbar .icon-btn { position: relative; }

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 92vw;
  background: white;
  border: 1px solid rgba(13, 79, 71, 0.1);
  border-radius: 14px;
  box-shadow: 0 24px 60px -12px rgba(13, 79, 71, 0.25);
  z-index: 1000;
  overflow: hidden;
  animation: notifSlideIn 0.22s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes notifSlideIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.notif-dropdown .notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--cream-200);
  background: var(--cream-50);
}

.notif-dropdown .notif-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--cream-200);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s ease;
}
.notif-dropdown .notif-item:hover { background: var(--cream-50); }
.notif-dropdown .notif-item.unread { background: rgba(212, 167, 44, 0.04); }
.notif-dropdown .notif-item.unread:hover { background: rgba(212, 167, 44, 0.08); }

.notif-dropdown .notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-300);
  flex-shrink: 0;
  margin-top: 0.45rem;
}
.notif-dropdown .notif-dot.dot-danger { background: var(--danger); }
.notif-dropdown .notif-dot.dot-warning { background: var(--gold-500); }
.notif-dropdown .notif-dot.dot-success { background: var(--success); }

.notif-dropdown .notif-foot {
  padding: 0.7rem 1.1rem;
  text-align: center;
  background: var(--cream-50);
}

@media (max-width: 480px) {
  .notif-dropdown { right: -8px; width: 92vw; }
}

/* Search bar — make it visually clear it's active */
.topbar .search-bar input:focus {
  outline: none;
  border-color: var(--teal-700);
  background: white;
  box-shadow: 0 0 0 4px rgba(13, 79, 71, 0.08);
}

/* =====================================================
   Toast notifications
   ===================================================== */
.pms-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: var(--ink-900);
  color: white;
  padding: 0.85rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 12px 32px -8px rgba(13, 79, 71, 0.4);
  opacity: 0;
  z-index: 9999;
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(.2,.8,.2,1);
  max-width: 90vw;
  pointer-events: none;
}
.pms-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.pms-toast-success { background: var(--success); }
.pms-toast-info    { background: var(--teal-800); }
.pms-toast-error   { background: var(--danger); }

/* Button loading state */
.btn.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: white;
  animation: btnSpin 0.7s linear infinite;
}
.btn-loading.btn-secondary::after { color: var(--ink-700); }
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* Form validation styles */
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: var(--danger) !important;
  background-color: #fef0ef !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12) !important;
}
.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18) !important;
}

/* Modal display fixes for fallback (no bootstrap JS) */
.modal.show {
  display: block !important;
  background: rgba(26, 26, 46, 0.4);
}
.modal-backdrop.show {
  opacity: 0.4;
}
