/* ============================================================
   Digi CRM — Modern SaaS admin (TailAdmin-inspired)
   Sky-blue primary · Outfit + Work Sans · data-dense dashboard
   Pure handwritten CSS. No build step. No FOUC.
   ============================================================ */

/* ── Fonts ─────────────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Work+Sans:wght@300;400;500;600;700&display=swap");

/* ── Tokens ────────────────────────────────────────────────── */
:root {
  --font-sans: "Work Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Outfit", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Work Sans", ui-sans-serif, system-ui, sans-serif;

  /* Bright sky-blue primary (Tailwind sky scale) */
  --brand-50: #f0f9ff;
  --brand-100: #e0f2fe;
  --brand-200: #bae6fd;
  --brand-300: #7dd3fc;
  --brand-400: #38bdf8;
  --brand-500: #0ea5e9;
  --brand-600: #0284c7;
  --brand-700: #0369a1;
  --brand-800: #075985;
  --brand-900: #0c4a6e;
  --brand-rgb: 14, 165, 233;

  /* Neutral slate scale (TailAdmin gray) */
  --ink-50: #f8fafc;
  --ink-100: #f1f5f9;
  --ink-200: #e2e8f0;
  --ink-300: #cbd5e1;
  --ink-400: #94a3b8;
  --ink-500: #64748b;
  --ink-600: #475569;
  --ink-700: #334155;
  --ink-800: #1e293b;
  --ink-900: #0f172a;

  --emerald-50: #ecfdf5;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;
  --amber-50: #fffbeb;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-200: #fecaca;
  --red-300: #fca5a5;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-700: #b91c1c;

  --shadow-card: 0 1px 3px rgba(16, 24, 40, 0.04), 0 1px 2px rgba(16, 24, 40, 0.03);
  --shadow-pop: 0 4px 14px -3px rgba(16, 24, 40, 0.12), 0 2px 6px -2px rgba(16, 24, 40, 0.06);
  --shadow-brand: 0 6px 18px -6px rgba(2, 132, 199, 0.40), 0 2px 4px rgba(2, 132, 199, 0.18);
  --shadow-modal: 0 24px 64px -16px rgba(16, 24, 40, 0.30), 0 8px 20px -8px rgba(16, 24, 40, 0.14);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
}

/* ── Reset & base ──────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-800);
  background: var(--ink-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* Display/heading typeface (Outfit) — distinct geometric voice */
h1, h2, h3, h4,
.brand, .brand-name,
.topbar h1, .card-title, .stat-value,
.modal-header h2, .login-title, .login-name,
.section-title {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--ink-400);
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes overlayIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes meshFlow {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(40px, -30px) scale(1.08);
  }

  66% {
    transform: translate(-25px, 30px) scale(0.95);
  }
}

@keyframes pulseDot {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell {
  display: flex;
  flex-direction: row;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: var(--ink-50);
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  width: 260px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--ink-200);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .22s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 16px 15px;
  border-bottom: 1px solid var(--ink-100);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.brand,
.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--ink-900);
  white-space: nowrap;
}

.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--ink-200);
  background: #fff;
  color: var(--ink-500);
  transition: background-color .15s, color .15s, border-color .15s;
}

.sidebar-toggle:hover {
  background: var(--ink-50);
  color: var(--ink-800);
  border-color: var(--ink-300);
}

.sidebar-toggle-icon {
  width: 16px;
  height: 16px;
  transition: transform .22s ease;
}

.industry,
.industry-name {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-400);
}

/* Footer user block */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 12px 0;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
}

.sidebar-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand-50);
  color: var(--brand-600);
}

.sidebar-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-user-avatar svg {
  width: 18px;
  height: 18px;
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-sub {
  font-size: 9.5px;
  margin-top: 1px;
}

/* Breathing room above the first menu item (Dashboard) */
.nav-section + .nav-item {
  margin-top: 6px;
}

/* ── Collapsed rail (desktop only) ─────────────────────────── */
@media (min-width: 768px) {
  .app-shell.sidebar-collapsed .sidebar {
    width: 74px;
    overflow: visible; /* let hover tooltips escape the rail */
  }
  .app-shell.sidebar-collapsed .sidebar-logo {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  .app-shell.sidebar-collapsed .sidebar-brand {
    gap: 0;
    justify-content: center;
  }
  .app-shell.sidebar-collapsed .brand-name,
  .app-shell.sidebar-collapsed .nav-section,
  .app-shell.sidebar-collapsed .sidebar-user-meta {
    display: none;
  }
  .app-shell.sidebar-collapsed .nav-section + .nav-item {
    margin-top: 12px;
  }
  .app-shell.sidebar-collapsed .nav-item,
  .app-shell.sidebar-collapsed .logout-btn {
    justify-content: center;
    gap: 0;
    margin-left: 12px;
    margin-right: 12px;
    margin-bottom: 8px;
    padding-left: 0;
    padding-right: 0;
  }
  .app-shell.sidebar-collapsed .nav-item.active::before {
    display: none;
  }
  .app-shell.sidebar-collapsed .sidebar-user {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
  }
  .app-shell.sidebar-collapsed .sidebar-plan-card {
    display: none !important;
  }

  /* Hover tooltip — custom div built from the existing label span */
  .app-shell.sidebar-collapsed .nav-item span,
  .app-shell.sidebar-collapsed .logout-btn span {
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--ink-900);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .12s ease;
    box-shadow: var(--shadow-pop);
    z-index: 60;
  }
  .app-shell.sidebar-collapsed .nav-item:hover span,
  .app-shell.sidebar-collapsed .logout-btn:hover span {
    opacity: 1;
    visibility: visible;
  }
}

/* The header toggle is desktop-only (mobile uses the bottom tab bar).
   Use a higher-specificity selector so it wins over the base rule below. */
@media (max-width: 767px) {
  .topbar .topbar-toggle {
    display: none !important;
  }
}

.nav-section {
  padding: 16px 20px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-400);
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 10px 4px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-600);
  cursor: pointer;
  user-select: none;
  transition: background-color .15s ease, color .15s ease;
}

.nav-item:hover {
  background: var(--ink-50);
  color: var(--ink-900);
}

.nav-item.active {
  background: var(--brand-50);
  color: var(--brand-700);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -2.5px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  background: var(--brand-600);
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: .75;
}

.nav-item.active .nav-icon {
  opacity: 1;
  color: var(--brand-600);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 0;
  border-top: 1px solid var(--ink-100);
}

/* Plan / upgrade card (shown above Lead Finder for non-superadmin roles) */
.sidebar-plan-card {
  margin: 0 10px 14px;
  padding: 12px 13px 13px;
  border-radius: 12px;
  background: linear-gradient(165deg, var(--brand-50) 0%, #fff 100%);
  border: 1px solid var(--brand-100, var(--ink-100));
}

.sidebar-plan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-plan-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-400);
}

.sidebar-plan-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-700);
  background: var(--brand-100, var(--brand-50));
  padding: 2px 7px;
  border-radius: 999px;
}

.sidebar-plan-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-900);
  margin-top: 5px;
}

.sidebar-plan-expiry {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
  line-height: 1.4;
}

.sidebar-plan-upgrade-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: var(--brand-600);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}

.sidebar-plan-upgrade-btn:hover {
  background: var(--brand-700, var(--brand-600));
}

.sidebar-plan-upgrade-btn:active {
  transform: translateY(1px);
}

/* Upgrade Plan page */
.upgrade-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.upgrade-plan-card {
  border: 1px solid var(--ink-100, #eef2f7);
  border-radius: 14px;
  padding: 20px;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.upgrade-plan-card.is-current {
  border-color: var(--brand-500, #635bff);
  box-shadow: 0 0 0 1px var(--brand-500, #635bff);
}

.upgrade-plan-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.upgrade-plan-price {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.upgrade-plan-price span {
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-500, #697386);
}

.upgrade-plan-meta {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  flex: 1;
}

.upgrade-plan-meta li {
  position: relative;
  padding: 4px 0 4px 20px;
  font-size: 13.5px;
  color: var(--ink-600, #425466);
}

.upgrade-plan-meta li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--brand-500, #635bff);
  font-weight: 700;
}

.logout-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 10px 4px;
  width: calc(100% - 20px);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--red-600);
  background: transparent;
  border: 0;
  transition: color .15s ease, background-color .15s ease;
}

.logout-btn:hover {
  color: var(--red-700);
  background: var(--red-50);
}

/* ── Main column ───────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: var(--ink-50);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 64px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--ink-100);
  flex-shrink: 0;
}

.topbar h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Centered global search: equal-grow left/right groups push the search to the middle */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
  justify-content: flex-end;
}

/* Sidebar collapse/expand control, lives in the header (left of the title) */
.topbar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--ink-200);
  background: #fff;
  color: var(--ink-600);
  transition: background-color .15s, color .15s, border-color .15s;
}

.topbar-toggle:hover {
  background: var(--ink-50);
  color: var(--ink-900);
  border-color: var(--ink-300);
}

.topbar-toggle-icon {
  width: 20px;
  height: 20px;
}

.search-wrap {
  position: relative;
  flex: 0 1 540px;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-400);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border-radius: 10px;
  border: 1px solid var(--ink-200);
  background: var(--ink-50);
  font-size: 14px;
  color: var(--ink-900);
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}

.search-input:focus {
  outline: none;
  background: #fff;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--brand-100);
}

