/* ==========================================================================
   FOUNTAIN TECHNOLOGIES CRM — ADMIN DASHBOARD
   Design System: QClay Soft-Surface / Neomorphic Clay Style
   ========================================================================== */

:root {
  /* Canvas & Card Surfaces */
  --crm-bg: #e9ecf1;
  --crm-canvas: #f2f4f7;
  --crm-card: #ffffff;
  --crm-card-soft: #f7f9fb;
  --crm-card-muted: #eef2f6;
  --crm-border: #e3e8ef;
  --crm-border-light: rgba(255, 255, 255, 0.8);

  /* Brand Accents */
  --crm-terracotta: #f05a36;
  --crm-terracotta-hover: #dc4723;
  --crm-terracotta-soft: rgba(240, 90, 54, 0.12);
  --crm-terracotta-gradient: linear-gradient(135deg, #f25a38 0%, #ea580c 100%);
  
  --crm-teal: #0284c7;
  --crm-teal-soft: rgba(2, 132, 199, 0.1);
  --crm-green: #10b981;
  --crm-green-soft: rgba(16, 185, 129, 0.12);
  --crm-amber: #f59e0b;
  --crm-amber-soft: rgba(245, 158, 11, 0.12);
  --crm-purple: #8b5cf6;
  --crm-purple-soft: rgba(139, 92, 246, 0.12);

  /* Text Colors */
  --crm-text-main: #131b26;
  --crm-text-muted: #69788d;
  --crm-text-light: #94a3b8;
  --crm-text-white: #ffffff;

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Outfit', 'Plus Jakarta Sans', sans-serif;

  /* Shadows (Clay / Soft Neomorphic Elevation) */
  --crm-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
  --crm-shadow-card: 0 12px 28px -6px rgba(18, 30, 49, 0.06), 0 4px 10px rgba(18, 30, 49, 0.02);
  --crm-shadow-clay: 0 18px 36px rgba(19, 27, 38, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --crm-shadow-float: 0 20px 40px -10px rgba(19, 27, 38, 0.12);
  --crm-shadow-terracotta: 0 10px 24px -4px rgba(240, 90, 54, 0.35);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-2xl: 34px;
  --radius-full: 9999px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--crm-bg);
  color: var(--crm-text-main);
  line-height: 1.5;
  min-height: 100vh;
  padding: 24px 20px;
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   LAYOUT WRAPPER (MATCHING SCREENSHOT CANVAS)
   -------------------------------------------------------------------------- */
.crm-layout {
  display: flex;
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
  align-items: flex-start;
  position: relative;
}

/* Left Floating Action Pill */
.crm-floating-strip {
  position: sticky;
  top: 30px;
  background: #ffffff;
  border-radius: var(--radius-full);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--crm-shadow-card);
  border: 1px solid var(--crm-border);
  z-index: 50;
}

.crm-strip-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crm-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-strip-btn:hover {
  background: var(--crm-card-muted);
  color: var(--crm-text-main);
}

.crm-strip-btn.active {
  background: var(--crm-terracotta);
  color: #ffffff;
  box-shadow: var(--crm-shadow-terracotta);
}

.crm-strip-divider {
  width: 20px;
  height: 1px;
  background: var(--crm-border);
}

/* Main Dashboard Canvas Card */
.crm-canvas {
  flex-grow: 1;
  background: var(--crm-canvas);
  border-radius: var(--radius-2xl);
  padding: 28px 32px 40px;
  box-shadow: var(--crm-shadow-clay);
  border: 1px solid rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   1. DASHBOARD TOP HEADER
   -------------------------------------------------------------------------- */
.crm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.crm-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.crm-brand-collapse-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--crm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crm-text-muted);
  cursor: pointer;
  box-shadow: var(--crm-shadow-sm);
}

.crm-brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #0f172a;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.crm-brand-titles {
  display: flex;
  flex-direction: column;
}

.crm-brand-title {
  font-family: var(--font-heading);
  font-size: 1.1875rem;
  font-weight: 800;
  color: var(--crm-text-main);
  line-height: 1.1;
}

.crm-brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--crm-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.crm-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.crm-profile-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--crm-border);
  padding: 6px 16px 6px 6px;
  border-radius: var(--radius-full);
  box-shadow: var(--crm-shadow-sm);
}

.crm-profile-add-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--crm-card-muted);
  color: var(--crm-text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  border: none;
}

.crm-profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f97316;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8125rem;
}

