@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #f6f6f9;
  --panel: #ffffff;
  --border: #eaeaf2;
  --border-strong: #dcdce8;
  --text: #17172b;
  --text-muted: #85859c;
  --text-faint: #b4b4c6;
  --primary: #6952f2;
  --primary-dark: #5540d6;
  --primary-tint: #f1eefe;
  --primary-glow: rgba(105,82,242,0.35);
  --success: #16a35f;
  --success-tint: #e6f8ef;
  --danger: #e14b4b;
  --danger-tint: #fdecec;
  --warning: #e0930c;
  --warning-tint: #fdf2df;
  --info: #1391c4;
  --info-tint: #e6f6fc;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(23,23,43,0.04);
  --shadow-sm: 0 1px 3px rgba(23,23,43,0.06), 0 1px 2px rgba(23,23,43,0.04);
  --shadow-md: 0 4px 12px rgba(23,23,43,0.08), 0 2px 4px rgba(23,23,43,0.04);
  --shadow-lg: 0 12px 32px rgba(23,23,43,0.12), 0 4px 8px rgba(23,23,43,0.04);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e16;
    --panel: #171723;
    --border: #262637;
    --border-strong: #32324a;
    --text: #f0f0f7;
    --text-muted: #9292ab;
    --text-faint: #5c5c78;
    --primary: #8b7bff;
    --primary-dark: #a596ff;
    --primary-tint: #241f47;
    --primary-glow: rgba(139,123,255,0.35);
    --success: #35d789;
    --success-tint: #103823;
    --danger: #ff6b6b;
    --danger-tint: #3a1a1a;
    --warning: #f2a93c;
    --warning-tint: #3a2c0f;
    --info: #4fc3f7;
    --info-tint: #123244;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.24);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.32), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 14px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.24);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

h1, h2, h3, h4 { font-family: inherit; letter-spacing: -0.01em; color: var(--text); }

a { color: var(--primary); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { color: var(--primary-dark); }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--primary-tint); color: var(--primary-dark); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--panel) 85%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 22px;
  height: 56px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; }
.topbar-brand { display: flex; align-items: center; gap: 9px; color: var(--text); }
.topbar-brand:hover { color: var(--text); }
.topbar-logo {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #8b6ff5);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
  box-shadow: 0 2px 6px var(--primary-glow);
}
.topbar-brand-name { font-weight: 700; font-size: 15px; white-space: nowrap; letter-spacing: -0.01em; }

.topbar-nav { display: flex; align-items: center; gap: 1px; margin-left: 20px; overflow-x: auto; flex: 1; }
.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.topbar-link svg { width: 15px; height: 15px; opacity: 0.8; flex-shrink: 0; }
.topbar-link:hover { background: var(--bg); color: var(--text); }
.topbar-link.active { background: var(--primary-tint); color: var(--primary-dark); font-weight: 600; }
.topbar-link.active svg { opacity: 1; }

.topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.topbar-icon-link {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 15px;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
}
.topbar-icon-link:hover { background: var(--bg); transform: rotate(24deg); }

.topbar-user { position: relative; }
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b6ff5);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; cursor: pointer;
  box-shadow: 0 2px 6px var(--primary-glow);
}
.topbar-user-menu {
  display: none;
  position: absolute; right: 0; top: 42px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; min-width: 175px; box-shadow: var(--shadow-lg);
  flex-direction: column; gap: 8px;
  animation: fadeInUp 0.15s var(--ease);
}
.topbar-user:hover .topbar-user-menu, .topbar-user:focus-within .topbar-user-menu { display: flex; }
.topbar-user-name { font-weight: 700; font-size: 13px; }
.topbar-user-role { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.topbar-user-menu a { font-size: 13px; color: var(--text); }
.topbar-user-menu a:hover { color: var(--primary); }

.main-content { flex: 1; padding: 28px 32px 48px; max-width: 100%; overflow-x: auto; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-xs); animation: fadeInUp 0.25s var(--ease); }
.alert-success { background: var(--success-tint); color: #0d7a45; border: 1px solid #c3ecd7; }
.alert-error { background: var(--danger-tint); color: #b83636; border: 1px solid #f5c9c9; }

/* ---------- Page header ---------- */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; gap: 16px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.page-subtitle { margin: 5px 0 0; color: var(--text-muted); font-size: 13.5px; }

/* ---------- KPIs ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 28px; }
.kpi-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease), border-color 0.2s var(--ease);
  overflow: hidden;
  animation: fadeInUp 0.4s var(--ease) backwards;
}
.kpi-card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, var(--primary), #8b6ff5);
  opacity: 0; transition: opacity 0.2s var(--ease);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.kpi-card:hover::before { opacity: 1; }
.kpi-label { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; font-weight: 500; }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.kpi-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; margin-top: 6px; }
.kpi-trend-up { color: var(--success); }
.kpi-trend-down { color: var(--danger); }

.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px; margin-bottom: 28px; }
.chart-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-xs); transition: box-shadow 0.2s var(--ease); }
.chart-card:hover { box-shadow: var(--shadow-sm); }
.chart-card h3 { margin: 0 0 14px; font-size: 14.5px; font-weight: 700; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow-xs); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.1s var(--ease);
  box-shadow: var(--shadow-xs);
}
.btn:hover { text-decoration: none; background: var(--bg); border-color: var(--text-faint); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-color: var(--primary); color: #fff; box-shadow: 0 2px 10px var(--primary-glow); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-dark), var(--primary-dark)); border-color: var(--primary-dark); box-shadow: 0 4px 16px var(--primary-glow); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #c73e3e; border-color: #c73e3e; }
.btn-sm { padding: 6px 11px; font-size: 12px; }

/* ---------- Tables ---------- */
table.data-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); text-align: left; font-size: 13.5px; }
.data-table th { background: color-mix(in srgb, var(--panel) 96%, var(--text)); color: var(--text-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.12s var(--ease); }
.data-table tbody tr:hover td { background: var(--bg); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: inherit;
  background: var(--panel);
  color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint); }