/* Global search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  max-height: min(64vh, 460px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  z-index: 50;
  padding: 6px;
}
.search-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-400);
  padding: 8px 10px 4px;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.search-item:hover,
.search-item.active {
  background: var(--brand-50);
}
.search-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 8px;
}
.search-item-icon svg { width: 16px; height: 16px; }
.search-item-icon.si-contact { background: var(--brand-50); color: var(--brand-600); }
.search-item-icon.si-deal { background: var(--amber-50); color: var(--amber-600); }
.search-item-icon.si-task { background: var(--emerald-50); color: var(--emerald-600); }
.search-item-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.search-item-title { font-size: 13px; font-weight: 600; color: var(--ink-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-sub { font-size: 11.5px; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-400);
}
.search-empty {
  padding: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-400);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: fadeUp .4s ease both;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  border-radius: 16px;
  border: 1px solid var(--ink-100);
  background: #fff;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink-900);
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink-100);
}

.card-header .card-title {
  margin-bottom: 0;
}

/* ── Stat cards ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--ink-100);
  background: #fff;
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-pop);
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 100% 0%, rgba(var(--brand-rgb), 0.05), transparent 50%);
}

.stat-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-500);
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}

.stat-value.blue {
  color: var(--brand-600);
}

.stat-value.green {
  color: var(--emerald-600);
}

.stat-value.amber {
  color: var(--amber-600);
}

.stat-value.red {
  color: var(--red-600);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--ink-200);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink-900);
  transition: transform .12s ease, background-color .15s, border-color .15s, box-shadow .15s, opacity .15s;
}

.btn:hover {
  background: var(--ink-50);
  border-color: var(--ink-300);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--brand-100);
}

.btn:disabled {
  opacity: .6;
  cursor: wait;
}

.btn-icon-svg {
  width: 16px;
  height: 16px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  border-color: transparent;
  color: #fff;
  background: var(--brand-600);
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  border-color: transparent;
  background: var(--brand-700);
  box-shadow: 0 10px 24px -8px rgba(2, 132, 199, 0.50);
}

.btn-danger {
  border-color: var(--red-200);
  color: var(--red-600);
  background: #fff;
}

.btn-danger:hover {
  background: var(--red-50);
  border-color: var(--red-300);
  color: var(--red-700);
}

.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin .7s linear infinite;
}

.btn-loading-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn.is-loading,
.logout-btn.is-loading {
  pointer-events: none;
}

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap,
.users-table-wrap {
  border-radius: 16px;
  border: 1px solid var(--ink-100);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.users-table-wrap {
  border-radius: 12px;
  box-shadow: none;
}

.table-wrap table,
.users-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-wrap th,
.users-table-wrap th {
  padding: 12px 20px;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-500);
  background: rgba(246, 249, 252, 0.7);
  border-bottom: 1px solid var(--ink-100);
  white-space: nowrap;
}

.table-wrap td,
.users-table-wrap td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--ink-100);
  color: var(--ink-900);
  font-size: 14px;
  vertical-align: middle;
}

.table-wrap tbody tr,
.users-table-wrap tbody tr {
  cursor: pointer;
  transition: background-color .12s ease;
}

.table-wrap tbody tr:hover td,
.users-table-wrap tbody tr:hover td {
  background: rgba(246, 249, 252, 0.6);
}

.table-wrap tbody tr:last-child td,
.users-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.table-wrap td:first-child {
  font-weight: 600;
  color: var(--ink-900);
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .9;
}

.badge-blue {
  background: var(--brand-50);
  color: var(--brand-700);
}

.badge-green {
  background: var(--emerald-50);
  color: var(--emerald-700);
}

.badge-amber {
  background: var(--amber-50);
  color: var(--amber-700);
}

.badge-red {
  background: var(--red-50);
  color: var(--red-700);
}

.badge-gray {
  background: var(--ink-100);
  color: var(--ink-700);
}

/* ── Avatars ───────────────────────────────────────────────── */
.avatar,
.avatar-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  background-image: linear-gradient(135deg, var(--brand-500), var(--brand-700));
}

.avatar {
  width: 32px;
  height: 32px;
  font-size: 11px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 20px;
  box-shadow: 0 8px 24px -8px rgba(var(--brand-rgb), 0.4);
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-700);
  margin-bottom: 6px;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--ink-200);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-900);
  transition: border-color .15s, box-shadow .15s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--brand-100);
}

.form-row textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.55;
}

.form-row select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.phone-input-group {
  display: flex;
  gap: 8px;
}
.phone-input-group input#cf-phone {
  flex: 1 1 auto;
}

/* Custom country-code dropdown (closed control shows only the dial code) */
.phone-cc {
  position: relative;
  flex: 0 0 auto;
}
.phone-cc-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
}
.phone-cc-btn:hover {
  border-color: var(--ink-300);
}
.phone-cc-caret {
  width: 14px;
  height: 14px;
  color: var(--ink-400);
}
.phone-cc-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  width: 260px;
  max-width: 70vw;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 8px;
}
.phone-cc-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 6px;
}
.phone-cc-search:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-100);
}
.phone-cc-options {
  max-height: 230px;
  overflow-y: auto;
}
.phone-cc-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.phone-cc-option:hover {
  background: var(--brand-50);
}
.phone-cc-option-name {
  color: var(--ink-800);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-cc-option-dial {
  color: var(--ink-500);
  font-weight: 600;
  flex-shrink: 0;
}

/* List page toolbar (count + filters/actions) */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.list-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.count-pill {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
  white-space: nowrap;
}

/* List pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}
.pagination:empty {
  display: none;
}
.pagination-info {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-500);
  white-space: nowrap;
}
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-900);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.form-hint {
  font-size: 12px;
  color: var(--ink-500);
  margin-top: 6px;
  line-height: 1.55;
}

/* ── Pipeline (Kanban) ─────────────────────────────────────── */
.pipeline-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(248px, 1fr);
  grid-auto-rows: 1fr;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  height: calc(100dvh - 210px);
  min-height: 360px;
  padding-bottom: 10px;
  scroll-padding-inline: 8px;
  align-items: stretch;
}

.pipeline-col {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--ink-200);
  background: var(--ink-50);
  min-width: 0;
  height: 100%;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}

/* ── Minimalist scrollbars ─────────────────────────────────── */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.18) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.18);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, 0.32);
  background-clip: padding-box;
  border: 2px solid transparent;
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

.pipeline-col.drag-over {
  border-color: var(--brand-400);
  box-shadow: inset 0 0 0 2px var(--brand-400);
}
.pipeline-col.drag-over .pipeline-col-body {
  background: var(--brand-50);
}

.pipeline-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  padding: 13px 14px;
  border-bottom: 1px solid var(--ink-200);
  background: #fff;
  border-radius: 16px 16px 0 0;
}

.pipeline-col-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-800);
}
.pipeline-col-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-300);
  flex-shrink: 0;
}

.pipeline-col-count {
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--ink-100);
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-600);
  font-variant-numeric: tabular-nums;
}

.pipeline-col-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 12px 2px;
  transition: background-color .15s;
}

.pipeline-empty {
  font-size: 12px;
  color: var(--ink-400);
  text-align: center;
  padding: 18px 0;
}

.pipeline-col-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 11px 14px;
  border-top: 1px solid var(--ink-200);
  background: #fff;
  border-radius: 0 0 16px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-600);
  font-variant-numeric: tabular-nums;
}
.pipeline-col-total span:last-child {
  color: var(--brand-700);
}

/* Stage accent dots (match the deal-card stage colours) */
.pipeline-col[data-stage-key="new"] .stage-dot { background: #9ca3af; }
.pipeline-col[data-stage-key="qualified"] .stage-dot { background: #3b82f6; }
.pipeline-col[data-stage-key="proposal"] .stage-dot { background: #8b5cf6; }
.pipeline-col[data-stage-key="negotiation"] .stage-dot { background: #eab308; }
.pipeline-col[data-stage-key="closed-won"] .stage-dot { background: #22c55e; }
.pipeline-col[data-stage-key="closed-lost"] .stage-dot { background: #ef4444; }

.deal-card {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--ink-100);
  background: #fff;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: move;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(10, 37, 64, 0.04);
  overflow: hidden;
}

.deal-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: #9ca3af;
  opacity: .9;
}

.deal-card[data-stage-key="new"]::before          { background: #9ca3af; }
.deal-card[data-stage-key="qualified"]::before    { background: #3b82f6; }
.deal-card[data-stage-key="proposal"]::before     { background: #8b5cf6; }
.deal-card[data-stage-key="negotiation"]::before  { background: #eab308; }
.deal-card[data-stage-key="closed-won"]::before   { background: #22c55e; }
.deal-card[data-stage-key="closed-lost"]::before  { background: #ef4444; }

.deal-card:hover {
  border-color: var(--brand-300);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -8px rgba(var(--brand-rgb), 0.28), 0 2px 4px rgba(16, 24, 40, 0.05);
}

.deal-card.dragging {
  opacity: .5;
  transform: rotate(-2deg);
  box-shadow: 0 18px 36px -10px rgba(10, 37, 64, 0.30);
  cursor: move;
}

/* Members can't drag deals they don't own */
.deal-card-locked {
  cursor: pointer;
}
.deal-card-locked:hover {
  transform: none;
}

.deal-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.deal-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--ink-900);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-value {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--brand-600);
  font-variant-numeric: tabular-nums;
}

.deal-contact {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-500);
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-contact svg {
  flex-shrink: 0;
  color: var(--ink-400);
}

.deal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--ink-100);
}

.deal-pic {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.deal-pic-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.deal-pic-name {
  font-size: 11.5px;
  color: var(--ink-600);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}

.deal-pic-unassigned {
  font-size: 11.5px;
  color: var(--ink-400);
  font-style: italic;
}

.deal-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.deal-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--ink-50, #f3f4f6);
  color: var(--ink-600, #4b5563);
  font-size: 10.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.deal-chip svg {
  width: 11px;
  height: 11px;
}

.deal-chip.deal-chip-attach {
  background: rgba(var(--brand-rgb), 0.10);
  color: var(--brand-700);
}

.deal-meta {
  font-size: 11px;
  color: var(--ink-500);
}

/* ── Tasks ─────────────────────────────────────────────────── */
.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-100);
}

.task-row:last-child {
  border-bottom: 0;
}

.task-cb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--ink-300);
  background: #fff;
  margin-top: 2px;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}

.task-cb:hover {
  border-color: var(--brand-500);
}

.task-cb.done {
  background: var(--brand-600);
  border-color: var(--brand-600);
}

.task-cb.done::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='3.5,8 6.5,11 12.5,5'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 76%;
}

.task-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-900);
}

.task-text.done {
  color: var(--ink-400);
  text-decoration: line-through;
  text-decoration-color: var(--ink-300);
}

.task-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 3px;
}

.task-contact {
  font-size: 11px;
  color: var(--ink-500);
}

.task-owner {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.task-due {
  flex-shrink: 0;
  align-self: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ink-100);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-600);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.task-due.overdue {
  color: var(--red-700);
  background: var(--red-50);
}

/* Tasks header / toolbar */
.tasks-header {
  flex-wrap: wrap;
}
.tasks-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tasks-toolbar .filter-search,
.tasks-toolbar #task-filter,
.tasks-toolbar .btn {
  height: 36px;
}
.tasks-toolbar .filter-search {
  min-width: 200px;
}

/* Task rows */
.task-row {
  margin: 0 -10px;
  padding: 12px 10px;
  border-radius: 10px;
  transition: background-color .12s;
}
.task-row:hover {
  background: var(--ink-50);
}

.task-del {
  flex-shrink: 0;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--ink-400);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .12s, color .12s;
}
.task-del:hover {
  background: var(--red-50);
  color: var(--red-600);
}

@media (max-width: 767px) {
  .tasks-header {
    flex-direction: column;
    align-items: stretch;
  }
  .tasks-toolbar {
    width: 100%;
  }
  .tasks-toolbar .filter-search {
    flex: 1 1 100%;
    min-width: 0;
  }
  .tasks-toolbar #task-filter {
    flex: 1 1 auto;
  }
  .tasks-toolbar [data-export],
  .tasks-toolbar #add-task-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .task-del {
    width: 36px;
    height: 36px;
  }
}

#task-filter {
  padding: 6px 32px 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--ink-200);
  background: #fff;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink-900);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}

#task-filter:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--brand-100);
}

/* ── Activity feed ─────────────────────────────────────────── */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-100);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-500);
  margin-top: 6px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--brand-50);
}