.crm-profile-info {
  display: flex;
  flex-direction: column;
}

.crm-profile-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--crm-text-main);
  line-height: 1.1;
}

.crm-profile-role {
  font-size: 0.6875rem;
  color: var(--crm-text-muted);
}

.crm-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid var(--crm-border);
  padding: 8px 18px;
  border-radius: var(--radius-full);
  box-shadow: var(--crm-shadow-sm);
  width: 260px;
}

.crm-search-bar input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.875rem;
  color: var(--crm-text-main);
  width: 100%;
}

.crm-search-bar input::placeholder {
  color: var(--crm-text-light);
}

/* --------------------------------------------------------------------------
   2. TOP QUICK BANNER & AI PROMPT ROW
   -------------------------------------------------------------------------- */
.crm-banner-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: stretch;
}

/* Date & Quick Action Card */
.crm-date-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--crm-shadow-card);
  border: 1px solid var(--crm-border);
}

.crm-date-num {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--crm-text-main);
  line-height: 1;
}

.crm-date-meta {
  display: flex;
  flex-direction: column;
  padding-right: 12px;
  border-right: 1px solid var(--crm-border);
}

.crm-date-day {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--crm-text-main);
}

.crm-date-month {
  font-size: 0.75rem;
  color: var(--crm-text-muted);
}

.crm-btn-terracotta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--crm-terracotta-gradient);
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  box-shadow: var(--crm-shadow-terracotta);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none;
}

.crm-btn-terracotta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -2px rgba(240, 90, 54, 0.45);
}

.crm-calendar-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--crm-card-soft);
  border: 1px solid var(--crm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crm-text-main);
  cursor: pointer;
  position: relative;
}

.crm-calendar-icon-btn::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--crm-terracotta);
}

/* AI Assistant Prompt Card */
.crm-ai-prompt-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--crm-shadow-card);
  border: 1px solid var(--crm-border);
  cursor: text;
}

.crm-ai-prompt-text {
  display: flex;
  flex-direction: column;
}

.crm-ai-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--crm-text-main);
  line-height: 1.2;
}

.crm-ai-placeholder {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--crm-text-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

.crm-ai-placeholder .cursor {
  display: inline-block;
  width: 2px;
  height: 18px;
  background-color: var(--crm-terracotta);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.crm-ai-mic-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--crm-card-soft);
  border: 1px solid var(--crm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crm-text-main);
  cursor: pointer;
  box-shadow: var(--crm-shadow-sm);
  transition: all 0.2s ease;
}

.crm-ai-mic-btn:hover {
  background: var(--crm-terracotta);
  color: #ffffff;
  border-color: var(--crm-terracotta);
}

/* --------------------------------------------------------------------------
   3. MIDDLE ANALYTICS WIDGETS ROW (MATCHING REFERENCE)
   -------------------------------------------------------------------------- */
.crm-widgets-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 0.8fr 0.8fr 0.8fr 1fr;
  gap: 18px;
}

.crm-card {
  background: var(--crm-card);
  border-radius: var(--radius-xl);
  padding: 22px 20px;
  box-shadow: var(--crm-shadow-card);
  border: 1px solid var(--crm-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* Card 1: Pipeline Summary Card (Visa style) */
.crm-card-pipeline {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.crm-pipeline-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.crm-pipeline-brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  color: #0f172a;
}

.crm-pill-dropdown {
  background: var(--crm-card-muted);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--crm-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.crm-pipeline-mask {
  font-size: 0.8125rem;
  color: var(--crm-text-muted);
}

.crm-pipeline-mask strong {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  color: var(--crm-text-main);
}

.crm-pipeline-actions {
  display: flex;
  gap: 10px;
  margin: 14px 0;
}

.crm-btn-mini {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 700;
  border: 1px solid var(--crm-border);
  background: var(--crm-card-soft);
  color: var(--crm-text-main);
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.crm-btn-mini:hover {
  background: #0f172a;
  color: #ffffff;
}

.crm-btn-mini.primary {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.crm-pipeline-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed var(--crm-border);
}

.crm-pipeline-stat {
  display: flex;
  flex-direction: column;
}

.crm-pipeline-stat-label {
  font-size: 0.6875rem;
  color: var(--crm-text-muted);
}

.crm-pipeline-stat-val {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--crm-terracotta);
}

/* Card 2: Metrics Card (Total income & Total paid) */
.crm-card-metrics {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.crm-metric-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.crm-metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crm-metric-icon-wrap {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--crm-card-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crm-text-muted);
}

.crm-metric-label {
  font-size: 0.75rem;
  color: var(--crm-text-muted);
}

.crm-metric-value {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--crm-text-main);
}

.crm-metric-value.terracotta {
  color: var(--crm-terracotta);
}

/* Card 3: System Lock / Conversion Progress Ring */
.crm-card-growth {
  align-items: center;
  text-align: center;
}

.crm-lock-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--crm-text-muted);
}

