/* ══ JUST CLEANING CRM — styles.css (v4 Futuristic) ══ */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --navy:   #07080e;
  --navy2:  #0d0f1e;
  --navy3:  #121624;
  --card:   #0e1122;
  --card2:  #131728;
  --teal:   #00e5c3;
  --teal2:  #00b89a;
  --teal3:  #006e5c;
  --white:  #f3f5f8;
  --grey:   #8692a6;
  --grey2:  #454e64;
  --border: rgba(255,255,255,0.07);
  --border-teal: rgba(0,229,195,0.2);
  --ease:   cubic-bezier(0.16,1,0.3,1);
  --bounce: cubic-bezier(0.34,1.56,0.64,1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── CRM Root ── */
.crm-root {
  background: var(--navy);
  position: relative;
}
.crm-root::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 50%, rgba(0,229,195,0.04) 0%, transparent 60%),
    radial-gradient(ellipse 40% 60% at 80% 20%, rgba(0,229,195,0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: var(--navy2); }
::-webkit-scrollbar-thumb { background: var(--grey2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal3); }
* { scrollbar-width: thin; scrollbar-color: var(--grey2) var(--navy2); }

/* ── Sidebar ── */
.crm-sidebar {
  background: var(--navy2);
  border-right: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.crm-sidebar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(0,229,195,0.3), transparent);
  animation: sidebarGlow 4s ease-in-out infinite;
}
@keyframes sidebarGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ── Sidebar nav buttons ── */
.crm-nav-btn {
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s var(--ease);
  color: var(--grey);
  background: transparent;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.crm-nav-btn::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--teal);
  transform: scaleY(0);
  transition: transform 0.2s var(--ease);
}
.crm-nav-btn:hover { background: rgba(255,255,255,0.04); color: var(--white); }
.crm-nav-btn.active {
  background: rgba(0,229,195,0.08);
  color: var(--teal);
  border-color: rgba(0,229,195,0.18);
}
.crm-nav-btn.active::before { transform: scaleY(1); }

/* ── Lead cards ── */
.crm-lead-card {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}
.crm-lead-card::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0,229,195,0.04), transparent);
  transition: left 0.4s var(--ease);
}
.crm-lead-card:hover::before { left: 100%; }
.crm-lead-card:hover { background: rgba(0,229,195,0.03); }
.crm-lead-card.selected { background: rgba(0,229,195,0.06); border-left: 2px solid var(--teal); }

/* ── Detail panel ── */
.crm-detail-panel {
  background: var(--card);
  border-left: 1px solid var(--border);
}

/* ── Stat cards ── */
.crm-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s;
}
.crm-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  animation: shimmer 3s ease-in-out infinite;
}
.crm-stat:hover { border-color: var(--border-teal); transform: translateY(-2px); }
@keyframes shimmer { 0%,100%{opacity:.2} 50%{opacity:1} }

/* ── Input fields ── */
input, select, textarea {
  background: var(--navy) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 10px !important;
  color: var(--white) !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(0,229,195,0.4) !important;
  box-shadow: 0 0 0 3px rgba(0,229,195,0.07) !important;
  outline: none !important;
}
input::placeholder, textarea::placeholder { color: var(--grey2) !important; }
select option { background: var(--navy2); color: var(--white); }

/* ── Modals ── */
.crm-modal {
  background: var(--card);
  border: 1px solid var(--border-teal);
  border-radius: 20px;
  box-shadow: 0 0 60px rgba(0,229,195,0.08), 0 24px 64px rgba(0,0,0,0.6);
  position: relative;
  overflow: hidden;
}
.crm-modal::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--teal2));
}

/* ── Chat bubbles ── */
.chat-bubble-out {
  background: linear-gradient(135deg, var(--teal), var(--teal2));
  color: var(--navy);
  border-radius: 18px 18px 4px 18px;
  font-weight: 500;
}
.chat-bubble-in {
  background: var(--navy3);
  border: 1px solid var(--border);
  border-radius: 18px 18px 18px 4px;
  color: var(--white);
}

/* ── Chat messages background ── */
.chat-messages-bg {
  background: var(--navy) !important;
}