.activity-dot.green {
  background: var(--emerald-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.activity-dot.amber {
  background: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.activity-dot.red {
  background: var(--red-500);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.activity-text {
  flex: 1;
  font-size: 14px;
  color: var(--ink-900);
  line-height: 1.45;
}

.activity-time {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-400);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.activity-main {
  flex: 1;
  min-width: 0;
}

.activity-actor {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-500);
}

/* Clickable feed rows (deep-link to the item) */
.activity-item.clickable {
  cursor: pointer;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  border-radius: 8px;
  transition: background-color .12s;
}
.activity-item.clickable:hover {
  background: var(--ink-50);
}
#dashboard-tasks .task-row.clickable {
  cursor: pointer;
}

.empty {
  text-align: center;
  padding: 48px 0;
  color: var(--ink-400);
  font-size: 14px;
  font-style: italic;
}

/* ── Contact detail ────────────────────────────────────────── */
.dashboard-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 1024px) {
  .dashboard-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-detail {
  display: none;
}

.contact-detail.open {
  display: block;
  animation: fadeUp .35s ease both;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 0;
  background: transparent;
  border: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-600);
  transition: color .15s;
}

.back-btn:hover {
  color: var(--brand-700);
}

.contact-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ink-100);
}

.contact-header-info {
  flex: 1;
}

.contact-header-info .cn {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.012em;
  color: var(--ink-900);
}

.contact-header-info .cc {
  margin-top: 4px;
  font-size: 14px;
  color: var(--ink-500);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px 24px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .detail-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.detail-field label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-500);
}

.detail-field span {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-900);
}

.notes-box {
  border-radius: 12px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  padding: 16px;
  font-size: 14px;
  color: var(--ink-700);
  min-height: 60px;
  line-height: 1.55;
}

/* ── Admin ─────────────────────────────────────────────────── */
.admin-section {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--ink-100);
}

.admin-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

/* ── Avatar upload ─────────────────────────────────────────── */
.avatar-upload-wrap {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 8px;
}

.avatar-upload-preview {
  flex-shrink: 0;
}

.avatar-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  padding-top: 4px;
}

#avatar-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

#avatar-file-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-section-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink-900);
  margin-bottom: 4px;
}

.admin-section>p {
  font-size: 13px;
  color: var(--ink-500);
  margin-bottom: 16px;
  line-height: 1.55;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--ink-200);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-700);
  transition: border-color .15s;
}

.tag:hover {
  border-color: var(--ink-300);
}

.tag[draggable="true"] {
  cursor: move;
}
.tag.tag-dragging {
  opacity: .5;
  cursor: move;
}
.tag.tag-drop-target {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px var(--brand-100);
}

.tag-remove {
  background: transparent;
  border: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1;
  color: var(--ink-400);
  cursor: pointer;
  transition: color .15s;
}

.tag-remove:hover {
  color: var(--red-500);
}

.tag-input-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.tag-input-row input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--ink-200);
  background: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--ink-900);
  transition: border-color .15s, box-shadow .15s;
}

.tag-input-row input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--brand-100);
}

/* ── Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 37, 64, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.open {
  display: flex;
  animation: overlayIn .18s ease-out both;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid var(--ink-100);
  background: #fff;
  padding: 28px;
  box-shadow: var(--shadow-modal);
  animation: modalIn .22s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.modal-lg {
  max-width: 1080px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--ink-100);
}

.modal-header h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.014em;
  color: var(--ink-900);
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1;
  color: var(--ink-400);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s, color .15s;
}

.modal-close:hover {
  background: var(--ink-100);
  color: var(--ink-700);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 16px;
  margin-top: 8px;
  border-top: 1px solid var(--ink-100);
}

/* ── Top progress bar ──────────────────────────────────────── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--brand-500);
  background-image: linear-gradient(90deg, var(--brand-400), var(--brand-500) 50%, var(--brand-600));
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .2s ease-out, opacity .25s ease;
  pointer-events: none;
  z-index: 10000;
  opacity: 0;
  box-shadow: 0 0 8px rgba(var(--brand-rgb), 0.55), 0 0 2px rgba(var(--brand-rgb), 0.4);
}

.progress-bar.active {
  opacity: 1;
}

.progress-bar.done {
  opacity: 0;
  transition: transform .2s ease-out, opacity .35s ease .1s;
}

/* ── Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  max-width: 384px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--ink-700);
  background: var(--ink-900);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 18px 40px -12px rgba(10, 37, 64, 0.50);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--brand-500);
  border-radius: 0 3px 3px 0;
}

/* ── Login error ───────────────────────────────────────────── */
.login-error {
  display: none;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--red-200);
  background: var(--red-50);
  font-size: 14px;
  font-weight: 500;
  color: var(--red-700);
  margin-bottom: 16px;
}

/* ============================================================
   LOGIN / REGISTER PAGES
   ============================================================ */
.login-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
}

.login-page.scrollable {
  overflow-y: auto;
  padding: 40px 0;
}

.login-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: #fff;
}

.mesh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .5;
  pointer-events: none;
  animation: meshFlow 22s ease-in-out infinite;
  will-change: transform;
}

.mesh-blob.b1 {
  width: 520px;
  height: 520px;
  background: var(--brand-300);
  top: -128px;
  right: -96px;
}

.mesh-blob.b2 {
  width: 420px;
  height: 420px;
  background: #a5f3fc;
  top: 33%;
  left: -128px;
  animation-delay: -7s;
}

.mesh-blob.b3 {
  width: 460px;
  height: 460px;
  background: #bae6fd;
  bottom: -96px;
  right: 25%;
  animation-delay: -14s;
}

.mesh-blob.b4 {
  width: 300px;
  height: 300px;
  background: #e0f2fe;
  top: 40px;
  left: 33%;
  opacity: .35;
  animation-delay: -3s;
}

.login-dotgrid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image: radial-gradient(rgba(10, 37, 64, 0.10) 1px, transparent 1px);
  background-size: 24px 24px;
}

.login-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.8));
}

.login-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 448px;
  padding: 0 24px;
  animation: fadeUp .6s ease both;
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-bottom: 20px;
  background-image: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-600) 100%);
  box-shadow: var(--shadow-brand);
}

.login-mark svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

.login-logo {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto 14px;
}

.sidebar-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 6px;
}

.login-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

.login-tag {
  margin-top: 6px;
  font-size: 14px;
  color: var(--ink-500);
}

.login-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--ink-100);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 28px;
  box-shadow: 0 30px 80px -20px rgba(10, 37, 64, 0.18), 0 8px 20px -8px rgba(10, 37, 64, 0.08);
}

.login-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--ink-900);
  margin-bottom: 14px;
}

.login-sub {
  font-size: 14px;
  color: var(--ink-500);
  margin-bottom: 24px;
}

.login-divider {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--ink-100);
  text-align: center;
  font-size: 14px;
  color: var(--ink-500);
}

.login-divider a {
  font-weight: 600;
  color: var(--brand-600);
  transition: color .15s;
}

.login-divider a:hover {
  color: var(--brand-700);
}

.login-trust {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-400);
}

.login-trust .dot {
  display: inline-flex;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald-500);
  animation: pulseDot 2.4s ease-in-out infinite;
}

/* Slug preview on register */
.slug-preview {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-500);
  letter-spacing: 0.02em;
  min-height: 16px;
}

.slug-preview:not(:empty)::before {
  content: '→ ';
  color: var(--brand-600);
}

/* ============================================================
   UTILITY CLASSES
   ── Used inline in markup. Small surface area, no Tailwind.
   ============================================================ */
.flex {
  display: flex;
}

.inline-flex {
  display: inline-flex;
}

.grid {
  display: grid;
}