.crm-ring-container {
  position: relative;
  width: 90px;
  height: 90px;
  margin: 10px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crm-ring-container svg {
  transform: rotate(-9deg);
}

.crm-ring-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.625rem;
  color: #ffffff;
  background: #0f172a;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.crm-ring-label strong {
  font-family: var(--font-heading);
  font-size: 0.9375rem;
  font-weight: 800;
}

/* Card 4: Dot Matrix Follow-up Queue */
.crm-card-dots {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.crm-dots-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--crm-text-main);
  line-height: 1.1;
}

.crm-dots-subtitle {
  font-size: 0.6875rem;
  color: var(--crm-text-muted);
  margin-top: 2px;
}

.crm-dot-matrix {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 14px;
}

.crm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
}

.crm-dot.active {
  background: var(--crm-terracotta);
}

/* Card 5: Trend & Bar Chart */
.crm-card-trend {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.crm-trend-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 80px;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--crm-border);
}

.crm-trend-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.crm-bar {
  width: 14px;
  border-radius: 6px;
  background: var(--crm-card-muted);
  transition: height 0.3s ease;
}

.crm-bar.accent {
  background: var(--crm-terracotta);
}

.crm-trend-year {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--crm-text-muted);
  background: var(--crm-card-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

.crm-trend-year.accent {
  background: #fde8e4;
  color: var(--crm-terracotta);
}

/* Card 6: Sparkline Pipeline Revenue */
.crm-card-spark {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.crm-spark-val {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--crm-terracotta);
}

.crm-spark-wave {
  width: 100%;
  height: 48px;
  margin: 6px 0;
}

.crm-spark-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crm-spark-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--crm-text-main);
}

.crm-growth-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--crm-terracotta);
  background: var(--crm-terracotta-soft);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

/* --------------------------------------------------------------------------
   4. BOTTOM SECTION: CONCENTRIC RINGS + ACTIVITY CRM MANAGER + FEEDBACK
   -------------------------------------------------------------------------- */
.crm-bottom-grid {
  display: grid;
  grid-template-columns: 1.1fr 2.4fr 1fr;
  gap: 20px;
}

/* Left Bottom: Concentric Circles (Annual Profits / Enquiries by Category) */
.crm-card-concentric {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
}

.crm-concentric-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.crm-concentric-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 800;
}

.crm-concentric-container {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.concentric-circle {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
  font-family: var(--font-heading);
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.concentric-c1 {
  width: 210px;
  height: 210px;
  background: #fde8e4;
  color: #ea580c;
  z-index: 1;
  font-size: 0.875rem;
}

.concentric-c2 {
  width: 160px;
  height: 160px;
  background: #fca592;
  color: #c2410c;
  z-index: 2;
  bottom: 0;
  font-size: 0.8125rem;
}

.concentric-c3 {
  width: 115px;
  height: 115px;
  background: #f87154;
  color: #ffffff;
  z-index: 3;
  bottom: 0;
  font-size: 0.75rem;
}

.concentric-c4 {
  width: 70px;
  height: 70px;
  background: #f05a36;
  color: #ffffff;
  z-index: 4;
  bottom: 0;
  font-size: 0.6875rem;
}

.crm-concentric-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  width: 100%;
  margin-top: 20px;
  font-size: 0.75rem;
  color: var(--crm-text-muted);
}

.crm-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crm-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* Middle Bottom: Activity & Lead Manager */
.crm-card-activity {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
}

.crm-activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.crm-activity-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--crm-text-main);
}

.crm-activity-filter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.crm-filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--crm-text-muted);
  background: var(--crm-card-muted);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crm-filter-pill:hover,
.crm-filter-pill.active {
  background: #ffffff;
  color: var(--crm-text-main);
  border-color: var(--crm-border);
  box-shadow: var(--crm-shadow-sm);
}

