:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #1a1d29;
  --muted: #6b7280;
  --border: #e6e8ef;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --danger: #dc2626;
  --success: #059669;
  --warning: #d97706;
  --lead: #94a3b8;
  --qualified: #3b82f6;
  --proposal: #8b5cf6;
  --negotiation: #f59e0b;
  --won: #10b981;
  --lost: #ef4444;
  --shadow: 0 1px 3px rgba(17,24,39,.06), 0 1px 2px rgba(17,24,39,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.5;
  display: flex; min-height: 100vh;
}

/* Mobile menu toggle (hidden on desktop) */
.mobile-menu-btn {
  display: none;
  position: fixed; top: 12px; left: 12px; z-index: 1000;
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, #0b1020, #1a1d3a);
  color: white; border: none; cursor: pointer;
  align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  font-size: 22px;
}
.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 998;
}

/* Mobile breakpoint — sidebar becomes drawer */
@media (max-width: 768px) {
  html, body {
    display: block !important;
    min-height: auto !important;
    width: 100%;
    overflow-x: hidden;
  }

  .mobile-menu-btn { display: flex; }

  .sidebar {
    position: fixed; top: 0; left: 0;
    height: 100vh; width: 280px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 999;
    margin: 0 !important;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }

  .main, .main-full {
    flex: none !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 60px 14px 30px !important;
    margin: 0 !important;
    box-sizing: border-box;
  }

  .page-head {
    flex-direction: column; align-items: flex-start;
    gap: 10px; margin-bottom: 14px;
  }
  .page-head h1 { margin-top: 0; }
  .page-head .actions { flex-wrap: wrap; gap: 6px; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; margin-bottom: 14px; }
  .grid-2 { grid-template-columns: 1fr !important; gap: 14px; }
  .top-perf-row { grid-template-columns: 1fr !important; gap: 8px; }
  .form-grid { grid-template-columns: 1fr !important; gap: 10px; }
  .calc-row { grid-template-columns: 1fr !important; gap: 10px; }
  .phone-grid { grid-template-columns: 1fr !important; }
  .settings-grid { grid-template-columns: 1fr !important; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar input, .filter-bar select { width: 100%; }

  .card { padding: 14px; margin-bottom: 14px; }
  h1 { font-size: 20px; margin-top: 0; }
  h2 { font-size: 15px; }
  .kpi-value { font-size: 20px; }
  .kpi { padding: 12px; }

  .table { font-size: 12px; }
  .table th, .table td { padding: 6px 8px; }

  .btn { padding: 8px 12px; font-size: 13px; }
  .btn.btn-primary { padding: 10px 16px; }

  /* Make nav items larger for tapping */
  .nav-item { padding: 12px 14px; font-size: 14px; }

  /* Hide some sidebar decorations to keep things clean */
  .brand-tag { display: none; }

  /* Auth pages — full viewport height */
  .auth-wrap { min-height: 100vh; padding: 14px; }
}

/* ───────────── AI Chatbot ───────────── */
.chatbot-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: 9998;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  color: white; border: none;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .45);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s, box-shadow .15s;
}
.chatbot-fab:hover { transform: scale(1.08); box-shadow: 0 12px 32px rgba(99, 102, 241, .55); }
.chatbot-fab svg { width: 28px; height: 28px; }
.chatbot-panel {
  position: fixed; right: 24px; bottom: 96px; z-index: 9999;
  width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 120px);
  background: white; color: #0f172a;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, .25), 0 4px 16px rgba(0,0,0,.1);
  border: 1px solid #e2e8f0;
  display: none; flex-direction: column;
  overflow: hidden;
}
.chatbot-panel.open { display: flex; }
.chatbot-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}
.chatbot-header strong { font-size: 15px; }
.chatbot-header .muted { color: rgba(255,255,255,.85) !important; font-size: 11.5px; }
.chatbot-close {
  background: rgba(255,255,255,.15); color: white;
  border: none; width: 28px; height: 28px;
  border-radius: 50%; cursor: pointer; font-size: 14px;
}
.chatbot-close:hover { background: rgba(255,255,255,.3); }
.chatbot-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: #f8fafc;
}
.chatbot-msg { display: flex; }
.chatbot-msg.chatbot-user { justify-content: flex-end; }
.chatbot-bubble {
  max-width: 85%; padding: 10px 14px;
  border-radius: 16px; font-size: 13.5px; line-height: 1.5;
  white-space: pre-wrap;
}
.chatbot-bot .chatbot-bubble {
  background: white; border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}