textarea.form-control { resize: vertical; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--bg); color: var(--text-muted); }
.badge-Won { background: var(--success-tint); color: var(--success); }
.badge-Lost { background: var(--danger-tint); color: var(--danger); }
.badge-active { background: var(--success-tint); color: var(--success); }
.badge-inactive, .badge-disabled { background: var(--bg); color: var(--text-muted); }
.badge-pending, .badge-draft, .badge-sending { background: var(--warning-tint); color: var(--warning); }
.badge-done, .badge-completed, .badge-sent { background: var(--success-tint); color: var(--success); }
.badge-failed { background: var(--danger-tint); color: var(--danger); }

/* ---------- Contact Stage badges (LeadSquared stage set) ---------- */
.badge-NewLead { background: var(--info-tint); color: var(--info); }
.badge-NotConnected { background: var(--bg); color: var(--text-muted); }
.badge-Prospects { background: var(--primary-tint); color: var(--primary-dark); }
.badge-CallBack { background: var(--warning-tint); color: var(--warning); }
.badge-MayBeLater { background: var(--warning-tint); color: var(--warning); }
.badge-HotProspects { background: var(--danger-tint); color: var(--danger); }
.badge-Commitments { background: var(--primary-tint); color: var(--primary-dark); }
.badge-Active { background: var(--success-tint); color: var(--success); }
.badge-Closed { background: var(--bg); color: var(--text-muted); }
.badge-JunkInvalid { background: var(--danger-tint); color: var(--danger); }
.badge-Unqualified { background: var(--danger-tint); color: var(--danger); }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }

.empty-state { padding: 48px 20px; text-align: center; color: var(--text-muted); font-size: 13.5px; }

/* ---------- Leads list layout ---------- */
.lsq-shell { display: flex; gap: 20px; align-items: flex-start; }
.lsq-sidebar {
  width: 224px;
  flex-shrink: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: sticky;
  top: 76px;
  box-shadow: var(--shadow-xs);
}
.lsq-sidebar-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; letter-spacing: 0.05em; }
.lsq-view-list { display: flex; flex-direction: column; gap: 2px; }
.lsq-view-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text); font-weight: 500; transition: background 0.15s var(--ease); }
.lsq-view-link:hover { background: var(--bg); }
.lsq-view-link.active { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 2px 8px var(--primary-glow); }
.lsq-view-count { font-size: 11.5px; font-weight: 700; color: var(--text-muted); background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.lsq-view-link.active .lsq-view-count { color: #fff; background: rgba(255,255,255,0.22); }
.lsq-quickadd { display: flex; flex-direction: column; gap: 8px; }
.lsq-quickadd .form-control { padding: 7px 10px; font-size: 13px; }
.lsq-main { flex: 1; min-width: 0; }

.lsq-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.lsq-toolbar .form-control { width: auto; padding: 8px 10px; font-size: 13px; }
.lsq-toolbar .lsq-search { flex: 1; min-width: 220px; }

.lsq-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-xs); }
.lsq-table { border-radius: 0; font-size: 13px; }
.lsq-table th { white-space: nowrap; position: sticky; top: 0; }
.lsq-table td { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.lsq-table .lsq-notes { white-space: normal; max-width: 260px; color: var(--text-muted); }

.lsq-pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; gap: 10px; }
.lsq-pagination-nav { display: flex; align-items: center; gap: 10px; }
.btn.disabled { pointer-events: none; opacity: 0.4; }