.crm-filter-pill.active.accent {
  background: var(--crm-terracotta);
  color: #ffffff;
  border-color: var(--crm-terracotta);
}

/* CRM Table & Records */
.crm-table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--crm-border);
  background: #ffffff;
}

.crm-leads-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.8125rem;
}

.crm-leads-table th {
  background: var(--crm-card-soft);
  color: var(--crm-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.6875rem;
  padding: 12px 16px;
  border-bottom: 1px solid var(--crm-border);
}

.crm-leads-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--crm-border);
  color: var(--crm-text-main);
  vertical-align: middle;
}

.crm-leads-table tr:last-child td {
  border-bottom: none;
}

.crm-leads-table tr:hover td {
  background-color: var(--crm-card-soft);
}

.crm-lead-customer {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crm-customer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--crm-card-muted);
  color: var(--crm-text-main);
  font-weight: 800;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.crm-customer-name {
  font-weight: 700;
  color: var(--crm-text-main);
  display: block;
}

.crm-customer-id {
  font-size: 0.6875rem;
  color: var(--crm-text-light);
}

/* Status Pill Badges */
.crm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.crm-status-badge.new {
  background: #fee2e2;
  color: #dc2626;
}

.crm-status-badge.consultation {
  background: #ffedd5;
  color: #ea580c;
}

.crm-status-badge.visit {
  background: #e0f2fe;
  color: #0284c7;
}

.crm-status-badge.proposal {
  background: #f3e8ff;
  color: #9333ea;
}

.crm-status-badge.won {
  background: #dcfce7;
  color: #16a34a;
}

.crm-status-badge.lost {
  background: #f1f5f9;
  color: #64748b;
}

/* Priority Badges */
.crm-priority-tag {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.crm-priority-tag.high {
  background: #fee2e2;
  color: #dc2626;
}

.crm-priority-tag.medium {
  background: #fef3c7;
  color: #d97706;
}

.crm-priority-tag.low {
  background: #f1f5f9;
  color: #64748b;
}

/* Action Icon Buttons in Table */
.crm-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crm-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--crm-card-muted);
  color: var(--crm-text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.crm-icon-btn:hover {
  background: #0f172a;
  color: #ffffff;
}

.crm-icon-btn.wa:hover {
  background: #25d366;
  color: #ffffff;
}

/* Sub Mini Cards inside Activity Manager */
.crm-sub-widgets-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 14px;
}

.crm-mini-card {
  background: var(--crm-card-soft);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.crm-mini-card-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--crm-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Right Bottom: Review & Feedback Card */
.crm-card-feedback {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}

.crm-feedback-meta {
  font-size: 0.6875rem;
  color: var(--crm-text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.crm-feedback-title {
  font-family: var(--font-heading);
  font-size: 1.1875rem;
  font-weight: 800;
  color: var(--crm-text-main);
  line-height: 1.25;
  margin-top: 6px;
}

.crm-feedback-faces {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--crm-card-soft);
  border-radius: var(--radius-full);
  border: 1px solid var(--crm-border);
}

.crm-face-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.crm-face-btn:hover {
  transform: scale(1.3);
}

/* --------------------------------------------------------------------------
   5. MODAL / DRAWER STYLES
   -------------------------------------------------------------------------- */
.crm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.crm-modal-backdrop.active {
  display: flex;
}

.crm-modal-card {
  background: #ffffff;
  border-radius: var(--radius-2xl);
  padding: 32px;
  max-width: 620px;
  width: 100%;
  box-shadow: var(--crm-shadow-float);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScale {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.crm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--crm-border);
}

.crm-modal-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
}

.crm-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--crm-card-muted);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}

.crm-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.crm-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crm-form-group.full {
  grid-column: 1 / -1;
}

.crm-form-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--crm-text-muted);
}

.crm-form-input,
.crm-form-select,
.crm-form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--crm-border);
  background: var(--crm-card-soft);
  font-size: 0.875rem;
  color: var(--crm-text-main);
  outline: none;
  font-family: var(--font-sans);
}

.crm-form-input:focus,
.crm-form-select:focus,
.crm-form-textarea:focus {
  border-color: var(--crm-terracotta);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--crm-terracotta-soft);
}