.block {
  display: block;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.items-baseline {
  align-items: baseline;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 {
  gap: 4px;
}

.gap-1\.5 {
  gap: 6px;
}

.gap-2 {
  gap: 8px;
}

.gap-2\.5 {
  gap: 10px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.gap-5 {
  gap: 20px;
}

.w-full {
  width: 100%;
}

.min-w-0 {
  min-width: 0;
}

.max-w-md {
  max-width: 448px;
}

.max-w-sm {
  max-width: 384px;
}

.size-3\.5 {
  width: 14px;
  height: 14px;
}

.size-4 {
  width: 16px;
  height: 16px;
}

.size-5 {
  width: 20px;
  height: 20px;
}

.size-6 {
  width: 24px;
  height: 24px;
}

.size-7 {
  width: 28px;
  height: 28px;
}

.size-8 {
  width: 32px;
  height: 32px;
}

.size-12 {
  width: 48px;
  height: 48px;
}

.size-16 {
  width: 64px;
  height: 64px;
}

.size-40 {
  width: 160px;
  height: 160px;
}

.text-white {
  color: #fff;
}

.text-ink-400 {
  color: var(--ink-400);
}

.text-ink-500 {
  color: var(--ink-500);
}

.text-ink-600 {
  color: var(--ink-600);
}

.text-ink-700 {
  color: var(--ink-700);
}

.text-ink-900 {
  color: var(--ink-900);
}

.text-brand-600 {
  color: var(--brand-600);
}

.text-amber-600 {
  color: var(--amber-600);
}

.text-red-600 {
  color: var(--red-600);
}

.bg-white {
  background-color: #fff;
}

.bg-brand-50 {
  background-color: var(--brand-50);
}

.bg-ink-50 {
  background-color: var(--ink-50);
}

.bg-ink-100 {
  background-color: var(--ink-100);
}

.bg-amber-50 {
  background-color: var(--amber-50);
}

.bg-red-50 {
  background-color: var(--red-50);
}

.text-xs {
  font-size: 12px;
}

.text-sm {
  font-size: 14px;
}

.text-base {
  font-size: 16px;
}

.text-xl {
  font-size: 20px;
}

.text-2xl {
  font-size: 24px;
}

.text-\[10px\] {
  font-size: 10px;
}

.text-\[10\.5px\] {
  font-size: 10.5px;
}

.text-\[11px\] {
  font-size: 11px;
}

.text-\[12px\] {
  font-size: 12px;
}

.text-\[12\.5px\] {
  font-size: 12.5px;
}

.text-\[13\.5px\] {
  font-size: 13.5px;
}

.text-\[15px\] {
  font-size: 15px;
}

.text-\[17px\] {
  font-size: 17px;
}

.text-\[28px\] {
  font-size: 28px;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.tracking-tight {
  letter-spacing: -0.012em;
}

.tracking-wide {
  letter-spacing: 0.04em;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.font-sans {
  font-family: var(--font-sans);
}

.font-mono {
  font-family: var(--font-mono);
}

.antialiased {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.rounded-md {
  border-radius: 6px;
}

.rounded-lg {
  border-radius: 8px;
}

.rounded-xl {
  border-radius: 12px;
}

.rounded-2xl {
  border-radius: 16px;
}

.rounded-full {
  border-radius: 999px;
}

.border {
  border: 1px solid var(--ink-200);
}

.border-ink-100 {
  border-color: var(--ink-100);
}

.border-ink-200 {
  border-color: var(--ink-200);
}

.cursor-pointer {
  cursor: pointer;
}

.select-none {
  user-select: none;
}

.pointer-events-none {
  pointer-events: none;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-y-auto {
  overflow-y: auto;
}

.overflow-x-auto {
  overflow-x: auto;
}

.opacity-30 {
  opacity: .3;
}

.opacity-100 {
  opacity: 1;
}

.transition {
  transition: all .15s ease;
}

.transition-colors {
  transition: background-color .15s, color .15s, border-color .15s;
}

.shadow-lg {
  box-shadow: 0 10px 30px -8px rgba(10, 37, 64, 0.18);
}

.backdrop-blur-xl {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* margins */
.m-0 {
  margin: 0;
}

.mt-0\.5 {
  margin-top: 2px;
}

.mt-1 {
  margin-top: 4px;
}

.mt-1\.5 {
  margin-top: 6px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.mt-5 {
  margin-top: 20px;
}

.mt-6 {
  margin-top: 24px;
}

.mt-auto {
  margin-top: auto;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-1\.5 {
  margin-bottom: 6px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-5 {
  margin-bottom: 20px;
}

.mb-6 {
  margin-bottom: 24px;
}

.mb-7 {
  margin-bottom: 28px;
}

.mb-8 {
  margin-bottom: 32px;
}

.ml-auto {
  margin-left: auto;
}

.\!mb-0 {
  margin-bottom: 0 !important;
}

.\!mt-5 {
  margin-top: 20px !important;
}

/* paddings */
.p-1 {
  padding: 4px;
}

.p-3 {
  padding: 12px;
}

.p-4 {
  padding: 16px;
}

.p-5 {
  padding: 20px;
}

.p-6 {
  padding: 24px;
}

.p-7 {
  padding: 28px;
}

.px-4 {
  padding-left: 16px;
  padding-right: 16px;
}

.px-6 {
  padding-left: 24px;
  padding-right: 24px;
}

.py-12 {
  padding-top: 48px;
  padding-bottom: 48px;
}

.pt-3 {
  padding-top: 12px;
}

.pt-4 {
  padding-top: 16px;
}

.pt-5 {
  padding-top: 20px;
}

.pb-3 {
  padding-bottom: 12px;
}

.pb-4 {
  padding-bottom: 16px;
}

.pb-5 {
  padding-bottom: 20px;
}

/* misc positional shortcuts used in markup */
.inset-0 {
  inset: 0;
}

.-z-10 {
  z-index: -10;
}

.z-10 {
  z-index: 10;
}

.-right-10 {
  right: -40px;
}

.-top-10 {
  top: -40px;
}

.space-y-3\.5>*+* {
  margin-top: 14px;
}

/* fade-up animation utility */
.anim-fade-up {
  animation: fadeUp .6s ease both;
}

.mobile-only { display: none; }

/* ============================================================
   RESPONSIVE — mobile sidebar becomes bottom tab bar
   ============================================================ */
@media (max-width: 767px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    width: 100%;
    height: 64px;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-around;
    padding: 4px;
    border-right: 0;
    border-top: 1px solid var(--ink-100);
    box-shadow: 0 -8px 24px -8px rgba(10, 37, 64, 0.10);
    z-index: 30;
    overflow: hidden;
  }

  .sidebar-logo,
  .sidebar-footer,
  .nav-section {
    display: none;
  }

  .mobile-only {
    display: flex;
  }

  div.mobile-only {
    display: block;
  }

  .nav-item {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0 2px;
    padding: 4px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .nav-item.active::before {
    display: none;
  }

  .nav-item.active {
    background: var(--brand-50);
    color: var(--brand-700);
  }

  .nav-icon {
    width: 20px;
    height: 20px;
    opacity: 1;
  }

  .main {
    padding-bottom: 64px;
  }

  .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    height: auto;
    padding: 12px 16px;
  }

  .topbar-left {
    flex: 1 1 auto;
    min-width: 0;
    order: 1;
  }

  .topbar-right {
    flex: 0 0 auto;
    order: 2;
  }

  .topbar h1 {
    font-size: 16px;
  }

  .notif-wrap {
    position: relative;
    top: unset;
    right: unset;
  }

  .search-wrap {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }

  .search-input {
    width: 100%;
  }

  #add-contact-btn {
    white-space: nowrap;
  }

  /* Superadmin topbar: only 2 items (h1 + button), flex is cleaner than grid */
  #sa-console .topbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  #sa-console .topbar h1 {
    flex: 1;
    grid-column: unset;
  }

  #sa-new-company-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .content {
    padding: 16px 16px 20px;
  }

  .table-wrap,
  .users-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
  }

  .table-wrap table,
  .users-table-wrap table {
    min-width: 520px;
  }

  .table-wrap th,
  .users-table-wrap th,
  .table-wrap td,
  .users-table-wrap td {
    padding: 12px 14px;
    white-space: nowrap;
  }

  .pipeline-board {
    margin-inline: -16px;
    padding: 0 16px 10px;
    grid-auto-columns: 84vw;
    height: calc(100dvh - 200px);
    scroll-snap-type: x mandatory;
  }
  .pipeline-col {
    scroll-snap-align: start;
  }

  .modal-overlay {
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    max-height: 92dvh;
  }

  .modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    flex-wrap: wrap;
  }
}

/* ============================================================
   PASSWORD TOGGLE
   ============================================================ */
.pw-wrap {
  position: relative;
}

.pw-wrap input {
  width: 100%;
  padding-right: 42px;
}

.pw-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ink-400);
  transition: color .15s;
}

.pw-toggle:hover {
  color: var(--ink-700);
}

.pw-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* ============================================================
   NOTIFICATION BELL & DROPDOWN
   ============================================================ */
.notif-wrap {
  position: relative;
}

.notif-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-500);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.notif-bell:hover {
  background: var(--ink-50);
  color: var(--ink-900);
  border-color: var(--ink-300);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red-600);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  z-index: 100;
  overflow: hidden;
}

.notif-dropdown.open {
  display: block;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ink-100);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
}

.notif-mark-all {
  padding: 0;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-600);
  cursor: pointer;
}

.notif-mark-all:hover {
  color: var(--brand-700);
}

.notif-list {
  overflow-y: auto;
  max-height: 320px;
}

.notif-item {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ink-100);
  cursor: pointer;
  transition: background .12s;
}

.notif-item:hover {
  background: var(--ink-50);
}

.notif-item.unread {
  background: var(--brand-50);
}

.notif-item.unread:hover {
  background: var(--brand-100);
}

.notif-item:last-child {
  border-bottom: none;
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-500);
  flex-shrink: 0;
  margin-top: 5px;
}

.notif-dot.read {
  background: var(--ink-300);
}

.notif-body {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 2px;
}

.notif-msg {
  font-size: 12px;
  color: var(--ink-500);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-item.expanded .notif-msg {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
}

.notif-time {
  font-size: 11px;
  color: var(--ink-400);
  flex-shrink: 0;
  margin-top: 2px;
}

.notif-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-400);
}

.notif-footer {
  border-top: 1px solid var(--ink-100);
  padding: 10px 16px;
}

.notif-view-all {
  display: block;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-600);
  cursor: pointer;
  text-align: center;
  transition: background .12s;
}

.notif-view-all:hover {
  background: var(--brand-50);
  color: var(--brand-700);
}

/* ============================================================
   USER AVATAR
   ============================================================ */
.user-avatar-sm {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}


/* ── Filter Controls ────────────────────────────────────────── */
.filter-select {
  height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--ink-200, #e2e8f0);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--ink-900, #1a1a2e);
  cursor: pointer;
  min-width: 120px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

/* Toolbar controls share one height so the dropdown and CSV button align */
.list-toolbar-actions .filter-select,
.list-toolbar-actions .btn {
  height: 36px;
}

.filter-search {
  padding: 5px 10px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font-size: 12px;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #1a1a2e);
  min-width: 140px;
}

.filter-select:focus,
.filter-search:focus {
  outline: none;
  border-color: var(--brand-500, #635bff);
  box-shadow: 0 0 0 2px var(--brand-100, #ede9fe);
}

/* ── Deal change history (compact) ───────────────────────────── */
.deal-history {
  border: 1px solid var(--ink-100, #eef0f4);
  border-radius: 8px;
  background: #fafbfc;
}
.deal-history > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700, #344054);
  user-select: none;
}
.deal-history > summary::-webkit-details-marker { display: none; }
.deal-history > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  color: var(--text-tertiary, #94a3b8);
  transition: transform .15s;
}
.deal-history[open] > summary::before { transform: rotate(90deg); }
.deal-history-count {
  color: var(--text-tertiary, #94a3b8);
  font-weight: 500;
}
.deal-history-list {
  max-height: 180px;
  overflow-y: auto;
  padding: 4px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.deal-history-item {
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-600, #475467);
  padding-left: 12px;
  border-left: 2px solid var(--ink-100, #eef0f4);
}
.deal-history-item .dh-actor {
  font-weight: 600;
  color: var(--ink-800, #1a2233);
}
.deal-history-item .dh-time {
  color: var(--text-tertiary, #94a3b8);
  font-size: 11px;
}
.deal-history-empty {
  font-size: 12px;
  color: var(--text-tertiary, #94a3b8);
  padding: 4px 0;
}

/* ── Deal comments (threaded + mentions) ─────────────────────── */
.comments-empty {
  font-size: 13px;
  color: var(--text-tertiary, #94a3b8);
  padding: 10px 0;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.comment {
  display: flex;
  gap: 10px;
}

.comment-avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-100, #ede9fe);
  color: var(--brand-600, #5048e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
}
.comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-body-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.comment-bubble {
  background: #f6f7f9;
  border: 1px solid var(--ink-100, #eef0f4);
  border-radius: 10px;
  padding: 8px 12px;
}

.comment-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-800, #1a2233);
}
.comment-time {
  font-size: 11px;
  color: var(--text-tertiary, #94a3b8);
}
.comment-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-700, #344054);
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-mention {
  color: var(--brand-600, #5048e5);
  background: var(--brand-100, #ede9fe);
  border-radius: 4px;
  padding: 0 3px;
  font-weight: 500;
}

.comment-actions {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  padding-left: 4px;
}
.comment-action {
  background: none;
  border: 0;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary, #94a3b8);
  cursor: pointer;
}
.comment-action:hover {
  color: var(--brand-600, #5048e5);
}
.comment-action.comment-action-danger:hover {
  color: var(--red-500, #ef4444);
}

.comment-children {
  margin-top: 12px;
  padding-left: 16px;
  border-left: 2px solid var(--ink-100, #eef0f4);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-composer {
  border-top: 1px solid var(--ink-100, #eef0f4);
  padding-top: 12px;
}
.comment-reply-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  background: var(--brand-100, #ede9fe);
  border-radius: 6px;
  padding: 4px 10px;
  margin-bottom: 8px;
}
.comment-reply-indicator button {
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  font-size: 13px;
  line-height: 1;
}

.comment-input-wrap {
  position: relative;
}
.comment-input-wrap textarea {
  width: 100%;
  resize: vertical;
  min-height: 44px;
}

.comment-composer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.mention-dropdown {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: calc(100% + 4px);
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--ink-200, #e2e8f0);
  border-radius: 8px;
  box-shadow: 0 8px 24px -8px rgba(10, 37, 64, 0.25);
}
.mention-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.mention-option:hover,
.mention-option.active {
  background: var(--brand-100, #ede9fe);
}
.mention-option .mention-opt-name {
  font-weight: 500;
  color: var(--ink-800, #1a2233);
}
.mention-option .mention-opt-email {
  font-size: 11px;
  color: var(--text-tertiary, #94a3b8);
}

/* ============================================================
   ACCESSIBILITY — focus visibility & reduced motion
   (ui-ux-pro-max: HIGH priority)
   ============================================================ */

/* Visible focus ring for keyboard users on all interactive elements */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
.nav-item:focus-visible,
.deal-card:focus-visible,
.table-wrap tbody tr:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 6px;
}
/* Inputs already paint their own ring; avoid doubling up */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: 0;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .mesh-blob { animation: none !important; }
}

/* ════════════════════════════════════════════════════════════════
   LEAD FINDER (Apollo-style)
   ════════════════════════════════════════════════════════════════ */
.lf {
  display: flex;
  flex-direction: column;
  gap: 14px;
  --lf-head-h: 52px;   /* shared height: filter header == results tab bar */
}

/* ── Toolbar ─────────────────────────────────────────────────── */
.lf-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lf-search {
  position: relative;
  flex: 1;
  max-width: 520px;
}
.lf-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-400);
  pointer-events: none;
}
.lf-search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 36px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  background: #fff;
  font-size: 13.5px;
  color: var(--ink-800);
  transition: border-color .15s, box-shadow .15s;
}
.lf-search-input:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12);
}
.lf-credits {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #6d28d9, #a855f7);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: 0 6px 18px -6px rgba(109, 40, 217, 0.45), 0 2px 4px rgba(109, 40, 217, 0.20);
  white-space: nowrap;
}
.lf-credits svg { width: 16px; height: 16px; }
.lf-credits-label { font-weight: 500; opacity: 0.85; font-size: 12.5px; }

/* ── Body: filters + results ─────────────────────────────────── */
.lf-body {
  display: grid;
  grid-template-columns: 224px 1fr;
  gap: 16px;
  align-items: start;
}

/* Filters */
.lf-filters {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  padding: 0 0 6px;
  box-shadow: var(--shadow-card);
}
.lf-filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--lf-head-h);
  padding: 0 16px;
  border-bottom: 1px solid var(--ink-100);
  flex-shrink: 0;
  background: #fff;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}
.lf-filters-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-800);
}
.lf-clear {
  background: none;
  border: none;
  color: var(--brand-600);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.lf-clear:hover { color: var(--brand-700); text-decoration: underline; }
.lf-fgroup { border-bottom: 1px solid var(--ink-100); }
.lf-fgroup:last-child { border-bottom: none; }
.lf-fgroup-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
}
.lf-fgroup-head:hover { color: var(--ink-900); }
.lf-chevron { width: 16px; height: 16px; color: var(--ink-400); transition: transform .18s; }
.lf-fgroup.collapsed .lf-chevron { transform: rotate(-90deg); }
.lf-fgroup-body { padding: 2px 16px 12px; }
.lf-fgroup.collapsed .lf-fgroup-body { display: none; }
.lf-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--ink-600);
  cursor: pointer;
}
.lf-check:hover { color: var(--ink-900); }
.lf-check input { accent-color: var(--brand-600); width: 14px; height: 14px; cursor: pointer; }
.lf-check .lf-check-count { margin-left: auto; color: var(--ink-400); font-size: 11.5px; }
.lf-kw-input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--ink-800);
}
.lf-kw-input:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.12); }

/* Results */
.lf-results {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.lf-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--lf-head-h);
  padding: 0 16px;
  border-bottom: 1px solid var(--ink-100);
}
.lf-tablist { display: flex; gap: 4px; }
.lf-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
}
.lf-tab:hover { background: var(--ink-50); color: var(--ink-800); }
.lf-tab.active { background: var(--brand-50); color: var(--brand-700); }
.lf-tab-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--ink-100);
  color: var(--ink-600);
  padding: 1px 7px;
  border-radius: 999px;
}
.lf-tab.active .lf-tab-count { background: var(--brand-100); color: var(--brand-700); }
.lf-showing { font-size: 12px; color: var(--ink-500); }

/* Chips */
.lf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px;
}
.lf-chips:not(:empty) { padding: 10px 16px; border-bottom: 1px solid var(--ink-100); }
.lf-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px 3px 10px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--brand-700);
}
.lf-chip button {
  display: inline-flex;
  border: none;
  background: none;
  color: var(--brand-600);
  cursor: pointer;
  padding: 2px;
  border-radius: 999px;
  line-height: 0;
}
.lf-chip button:hover { background: var(--brand-100); }
.lf-chip svg { width: 12px; height: 12px; }