@media (max-width: 900px) {
  .lsq-shell { flex-direction: column; }
  .lsq-sidebar { width: 100%; position: static; }
}

/* ---------- Legacy detail header (unused now but kept safe) ---------- */
.lsq-detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.lsq-detail-identity { display: flex; gap: 14px; align-items: center; }
.lsq-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b6ff5); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.lsq-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lsq-detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .lsq-detail-grid { grid-template-columns: 1fr; } }

.lsq-callform { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.lsq-callform .form-control { width: auto; flex: 1; min-width: 160px; }

/* ---------- Timeline ---------- */
.lsq-timeline { position: relative; padding-left: 18px; }
.lsq-timeline-item { position: relative; padding-bottom: 20px; border-left: 2px solid var(--border); padding-left: 18px; margin-left: 4px; }
.lsq-timeline-item:last-child { border-left-color: transparent; }
.lsq-timeline-dot { position: absolute; left: -7px; top: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid var(--panel); box-shadow: 0 0 0 1px var(--border); }
.lsq-timeline-call .lsq-timeline-dot { background: var(--success); }
.lsq-timeline-system .lsq-timeline-dot, .lsq-timeline-status_change .lsq-timeline-dot { background: var(--text-faint); }
.lsq-timeline-meta { font-size: 11.5px; color: var(--text-muted); margin-bottom: 3px; font-weight: 500; }

.lsq-field { margin-bottom: 12px; font-size: 13px; }
.lsq-field label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; letter-spacing: 0.03em; }

/* ---------- Funnel ---------- */
.lsq-funnel { display: flex; flex-direction: column; gap: 12px; }
.lsq-funnel-row { display: grid; grid-template-columns: 110px 1fr 50px; align-items: center; gap: 12px; }
.lsq-funnel-label { font-size: 13px; font-weight: 600; }
.lsq-funnel-bar-track { background: var(--bg); border-radius: 999px; height: 10px; overflow: hidden; }
.lsq-funnel-bar { height: 100%; border-radius: 999px; min-width: 4px; background: linear-gradient(90deg, var(--primary), #8b6ff5); }
.lsq-funnel-count { font-size: 13px; color: var(--text-muted); text-align: right; font-weight: 600; }

/* ---------- New UI / Old UI switch (login page) ---------- */
.ui-switch {
  position: fixed; top: 18px; right: 18px; z-index: 50;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 7px; border-radius: 999px;
  background: rgba(15,12,35,0.82);
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}
.ui-switch:hover { background: rgba(15,12,35,0.95); color: #fff; transform: translateY(-1px); }
.ui-switch-track { width: 34px; height: 18px; border-radius: 999px; background: rgba(255,255,255,0.28); position: relative; flex-shrink: 0; }
.ui-switch-thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.25s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,0.3); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 20% 20%, var(--primary-tint) 0%, var(--bg) 55%); }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.login-card h1 { font-size: 19px; font-weight: 700; margin: 0 0 22px; text-align: center; }