/* Toast Notifications */
.crm-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 14px 22px;
  border-radius: var(--radius-lg);
  box-shadow: var(--crm-shadow-float);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 2000;
  font-size: 0.875rem;
  font-weight: 600;
  animation: toastSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlide {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* --------------------------------------------------------------------------
   6. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 1280px) {
  .crm-widgets-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .crm-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .crm-layout {
    flex-direction: column;
  }
  .crm-floating-strip {
    position: static;
    flex-direction: row;
    justify-content: center;
    width: 100%;
  }
  .crm-widgets-grid {
    grid-template-columns: 1fr 1fr;
  }
  .crm-banner-row {
    grid-template-columns: 1fr;
  }
  .crm-sub-widgets-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .crm-widgets-grid {
    grid-template-columns: 1fr;
  }
  .crm-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .crm-search-bar {
    width: 100%;
  }
}

/* ==========================================================================
   NEW STYLES: BRAND LOGO
   ========================================================================== */
.crm-brand-logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background: #00a8e8;
  border-radius: 10px;
  padding: 4px 10px;
  box-shadow: 0 4px 14px rgba(0, 168, 232, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  overflow: hidden;
}

.crm-brand-logo-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 168, 232, 0.38);
}

.crm-brand-logo-img {
  height: 34px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

/* ==========================================================================
   NEW STYLES: VOICE ASSISTANT MIC & WAVEFORM
   ========================================================================== */
.crm-ai-actions-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crm-voice-wave-container {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffe4e6;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid #fda4af;
}

.wave-bar {
  width: 4px;
  height: 16px;
  background: #f43f5e;
  border-radius: 2px;
  animation: wavePulse 1s ease-in-out infinite alternate;
}
.wave-bar:nth-child(2) { animation-delay: -0.2s; }
.wave-bar:nth-child(3) { animation-delay: -0.4s; }
.wave-bar:nth-child(4) { animation-delay: -0.6s; }
.wave-bar:nth-child(5) { animation-delay: -0.8s; }

@keyframes wavePulse {
  0% { transform: scaleY(0.4); }
  100% { transform: scaleY(1.2); }
}

.wave-timer {
  font-size: 0.8125rem;
  font-family: monospace;
  font-weight: 700;
  color: #f43f5e;
  margin-left: 8px;
}

.crm-ai-mic-btn {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--crm-card-soft);
  border: 1px solid var(--crm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crm-text-main);
  cursor: pointer;
  box-shadow: var(--crm-shadow-sm);
  transition: all 0.2s ease;
  z-index: 2;
}

.crm-ai-mic-btn:hover {
  background: var(--crm-terracotta);
  color: #ffffff;
  border-color: var(--crm-terracotta);
}

.crm-ai-mic-btn.recording {
  background: #f43f5e;
  color: #ffffff;
  border-color: #f43f5e;
  box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7);
  animation: micPulse 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes micPulse {
  to {
    box-shadow: 0 0 0 20px rgba(244, 63, 94, 0);
  }
}

.mic-pulse-ring {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 2px solid #f43f5e;
  opacity: 0;
  z-index: -1;
}

.crm-ai-mic-btn.recording .mic-pulse-ring {
  animation: ringExpand 1.5s infinite;
}

@keyframes ringExpand {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ==========================================================================
   NEW STYLES: TABLE HORIZONTAL SCROLL HELPERS
   ========================================================================== */
.crm-table-wrapper-outer {
  position: relative;
  width: 100%;
}

.crm-table-container {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--crm-border) transparent;
  width: 100%;
}

.crm-table-container::-webkit-scrollbar {
  height: 8px;
}
.crm-table-container::-webkit-scrollbar-track {
  background: transparent;
}
.crm-table-container::-webkit-scrollbar-thumb {
  background: var(--crm-border);
  border-radius: 4px;
}

.crm-table-scroll-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--crm-card-soft);
  border-top: 1px solid var(--crm-border);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.crm-table-arrow-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid var(--crm-border);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--crm-text-main);
  cursor: pointer;
  box-shadow: var(--crm-shadow-sm);
  transition: all 0.15s ease;
}

.crm-table-arrow-btn:hover {
  background: var(--crm-card-muted);
  transform: scale(1.02);
}

.crm-table-scroll-hint {
  font-size: 0.75rem;
  color: var(--crm-text-light);
  font-weight: 600;
}

/* ==========================================================================
   NEW STYLES: BOTTOM HORIZONTAL SCROLL DOCK
   ========================================================================== */
.crm-bottom-scroll-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none; /* Let clicks pass through outside the inner dock */
}

.crm-scroll-dock-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 16px 32px rgba(18, 30, 49, 0.1), 0 4px 8px rgba(18, 30, 49, 0.05);
}