/* Table */
.lf-table-wrap { overflow: auto; }
.lf-table { width: 100%; min-width: 1100px; border-collapse: collapse; }
.lf-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-500);
  background: var(--ink-50);
  border-bottom: 1px solid var(--ink-200);
  white-space: nowrap;
}
.lf-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ink-100);
  font-size: 13px;
  color: var(--ink-700);
  vertical-align: middle;
}
.lf-table tbody tr:hover td { background: var(--brand-50); }
.lf-col-num { text-align: right; }
.lf-table td.lf-col-num { text-align: right; font-variant-numeric: tabular-nums; }
.lf-col-action { width: 120px; }
.lf-table input[type="checkbox"] { accent-color: var(--brand-600); width: 15px; height: 15px; cursor: pointer; }

/* Roomier columns */
.lf-col-industry { min-width: 160px; }
.lf-col-segs { min-width: 280px; }
.lf-col-location { min-width: 140px; }
.lf-col-links { min-width: 150px; }
.lf-col-contacts { min-width: 110px; text-align: center; }
.lf-contacts-count { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-700); }
.lf-btn-view {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 18px; border: 1px solid var(--brand-200);
  background: var(--brand-50); color: var(--brand-700);
  border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; cursor: pointer;
}
.lf-btn-view:hover { background: var(--brand-100); border-color: var(--brand-300); }
.lf-detail-empty { padding: 28px; text-align: center; color: var(--ink-500); font-size: 14px; }
.lf-co-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.lf-fact {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; background: var(--ink-50); border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm); font-size: 12.5px; color: var(--ink-700);
}
.lf-fact-k { font-weight: 700; color: var(--ink-500); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }

/* Frozen left column: Company stays put on horizontal scroll */
.lf-table th.lf-col-company,
.lf-table td.lf-col-company {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
  min-width: 240px;
  box-shadow: 1px 0 0 var(--ink-200);    /* divider between frozen & scrolling area */
}
/* Frozen right column: Action stays pinned to the right */
.lf-table th.lf-col-action,
.lf-table td.lf-col-action {
  position: sticky;
  right: 0;
  z-index: 1;
  background: #fff;
  box-shadow: -1px 0 0 var(--ink-200);   /* divider on its left edge */
}
/* Keep frozen cells opaque (not see-through) on row hover */
.lf-table tbody tr:hover td.lf-col-company,
.lf-table tbody tr:hover td.lf-col-action { background: var(--brand-50); }
/* Header cells must paint above the frozen body column */
.lf-table thead th.lf-col-company,
.lf-table thead th.lf-col-action { background: var(--ink-50); z-index: 3; }

/* Market segment pills */
.lf-segs { display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px; }
.lf-seg {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink-100);
  color: var(--ink-600);
  white-space: nowrap;
}

.lf-company { display: flex; align-items: center; gap: 10px; }
.lf-logo {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}
.lf-company-meta { min-width: 0; }
.lf-company-name {
  display: inline-block;
  max-width: 100%;
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--ink-300);
  text-underline-offset: 2px;
}
.lf-company-name:hover { color: var(--brand-600); text-decoration-color: var(--brand-400); }
.lf-company-domain { font-size: 11.5px; color: var(--ink-400); }

/* Links column */
.lf-links { display: flex; align-items: center; gap: 9px; }
.lf-link { display: inline-flex; color: var(--ink-400); transition: color .15s; }
.lf-link:hover { color: var(--brand-600); }
.lf-link svg { width: 16px; height: 16px; display: block; }
/* LinkedIn & Facebook glyphs have built-in padding — nudge them up a touch. */
.lf-link-linkedin svg,
.lf-link-facebook svg { width: 18px; height: 18px; }
.lf-dash { color: var(--ink-300); }
.lf-contact-name { font-weight: 600; color: var(--ink-800); }
.lf-contact-title { font-size: 11.5px; color: var(--ink-500); }

.lf-masked {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-400);
  font-family: var(--font-mono, ui-monospace, monospace);
  letter-spacing: 0.06em;
  font-size: 12px;
}
.lf-masked svg { width: 13px; height: 13px; }
.lf-email { color: var(--brand-600); font-weight: 500; }
.lf-phone { color: var(--ink-600); }

/* Action buttons in rows */
.lf-btn-unlock,
.lf-btn-add,
.lf-btn-incrm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.lf-btn-unlock { background: var(--brand-600); color: #fff; }
.lf-btn-unlock:hover { background: var(--brand-700); }
.lf-btn-unlock svg { width: 13px; height: 13px; }
.lf-btn-unlock:disabled { background: var(--ink-200); color: var(--ink-400); cursor: not-allowed; }
.lf-btn-add { background: #fff; border-color: var(--brand-300); color: var(--brand-700); }
.lf-btn-add:hover { background: var(--brand-50); }
.lf-btn-incrm { background: var(--emerald-50); color: var(--emerald-700); cursor: default; }
.lf-btn-incrm svg { width: 14px; height: 14px; }

/* Empty + footer */
.lf-empty { padding: 56px 20px; text-align: center; color: var(--ink-500); font-size: 13.5px; }
.lf-empty strong { display: block; color: var(--ink-700); font-size: 15px; margin-bottom: 4px; }
.lf-footer { padding: 12px 16px; border-top: 1px solid var(--ink-100); }

/* Bulk bar */
.lf-bulkbar {
  position: sticky;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  background: var(--ink-900);
  color: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
}
.lf-bulk-count { font-size: 13px; font-weight: 600; }
.lf-bulk-actions { display: flex; gap: 8px; }

/* ── Company detail view ───────────────────────────────────────── */
.lf-detail { flex-direction: column; overflow-y: auto; }
.lf-detail-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}
.lf-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-600);
  font-size: 13px;
  font-weight: 600;
  padding: 2px 0;
}
.lf-back:hover { color: var(--brand-600); }
.lf-back svg { width: 16px; height: 16px; }

.lf-co-card {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.lf-co-logo {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
}
.lf-co-main { min-width: 0; }
.lf-co-name { font-family: var(--font-display, inherit); font-size: 20px; font-weight: 700; color: var(--ink-900); line-height: 1.2; }
.lf-co-domain { display: inline-block; margin-top: 2px; font-size: 13px; color: var(--brand-600); font-weight: 500; }
.lf-co-domain:hover { text-decoration: underline; }
.lf-co-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lf-co-tag { font-size: 12px; color: var(--ink-600); background: var(--ink-100); padding: 3px 10px; border-radius: 999px; }
.lf-co-segs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.lf-co-links { display: flex; gap: 13px; margin-top: 14px; }
.lf-co-links .lf-link svg { width: 18px; height: 18px; }
.lf-co-desc { margin-top: 16px; font-size: 13px; line-height: 1.65; color: var(--ink-600); max-width: 760px; }
.lf-co-updated { margin-top: 10px; font-size: 12px; color: var(--ink-400); }

.lf-people-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-800);
}
.lf-people-sub { font-size: 12px; font-weight: 500; color: var(--ink-500); }
.lf-people { display: flex; flex-direction: column; gap: 10px; }