/* ---------- Login (split-panel) ---------- */
.login-split { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
@media (max-width: 860px) { .login-split { grid-template-columns: 1fr; } .login-split-brand { display: none; } }
.login-split-brand {
  position: relative;
  background: linear-gradient(155deg, var(--primary) 0%, #4633b0 100%);
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px;
  overflow: hidden;
}
.login-split-brand::before {
  content: "";
  position: absolute; inset: -20%;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.14) 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(255,255,255,0.10) 0%, transparent 40%);
  pointer-events: none;
}
.login-split-brand-top { position: relative; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; }
.login-split-logo {
  width: 34px; height: 34px; border-radius: 9px; background: rgba(255,255,255,0.16);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
  border: 1px solid rgba(255,255,255,0.25);
}
.login-split-headline { position: relative; font-size: 32px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; max-width: 420px; }
.login-split-sub { position: relative; font-size: 14.5px; color: rgba(255,255,255,0.78); margin-top: 14px; max-width: 380px; line-height: 1.6; }
.login-split-stats { position: relative; display: flex; gap: 28px; margin-top: 36px; }
.login-split-stat-value { font-size: 22px; font-weight: 800; }
.login-split-stat-label { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.login-split-foot { position: relative; font-size: 12px; color: rgba(255,255,255,0.55); }

.login-split-form-wrap { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-split-form { width: 100%; max-width: 360px; }
.login-split-form h1 { font-size: 22px; font-weight: 800; margin: 0 0 6px; letter-spacing: -0.02em; }
.login-split-form p.login-split-form-sub { color: var(--text-muted); font-size: 13.5px; margin: 0 0 28px; }

/* ---------- Contact detail (3-panel) ---------- */
.cd-breadcrumb { font-size: 12.5px; color: var(--text-muted); margin-bottom: 18px; }
.cd-breadcrumb a { color: var(--text-muted); font-weight: 500; }
.cd-breadcrumb a:hover { color: var(--primary); }

.cd-layout { display: grid; grid-template-columns: 264px 1fr 300px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .cd-layout { grid-template-columns: 1fr; } }

.cd-left { text-align: center; position: sticky; top: 76px; }
.cd-avatar-lg {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--primary), #8b6ff5); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.cd-name { margin: 0 0 8px; font-size: 17px; font-weight: 700; }

.cd-quick-actions { display: flex; justify-content: center; gap: 4px; margin: 18px 0; flex-wrap: wrap; }
.cd-action {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--text-muted); padding: 9px 5px; border-radius: var(--radius-sm); width: 58px;
  font-weight: 500; transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.cd-action svg { width: 18px; height: 18px; }
.cd-action:hover { background: var(--primary-tint); color: var(--primary-dark); }

.cd-contactinfo { font-size: 13px; color: var(--text); border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; text-align: left; }
.cd-contactinfo div { margin-bottom: 5px; font-weight: 500; }

.cd-properties { text-align: left; border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.cd-properties-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px; letter-spacing: 0.05em; }
.cd-prop { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; margin-bottom: 10px; }
.cd-prop label { color: var(--text-muted); font-weight: 500; }
.cd-prop span { text-align: right; font-weight: 600; }

.cd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.cd-tab { padding: 10px 15px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color 0.15s var(--ease); }
.cd-tab:hover { color: var(--text); }
.cd-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }
.cd-tab-badge { background: var(--danger); color: #fff; font-size: 10px; border-radius: 999px; padding: 1px 6px; margin-left: 4px; }

.cd-section { margin-bottom: 16px; }

.cd-right { position: sticky; top: 76px; }
.cd-notes-header { margin-bottom: 14px; }
.cd-note { border-top: 1px solid var(--border); padding: 12px 0; font-size: 13px; }
.cd-note-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }

.cd-stats { display: flex; justify-content: space-around; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 6px; }
.cd-stat { display: flex; flex-direction: column; align-items: center; }
.cd-stat-value { font-size: 17px; font-weight: 800; }
.cd-stat-label { font-size: 9.5px; color: var(--text-muted); text-transform: uppercase; font-weight: 600; letter-spacing: 0.03em; }

.cd-month-header { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; margin: 16px 0 10px; letter-spacing: 0.04em; }

.cd-fb-group { margin-bottom: 16px; }
.cd-fb-label { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.cd-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-right: 22px; font-weight: 500; }
.cd-fb-group-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin: 20px 0 12px; letter-spacing: 0.04em; }

/* ---------- Reports funnel bars use icons — ensure svg inline icons scale nicely ---------- */
.icon { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; flex-shrink: 0; }

.bulk-bar {
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--primary-tint);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  flex-wrap: wrap;
}
.bulk-bar.visible { display: flex; }
.bulk-bar select.form-control { width: auto; padding: 6px 10px; font-size: 12.5px; }

.score-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.score-hot { background: var(--danger-tint); color: var(--danger); }
.score-warm { background: var(--warning-tint); color: var(--warning); }
.score-cold { background: var(--bg); color: var(--text-muted); }

.task-due-overdue { color: var(--danger); font-weight: 700; }
.task-due-today { color: var(--warning); font-weight: 700; }

/* ---------- Motion ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.kpi-row .kpi-card:nth-child(1) { animation-delay: 0.02s; }
.kpi-row .kpi-card:nth-child(2) { animation-delay: 0.06s; }
.kpi-row .kpi-card:nth-child(3) { animation-delay: 0.10s; }
.kpi-row .kpi-card:nth-child(4) { animation-delay: 0.14s; }
.kpi-row .kpi-card:nth-child(5) { animation-delay: 0.18s; }
.kpi-row .kpi-card:nth-child(6) { animation-delay: 0.22s; }
.kpi-row .kpi-card:nth-child(7) { animation-delay: 0.26s; }

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