.crm-dock-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--crm-card-muted);
  border: 1px solid var(--crm-border);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--crm-text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.crm-dock-nav-btn:hover {
  background: var(--crm-terracotta);
  color: #ffffff;
  border-color: var(--crm-terracotta);
}

.crm-dock-track-wrap {
  position: relative;
  width: 140px;
  height: 8px;
  background: var(--crm-border);
  border-radius: 4px;
  cursor: pointer;
  overflow: hidden;
}

.crm-dock-progress {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--crm-terracotta);
  border-radius: 4px;
  transition: width 0.1s linear;
}

.crm-dock-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: #ffffff;
  border: 2px solid var(--crm-terracotta);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: left 0.1s linear;
}

.crm-dock-divider {
  width: 1px;
  height: 24px;
  background: var(--crm-border);
}

.crm-dock-jumps {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crm-dock-pill {
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--crm-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.crm-dock-pill:hover {
  background: var(--crm-card-muted);
  color: var(--crm-text-main);
}

/* ==========================================================================
   ADMIN AUTHENTICATION (LOGIN MODAL & GATE OVERLAY)
   ========================================================================== */
.crm-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.crm-auth-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.crm-auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 36px 32px;
  box-shadow: 0 25px 60px -12px rgba(15, 23, 42, 0.28), 0 0 0 1px rgba(227, 232, 239, 0.9);
  animation: authCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  position: relative;
}

@keyframes authCardIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(14px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.crm-auth-header {
  text-align: center;
  margin-bottom: 24px;
}

.crm-auth-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: var(--crm-card-soft);
  border: 1px solid var(--crm-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: var(--crm-shadow-sm);
}

.crm-auth-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.crm-auth-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--crm-text-main);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.crm-auth-subtitle {
  font-size: 0.875rem;
  color: var(--crm-text-muted);
  line-height: 1.45;
}

/* Alert Message */
.crm-auth-alert {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  animation: authShake 0.4s ease;
}

@keyframes authShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.crm-auth-group {
  margin-bottom: 18px;
}

.crm-auth-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--crm-text-main);
  margin-bottom: 7px;
}

.crm-auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.crm-auth-forgot-btn {
  background: none;
  border: none;
  color: var(--crm-terracotta);
  font-size: 0.78125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.crm-auth-forgot-btn:hover {
  color: var(--crm-terracotta-hover);
  text-decoration: underline;
}

.crm-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.crm-auth-input-icon {
  position: absolute;
  left: 14px;
  color: var(--crm-text-light);
  pointer-events: none;
}

.crm-auth-input {
  width: 100%;
  height: 46px;
  padding: 0 42px 0 42px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--crm-text-main);
  background: var(--crm-card-soft);
  border: 1.5px solid var(--crm-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all 0.2s ease;
}

.crm-auth-input:focus {
  background: #ffffff;
  border-color: var(--crm-terracotta);
  box-shadow: 0 0 0 4px var(--crm-terracotta-soft);
}

.crm-auth-pwd-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--crm-text-light);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.crm-auth-pwd-toggle:hover {
  color: var(--crm-text-main);
}

.crm-auth-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.crm-auth-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--crm-text-muted);
  font-weight: 500;
  cursor: pointer;
}

.crm-auth-checkbox-label input {
  accent-color: var(--crm-terracotta);
  width: 16px;
  height: 16px;
  border-radius: 4px;
  cursor: pointer;
}

.crm-auth-submit-btn {
  width: 100%;
  height: 48px;
  background: var(--crm-terracotta-gradient);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--crm-shadow-terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.crm-auth-submit-btn:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 14px 28px -4px rgba(240, 90, 54, 0.45);
}

.crm-auth-submit-btn:active {
  transform: translateY(0);
}

/* Helper Pill */
.crm-auth-helper-pill {
  margin-top: 20px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.78125rem;
  color: #475569;
}

.crm-auth-helper-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.crm-auth-creds-preview {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.crm-auth-creds-preview code {
  background: #e2e8f0;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: 600;
  color: #0f172a;
}

.crm-auth-footer {
  text-align: center;
  margin-top: 20px;
}

.crm-auth-back-link {
  color: var(--crm-text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.crm-auth-back-link:hover {
  color: var(--crm-terracotta);
}

/* Logout Header Button */
.crm-logout-btn {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  margin-left: 10px;
}

.crm-logout-btn:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