.lf-person {
  display: grid;
  grid-template-columns: 42px minmax(0, 1.1fr) minmax(0, 1.5fr) 160px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s, background .15s;
  scroll-margin: 20px;
}
.lf-person.highlight {
  border-color: var(--brand-400);
  background: var(--brand-50);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.15);
}
.lf-person-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.lf-person-info { min-width: 0; }
.lf-person-name { font-weight: 600; color: var(--ink-900); }
.lf-person-title { font-size: 12px; color: var(--ink-500); }
.lf-person-contact { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; min-width: 0; }

/* Clickable person name inside the results table */
.lf-person-link { cursor: pointer; }
.lf-person-link:hover { color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 860px) {
  .lf-co-card { flex-direction: column; }
  .lf-person { grid-template-columns: 42px 1fr; }
  .lf-person-contact,
  .lf-person-action { grid-column: 1 / -1; }
}

/* ── Independent scroll: filter column + results table each scroll
   on their own (desktop), instead of the whole page body. ───────── */
@media (min-width: 861px) {
  #panel-leads.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }
  .lf { flex: 1; min-height: 0; }
  .lf-toolbar { flex-shrink: 0; }
  .lf-body { flex: 1; min-height: 0; align-items: stretch; }

  /* Header stays put; only the groups below it scroll. */
  .lf-filters { max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
  .lf-filters-scroll { flex: 1; min-height: 0; overflow-y: auto; }

  .lf-results {
    display: flex;
    flex-direction: column;
    max-height: 100%;
    min-height: 0;
  }
  .lf-tabs, .lf-chips, .lf-footer { flex-shrink: 0; }
  .lf-table-wrap { flex: 1; min-height: 0; }

  /* Keep the column headers pinned while the table body scrolls. */
  .lf-table thead th { position: sticky; top: 0; z-index: 2; }

  /* Company detail scrolls on its own, like the list view. */
  .lf-detail { flex: 1; min-height: 0; }
}

/* ── Minimalist scrollbars for the two scroll regions ──────────── */
.lf-filters-scroll,
.lf-table-wrap,
.lf-detail {
  scrollbar-width: thin;                       /* Firefox */
  scrollbar-color: var(--ink-200) transparent; /* thumb / track */
}
.lf-filters-scroll::-webkit-scrollbar,
.lf-table-wrap::-webkit-scrollbar,
.lf-detail::-webkit-scrollbar { width: 8px; height: 8px; }
.lf-filters-scroll::-webkit-scrollbar-track,
.lf-table-wrap::-webkit-scrollbar-track,
.lf-detail::-webkit-scrollbar-track { background: transparent; }
.lf-filters-scroll::-webkit-scrollbar-thumb,
.lf-table-wrap::-webkit-scrollbar-thumb,
.lf-detail::-webkit-scrollbar-thumb {
  background: var(--ink-200);
  border-radius: 999px;
  border: 2px solid transparent;   /* inset padding → slim thumb */
  background-clip: padding-box;
}
.lf-filters-scroll:hover::-webkit-scrollbar-thumb,
.lf-table-wrap:hover::-webkit-scrollbar-thumb,
.lf-detail:hover::-webkit-scrollbar-thumb {
  background: var(--ink-300);
  background-clip: padding-box;
}
.lf-filters-scroll::-webkit-scrollbar-thumb:hover,
.lf-table-wrap::-webkit-scrollbar-thumb:hover,
.lf-detail::-webkit-scrollbar-thumb:hover {
  background: var(--ink-400);
  background-clip: padding-box;
}

/* Mobile: stack filters above results, use the normal page scroll. */
@media (max-width: 860px) {
  .lf-body { grid-template-columns: 1fr; }
}

/* ============================================================
   Growth OS components (Phase 0)
   Layout & UX follow the DHC wireframe; colours come from the
   existing tokens (--brand-*, --ink-*, --amber-*, --emerald-*).
   ============================================================ */

/* ── Page header: title + subtitle left, actions right ────── */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink-900);
}
.page-head-sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--ink-500);
}
.page-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
/* Pages with their own header hide the duplicate topbar title. */
.main.has-page-head #panel-title { display: none; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.breadcrumb {
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--ink-500);
}
.breadcrumb a {
  color: var(--brand-700);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.breadcrumb a:hover { color: var(--brand-800); }
.breadcrumb-sep { margin: 0 6px; color: var(--ink-300); }

/* ── KPI row ──────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpi {
  padding: 14px 16px;
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-card);
}
.kpi-label { font-size: 12.5px; color: var(--ink-500); }
.kpi-value {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
.kpi-value.is-warn { color: var(--amber-700); }
.kpi-delta { margin-top: 2px; font-size: 12px; color: var(--ink-500); }
.kpi-delta.up { color: var(--emerald-700); }
.kpi-delta.down { color: var(--red-600); }

/* ── Layout splits ────────────────────────────────────────── */
.split-2-1,
.split-3 {
  display: grid;
  gap: 20px;
  align-items: start;
}
.split-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.split-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); }
@media (max-width: 1023px) {
  .split-2-1,
  .split-3 { grid-template-columns: 1fr; }
}
.detail-panel {
  position: sticky;
  top: 0;
  padding: 20px;
  border: 1px solid var(--ink-100);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
}
.detail-panel-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink-900);
}
.detail-panel-sub { font-size: 13px; color: var(--ink-500); }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack > .btn { justify-content: center; }

/* ── Segmented filter with counts ─────────────────────────── */
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  background: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-700);
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.seg-btn:hover { background: var(--ink-50); }
.seg-btn.is-warn {
  border-color: rgba(245, 158, 11, 0.45);
  background: var(--amber-50);
  color: var(--amber-700);
}
.seg-btn.active,
.seg-btn.active.is-warn {
  border-color: var(--brand-600);
  background: var(--brand-600);
  color: #fff;
}
.seg-count { font-variant-numeric: tabular-nums; opacity: .85; }
.seg-sm .seg-btn { padding: 3px 10px; font-size: 12px; }

/* ── Flat status chip (wireframe tables/kanban: no dot) ───── */
.badge-flat {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.badge-flat::before { display: none; }

/* ── Timeline (time · title · subtitle) ───────────────────── */
.timeline { display: flex; flex-direction: column; }
.timeline-item {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ink-100);
}
.timeline-item:last-child { border-bottom: 0; }
.timeline-time {
  font-size: 12.5px;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}
.timeline-title { font-weight: 600; color: var(--ink-900); }
.timeline-sub { font-size: 13px; color: var(--ink-500); }
.timeline-item.is-next .timeline-title { font-weight: 500; color: var(--ink-500); }

/* ── Inbox / chat ─────────────────────────────────────────── */
.chat-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 280px;
  min-height: 560px;
  border: 1px solid var(--ink-100);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.chat-list { border-right: 1px solid var(--ink-100); overflow-y: auto; }
.chat-list-search { padding: 12px; border-bottom: 1px solid var(--ink-100); }
.chat-row {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--ink-100);
  background: #fff;
  text-align: left;
  font-family: var(--font-sans);
  cursor: pointer;
}
.chat-row:hover { background: var(--ink-50); }
.chat-row.is-warn { background: var(--amber-50); }
.chat-row.active { box-shadow: inset 3px 0 0 var(--brand-600); }
.chat-row-top { display: flex; justify-content: space-between; gap: 8px; }
.chat-row-name { font-weight: 600; color: var(--ink-900); }
.chat-row-time { font-size: 12px; color: var(--ink-500); }
.chat-row-snippet {
  font-size: 13px;
  color: var(--ink-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-row-meta { font-size: 12px; font-weight: 500; color: var(--ink-500); }
.chat-row-meta.is-ai { color: var(--brand-700); }
.chat-row-meta.is-warn { color: var(--amber-700); font-weight: 600; }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ink-100);
}
.chat-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--ink-50);
  overflow-y: auto;
}
.bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}
.bubble-in { align-self: flex-start; border: 1px solid var(--ink-200); background: #fff; }
.bubble-ai,
.bubble-me { align-self: flex-end; background: var(--brand-50); color: var(--ink-900); }
.bubble-me { background: var(--brand-100); }
.bubble-label {
  display: block;
  margin-bottom: 2px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-700);
}
.bubble-meta { display: block; margin-top: 4px; font-size: 12px; color: var(--brand-700); }
.bubble-meta.is-warn { color: var(--amber-700); font-weight: 600; }
.system-note {
  align-self: center;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-50);
  font-size: 12.5px;
  color: var(--amber-700);
}
.chat-composer { padding: 12px 16px; border-top: 1px solid var(--ink-100); }
.chat-composer-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chat-side { padding: 16px; border-left: 1px solid var(--ink-100); }
@media (max-width: 1100px) {
  .chat-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .chat-side { display: none; }
}
@media (max-width: 767px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { border-right: 0; }
}

/* ── Workflow canvas ──────────────────────────────────────── */
.flow-canvas {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--ink-100);
}
.flow-node {
  width: min(340px, 100%);
  padding: 10px 14px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  background: #fff;
}
.flow-node.is-selected { border: 2px solid var(--brand-600); }
.flow-kind {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-500);
}
.flow-title { font-weight: 600; color: var(--ink-900); }
.flow-sub { font-size: 12.5px; color: var(--ink-500); }
.flow-arrow { padding: 6px 0; color: var(--ink-400); text-align: center; }
.flow-branches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  justify-items: center;
}
.flow-branch { display: flex; flex-direction: column; align-items: center; width: 100%; }
.flow-branch-label { padding-bottom: 6px; font-size: 12px; font-weight: 700; }
.flow-branch-label.yes { color: var(--emerald-700); }
.flow-branch-label.no { color: var(--amber-700); }
.flow-palette { display: flex; flex-direction: column; gap: 8px; }
.flow-palette .btn { justify-content: flex-start; }

/* ── Checklist + progress ─────────────────────────────────── */
.checklist-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--ink-100);
  font-size: 14px;
}
.checklist-label { flex: 1; color: var(--ink-800); }
.checklist-row a { font-size: 13px; color: var(--brand-700); text-decoration: underline; }
.progress {
  height: 6px;
  border-radius: 999px;
  background: var(--ink-100);
  overflow: hidden;
}
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--brand-600); }

/* ── Funnel ───────────────────────────────────────────────── */
.funnel-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 12px;
  padding: 5px 0;
  cursor: pointer;
}
.funnel-label { color: var(--ink-800); }
.funnel-track { display: block; height: 28px; border-radius: 6px; background: var(--ink-100); overflow: hidden; }
.funnel-bar { display: block; height: 100%; border-radius: 6px; background: var(--brand-500); }
.funnel-row:hover .funnel-bar { background: var(--brand-600); }
.funnel-num { text-align: right; color: var(--ink-700); font-variant-numeric: tabular-nums; }

/* ── Alert cards ──────────────────────────────────────────── */
.alert-card { padding: 12px 14px; border-radius: var(--radius); }
.alert-card + .alert-card { margin-top: 10px; }
.alert-title { font-weight: 600; color: var(--ink-900); }
.alert-sub { font-size: 13px; color: var(--ink-600); }
.alert-amber { background: var(--amber-50); }
.alert-amber .alert-title { color: var(--amber-700); }
.alert-gray { background: var(--ink-100); }