.chatbot-user .chatbot-bubble {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white; border-bottom-right-radius: 4px;
}
.chatbot-bubble strong { font-weight: 700; }
.chatbot-bubble em { font-style: italic; color: #4338ca; }
.chatbot-bubble a {
  display: inline-block;
  margin-top: 8px; padding: 6px 12px;
  background: #4338ca; color: white;
  border-radius: 6px; text-decoration: none;
  font-size: 12px; font-weight: 600;
}
.chatbot-input-row {
  display: flex; gap: 6px; padding: 12px;
  background: white; border-top: 1px solid #e2e8f0;
}
.chatbot-input-row input {
  flex: 1; padding: 9px 12px;
  border: 1px solid #cbd5e1; border-radius: 8px;
  font-size: 13.5px; font-family: inherit;
}
.chatbot-mic, .chatbot-send {
  padding: 9px 12px; border-radius: 8px; cursor: pointer; border: none;
  font-family: inherit; font-size: 13px;
}
.chatbot-mic { background: #f1f5f9; color: #475569; font-size: 16px; }
.chatbot-mic:hover { background: #e2e8f0; }
.chatbot-mic.recording { background: #ef4444; color: white; animation: chatbot-pulse 1.2s infinite; }
@keyframes chatbot-pulse { 0%,100% { opacity: 1 } 50% { opacity: .6 } }
.chatbot-send {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white; font-weight: 600;
}
.chatbot-typing { color: #94a3b8; font-style: italic; font-size: 12px; padding: 4px 14px; }
.ai-tag {
  display: inline-block; font-size: 10px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: white; padding: 1px 8px; border-radius: 4px;
  font-weight: 700; letter-spacing: .5px; margin-bottom: 6px;
}

@media (max-width: 480px) {
  .chatbot-panel { width: calc(100vw - 16px); right: 8px; bottom: 88px; }
  .chatbot-fab { right: 16px; bottom: 16px; }
}

/* Voice-to-text mic button (used inline next to text inputs/textareas) */
.crm-mic-btn {
  background: #f1f5f9; color: #475569;
  border: 1px solid #cbd5e1; border-radius: 6px;
  padding: 6px 10px; cursor: pointer;
  font-size: 14px;
  display: inline-flex; align-items: center; gap: 4px;
}
.crm-mic-btn:hover { background: #e2e8f0; }
.crm-mic-btn.recording {
  background: #ef4444; color: white; border-color: #ef4444;
  animation: chatbot-pulse 1.2s infinite;
}

/* Sidebar — premium dark with gradient + section grouping */
.sidebar {
  width: 244px;
  background: linear-gradient(180deg, var(--sidebar-top, #0b1020) 0%, var(--sidebar-bot, #1a1d3a) 100%);
  color: var(--sidebar-text, #cbd5e1);
  display: flex; flex-direction: column;
  padding: 20px 14px 14px;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid rgba(255,255,255,.04);
  box-shadow: 1px 0 30px rgba(0,0,0,.15);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 3px; }

.brand {
  display: flex; align-items: center; gap: 12px;
  margin: 0 4px 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-pulse {
  text-decoration: none;
  display: block;
  padding: 4px 6px;
  border-radius: 10px;
  transition: background .15s, transform .15s;
}
.brand-pulse:hover { background: rgba(255,255,255,.04); transform: translateY(-1px); }
.pulse-logo-img {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(99,102,241,.3));
}

/* Legacy classes kept for back-compat (login page still uses .logo-img) */
.logo {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 16px; box-shadow: 0 4px 12px rgba(79,70,229,.4);
}
.logo-img {
  width: 40px; height: 40px; border-radius: 10px; object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 2px 8px rgba(124,58,237,.3));
}
.brand-name {
  color: white; font-weight: 700; font-size: 16px;
  letter-spacing: -.2px;
}
.brand-tag {
  color: #94a3b8; font-size: 10px;
  text-transform: uppercase; letter-spacing: 1.2px; font-weight: 600;
  margin-top: 1px;
}

/* Nav sections */
.sidebar nav { display: flex; flex-direction: column; flex: 1; gap: 4px; }
.nav-section { display: flex; flex-direction: column; gap: 1px; margin-bottom: 14px; }
.nav-label {
  color: #cbd5e1;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  font-weight: 800;
  padding: 6px 12px 8px;
  margin-top: 4px;
  opacity: .85;
}

.nav-item {
  position: relative;
  color: var(--sidebar-text, #cbd5e1); text-decoration: none;
  padding: 9px 12px; border-radius: 8px;
  font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 11px;
  transition: all .18s ease;
  letter-spacing: -.1px;
}
.nav-item:hover {
  background: rgba(255,255,255,.05);
  color: white;
  transform: translateX(2px);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(79,70,229,.25), rgba(124,58,237,.18));
  color: white;
  box-shadow: 0 2px 8px rgba(79,70,229,.15), inset 0 1px 0 rgba(255,255,255,.06);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 6px; bottom: 6px;
  width: 3px; background: linear-gradient(180deg, var(--primary), #7c3aed);
  border-radius: 0 3px 3px 0; box-shadow: 0 0 8px rgba(79,70,229,.6);
}
.nav-ico {
  width: 18px; height: 18px; flex-shrink: 0;
  opacity: .85; transition: opacity .15s, transform .15s;
}
.nav-item:hover .nav-ico, .nav-item.active .nav-ico {
  opacity: 1;
}
.nav-item.active .nav-ico {
  color: #a78bfa;
}

/* Expandable nav group (Settings) */
.nav-group {
  display: flex; flex-direction: column; gap: 1px;
  margin: 0;
}
.nav-group > summary {
  list-style: none; cursor: pointer;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary .chev {
  margin-left: auto;
  width: 14px; height: 14px;
  transition: transform .25s ease;
  opacity: .6;
}
.nav-group[open] > summary .chev {
  transform: rotate(180deg);
  opacity: 1;
}
.nav-sub {
  display: flex; flex-direction: column;
  padding-left: 30px; margin-top: 2px; gap: 1px;
}
.nav-sub a {
  font-size: 12.5px; padding: 7px 12px;
  border-radius: 6px; color: #94a3b8;
  text-decoration: none; transition: all .15s;
}
.nav-sub a:hover { background: rgba(255,255,255,.04); color: white; }
.nav-sub a.active {
  background: rgba(79,70,229,.18); color: white;
  font-weight: 600;
}

/* Sidebar footer (user card + logout) */
.sidebar-footer {
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.06);
}
/* Notification bell */
.notif-bell-wrap { position: relative; margin: 0 4px 8px; }
.notif-bell {
  width: 100%; padding: 9px 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 10px;
  color: #cbd5e1; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; position: relative;
  transition: background .15s, transform .15s;
}
.notif-bell:hover { background: rgba(255,255,255,.08); transform: translateY(-1px); }
.notif-bell-badge {
  position: absolute; top: -4px; right: 6px;
  background: #ef4444; color: white;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  min-width: 18px; text-align: center;
  box-shadow: 0 2px 6px rgba(239,68,68,.4);
}
.notif-dropdown {
  display: none;
  position: fixed;
  /* JS sets top/left dynamically when opened */
  background: white; color: #0f172a;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.1);
  border: 1px solid #e2e8f0;
  z-index: 10000;
  max-height: 480px;
  overflow: hidden;
  width: 360px;
  max-width: calc(100vw - 32px);
}
.notif-dropdown.open { display: flex; flex-direction: column; }
/* Small triangle pointer pointing to the bell */
.notif-dropdown::before {
  content: "";
  position: absolute;
  top: 14px; left: -7px;
  width: 14px; height: 14px;
  background: white;
  border-left: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  transform: rotate(45deg);
}
@media (max-width: 760px) {
  .notif-dropdown {
    width: calc(100vw - 32px);
    max-height: 70vh;
  }
  .notif-dropdown::before { display: none; }
}
.notif-dropdown-head {
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.notif-view-all {
  font-size: 12px; color: #4338ca; text-decoration: none; font-weight: 600;
}
.notif-view-all:hover { text-decoration: underline; }
.notif-dropdown-body {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
}
.notif-item {
  display: flex; gap: 12px;
  padding: 12px 14px;
  text-decoration: none; color: inherit;
  border-bottom: 1px solid #f1f5f9;
  transition: background .15s;
}
.notif-item:hover { background: #f8fafc; }
.notif-item.unread { background: #f0f9ff; }
.notif-item.unread:hover { background: #e0f2fe; }
.notif-icon {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-weight: 600; font-size: 13.5px; color: #0f172a; line-height: 1.3; }
.notif-body-text { font-size: 12.5px; color: #64748b; margin-top: 3px; line-height: 1.4; }
.notif-time { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.notif-empty { text-align: center; padding: 30px 20px; }

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 10px;
  margin-bottom: 8px;
  text-decoration: none;
  transition: all .18s ease;
  position: relative;
}
.user-chip-top {
  margin: 0 0 18px;
  padding: 11px 12px;
  cursor: pointer;
}
.user-chip-top:hover {
  background: linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
  border-color: rgba(255,255,255,.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.user-chip-top .user-chip-arrow {
  width: 14px; height: 14px;
  color: #94a3b8;
  opacity: .6;
  transition: transform .15s, opacity .15s;
  flex-shrink: 0;
}
.user-chip-top:hover .user-chip-arrow {
  opacity: 1;
  transform: translateX(2px);
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  box-shadow: 0 2px 8px rgba(16,185,129,.3);
  overflow: hidden;
}
.avatar-img {
  width: 36px; height: 36px; border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.user-info { flex: 1; min-width: 0; overflow: hidden; }
.user-name {
  color: white; font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -.1px;
}
.user-role { margin-top: 2px; }
.user-badge {
  display: inline-block;
  font-size: 9.5px; text-transform: uppercase; letter-spacing: 1px;
  font-weight: 700; padding: 2px 7px; border-radius: 10px;
  background: rgba(148,163,184,.15); color: #94a3b8;
}
.user-badge.admin {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.logout-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  color: #94a3b8; text-decoration: none;
  font-size: 13px; font-weight: 500;
  border-radius: 8px; transition: all .15s;
}
.logout-btn:hover { background: rgba(239,68,68,.1); color: #fca5a5; }
.logout-btn svg { width: 16px; height: 16px; }

/* Designer credit at the bottom of the sidebar */
.sidebar-credit {
  margin-top: 14px;
  padding: 12px 14px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-credit-line {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: #cbd5e1;
  font-weight: 800;
  margin-bottom: 3px;
  opacity: .8;
}
.sidebar-credit-name {
  font-family: 'Sacramento', 'Great Vibes', cursive;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  background: linear-gradient(135deg, #818cf8, #67e8f9, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: .5px;
  margin-top: 2px;
  /* Subtle ink-shadow for the signature feel */
  filter: drop-shadow(0 1px 0 rgba(103, 232, 249, 0.15));
  /* Slight italic slant — like a real signature */
  transform: rotate(-2deg);
  display: inline-block;
  /* Breathing pulse — the brand tie-in */
  animation: pulseBreathe 2.4s ease-in-out infinite;
}

/* The EKG / heartbeat line under the signature — represents "Pulse" the brand */
.sidebar-credit-pulse {
  display: block;
  width: 88%;
  height: 18px;
  margin: 2px auto 0;
  overflow: visible;
}
.sidebar-credit-pulse-path {
  /* Animate the heartbeat — the spike "travels" left to right repeatedly */
  stroke-dasharray: 60 200;
  stroke-dashoffset: 260;
  animation: pulseTrace 2.4s linear infinite;
  filter: drop-shadow(0 0 4px rgba(103, 232, 249, 0.45));
}

@keyframes pulseBreathe {
  0%, 100% { transform: rotate(-2deg) scale(1);    opacity: 1;   }
  50%      { transform: rotate(-2deg) scale(1.025); opacity: .92; }
}

@keyframes pulseTrace {
  0%   { stroke-dashoffset: 260; }
  100% { stroke-dashoffset: 0;   }
}

/* Sidebar nav badge — used for pending counts */
.nav-badge {
  margin-left: auto;
  background: #ef4444; color: white;
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
  min-width: 18px; text-align: center;
}
.nav-badge-pulse {
  background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 0 0 0 rgba(249,115,22, .7);
  animation: claim-pulse 1.6s infinite;
}
/* Chat unread badge — WhatsApp-style green */
.nav-badge-chat {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 2px 6px rgba(16, 185, 129, .4);
  font-size: 11px;
  padding: 2px 8px;
  min-width: 22px;
}
@keyframes claim-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(249,115,22, .7); }
  70%  { box-shadow: 0 0 0 10px rgba(249,115,22, 0); }
  100% { box-shadow: 0 0 0 0   rgba(249,115,22, 0); }
}
.nav-item-claim {
  background: linear-gradient(90deg, rgba(249,115,22,.14), transparent) !important;
  border-left: 2px solid #f97316;
  padding-left: 10px !important;
}
.nav-item-claim:hover {
  background: linear-gradient(90deg, rgba(249,115,22,.22), rgba(255,255,255,.03)) !important;
}
.logout {
  /* Legacy class — keep as alias */
  color: #94a3b8; text-decoration: none; font-size: 13px;
}
.logout:hover { color: white; }

/* Settings cards (overview page) */
.settings-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 20px; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
  display: block;
}
.settings-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
}
.settings-card.disabled { opacity: .5; cursor: not-allowed; }
.settings-icon { font-size: 28px; margin-bottom: 10px; }
.settings-card-title { font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.settings-card-desc { color: var(--muted); font-size: 13px; }

/* Pipeline editor — stages list */
.stages-list {
  display: flex; flex-direction: column; gap: 8px;
  background: #fafbfd; border: 1px solid var(--border); border-radius: 8px;
  padding: 12px;
}
.stage-row-edit {
  display: flex; align-items: center; gap: 10px;
  background: white; border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px;
}
.stage-row-edit .grip {
  color: var(--muted); cursor: grab; font-size: 16px;
  user-select: none;
  padding: 2px 6px; border-radius: 4px;
  transition: background .15s, color .15s;
}
.stage-row-edit .grip:hover {
  background: #eef0f5; color: var(--primary);
}
.stage-row-edit .grip:active { cursor: grabbing; }
.stage-row-ghost {
  opacity: 0.4; background: #eef0f5;
}
.stage-row-chosen {
  background: rgba(79,70,229,.05) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(79,70,229,.15);
}
.stage-row-edit input[name=stage_name] {
  flex: 1; border: 1px solid var(--border); padding: 7px 10px;
  border-radius: 5px; font-size: 14px; font-family: inherit;
}
.stage-row-edit input[name=stage_name]:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.remove-stage { color: var(--danger); }

/* Notes timeline */
.note-form {
  display: flex; gap: 8px; margin-bottom: 16px;
  flex-direction: column;
}
.note-form textarea {
  border: 1px solid var(--border); border-radius: 6px; padding: 10px;
  font-family: inherit; font-size: 13px; resize: vertical;
}
.note-form button { align-self: flex-end; }

.notes-timeline li { gap: 12px; }
.note-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; flex-shrink: 0;
}
.note-body { flex: 1; }
.note-meta { display: flex; align-items: center; margin-bottom: 4px; }

/* Task reminder toasts */
.reminder-stack {
  position: fixed; bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 9999; max-width: 360px;
}
.reminder-toast {
  display: flex; gap: 12px;
  background: white; border: 1px solid var(--border);
  border-left: 4px solid var(--warning);
  border-radius: 8px; padding: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  animation: slide-in .25s ease-out;
}
@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.reminder-icon { font-size: 22px; }
.reminder-body { flex: 1; }
.reminder-title { font-weight: 600; margin-bottom: 2px; }
.reminder-sub { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.reminder-actions { display: flex; gap: 6px; }

/* Opportunity card extras */
.opp-card .deal-foot { margin-top: 6px; }

/* Motivation banner — coaching messages on dashboard */
.motivation-banner {
  display: flex; align-items: center; gap: 16px;
  color: white;
  padding: 18px 22px;
  border-radius: 14px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(79,70,229,.25);
  position: relative;
  overflow: hidden;
  animation: banner-in .4s ease-out;
}
@keyframes banner-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.motivation-banner::before {
  content: ""; position: absolute;
  top: -50%; right: -10%; width: 200px; height: 200px;
  background: rgba(255,255,255,.08); border-radius: 50%;
  pointer-events: none;
}
.motivation-icon {
  font-size: 36px; flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.2));
}
.motivation-text { flex: 1; min-width: 0; }
.motivation-title {
  font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px;
  opacity: .9; margin-bottom: 2px;
}
.motivation-body {
  font-size: 17px; font-weight: 600;
  letter-spacing: -.2px;
  text-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.motivation-dismiss {
  background: rgba(255,255,255,.15); border: none;
  color: white; font-size: 22px;
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.motivation-dismiss:hover { background: rgba(255,255,255,.3); }

/* Contacts filter grid */
.contacts-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto auto;
  gap: 8px; align-items: center;
}
@media (max-width: 1100px) { .contacts-filter-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .contacts-filter-grid { grid-template-columns: 1fr; } }
.contacts-filter-grid select,
.contacts-filter-grid input {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; background: white;
}

/* Bulk action strip (Select all bar) */
.bulk-action-strip {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 16px;
}
.bulk-select-all {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 14px;
}
.bulk-select-all input { width: 16px; height: 16px; cursor: pointer; }

/* Bulk reassign card */
.bulk-reassign-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d;
}
.bulk-reassign-form {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 4px;
}
.bulk-actions-row {
  display: flex; gap: 8px;
}

/* Tom Select customisation */
.ts-control {
  min-height: 42px;
  border-radius: 8px !important;
  border-color: var(--border) !important;
}
.ts-control input {
  font-size: 14px !important;
}
.ts-dropdown {
  border-radius: 8px !important;
  font-size: 14px !important;
}
.ts-control .item {
  background: var(--primary) !important;
  color: white !important;
  border-radius: 12px !important;
  padding: 4px 10px !important;
  margin: 2px 4px 2px 0 !important;
}
.ts-control .item .remove {
  color: white !important; opacity: .8;
  border-left-color: rgba(255,255,255,.3) !important;
}
.ts-control .item .remove:hover { opacity: 1; }

/* Bulk checkbox on contact row */
.contact-bulk-check {
  display: flex; align-items: center; padding-right: 4px;
  cursor: pointer;
}
.contact-bulk-check input { width: 16px; height: 16px; cursor: pointer; }

/* Premium Contacts list */
.contacts-filter-card { padding: 14px 16px; }
.contacts-filter {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto auto;
  gap: 10px; align-items: center;
}
@media (max-width: 1100px) {
  .contacts-filter { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 700px) {
  .contacts-filter { grid-template-columns: 1fr; }
}
.filter-search {
  position: relative;
}
.filter-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  pointer-events: none; opacity: .6;
}
.filter-search input {
  width: 100%; padding: 9px 14px 9px 36px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: white;
  transition: border-color .15s, box-shadow .15s;
}
.filter-search input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.contacts-filter select {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: white;
}

.contacts-card { padding: 0; overflow: hidden; }
.contacts-list { display: flex; flex-direction: column; }

.contact-row {
  display: grid;
  grid-template-columns: 28px 36px minmax(200px, 2fr) 1fr 1fr 120px auto;
  gap: 12px; align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
  position: relative;
}
.contact-row:not(:has(.contact-bulk-check)) {
  grid-template-columns: 36px minmax(200px, 2fr) 1fr 1fr 120px auto;
}
.contact-row:last-child { border-bottom: none; }
.contact-row:hover {
  background: linear-gradient(90deg, rgba(79,70,229,.03), transparent 50%);
}
.contact-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: transparent;
  transition: background .15s;
}
.contact-row:hover::before { background: var(--primary); }

@media (max-width: 1100px) {
  .contact-row { grid-template-columns: 28px 36px 1fr auto; gap: 10px; }
  .contact-row:not(:has(.contact-bulk-check)) { grid-template-columns: 36px 1fr auto; }
  .contact-pipeline, .contact-source, .contact-owner { display: none; }
}

.contact-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ac, #4f46e5), color-mix(in srgb, var(--ac, #4f46e5) 70%, #1a1d29));
  color: white; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--ac, #4f46e5) 30%, transparent);
  flex-shrink: 0;
}

.contact-main { min-width: 0; }
.contact-name-row {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 2px;
}
.contact-name {
  font-weight: 600; font-size: 14px;
  color: var(--text); text-decoration: none;
  letter-spacing: -.1px;
}
.contact-name:hover { color: var(--primary); }

.contact-tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  letter-spacing: .3px;
}
.tag-referrer {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e; border: 1px solid #fcd34d;
}
.tag-budget {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #065f46; border: 1px solid #6ee7b7;
}

.contact-meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--muted);
}

.contact-pipeline { font-size: 12.5px; }
.contact-pipeline-name { font-weight: 500; color: var(--text); margin-bottom: 2px; }
.contact-stage-pill {
  display: inline-block;
  background: linear-gradient(135deg, rgba(79,70,229,.1), rgba(124,58,237,.08));
  color: var(--primary);
  border: 1px solid rgba(79,70,229,.2);
  padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}

.contact-source-badge {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 12px;
  background: #eef0f5; color: var(--muted);
  border: 1px solid var(--border);
}
.contact-source-badge.source-facebook    { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.contact-source-badge.source-instagram   { background: #fce7f3; color: #9f1239; border-color: #f9a8d4; }
.contact-source-badge.source-linkedin    { background: #dbeafe; color: #1e3a8a; border-color: #93c5fd; }
.contact-source-badge.source-youtube     { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.contact-source-badge.source-twitter     { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }
.contact-source-badge.source-tiktok      { background: #f3f4f6; color: #1f2937; border-color: #d1d5db; }
.contact-source-badge.source-website     { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.contact-source-badge.source-referral    { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.contact-source-badge.source-landing-page{ background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border-color: #fcd34d; }

.contact-tag-pill {
  display: inline-block;
  font-size: 10.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 12px;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  color: #5b21b6;
  border: 1px solid #c4b5fd;
  margin-left: 4px; margin-top: 3px;
  text-decoration: none;
  font-family: 'SF Mono', Monaco, monospace;
  letter-spacing: -.2px;
  transition: all .15s;
}
.contact-tag-pill:hover {
  background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(91,33,182,.2);
}

.contact-owner {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
}
.owner-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #64748b, #475569);
  color: white; font-weight: 600; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.owner-name { color: var(--muted); }

.contact-actions { display: flex; gap: 6px; }
.contact-action-btn {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 13px;
  border: 1px solid var(--border);
  background: white; transition: all .15s;
}
.contact-action-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.08); }
.contact-action-btn.call    { color: #059669; border-color: #a7f3d0; background: #d1fae5; }
.contact-action-btn.whatsapp{ color: white; background: #25d366; border-color: #25d366; }
.contact-action-btn.email   { color: #4f46e5; border-color: #c7d2fe; background: #eef2ff; }

.pagination-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--border);
  background: #fafbfd;
}
.pagination-info { font-weight: 500; }
.pagination-controls {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.pagination-size select {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; background: white; margin-right: 4px;
}
.page-num {
  min-width: 32px; padding: 6px 10px;
  text-align: center;
}
.page-num.active {
  background: var(--primary) !important;
  color: white !important;
  border-color: var(--primary) !important;
  cursor: default;
}
.btn.small[disabled] {
  opacity: 0.4; cursor: not-allowed;
}

.contacts-empty {
  text-align: center; padding: 60px 20px;
}
.contacts-empty-icon { font-size: 48px; margin-bottom: 8px; }
.contacts-empty h2 { margin: 8px 0 4px; font-size: 18px; }
.contacts-empty p { margin-bottom: 16px; }


/* Opportunities toolbar (pipeline tabs + owner filter) */
.opp-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  margin-bottom: 14px;
}
.opp-owner-filter {
  display: flex; align-items: center; gap: 8px;
}
.opp-owner-filter select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: white; font-size: 13px; font-family: inherit;
  min-width: 220px;
}
.opp-filter-pill {
  display: inline-block;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d;
  padding: 8px 14px; border-radius: 8px;
  font-size: 13px; margin-bottom: 14px;
}

/* Premium Opportunities kanban */
.opp-kanban {
  padding: 4px 0 14px;
}
.opp-col {
  background: #f8fafc;
  border-radius: 12px;
  padding: 0;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.opp-col::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--stage-color, var(--primary)), color-mix(in srgb, var(--stage-color, var(--primary)) 60%, white));
}

.opp-col-head {
  padding: 14px 14px 10px;
  background: linear-gradient(180deg, white, transparent);
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.opp-col-title-row {
  display: flex; align-items: center; gap: 8px;
}
.opp-col-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--stage-color, var(--primary));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--stage-color, var(--primary)) 20%, transparent);
}
.opp-col-title {
  flex: 1;
  font-weight: 700; font-size: 14px;
  color: var(--text); letter-spacing: -.1px;
}
.opp-col-count {
  background: white;
  color: var(--stage-color, var(--primary));
  border: 1px solid color-mix(in srgb, var(--stage-color, var(--primary)) 30%, transparent);
  border-radius: 12px; padding: 2px 9px;
  font-size: 12px; font-weight: 700;
  min-width: 24px; text-align: center;
}
.opp-col-sub {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .6px;
  font-weight: 600; margin-top: 4px;
}

.opp-col-body {
  flex: 1;
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 200px;
}
.opp-col-body.drag-over {
  background: color-mix(in srgb, var(--stage-color, var(--primary)) 6%, transparent);
}

/* Premium card */
.opp-card-new {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: grab;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
  border-left: 3px solid var(--stage-color, var(--primary));
}
.opp-card-new:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15,23,42,.08), 0 2px 4px rgba(15,23,42,.04);
  border-color: color-mix(in srgb, var(--stage-color, var(--primary)) 40%, var(--border));
}
.opp-card-new.dragging { opacity: 0.4; cursor: grabbing; }

.opp-card-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.opp-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--stage-color, var(--primary)), color-mix(in srgb, var(--stage-color, var(--primary)) 60%, #4f46e5));
  color: white; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--stage-color, var(--primary)) 30%, transparent);
}
.opp-name {
  flex: 1; min-width: 0;
  font-weight: 600; font-size: 14px;
  color: var(--text); text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.opp-name:hover { color: var(--primary); }
.opp-actions { display: flex; gap: 4px; flex-shrink: 0; }

.opp-meta {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 12px; color: var(--muted);
  margin-bottom: 8px;
}
.opp-line {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.opp-card-foot {
  display: flex; flex-wrap: wrap; gap: 4px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
.opp-tag {
  display: inline-block;
  background: color-mix(in srgb, var(--stage-color, var(--primary)) 12%, white);
  color: var(--stage-color, var(--primary));
  font-size: 10px; font-weight: 600;
  padding: 3px 8px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: .4px;
  border: 1px solid color-mix(in srgb, var(--stage-color, var(--primary)) 25%, transparent);
}
.opp-tag-referrer {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
  border-color: #fcd34d;
}

.opp-empty {
  text-align: center; padding: 28px 12px;
  color: var(--muted); font-size: 12px;
  border: 2px dashed var(--border); border-radius: 10px;
  background: white;
  margin: 0;
}
.opp-empty-icon {
  font-size: 22px; margin-bottom: 4px; color: var(--border);
}
.opp-empty-text { font-weight: 500; letter-spacing: .3px; }

/* Chat — WhatsApp-style layout */
.chat-layout {
  display: grid; grid-template-columns: 320px 1fr; gap: 16px;
  height: calc(100vh - 180px); min-height: 500px;
}
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
}
.chat-sidebar {
  padding: 12px; overflow-y: auto;
}
.chat-sidebar-head {
  padding: 4px 6px 8px; border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.chat-sidebar-head h3 {
  margin: 0; font-size: 12px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted);
}
.chat-conv-list {
  list-style: none; padding: 0; margin: 0;
}
.chat-conv-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 8px; text-decoration: none;
  color: inherit; cursor: pointer; width: 100%;
  background: transparent; border: none; font-family: inherit; text-align: left;
}
.chat-conv-item:hover { background: #f6f7fb; }
.chat-conv-item.active { background: rgba(79, 70, 229, .1); }
.chat-conv-item.start-btn { color: var(--muted); }
.conv-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 16px; flex-shrink: 0;
}
.conv-avatar.group { background: #10b981; }
.conv-body { flex: 1; min-width: 0; }
.conv-row1 { display: flex; justify-content: space-between; align-items: center; }
.conv-preview {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.conv-badge {
  background: var(--primary); color: white;
  border-radius: 10px; padding: 1px 8px; font-size: 11px; font-weight: 600;
}

.chat-main {
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
}
.chat-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: white;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 16px 18px;
  background: #f9fafb;
}
.chat-day-divider {
  text-align: center; font-size: 11px; color: var(--muted);
  margin: 16px 0 12px; text-transform: uppercase; letter-spacing: .5px;
}
.chat-message {
  display: flex; margin-bottom: 8px;
}
.chat-message.mine { justify-content: flex-end; }
.chat-bubble {
  max-width: 70%; padding: 8px 12px;
  background: white; border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  border-bottom-left-radius: 2px;
}
.chat-message.mine .chat-bubble {
  background: #dcf8c6;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 2px;
}
.chat-author {
  font-size: 11px; color: var(--primary); font-weight: 600; margin-bottom: 2px;
}
.chat-body-text {
  white-space: pre-wrap; word-break: break-word;
}
.chat-time {
  font-size: 10px; color: var(--muted); margin-top: 4px; text-align: right;
}
.chat-image {
  max-width: 280px; max-height: 220px; border-radius: 6px; display: block;
  margin-bottom: 4px; cursor: pointer;
}
.chat-file {
  display: inline-block; padding: 6px 12px;
  background: #eef0f5; border-radius: 6px; text-decoration: none;
  color: var(--text); font-weight: 500; font-size: 13px;
  margin-bottom: 4px;
}
.chat-file:hover { background: #e0e3eb; }

.chat-input-bar {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: white; align-items: center;
}
.chat-input-bar input[type=text] {
  flex: 1; border: 1px solid var(--border); border-radius: 20px;
  padding: 9px 14px; font-size: 14px; font-family: inherit;
}
.chat-attach-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: #f0f0f0; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; flex-shrink: 0;
}
.chat-attach-btn:hover { background: #e0e3eb; }

.chat-empty {
  flex: 1; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
  padding: 60px 30px; background: #f9fafb;
}
.chat-empty h2 { margin: 0 0 8px; font-size: 22px; }

/* Member picker for new group / manage */
.member-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: #fafbfd; border: 1px solid var(--border);
  padding: 12px; border-radius: 6px;
  max-height: 380px; overflow-y: auto;
}
@media (max-width: 700px) { .member-grid { grid-template-columns: 1fr; } }
.member-pick {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border: 1px solid var(--border); border-radius: 6px;
  background: white; cursor: pointer;
  text-transform: none; letter-spacing: normal; font-size: 13px;
  font-weight: 400; color: var(--text);
}
.member-pick input[type=checkbox] {
  width: 16px; height: 16px;
}

/* Landing link box (user form) */
.landing-link-box {
  display: flex; gap: 6px; align-items: center;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d; border-radius: 8px;
  padding: 8px 10px; margin-top: 4px;
}
.landing-link-box input {
  flex: 1; font-family: monospace; font-size: 12px;
  background: white; border: 1px solid #e6e8ef;
  border-radius: 6px; padding: 7px 10px;
}

/* Permissions picker grid */
.permissions-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: #fafbfd; border: 1px solid var(--border);
  border-radius: 8px; padding: 12px;
}
@media (max-width: 700px) { .permissions-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .permissions-grid { grid-template-columns: 1fr; } }
.perm-pick {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; background: white; border-radius: 6px;
  border: 1px solid var(--border); cursor: pointer;
  text-transform: none; letter-spacing: normal; font-weight: 400;
  font-size: 13px; color: var(--text);
}
.perm-pick:hover { border-color: var(--primary); }
.perm-pick input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.perm-pick input[type=checkbox]:checked + span { font-weight: 600; color: var(--primary); }

/* Permission groups (organized by category) */
.perm-quick-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.perm-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 760px) {
  .perm-groups { grid-template-columns: 1fr; }
}
.perm-group {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafbfc;
  overflow: hidden;
}
.perm-group-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: #1e293b;
}
.perm-group-toggle {
  font-size: 11px;
  background: white; color: #4338ca;
  border: 1px solid #c7d2fe;
}
.perm-group-toggle:hover { background: #eef2ff; }
.perm-group-body {
  padding: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.perm-group .perm-pick {
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 10px;
  border-radius: 6px;
}
.perm-group .perm-pick:hover { background: white; border-color: #e2e8f0; }

/* Click-to-call button */
.call-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: #d1fae5; color: #065f46;
  text-decoration: none; font-size: 14px;
  margin-right: 6px; transition: transform .15s, background .15s;
  vertical-align: middle;
}
.call-btn:hover {
  background: var(--success); color: white;
  transform: scale(1.1);
}
.call-btn.small { width: 24px; height: 24px; font-size: 12px; margin-right: 0; }

/* WhatsApp click-to-chat button */
.wa-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: #25d366; color: white;
  text-decoration: none; font-size: 14px;
  margin-right: 6px; transition: transform .15s, background .15s;
  vertical-align: middle;
}
.wa-btn:hover {
  background: #128c7e; color: white;
  transform: scale(1.1);
}
.wa-btn.small { width: 24px; height: 24px; font-size: 12px; margin-right: 0; }

/* Email — Gmail-style with folder sidebar */
.email-layout {
  display: grid; grid-template-columns: 220px 1fr; gap: 16px;
}
@media (max-width: 800px) {
  .email-layout { grid-template-columns: 1fr; }
}
.email-folders {
  padding: 10px;
}
.email-folder {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; text-decoration: none;
  color: inherit; border-radius: 6px;
  font-size: 14px;
}
.email-folder:hover { background: #f6f7fb; }
.email-folder.active {
  background: rgba(79, 70, 229, .12);
  color: var(--primary); font-weight: 600;
}
.email-folder-icon { font-size: 16px; }
.email-folder-label { flex: 1; }
.email-folder-count {
  background: #e6e8ef; color: var(--muted);
  font-size: 11px; font-weight: 600;
  padding: 1px 8px; border-radius: 10px;
}
.email-folder.active .email-folder-count {
  background: var(--primary); color: white;
}
.email-list-card { padding: 0; }

.email-action-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px;
}
.email-action-bar .inline { display: inline; }
.email-action-divider {
  width: 1px; height: 24px; background: var(--border); margin: 0 6px;
}

/* Email list (in main area) */
/* Bulk action bar (sticky at top of email list) */
.bulk-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  background: #fafbfd;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
}
.bulk-check-all {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted);
  font-weight: 500; cursor: pointer;
  padding: 4px 10px; border-radius: 6px;
}
.bulk-check-all input { width: 16px; height: 16px; cursor: pointer; }
.bulk-actions {
  display: flex; gap: 6px; align-items: center;
  opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
.bulk-actions.visible { opacity: 1; pointer-events: auto; }

.email-check {
  display: flex; align-items: center; padding: 0 14px 0 16px;
  cursor: pointer;
}
.email-check input { width: 16px; height: 16px; cursor: pointer; }
.email-row { display: flex; align-items: stretch; }
.email-row .email-link { flex: 1; }

.email-list {
  list-style: none; padding: 0; margin: 0;
}
.email-row {
  border-bottom: 1px solid var(--border);
}
.email-row:last-child { border-bottom: none; }
.email-row.unread { background: #f0f9ff; font-weight: 500; }
.email-link {
  display: grid; grid-template-columns: 240px 1fr 100px;
  gap: 14px; padding: 12px 16px; align-items: center;
  text-decoration: none; color: inherit;
}
.email-link:hover { background: #fafbfd; }
.email-from {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.email-from-name {
  font-weight: 500; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px;
}
.email-from-addr {
  font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px;
}
.email-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; flex-shrink: 0;
}
.email-avatar.large { width: 48px; height: 48px; font-size: 18px; }
.email-content {
  min-width: 0;
}
.email-subject {
  font-weight: 500; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.email-snippet {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.email-meta {
  text-align: right; font-size: 12px; color: var(--muted);
}
.email-date { white-space: nowrap; }

.email-view-head {
  display: flex; gap: 14px; align-items: flex-start;
}
.email-body-text {
  white-space: pre-wrap; word-break: break-word;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px; line-height: 1.6; margin: 0;
}
.email-body-html {
  font-size: 14px; line-height: 1.6; max-width: 100%;
}
.email-body-html img { max-width: 100%; height: auto; }

@media (max-width: 700px) {
  .email-link { grid-template-columns: 1fr; }
  .email-meta { text-align: left; }
}

/* MIS filter grid (one filter per Excel column, clean layout) */
.mis-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 14px;
}
@media (max-width: 1100px) { .mis-filter-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .mis-filter-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px)  { .mis-filter-grid { grid-template-columns: 1fr; } }
.mis-filter-grid label {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 13px; color: var(--text);
  text-transform: none; letter-spacing: normal; font-weight: 400;
}
.mis-filter-grid label > span {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .4px; font-weight: 600;
}
.mis-filter-grid input,
.mis-filter-grid select {
  padding: 7px 10px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 6px;
  font-family: inherit; background: white;
  color: var(--text); width: 100%;
}
.mis-filter-grid input:focus, .mis-filter-grid select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

/* Dashboard top-performer cards */
.top-perf-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
}
@media (max-width: 800px) {
  .top-perf-row { grid-template-columns: 1fr; }
}
.perf-card {
  background: #fafbfd; border: 1px solid var(--border);
  border-radius: 8px; padding: 14px;
}
.perf-card.highlight {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border-color: #bae6fd;
}
.perf-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); font-weight: 600;
}
.perf-name {
  font-size: 18px; font-weight: 700; margin: 4px 0;
  color: var(--primary);
}
.perf-value {
  font-size: 16px; font-weight: 600; color: var(--success);
}
.perf-meta {
  font-size: 11px; color: var(--muted); margin-top: 2px;
}

/* Invoice form */
.invoice-header .inv-header-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
}
@media (max-width: 800px) {
  .invoice-header .inv-header-grid { grid-template-columns: 1fr; }
}
.inv-block-label {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .5px;
  font-weight: 500;
}
.inv-fixed {
  background: #fafbfd; border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 6px;
  font-size: 14px; font-weight: 500;
  margin-top: 4px; word-wrap: break-word;
}
.developer-info {
  background: #f0f9ff; border: 1px solid #bae6fd;
  padding: 12px; border-radius: 6px; margin-top: 10px;
}
.developer-info .inv-fixed {
  background: white;
}

/* Items table — compact, scrollable on narrow screens */
.invoice-items-card { padding: 16px; }
.items-scroll { overflow-x: auto; }
.invoice-items-table {
  width: 100%; min-width: 900px;
  border-collapse: collapse;
  font-size: 12px;
}
.invoice-items-table th {
  background: #f6f7fb; padding: 8px 6px;
  font-size: 10px; text-transform: uppercase; letter-spacing: .3px;
  color: var(--muted); font-weight: 600;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.invoice-items-table th.col-num { text-align: right; }
.invoice-items-table th.col-pct { text-align: right; }
.invoice-items-table td {
  padding: 4px 4px;
  border-bottom: 1px solid var(--border);
}
.invoice-items-table td.num { text-align: right; }
.invoice-items-table input {
  width: 100%; border: 1px solid var(--border);
  padding: 6px 8px; border-radius: 4px;
  font-size: 12px; font-family: inherit;
  background: white;
}
.invoice-items-table input.num { text-align: right; font-variant-numeric: tabular-nums; }
.invoice-items-table input[readonly] {
  background: #f6f7fb; font-weight: 600; color: var(--success);
  border-color: transparent;
}
.invoice-items-table th.col-unit { width: 70px; }
.invoice-items-table th.col-pct { width: 70px; }
.invoice-items-table th.col-num { width: 130px; }
.invoice-items-table th.col-x { width: 30px; }
.invoice-items-table tfoot td {
  border-top: 2px solid var(--text);
  border-bottom: none;
  padding-top: 10px;
  font-size: 13px;
  font-weight: 600;
}

/* AML / KYC form */
.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  font-weight: 400; text-transform: none; letter-spacing: normal;
  font-size: 13px; color: var(--text);
  padding: 4px 0;
}
.checkbox-row input[type=checkbox] {
  width: 16px; height: 16px; cursor: pointer;
}
.docs-section {
  background: #fafbfd; border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 14px; margin-bottom: 8px;
}
.docs-section strong {
  display: block; margin-bottom: 4px;
  font-size: 13px; color: var(--text);
}

/* Booking form */
.calc-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px;
  margin-bottom: 10px;
}
.calc-row input[readonly] {
  background: #f6f7fb; font-weight: 600; color: var(--success);
}

/* Approval trail */
.approval-trail {
  display: flex; gap: 24px; flex-wrap: wrap;
  padding: 8px 0;
}
.approval-step {
  display: flex; align-items: center; gap: 10px;
  opacity: 0.5;
}
.approval-step.done { opacity: 1; }
.approval-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: #eef0f5; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600;
}
.approval-step.done .approval-icon {
  background: var(--success); color: white;
}

/* Meeting form — map and search */
.meeting-map {
  height: 320px; width: 100%; border-radius: 8px;
  border: 1px solid var(--border); margin-top: 10px;
  z-index: 1;
}
.search-results {
  max-height: 220px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 6px;
  background: white; margin-top: -8px;
}
.search-results:empty { display: none; }
.search-result {
  padding: 8px 12px; font-size: 13px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.search-result:last-child { border-bottom: none; }
.search-result:hover { background: #f6f7fb; }
.selected-location {
  padding: 10px 12px; background: #fafbfd;
  border: 1px solid var(--border); border-radius: 6px;
  margin-top: 8px; font-size: 13px;
}

/* Filter bar (users page) */
.filter-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px;
  padding-bottom: 16px; border-bottom: 1px solid var(--border);
}
.filter-bar input, .filter-bar select {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit; background: white;
}
.filter-bar input { min-width: 220px; flex: 1; }

/* Phone grid (country code + number) */
.phone-grid {
  display: grid; grid-template-columns: 280px 1fr; gap: 14px;
}
@media (max-width: 700px) { .phone-grid { grid-template-columns: 1fr; } }

/* Color pickers */
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type=color] {
  width: 44px; height: 36px; padding: 0; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; background: white;
}
.color-row input[type=text] { flex: 1; font-family: monospace; }

/* Preset chips */
.theme-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.preset {
  background: white; border: 1px solid var(--border); border-radius: 16px;
  padding: 5px 12px; font-size: 12px; cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.preset:hover { border-color: var(--primary); color: var(--primary); }

/* Live preview */
.theme-preview { background: #f6f7fb; border-radius: 8px; padding: 24px; }
.preview-card {
  background: white; border-radius: 8px; padding: 20px; box-shadow: var(--shadow);
  color: var(--t);
}
.preview-head { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #6b7280; }
.preview-h1 { font-size: 12px; text-transform: uppercase; color: #6b7280; margin-top: 12px; letter-spacing: .5px; }
.preview-amount { font-size: 26px; font-weight: 700; margin: 4px 0 12px; color: var(--p); }
.preview-body { margin: 12px 0; }
.preview-buttons { display: flex; gap: 8px; margin-top: 16px; }
.preview-btn-primary {
  background: var(--p); color: white; border: none; padding: 8px 14px;
  border-radius: 6px; font-family: inherit; font-weight: inherit; font-style: inherit;
  cursor: pointer;
}
.preview-btn-secondary {
  background: white; color: var(--t); border: 1px solid #e6e8ef;
  padding: 8px 14px; border-radius: 6px; font-family: inherit;
  font-weight: inherit; font-style: inherit; cursor: pointer;
}
.preview-pill {
  display: inline-block; margin-top: 12px;
  background: color-mix(in srgb, var(--p) 15%, white); color: var(--p);
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 500;
}

/* Sidebar preview (in theme settings) */
.sb-preview {
  border-radius: 10px;
  padding: 14px 10px;
  margin-bottom: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.sb-preview-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 6px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 8px;
}
.sb-preview-logo {
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 13px;
}
.sb-preview-item {
  padding: 7px 10px; border-radius: 6px;
  font-size: 12px; margin: 2px 4px;
  display: flex; align-items: center; gap: 8px;
}
.sb-preview-item.active {
  font-weight: 600;
  color: white;
}

/* Sidebar preset chips */
.preset-sidebar {
  background: white; border: 1px solid var(--border); border-radius: 16px;
  padding: 6px 12px; font-size: 12px; cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.preset-sidebar:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

.form-section-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin: 18px 0 4px; padding-top: 14px;
  border-top: 1px solid var(--border);
}

.sidebar-footer { border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; }
.user-chip { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.user-name { color: white; font-size: 13px; font-weight: 500; }
.user-role { color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.logout { color: #94a3b8; text-decoration: none; font-size: 13px; }
.logout:hover { color: white; }

/* Main */
.main { flex: 1; padding: 28px 36px; max-width: calc(100% - 244px); }
.main-full { flex: 1; padding: 0; width: 100%; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 24px; gap: 16px;
}
.page-head h1 { margin: 0 0 4px; font-size: 24px; font-weight: 700; }
.page-head .muted { margin: 0; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

/* Cards */
.card {
  background: var(--surface); border-radius: 10px; padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 20px; border: 1px solid var(--border);
}
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px;
}
.card-head h2 { margin: 0; font-size: 16px; font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* KPIs */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px;
}
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--surface); border-radius: 10px; padding: 18px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
.kpi-value { font-size: 24px; font-weight: 700; margin: 6px 0 4px; }
.kpi-sub { color: var(--muted); font-size: 12px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.table th { font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.table tbody tr:hover { background: #fafbfd; }
.table .right, th.right { text-align: right; }
.table a { color: var(--primary); text-decoration: none; font-weight: 500; }
.table a:hover { text-decoration: underline; }

/* Buttons */
.btn {
  display: inline-block; padding: 8px 14px; border-radius: 6px;
  border: 1px solid var(--border); background: white; color: var(--text);
  cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: none;
  transition: all .15s;
}
.btn:hover { background: #f9fafb; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: white; color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover { background: #fef2f2; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.full { width: 100%; }

.icon-btn {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; padding: 4px 8px; font-size: 18px; line-height: 1;
}
.icon-btn:hover { color: var(--danger); }

/* Segmented control */
.seg { display: inline-flex; background: #eef0f5; border-radius: 6px; padding: 3px; }
.seg a {
  padding: 5px 12px; font-size: 13px; text-decoration: none;
  color: var(--muted); border-radius: 4px;
}
.seg a.active { background: white; color: var(--text); box-shadow: var(--shadow); font-weight: 500; }

/* Search */
.search input {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 6px;
  width: 240px; font-size: 13px;
}

/* Pills */
.pill {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 500; background: #eef0f5; color: var(--muted);
  text-transform: capitalize;
}
.pill.small { font-size: 10px; padding: 1px 6px; }
.pill-call { background: #dbeafe; color: #1e40af; }
.pill-email { background: #e0e7ff; color: #3730a3; }
.pill-meeting { background: #fef3c7; color: #92400e; }
.pill-task { background: #f3e8ff; color: #6b21a8; }
.pill-note { background: #f1f5f9; color: #475569; }

.stage-lead { background: #f1f5f9; color: #475569; }
.stage-qualified { background: #dbeafe; color: #1e40af; }
.stage-proposal { background: #ede9fe; color: #6d28d9; }
.stage-negotiation { background: #fef3c7; color: #92400e; }
.stage-won { background: #d1fae5; color: #065f46; }
.stage-lost { background: #fee2e2; color: #991b1b; }

/* Forms */
.form-card form { display: flex; flex-direction: column; gap: 14px; }
.form-card label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .3px;
}
.form-card input, .form-card select, .form-card textarea {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; background: white; color: var(--text);
  font-weight: 400; text-transform: none; letter-spacing: normal;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row { display: block; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.inline { display: inline-flex; gap: 6px; align-items: center; }

/* Auth pages */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  padding: 20px;
}
.auth-card {
  background: white; border-radius: 14px; padding: 36px; width: 100%;
  max-width: 400px; box-shadow: 0 20px 40px rgba(0,0,0,.15);
}
.auth-brand { font-size: 16px; color: var(--primary); font-weight: 700; margin-bottom: 20px; }
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.auth-card label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 12px; font-weight: 500; color: var(--muted);
}
.auth-card input {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
.auth-card .center { text-align: center; }
.auth-card a { color: var(--primary); text-decoration: none; font-weight: 500; }

/* Flash messages */
.flash {
  padding: 10px 14px; border-radius: 6px; margin-bottom: 14px;
  font-size: 13px; border: 1px solid;
}
.flash-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.flash-error { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* Kanban */
.kanban {
  display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr));
  gap: 12px; overflow-x: auto; padding-bottom: 10px;
}
.kanban-col {
  background: #f1f3f8; border-radius: 8px; padding: 10px;
  min-height: 300px; display: flex; flex-direction: column;
}
.kanban-col-head { padding: 4px 6px 12px; }
.kanban-col-title { font-weight: 600; font-size: 13px; }
.kanban-col-sub { font-size: 11px; color: var(--muted); }
.kanban-col-body { flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 100px; }
.kanban-col-body.drag-over { background: rgba(79,70,229,.08); border-radius: 6px; }
.deal-card {
  background: white; border-radius: 6px; padding: 10px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  cursor: grab; transition: transform .15s;
}
.deal-card:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.08); }
.deal-card.dragging { opacity: .5; cursor: grabbing; }
.deal-title { font-weight: 600; color: var(--text); text-decoration: none; font-size: 13px; display: block; }
.deal-title:hover { color: var(--primary); }
.deal-amount { font-size: 16px; font-weight: 700; margin: 4px 0; color: var(--success); }
.deal-meta { margin-bottom: 6px; }
.deal-foot { display: flex; justify-content: space-between; align-items: center; }

/* Stage bars */
.stage-bars { display: flex; flex-direction: column; gap: 12px; }
.stage-row {
  display: grid; grid-template-columns: 140px 1fr 100px;
  gap: 12px; align-items: center; font-size: 13px;
}
.stage-row-label { font-weight: 500; }
.stage-row-value { text-align: right; font-weight: 600; }
.stage-bar { height: 8px; background: #eef0f5; border-radius: 4px; overflow: hidden; }
.stage-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }
.stage-bar-fill.stage-won { background: var(--won); }
.stage-bar-fill.stage-lost { background: var(--lost); }

/* Bar chart */
.bar-chart {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 8px; height: 180px; align-items: end;
}
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-wrap { width: 100%; height: 120px; display: flex; align-items: flex-end; }
.bar {
  width: 70%; margin: 0 auto; background: linear-gradient(180deg, #4f46e5, #7c3aed);
  border-radius: 4px 4px 0 0; min-height: 2px; transition: height .3s;
}
.bar-val { font-size: 11px; font-weight: 600; }
.bar-label { font-size: 10px; color: var(--muted); }

/* Task list */
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.task-list li:last-child { border-bottom: none; }
.task-list.big li { padding: 14px 0; }
.task-body { flex: 1; }
.task-title { font-weight: 500; font-size: 13px; }
.task-title.done { text-decoration: line-through; color: var(--muted); }
.task-meta { display: flex; gap: 10px; margin-top: 4px; font-size: 12px; flex-wrap: wrap; }
.checkbox {
  width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 4px;
  background: white; cursor: pointer; margin-top: 2px; padding: 0;
}
.checkbox:hover { border-color: var(--primary); }
.checkbox.checked { background: var(--primary); border-color: var(--primary); }

/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.timeline li:last-child { border-bottom: none; }
.timeline .pill { height: fit-content; margin-top: 2px; }

/* Leaderboard */
.leaderboard { list-style: none; padding: 0; margin: 0; counter-reset: rank; }
.leaderboard li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); counter-increment: rank;
}
.leaderboard li::before {
  content: counter(rank); display: inline-block; width: 24px; height: 24px;
  background: #eef0f5; border-radius: 50%; text-align: center; line-height: 24px;
  font-size: 12px; font-weight: 600; margin-right: 10px;
}
.leaderboard li:first-child::before { background: #fef3c7; color: #92400e; }

.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li {
  padding: 8px 0; border-bottom: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center;
}
.plain-list li:last-child { border-bottom: none; }
.plain-list a { color: var(--primary); text-decoration: none; font-weight: 500; }

/* Utilities */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.right { text-align: right; }
