:root {
  --background: 36 32% 94%;
  --foreground: 35 18% 12%;
  --primary: 41 72% 46%;
  --primary-foreground: 38 45% 96%;
  --secondary: 28 17% 20%;
  --secondary-foreground: 38 42% 94%;
  --muted: 34 24% 86%;
  --muted-foreground: 31 11% 42%;
  --destructive: 4 68% 45%;
  --destructive-foreground: 35 40% 96%;
  --border: 34 18% 78%;
  --card: 38 38% 98%;
  --shadow-sm: 0 6px 18px rgba(38, 30, 22, 0.08);
  --shadow-md: 0 18px 48px rgba(38, 30, 22, 0.12);
  --shadow-lg: 0 26px 80px rgba(38, 30, 22, 0.18);
  --transition-fast: 160ms ease;
  --transition-smooth: 280ms cubic-bezier(.2,.8,.2,1);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
}

.dark {
  --background: 30 18% 9%;
  --foreground: 40 34% 92%;
  --primary: 41 76% 54%;
  --primary-foreground: 30 20% 10%;
  --secondary: 34 22% 16%;
  --secondary-foreground: 40 32% 92%;
  --muted: 32 18% 18%;
  --muted-foreground: 36 14% 67%;
  --destructive: 4 68% 54%;
  --destructive-foreground: 35 35% 96%;
  --border: 32 17% 25%;
  --card: 32 20% 13%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, hsl(var(--primary) / 0.18), transparent 34rem),
    linear-gradient(135deg, hsl(var(--background)), hsl(var(--muted)));
  color: hsl(var(--foreground));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, a { transition: all var(--transition-fast); }
button { min-height: 44px; }
input, textarea, select {
  font-size: max(16px, 1rem);
}

.bg-1 { background: hsl(var(--background)); }
.bg-2 { background: hsl(var(--card)); }
.bg-3 { background: hsl(var(--muted)); }
.bg-4 { background: hsl(var(--secondary)); }
.text-primary { color: hsl(var(--foreground)); }
.text-secondary { color: hsl(var(--muted-foreground)); }
.text-tertiary { color: hsl(var(--foreground) / 0.62); }
.accent { color: hsl(var(--primary)); }

.status-pulse {
  position: relative;
}
.status-pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  border: 1px solid hsl(var(--primary) / 0.45);
  animation: pulseRing 1.8s ease-out infinite;
}
@keyframes pulseRing {
  from { transform: scale(.75); opacity: .65; }
  to { transform: scale(1.45); opacity: 0; }
}
.timeline-line::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  bottom: -1rem;
  left: .45rem;
  width: 1px;
  background: hsl(var(--border));
}
.glass-card {
  background: hsl(var(--card) / 0.88);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-sm);
}
.safe-bottom {
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
}

/* Slide in animation for VIP CRM Drawer */
.animate-slide-in {
  animation: slideIn var(--transition-smooth) forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0.8;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