/* ── Score trio (Low / High / Medium) ─────────────────────── */
.score-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.score-box {
  padding: 8px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  text-align: center;
}
.score-box-value { font-weight: 700; color: var(--ink-900); }
.score-box-label { font-size: 12px; color: var(--ink-500); }

/* ── Media tile (approval creatives) ──────────────────────── */
.media-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  background: var(--ink-100);
  font-size: 13px;
  color: var(--ink-500);
  overflow: hidden;
}
.media-tile img,
.media-tile video { width: 100%; height: 100%; object-fit: cover; }

/* ── "Coming soon" placeholder for unbuilt modules ────────── */
.soon {
  padding: 28px;
  border: 1px dashed var(--ink-300);
  border-radius: 16px;
  background: #fff;
}
.soon-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.soon-title { font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink-900); }
.soon-text { margin: 0 0 12px; font-size: 14px; color: var(--ink-500); }
.soon-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px 24px;
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--ink-700);
}

/* ── Topbar: workspace switcher + avatar ──────────────────── */
.ws-switch { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ws-label { font-size: 13px; color: var(--ink-500); white-space: nowrap; }
/* The centred search box leaves little room on the right: show the
   "Workspace" label only when it fits. */
@media (max-width: 1599px) { .ws-label { display: none; } }
.ws-select { min-width: 180px; }
.topbar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--ink-100);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-700);
  cursor: pointer;
  overflow: hidden;
}
.topbar-avatar:hover { background: var(--ink-200); }
.topbar-avatar img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) {
  .ws-label { display: none; }
  .ws-select { min-width: 0; max-width: 140px; }
}

/* ── Mobile bottom bar: more items → scroll horizontally ──── */
@media (max-width: 767px) {
  .sidebar {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar .nav-item { flex: 0 0 72px; }
}

/* ============================================================
   Phase 1 — Pipeline board (wireframe p.3) + contact detail (p.4)
   ============================================================ */

/* ── Pipeline toolbar + summary ───────────────────────────── */
.kb-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 14px;
}
.kb-field { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-500); }
.kb-field .filter-select { min-width: 200px; }
.kb-search {
  width: 220px;
  padding: 7px 12px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  background: #fff;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink-900);
}
.kb-search:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-100); }
.kb-summary { margin-bottom: 16px; font-size: 13.5px; color: var(--ink-500); }
.kb-summary strong { color: var(--ink-900); font-weight: 600; }
.kb-summary strong.is-warn { color: var(--amber-700); }
.kb-dot { margin: 0 8px; color: var(--ink-300); }

/* ── Board ────────────────────────────────────────────────── */
.kb-board {
  display: flex;
  gap: 14px;
  align-items: stretch;
  padding-bottom: 8px;
  overflow-x: auto;
}
.kb-col {
  display: flex;
  flex-direction: column;
  flex: 0 0 236px;
  min-height: 420px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--ink-100);
  transition: box-shadow .15s ease, background-color .15s ease;
}
.kb-col.drag-over { background: var(--brand-50); box-shadow: inset 0 0 0 2px var(--brand-300); }
.kb-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px 10px;
  font-weight: 600;
  color: var(--ink-900);
}
.kb-col-count { font-size: 12.5px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.kb-col-body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.kb-card {
  padding: 10px 12px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.kb-card:hover { border-color: var(--brand-300); box-shadow: var(--shadow-pop); }
.kb-card:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.kb-card.dragging { opacity: .5; transform: rotate(1deg); }
.kb-card.is-locked { cursor: default; }
.kb-card-title { font-weight: 600; color: var(--ink-900); line-height: 1.3; }
.kb-card-deal { font-size: 12.5px; color: var(--ink-600); }
.kb-card-meta { margin-top: 2px; font-size: 12.5px; color: var(--ink-500); }
.kb-card-chip { margin-top: 8px; }
.kb-card-chip .badge { white-space: normal; line-height: 1.3; }

/* ── Contact detail ───────────────────────────────────────── */
.cd-grid { margin-top: 4px; }
.cd-card { margin-bottom: 0; padding: 20px; }
.cd-side { display: flex; flex-direction: column; gap: 20px; }
.cd-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.cd-card-title { margin: 0 0 12px; font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink-900); }
.cd-card-head .cd-card-title { margin: 0; }
.cd-sub-title { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-900); }
.cd-fields { margin: 0; }
.cd-field { margin-bottom: 10px; }
.cd-field dt { font-size: 12.5px; color: var(--ink-500); }
.cd-field dd { margin: 1px 0 0; color: var(--ink-900); overflow-wrap: anywhere; }
.cd-field dd a { color: var(--brand-700); }
.cd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.cd-tag {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--ink-100);
  font-size: 12.5px;
  color: var(--ink-700);
}
.cd-divider { height: 1px; margin: 14px 0; background: var(--ink-100); }
.cd-compliance { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; color: var(--ink-800); }
.cd-ok { color: var(--emerald-700); }
.cd-bad { color: var(--red-600); }
.cd-muted { color: var(--ink-500); font-size: 13.5px; }
.cd-gap { margin: 8px 0 12px; }
.cd-deal-name { font-weight: 600; color: var(--ink-900); }
.cd-label { display: block; margin: 12px 0 4px; font-size: 12.5px; color: var(--ink-500); }
.cd-select { width: 100%; }
.cd-deal-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cd-other-deals { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ink-100); }
.cd-other-deal { display: block; padding: 3px 0; font-size: 13px; color: var(--brand-700); cursor: pointer; }
.cd-ai-text { margin: 0 0 6px; color: var(--ink-800); }
.cd-note-composer { margin: 8px 0 4px; }
.cd-note-composer textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 13.5px;
  resize: vertical;
}
.cd-note-composer textarea:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-100); }
.cd-note-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* Contact modal: collapsible extra fields */
.cf-more { margin: 4px 0 12px; border: 1px solid var(--ink-100); border-radius: var(--radius); padding: 0 12px; }
.cf-more > summary { padding: 10px 0; font-size: 13.5px; font-weight: 600; color: var(--ink-700); cursor: pointer; }
.cf-more[open] > summary { border-bottom: 1px solid var(--ink-100); margin-bottom: 10px; }

@media (max-width: 767px) {
  .kb-field .filter-select, .kb-search { min-width: 0; width: 100%; }
  .kb-field { flex: 1 1 100%; }
  .kb-col { flex-basis: 78vw; }
}

/* Settings: business hours + extra pipelines */
.bh-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bh-days { display: flex; flex-wrap: wrap; gap: 4px; margin-right: 8px; }
.bh-day { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid var(--ink-200); border-radius: var(--radius-sm); font-size: 12.5px; cursor: pointer; }
.bh-day:has(input:checked) { border-color: var(--brand-300); background: var(--brand-50); color: var(--brand-700); }
.bh-row input[type="time"] { width: auto; }
.pl-extra { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ink-100); }
.pl-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.pl-row, .pl-new { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(200px, 2fr) auto auto auto; gap: 8px; align-items: center; }
.pl-new { grid-template-columns: minmax(140px, 1fr) minmax(200px, 2fr) auto; }
.pl-count { white-space: nowrap; font-size: 12.5px; }
@media (max-width: 767px) { .pl-row, .pl-new { grid-template-columns: 1fr; } }
.pl-row input, .pl-new input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--ink-200);
  border-radius: 8px;
  background: #fff;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--ink-900);
}
.pl-row input:focus, .pl-new input:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-100); }

/* ============================================================
   Phase 2 — Leads: Revenue Leak Assessment (wireframe p.2)
   ============================================================ */
.asmt-table tbody tr { cursor: pointer; }
.asmt-table tbody tr.is-selected td { background: var(--brand-50); }
.asmt-table tbody tr:focus-visible { outline: 2px solid var(--brand-500); outline-offset: -2px; }
.asmt-gap { margin: 14px 0; }
.asmt-leaks { margin: 0 0 8px; padding-left: 18px; color: var(--ink-700); font-size: 14px; }
.asmt-leaks li { margin: 2px 0; }
.asmt-link-btn { display: inline-block; margin: 2px 0 4px; font-size: 13.5px; color: var(--brand-700); text-decoration: underline; cursor: pointer; }
.modal.modal-wide { max-width: 720px; width: 100%; }
.asmt-answers { max-height: 60vh; overflow-y: auto; }
.asmt-area { margin-top: 12px; }
.asmt-answer-list { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 6px 16px; margin: 6px 0 0; font-size: 13.5px; }
.asmt-answer-list dt { color: var(--ink-600); }
.asmt-answer-list dd { margin: 0; color: var(--ink-900); font-weight: 500; }
.asmt-proposal-text { width: 100%; font-family: var(--font-sans); font-size: 13.5px; line-height: 1.55; }
.asmt-check { display: flex !important; align-items: center; gap: 8px; font-weight: 500; }
.asmt-link { font-size: 13px; overflow-wrap: anywhere; }
.asmt-link a { color: var(--brand-700); }
@media (max-width: 767px) { .asmt-answer-list { grid-template-columns: 1fr; } }

/* ============================================================
   Phase 3 — Results dashboard (wireframe p.13)
   ============================================================ */
.rpt-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1279px) { .rpt-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 639px) { .rpt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rpt-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 20px; }
@media (max-width: 1023px) { .rpt-grid { grid-template-columns: 1fr; } }
.rpt-card { margin-bottom: 0; padding: 20px; }
.rpt-note { margin: 10px 0 0; font-size: 12.5px; }
.rpt-sources { margin-bottom: 20px; }
.rpt-spend { margin-bottom: 20px; }
.rpt-spend-form { display: grid; grid-template-columns: 180px 150px 130px minmax(0, 1fr) auto; gap: 8px; margin: 8px 0 14px; }
.rpt-spend-form input {
  padding: 7px 10px; border: 1px solid var(--ink-200); border-radius: 8px; background: #fff;
  font-family: var(--font-sans); font-size: 13.5px; color: var(--ink-900);
}
.rpt-spend-form input:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-100); }
@media (max-width: 767px) { .rpt-spend-form { grid-template-columns: 1fr 1fr; } }
.rpt-step-list { display: flex; flex-direction: column; max-height: 55vh; overflow-y: auto; }
.rpt-step-item { padding: 8px 4px; border-bottom: 1px solid var(--ink-100); color: var(--brand-700); cursor: pointer; }
.rpt-step-item:hover { background: var(--ink-50); }
#rpt-export-url { width: 100%; font-size: 13px; }

/* ============================================================
   Phase 4 — Booking pages + appointments
   ============================================================ */