/* ── Toast notification ── */
.crm-toast {
  background: var(--card);
  border: 1px solid var(--border-teal);
  color: var(--white);
  box-shadow: 0 0 30px rgba(0,229,195,0.15), 0 16px 48px rgba(0,0,0,0.5);
}

/* ── Mobile header ── */
.crm-mobile-header {
  background: var(--navy2);
  border-bottom: 1px solid var(--border);
}

/* ── Status badges (override Tailwind) ── */
.status-new      { background: rgba(239,68,68,0.15);   color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.status-contacted{ background: rgba(234,179,8,0.15);   color: #facc15; border: 1px solid rgba(234,179,8,0.3); }
.status-quoted   { background: rgba(0,229,195,0.15);   color: #00e5c3; border: 1px solid rgba(0,229,195,0.3); }
.status-booked   { background: rgba(34,197,94,0.15);   color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.status-sold     { background: rgba(16,185,129,0.15);  color: #34d399; border: 1px solid rgba(16,185,129,0.3); }

/* ── Info grid tiles ── */
.crm-info-tile {
  background: var(--navy2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  transition: border-color 0.2s;
}
.crm-info-tile:hover { border-color: var(--border-teal); }
.crm-info-tile .label { font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--grey); margin-bottom: 4px; }
.crm-info-tile .value { font-size: 14px; color: var(--white); font-weight: 500; }

/* ── Map picker modal bottom sheet ── */
.maps-sheet {
  background: var(--card2);
  border: 1px solid var(--border-teal);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,229,195,0.1), 0 24px 64px rgba(0,0,0,0.7);
}
.maps-sheet-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  transition: background 0.2s;
  border: none;
  background: transparent;
  color: var(--white);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.maps-sheet-btn:hover { background: rgba(0,229,195,0.06); }
.maps-sheet-btn:last-of-type { border-bottom: none; }

/* ── Quick reply chips ── */
.crm-chip {
  background: rgba(0,229,195,0.08);
  border: 1px solid rgba(0,229,195,0.2);
  color: var(--teal);
  border-radius: 100px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.crm-chip:hover { background: rgba(0,229,195,0.15); transform: translateY(-1px); }

/* ── Teal primary button ── */
.crm-btn-primary {
  background: var(--teal);
  color: var(--navy);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}
.crm-btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  transition: transform 0.4s;
}
.crm-btn-primary:hover::after { transform: translateX(100%); }
.crm-btn-primary:hover { background: var(--teal2); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(0,229,195,0.3); }

/* ── Analytics cards ── */
.crm-analytics-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease);
}
.crm-analytics-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.crm-analytics-card:hover::after { transform: scaleX(1); }
.crm-analytics-card:hover { border-color: var(--border-teal); transform: translateY(-3px); }

/* ── Unread badge ── */
.crm-badge {
  background: #ef4444;
  color: white;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
  0%,100%{ box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%{ box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* ── Scanning line animation for new lead ── */
@keyframes scanLine {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.5; }
  100% { transform: translateY(100%); opacity: 0; }
}
.crm-scan::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  animation: scanLine 2s ease-in-out;
}

/* ── Existing animations ── */
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
@keyframes scaleIn { from{opacity:0;transform:scale(0.93)} to{opacity:1;transform:scale(1)} }
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }
@keyframes slideInLeft { from{opacity:0;transform:translateX(-32px)} to{opacity:1;transform:translateX(0)} }
@keyframes slideInRight { from{opacity:0;transform:translateX(32px)} to{opacity:1;transform:translateX(0)} }

.animate-fade-in    { animation: fadeIn 0.4s ease both; }
.animate-scale-in   { animation: scaleIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both; }
.animate-slide-up   { animation: slideUp 0.4s ease both; }
.animate-slide-in-left  { animation: slideInLeft 0.5s cubic-bezier(0.16,1,0.3,1) both; }
.animate-slide-in-right { animation: slideInRight 0.5s cubic-bezier(0.16,1,0.3,1) both; }
.delay-75  { animation-delay: 75ms; }
.delay-150 { animation-delay: 150ms; }

/* ── Glow pulse on teal elements ── */
@keyframes tealpulse {
  0%,100%{ box-shadow: 0 0 0 0 rgba(0,229,195,0.25); }
  50%{ box-shadow: 0 0 16px 4px rgba(0,229,195,0.12); }
}

/* ── Maps sheet cancel btn ── */
.maps-cancel {
  width: 100%;
  padding: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--grey);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.2s;
  border-top: 1px solid var(--border);
}
.maps-cancel:hover { color: var(--white); }

/* ── Tailwind overrides for remaining classes ── */
.bg-\[\#0e1122\] { background-color: #0e1122 !important; }
.bg-\[\#07080e\] { background-color: #07080e !important; }
.bg-\[\#0d0f1e\] { background-color: #0d0f1e !important; }
.bg-\[\#121624\] { background-color: #121624 !important; }
.bg-\[\#1a1f35\] { background-color: #1a1f35 !important; }
.text-\[\#00e5c3\] { color: #00e5c3 !important; }
.text-\[\#f3f5f8\] { color: #f3f5f8 !important; }
.text-\[\#8692a6\] { color: #8692a6 !important; }
.border-\[rgba\(0\2c 229\2c 195\2c 0\.2\)\] { border-color: rgba(0,229,195,0.2) !important; }
.border-\[rgba\(255\2c 255\2c 255\2c 0\.07\)\] { border-color: rgba(255,255,255,0.07) !important; }

@keyframes badgePulse {
  0%,100%{ box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%{ box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* ══ MOBILE IMPROVEMENTS ══ */
@media (max-width: 768px) {
  /* Email client on mobile — stack vertically */
  .email-mobile-folders { display: none !important; }

  /* Kanban — horizontal scroll feels native on mobile */
  .kanban-board { -webkit-overflow-scrolling: touch; }

  /* Better touch targets */
  button { min-height: 36px; }

  /* Prevent text size adjustment */
  body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

  /* Safe area for bottom nav */
  .crm-root { padding-bottom: 0; }

  /* Remove hover states on mobile (they stick on touch) */
  .crm-lead-card:hover { transform: none; }

  /* Compose modal full screen on mobile */
  .compose-modal { max-width: 100% !important; max-height: 100% !important; border-radius: 20px 20px 0 0 !important; }
}

/* Email mobile — show only list, then body */
@media (max-width: 640px) {
  /* Force email to show as two-pane: folder+list OR full body */
  .email-folder-sidebar { width: clamp(56px, 14vw, 160px) !important; }
  .email-folder-sidebar .folder-label { display: none; }
  .email-folder-sidebar .folder-icon { font-size: 20px; }
  .email-list-pane { width: 100% !important; flex: 1 !important; }
  .email-body-pane { display: none !important; }
  .email-body-pane.active { display: flex !important; position: fixed; inset: 0; z-index: 40; }
}

/* Scrollbar hide on mobile */
@media (max-width: 768px) {
  ::-webkit-scrollbar { display: none; }
  * { scrollbar-width: none; }
}

/* Analytics grid mobile */
@media (max-width: 480px) {
  .analytics-stats { grid-template-columns: 1fr 1fr !important; }
}

/* Bottom nav safe area */
.mobile-bottom-nav {
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

/* ══ MOBILE SHOW/HIDE — CSS backup for isMobile ══ */
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
}
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
  /* Sidebar hidden by default on mobile, shown when open */
  .crm-sidebar-mobile { transform: translateX(-100%); transition: transform 0.2s ease; }
  .crm-sidebar-mobile.open { transform: translateX(0); }
}

/* ═══════════════════════════════════════════════
   CRM v5 — ANIMATIONS & APP-LIKE POLISH
═══════════════════════════════════════════════ */

/* ── Core keyframes ── */
@keyframes floatY {
  0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)}
}
@keyframes pulseRing {
  0%{box-shadow:0 0 0 0 rgba(0,229,195,0.5)}
  70%{box-shadow:0 0 0 16px rgba(0,229,195,0)}
  100%{box-shadow:0 0 0 0 rgba(0,229,195,0)}
}
@keyframes pulseRingGreen {
  0%{box-shadow:0 0 0 0 rgba(34,197,94,0.6)}
  70%{box-shadow:0 0 0 20px rgba(34,197,94,0)}
  100%{box-shadow:0 0 0 0 rgba(34,197,94,0)}
}
@keyframes pulseRingRed {
  0%{box-shadow:0 0 0 0 rgba(239,68,68,0.5)}
  70%{box-shadow:0 0 0 16px rgba(239,68,68,0)}
  100%{box-shadow:0 0 0 0 rgba(239,68,68,0)}
}
@keyframes ripple {
  0%{transform:scale(0);opacity:1}
  100%{transform:scale(4);opacity:0}
}
@keyframes gradientShift {
  0%{background-position:0% 50%}
  50%{background-position:100% 50%}
  100%{background-position:0% 50%}
}
@keyframes spin {
  to{transform:rotate(360deg)}
}
@keyframes slideUpFade {
  from{opacity:0;transform:translateY(30px) scale(0.97)}
  to{opacity:1;transform:translateY(0) scale(1)}
}
@keyframes popIn {
  0%{opacity:0;transform:scale(0.8)}
  70%{transform:scale(1.05)}
  100%{opacity:1;transform:scale(1)}
}
@keyframes breathe {
  0%,100%{opacity:0.6;transform:scale(1)}
  50%{opacity:1;transform:scale(1.04)}
}
@keyframes waveform {
  0%,100%{height:4px}
  50%{height:18px}
}
@keyframes callTimer {
  from{opacity:0.7} to{opacity:1}
}
@keyframes numberPop {
  0%{transform:scale(1)}
  40%{transform:scale(1.2)}
  100%{transform:scale(1)}
}
@keyframes glowPulse {
  0%,100%{filter:drop-shadow(0 0 6px rgba(0,229,195,0.4))}
  50%{filter:drop-shadow(0 0 18px rgba(0,229,195,0.8))}
}
@keyframes slideBottomIn {
  from{transform:translateY(100%);opacity:0}
  to{transform:translateY(0);opacity:1}
}
@keyframes pressDown {
  0%{transform:scale(1)}
  50%{transform:scale(0.93)}
  100%{transform:scale(1)}
}

/* ── Utility animation classes ── */
.anim-float { animation: floatY 3s ease-in-out infinite; }
.anim-pulse-teal { animation: pulseRing 2s ease-in-out infinite; }
.anim-pulse-green { animation: pulseRingGreen 1.5s ease-in-out infinite; }
.anim-pulse-red { animation: pulseRingRed 1.5s ease-in-out infinite; }
.anim-slide-up-fade { animation: slideUpFade 0.45s cubic-bezier(0.16,1,0.3,1) both; }
.anim-pop-in { animation: popIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both; }
.anim-breathe { animation: breathe 2.5s ease-in-out infinite; }
.anim-spin { animation: spin 0.8s linear infinite; }
.anim-bottom-in { animation: slideBottomIn 0.4s cubic-bezier(0.16,1,0.3,1) both; }

/* ── Stagger delays ── */
.delay-1{animation-delay:0.05s}
.delay-2{animation-delay:0.1s}
.delay-3{animation-delay:0.15s}
.delay-4{animation-delay:0.2s}
.delay-5{animation-delay:0.25s}
.delay-6{animation-delay:0.3s}
.delay-7{animation-delay:0.35s}
.delay-8{animation-delay:0.4s}
.delay-9{animation-delay:0.45s}
.delay-10{animation-delay:0.5s}
.delay-11{animation-delay:0.55s}
.delay-12{animation-delay:0.6s}

/* ── Phone dialer — mobile app style ── */
.dialer-root {
  display: flex;
  height: 100%;
  background: #07080e;
  overflow: hidden;
}

/* Mobile: full screen stacked layout */
@media (max-width: 768px) {
  .dialer-root {
    flex-direction: column;
  }
  .dialer-left {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex: 1;
    min-height: 0;
  }
  .dialer-right {
    position: fixed !important;
    inset: 0 !important;
    z-index: 100 !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .dialer-right.idle-state { display: none !important; }
}

/* ── Dial pad button ── */
.dial-btn {
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.08);
  background: #121624;
  color: #f3f5f8;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  width: 64px;
}
.dial-btn:hover { background: rgba(0,229,195,0.1); border-color: rgba(0,229,195,0.3); }
.dial-btn:active { transform: scale(0.92); background: rgba(0,229,195,0.15); }
.dial-btn .sub { font-size: 8px; color: #454e64; letter-spacing: 1.5px; font-weight: 500; }

/* ── Ripple effect on dial buttons ── */
.dial-btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(0,229,195,0.25);
  animation: ripple 0.5s ease-out forwards;
  pointer-events: none;
}

/* ── Call action buttons (answer/reject/hangup) ── */
.call-action-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.call-action-btn:active { transform: scale(0.88) !important; }
.call-btn-answer {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 0 24px rgba(34,197,94,0.5);
  animation: pulseRingGreen 1.5s ease-in-out infinite;
}
.call-btn-reject, .call-btn-hangup {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 0 20px rgba(239,68,68,0.4);
}
.call-btn-answer:hover { transform: scale(1.08); box-shadow: 0 0 36px rgba(34,197,94,0.7); }
.call-btn-reject:hover { transform: scale(1.08); box-shadow: 0 0 32px rgba(239,68,68,0.6); }

/* ── Control buttons (mute, keypad, etc) ── */
.ctrl-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.07);
  color: #f3f5f8;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.ctrl-btn:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); }
.ctrl-btn:active { transform: scale(0.92); }
.ctrl-btn.active { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #f87171; }
.ctrl-btn .ctrl-label { font-size: 9px; color: #8692a6; letter-spacing: 0.5px; font-weight: 600; text-transform: uppercase; }

/* ── Waveform animation (active call) ── */
.waveform { display: flex; align-items: center; gap: 3px; height: 24px; }
.waveform span {
  display: inline-block;
  width: 3px;
  background: #00e5c3;
  border-radius: 99px;
  animation: waveform 0.8s ease-in-out infinite;
}
.waveform span:nth-child(1){animation-delay:0s}
.waveform span:nth-child(2){animation-delay:0.1s}
.waveform span:nth-child(3){animation-delay:0.2s}
.waveform span:nth-child(4){animation-delay:0.3s}
.waveform span:nth-child(5){animation-delay:0.15s}
.waveform span:nth-child(6){animation-delay:0.05s}
.waveform span:nth-child(7){animation-delay:0.25s}

/* ── Call timer ── */
.call-timer {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 28px;
  letter-spacing: 4px;
  color: #00e5c3;
  animation: callTimer 1s ease-in-out infinite alternate;
}

/* ── Number input display ── */
.dial-display {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dial-display:focus-within {
  border-color: rgba(0,229,195,0.35);
  box-shadow: 0 0 0 3px rgba(0,229,195,0.07);
}

/* ── Incoming call overlay ── */
.incoming-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #07080e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 60px 24px 56px;
  animation: slideBottomIn 0.4s cubic-bezier(0.16,1,0.3,1) both;
}

/* ── Lead card hover — more fluid ── */
.crm-lead-card {
  transition: background 0.15s, border-color 0.15s, transform 0.2s cubic-bezier(0.16,1,0.3,1);
}
@media (min-width: 768px) {
  .crm-lead-card:hover { transform: translateX(3px); }
}

/* ── Sidebar active item indicator ── */
.crm-nav-btn.active::before {
  background: linear-gradient(to bottom, #00e5c3, #00b89a);
  box-shadow: 0 0 8px rgba(0,229,195,0.5);
}

/* ── Toast slide in ── */
.crm-toast { animation: slideInRight 0.35s cubic-bezier(0.16,1,0.3,1) both; }

/* ── Page transitions ── */
.page-enter { animation: slideUpFade 0.35s cubic-bezier(0.16,1,0.3,1) both; }

/* ── Stat card hover ── */
.crm-stat { cursor: default; }
@media (min-width: 768px) {
  .crm-analytics-card:hover { transform: translateY(-4px); }
}

/* ── Input focus glow ── */
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(0,229,195,0.08), 0 0 16px rgba(0,229,195,0.08) !important;
}

/* ── Button press haptic feel ── */
button:active:not(:disabled) { transform: scale(0.96); }

/* ── Mobile bottom nav active dot ── */
.mob-nav-dot {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #00e5c3;
  box-shadow: 0 0 6px #00e5c3;
  animation: popIn 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* ── Chat bubble entrance ── */
.chat-bubble-out, .chat-bubble-in {
  animation: popIn 0.2s cubic-bezier(0.34,1.56,0.64,1) both;
}

/* ── Scrollbar refinement ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-thumb { background: rgba(0,229,195,0.2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,229,195,0.4); }