.bl-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.bl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--ink-100); border-radius: var(--radius); background: #fff; }
.bl-main { flex: 1 1 260px; min-width: 0; }
.bl-main .badge { margin-left: 6px; }
.ap-row { padding: 8px 0; border-bottom: 1px solid var(--ink-100); }
.ap-row:last-child { border-bottom: 0; }
.ap-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ba-days, .ba-times { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.ba-days { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
.ba-days .seg-btn { flex: 0 0 auto; }

/* ============================================================
   Phase 5 — Unified inbox (wireframe p.5) + integrations
   ============================================================ */
.ib-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ib-empty-connect { margin-bottom: 14px; padding: 10px 14px; border-radius: var(--radius); background: var(--brand-50); color: var(--brand-800); font-size: 13.5px; }
.ib-empty-connect a { color: var(--brand-700); text-decoration: underline; cursor: pointer; }
#panel-inbox .chat-layout { height: calc(100vh - 260px); min-height: 520px; }
#panel-inbox .chat-list, #panel-inbox .chat-side { overflow-y: auto; }
.ib-search { width: 100%; }
.ib-unread { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--brand-600); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.ib-mode { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ib-send-row { display: flex; gap: 8px; align-items: flex-end; }
.ib-send-row textarea {
  flex: 1; min-height: 42px; max-height: 160px; padding: 9px 12px; border: 1px solid var(--ink-200); border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 14px; resize: vertical;
}
.ib-send-row textarea:focus { outline: none; border-color: var(--brand-400); box-shadow: 0 0 0 4px var(--brand-100); }
.ib-send-row textarea:disabled { background: var(--ink-50); }
.ib-window-note { margin-bottom: 8px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--amber-50); color: var(--amber-700); font-size: 12.5px; }
.ib-menu-wrap { position: relative; }
.ib-menu {
  position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 40; width: 320px; max-height: 280px; overflow-y: auto;
  padding: 4px; border: 1px solid var(--ink-200); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-pop);
}
.ib-menu-item { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; text-align: left; font-family: var(--font-sans); font-size: 13px; cursor: pointer; }
.ib-menu-item:hover { background: var(--ink-50); }
.ib-menu-item .cd-muted { display: block; font-size: 12px; }
.ib-side-line { margin-top: 4px; font-size: 13px; }
.bubble-me .bubble-meta { color: var(--ink-500); }

.ig-list { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 12px; }
.ig-card { padding: 12px 14px; border: 1px solid var(--ink-100); border-radius: var(--radius); background: #fff; }
.ig-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ig-head .cd-muted { flex-basis: 100%; font-size: 12.5px; }
.ig-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 10px; }
.ig-field span { display: block; margin-bottom: 3px; font-size: 12px; color: var(--ink-500); }
.ig-field input, .ig-import input[type="text"], .tp-new input, .tp-new textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--ink-200); border-radius: 8px; background: #fff; font-family: var(--font-sans); font-size: 13px;
}
.ig-copy { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; }
.ig-copy code { flex: 1; min-width: 0; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--ink-50); overflow-wrap: anywhere; font-size: 12px; }
.ig-error { margin-top: 8px; padding: 6px 10px; border-radius: var(--radius-sm); background: var(--red-50); color: var(--red-700); font-size: 12.5px; }
.ig-last { margin-top: 6px; font-size: 12px; }
.ig-actions { display: flex; gap: 8px; margin-top: 10px; }
.ig-import { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.ig-import input[type="text"] { width: 240px; }
.tp-new { display: grid; grid-template-columns: 1fr 160px 1fr 150px; gap: 8px; }
.tp-new textarea { grid-column: 1 / -2; }
@media (max-width: 767px) { .tp-new { grid-template-columns: 1fr; } .tp-new textarea { grid-column: auto; } #panel-inbox .chat-layout { height: auto; } }

/* ============================================================
   Phase 6 — AI agent setup (wireframe p.8) + Test & review (p.9)
   ============================================================ */
.ag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ag-card { margin-bottom: 0; padding: 18px 20px; }
.ag-note { margin: 8px 0 0; font-size: 12.5px; }
.ag-warn { margin-bottom: 14px; padding: 10px 14px; border-radius: var(--radius); background: var(--amber-50); color: var(--amber-700); font-size: 13.5px; }
.ag-sources { display: flex; flex-direction: column; }
.ag-source { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border: 0; border-bottom: 1px solid var(--ink-100); background: none; text-align: left; font-family: var(--font-sans); font-size: 13.5px; color: var(--ink-900); cursor: pointer; }
.ag-source:hover { color: var(--brand-700); }
.ag-source .cd-muted { font-size: 12.5px; white-space: nowrap; }
.ag-amber { color: var(--amber-700); font-weight: 600; }
.ag-q-table td { padding: 6px 8px; }
.ag-q-table input { width: 100%; padding: 5px 8px; border: 1px solid var(--ink-200); border-radius: 6px; font-family: var(--font-sans); font-size: 13px; }
.ag-inline-num { width: 64px !important; padding: 3px 6px; border: 1px solid var(--ink-200); border-radius: 6px; font-family: var(--font-sans); }
.ag-checks { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.ag-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ag-never { margin: 0 0 10px; padding-left: 18px; font-size: 13.5px; color: var(--ink-700); }
.ag-channels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ag-chip { padding: 4px 10px; border: 1px solid var(--ink-200); border-radius: var(--radius-sm); background: var(--ink-100); font-family: var(--font-sans); font-size: 12.5px; font-weight: 600; color: var(--ink-600); cursor: pointer; }
.ag-chip.on { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand-700); }
.ag-hours { padding: 7px 10px; border: 1px solid var(--ink-200); border-radius: 8px; font-size: 13.5px; }
.ag-hours a { color: var(--brand-700); cursor: pointer; text-decoration: underline; }
#panel-agents .page-head .ag-kpis { margin: 0; flex: 1 1 520px; max-width: 640px; }
.ag-review-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.ag-testchat { display: flex; flex-direction: column; min-height: 520px; }
.ag-thread { min-height: 380px; margin: 0 -20px; border-top: 1px solid var(--ink-100); border-bottom: 1px solid var(--ink-100); }
.ag-thread .bubble-me.ag-cust { align-self: flex-end; background: #fff; border: 1px solid var(--ink-200); }
.ag-thread .bubble-in.ag-ai { align-self: flex-start; border: 0; background: var(--brand-50); }
.ag-test-send { margin-top: 12px; }
.ag-test-send input { flex: 1; padding: 9px 12px; border: 1px solid var(--ink-200); border-radius: var(--radius); font-family: var(--font-sans); }
.ag-actions { white-space: nowrap; }
.ag-actions .btn + .btn { margin-left: 4px; }
.ag-correct { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--ink-100); }
.ag-correct textarea { width: 100%; margin-top: 6px; padding: 8px 10px; border: 1px solid var(--ink-200); border-radius: var(--radius); font-family: var(--font-sans); }
@media (max-width: 1023px) { .ag-grid, .ag-review-grid { grid-template-columns: 1fr; } }

.ag-q-table th:first-child, .ag-q-table td:first-child { width: 52%; }
.ag-q-table th:nth-child(2), .ag-q-table td:nth-child(2) { width: 26%; }

/* ============================================================
   Phase 7 — Workflows list (wireframe p.6) + editor (p.7)
   ============================================================ */
.wf-link { color: var(--brand-700); text-decoration: underline; cursor: pointer; font-weight: 500; }
.wf-desc { max-width: 420px; }
.wf-desc .cd-muted { font-size: 12px; }
.wf-title-input { width: min(520px, 100%); padding: 2px 6px; margin-left: -6px; border: 1px solid transparent; border-radius: 8px; background: transparent; }
.wf-title-input:hover:not(:disabled), .wf-title-input:focus { border-color: var(--ink-200); background: #fff; outline: none; }
.wf-editor { display: grid; grid-template-columns: 220px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.wf-palette-card, .wf-settings-card { margin: 0; padding: 16px; }
.wf-canvas { min-height: 520px; gap: 0; }
.wf-canvas .flow-node { display: block; text-align: left; font-family: var(--font-sans); cursor: pointer; }
.wf-canvas .flow-node:hover { border-color: var(--brand-300); }
.wf-canvas .flow-branches { margin-top: 0; }
.wf-canvas .flow-branch .flow-node { width: 100%; }
.wf-slot { width: min(340px, 100%); padding: 8px; border: 1px dashed var(--ink-300); border-radius: var(--radius); background: transparent; color: var(--ink-500); font-family: var(--font-sans); font-size: 12.5px; cursor: pointer; }
.wf-slot:hover, .wf-slot.is-selected { border-color: var(--brand-500); color: var(--brand-700); background: var(--brand-50); }
.wf-settings-card .form-row label { font-size: 12.5px; }
.wf-settings-card input, .wf-settings-card select, .wf-settings-card textarea { width: 100%; }
.wf-runs { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.wf-run { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; }
.wf-run .cd-muted { flex-basis: 100%; font-size: 12px; }
.wf-test-steps { margin: 10px 0 0; padding-left: 20px; font-size: 13.5px; }
.wf-test-steps li { margin: 4px 0; }
@media (max-width: 1199px) { .wf-editor { grid-template-columns: 1fr; } }

/* ── Phase 8: Clients (wireframe p.10) ─────────────────────────── */
.cl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.cl-table td { vertical-align: top; }
.cl-table { overflow-x: auto; }
.cl-table th, .cl-table td { padding-left: 12px; padding-right: 12px; }
.cl-table td:first-child { min-width: 160px; }
.cl-actions { text-align: right; white-space: nowrap; }
.cl-new { padding: 16px; }
.cl-new .form-row { margin-bottom: 10px; }
.cl-copy { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 14px; }
.cl-create { width: 100%; justify-content: center; }
@media (max-width: 1100px) { .cl-layout { grid-template-columns: 1fr; } }

/* ── Phase 9: client portal management (Clients → client) ───────── */
.cp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.cp-side { display: flex; flex-direction: column; gap: 14px; }
.cp-card { padding: 16px; margin-bottom: 12px; }
.cp-side .cp-card { margin-bottom: 0; }
.cp-tabs { margin-bottom: 14px; }
.cp-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cp-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--ink-200); overflow: hidden; }
.cp-bar span { display: block; height: 100%; background: var(--brand-600); }
.cp-item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--ink-100); }
.cp-item:first-of-type { border-top: 0; }
.cp-item-main { min-width: 0; flex: 1; }
.cp-value { white-space: pre-wrap; max-height: 6.5em; overflow: hidden; }
.cp-files { font-size: 13px; margin-top: 2px; }
.cp-status { min-width: 130px; }
.cp-row-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.cp-assets { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.cp-assets img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--ink-200); }
.cp-asset-file { display: inline-flex; align-items: center; padding: 6px 10px; border: 1px solid var(--ink-200); border-radius: 8px; font-size: 13px; }
.cp-comment { background: var(--ink-50); border-radius: 8px; padding: 8px 10px; margin-top: 6px; font-size: 14px; }
.cp-actions { display: flex; gap: 8px; margin-top: 8px; }
.cp-pre { white-space: pre-wrap; margin: 6px 0 0; }
.cp-thread { padding: 14px; max-height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.cp-msg { max-width: 75%; }
.cp-msg-team { align-self: flex-end; text-align: right; }
.cp-bubble { display: inline-block; padding: 8px 12px; border-radius: 12px; background: var(--ink-100); white-space: pre-wrap; text-align: left; }
.cp-msg-team .cp-bubble { background: var(--brand-600); color: #fff; }
.cp-compose { display: flex; gap: 10px; align-items: flex-end; }
.cp-compose textarea { flex: 1; padding: 9px 11px; border: 1px solid var(--ink-200); border-radius: 10px; font: inherit; }
.cp-users { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.cp-user { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
@media (max-width: 1100px) { .cp-layout { grid-template-columns: 1fr; } }
