/* ==========================================================================
   Sunbeam English School, Bhagwanpur — Lead Management CRM Stylesheet
   Modern, Executive UI with Academic Deep Blue (#063B66) & Warm Gold (#F8C531)
   ========================================================================== */

:root {
  --crm-primary: #063B66;
  --crm-primary-dark: #042744;
  --crm-primary-light: #0D4E83;
  --crm-primary-soft: #EAF4FB;
  --crm-gold: #F8C531;
  --crm-gold-dark: #D4AF37;
  --crm-gold-soft: #FEF9E7;
  
  --crm-bg: #F8FAFC;
  --crm-card-bg: #FFFFFF;
  --crm-surface: #FFFFFF;
  --crm-surface-hover: #F1F5F9;
  --crm-border: #E2E8F0;
  --crm-border-subtle: #EDF2F7;
  
  --crm-text: #0F172A;
  --crm-text-muted: #64748B;
  --crm-text-light: #94A3B8;

  /* Status Colors */
  --status-new: #2563EB;
  --status-new-bg: #EFF6FF;
  --status-new-border: #BFDBFE;
  
  --status-contacted: #D97706;
  --status-contacted-bg: #FFFBEB;
  --status-contacted-border: #FDE68A;
  
  --status-visit: #7C3AED;
  --status-visit-bg: #F5F3FF;
  --status-visit-border: #DDD6FE;
  
  --status-assessment: #0891B2;
  --status-assessment-bg: #ECFEFF;
  --status-assessment-border: #A5F3FC;
  
  --status-enrolled: #059669;
  --status-enrolled-bg: #ECFDF5;
  --status-enrolled-border: #A7F3D0;
  
  --status-dropped: #DC2626;
  --status-dropped-bg: #FEF2F2;
  --status-dropped-border: #FECACA;

  /* Priorities */
  --priority-urgent: #EF4444;
  --priority-high: #F97316;
  --priority-medium: #FBBF24;
  --priority-low: #94A3B8;

  --crm-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --crm-shadow-md: 0 4px 12px rgba(6, 59, 102, 0.07);
  --crm-shadow-lg: 0 12px 28px rgba(6, 59, 102, 0.12);
  --crm-shadow-xl: 0 20px 40px rgba(6, 59, 102, 0.18);
  
  --crm-radius-sm: 6px;
  --crm-radius-md: 10px;
  --crm-radius-lg: 14px;
  --crm-radius-xl: 20px;
}

/* Reset for CRM page */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.crm-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--crm-bg);
  color: var(--crm-text);
  line-height: 1.5;
  font-size: 0.92rem;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* CRM Topbar */
.crm-header {
  background: var(--crm-primary);
  color: #fff;
  padding: 0.75rem 1.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(4, 39, 68, 0.3);
}

.crm-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1720px;
  margin: 0 auto;
}

.crm-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
}

.crm-brand-logo {
  width: 42px;
  height: 42px;
  background: #fff;
  border-radius: var(--crm-radius-md);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.crm-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.crm-brand-titles h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.crm-badge-year {
  background: var(--crm-gold);
  color: var(--crm-primary-dark);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.crm-brand-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

/* Search bar */
.crm-search-box {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.crm-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  pointer-events: none;
  font-size: 0.9rem;
}

.crm-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 0.5rem 1rem 0.5rem 2.4rem;
  color: #fff;
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.crm-search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.crm-search-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.22);
  border-color: var(--crm-gold);
  box-shadow: 0 0 0 3px rgba(248, 197, 49, 0.25);
}

/* Header Action Buttons */
.crm-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.crm-backend-status-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.15);
  color: #fff;
}

.crm-backend-status-pill:hover {
  background: rgba(0, 0, 0, 0.3);
  border-color: var(--crm-gold);
}

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

.crm-status-dot.local {
  background: #F59E0B;
}

.crm-status-dot.pulse {
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.btn-crm {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.5rem 1rem;
  border-radius: var(--crm-radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-crm-gold {
  background: var(--crm-gold);
  color: var(--crm-primary-dark);
  box-shadow: 0 2px 8px rgba(248, 197, 49, 0.3);
}

.btn-crm-gold:hover {
  background: #e5b324;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(248, 197, 49, 0.4);
}

.btn-crm-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-crm-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #fff;
}

.btn-crm-primary {
  background: var(--crm-primary);
  color: #fff;
}

.btn-crm-primary:hover {
  background: var(--crm-primary-light);
}

.btn-crm-ghost {
  background: transparent;
  color: var(--crm-text-muted);
}

.btn-crm-ghost:hover {
  background: var(--crm-surface-hover);
  color: var(--crm-text);
}

/* Main Container */
.crm-main-content {
  flex: 1;
  max-width: 1720px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.75rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* KPI Cards Grid */
.crm-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
}

.crm-kpi-card {
  background: var(--crm-card-bg);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--crm-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.crm-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--crm-primary);
  opacity: 0.8;
}

.crm-kpi-card.kpi-new::before { background: var(--status-new); }
.crm-kpi-card.kpi-contacted::before { background: var(--status-contacted); }
.crm-kpi-card.kpi-visit::before { background: var(--status-visit); }
.crm-kpi-card.kpi-enrolled::before { background: var(--status-enrolled); }
.crm-kpi-card.kpi-conversion::before { background: var(--crm-gold-dark); }

.crm-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--crm-shadow-md);
  border-color: var(--crm-border-subtle);
}

.crm-kpi-card.active {
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 2px var(--crm-primary-light);
}

.crm-kpi-title {
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--crm-text-muted);
  margin-bottom: 0.25rem;
}

.crm-kpi-value {
  font-family: 'Poppins', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--crm-text);
  line-height: 1.1;
}

.crm-kpi-sub {
  font-size: 0.72rem;
  color: var(--crm-text-light);
  margin-top: 0.2rem;
}

.crm-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--crm-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: var(--crm-surface-hover);
}

.kpi-total .crm-kpi-icon { background: var(--crm-primary-soft); color: var(--crm-primary); }
.kpi-new .crm-kpi-icon { background: var(--status-new-bg); color: var(--status-new); }
.kpi-contacted .crm-kpi-icon { background: var(--status-contacted-bg); color: var(--status-contacted); }
.kpi-visit .crm-kpi-icon { background: var(--status-visit-bg); color: var(--status-visit); }
.kpi-enrolled .crm-kpi-icon { background: var(--status-enrolled-bg); color: var(--status-enrolled); }
.kpi-conversion .crm-kpi-icon { background: var(--crm-gold-soft); color: var(--crm-gold-dark); }

/* Control Toolbar & Filters */
.crm-toolbar {
  background: var(--crm-card-bg);
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--crm-shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.crm-view-switch {
  display: flex;
  background: var(--crm-surface-hover);
  padding: 3px;
  border-radius: var(--crm-radius-md);
  border: 1px solid var(--crm-border);
}

.crm-view-btn {
  background: transparent;
  border: none;
  padding: 0.4rem 0.85rem;
  border-radius: var(--crm-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--crm-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}

.crm-view-btn.active {
  background: #fff;
  color: var(--crm-primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.crm-filters {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.crm-select {
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-md);
  padding: 0.42rem 0.75rem;
  font-size: 0.82rem;
  color: var(--crm-text);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.crm-select:focus {
  outline: none;
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 2px var(--crm-primary-soft);
}

.crm-chip-filter {
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: 9999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--crm-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.15s ease;
}

.crm-chip-filter.active {
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
  border-color: var(--crm-primary-light);
}

/* Kanban Board Container */
.crm-kanban-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(260px, 1fr));
  gap: 1.1rem;
  overflow-x: auto;
  padding-bottom: 1.5rem;
  align-items: start;
}

/* Kanban Column */
.kanban-col {
  background: #F1F5F9;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 270px);
  min-height: 480px;
}

.kanban-col-header {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--crm-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: var(--crm-radius-lg);
  border-top-right-radius: var(--crm-radius-lg);
  background: #fff;
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--crm-text);
}

.kanban-col-title .col-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.col-new .col-indicator { background: var(--status-new); }
.col-contacted .col-indicator { background: var(--status-contacted); }
.col-visit .col-indicator { background: var(--status-visit); }
.col-assessment .col-indicator { background: var(--status-assessment); }
.col-enrolled .col-indicator { background: var(--status-enrolled); }
.col-dropped .col-indicator { background: var(--status-dropped); }

.kanban-count-badge {
  background: var(--crm-surface-hover);
  color: var(--crm-text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9999px;
  border: 1px solid var(--crm-border);
}

.kanban-cards-wrapper {
  padding: 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

/* Kanban Lead Card */
.lead-card {
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-md);
  padding: 0.95rem;
  box-shadow: var(--crm-shadow-sm);
  cursor: grab;
  transition: all 0.2s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.lead-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--crm-shadow-md);
  border-color: #CBD5E1;
}

.lead-card.dragging {
  opacity: 0.5;
  transform: rotate(2deg) scale(0.98);
}

.lead-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.lead-type-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--crm-radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.lead-type-tag.admission {
  background: var(--crm-primary-soft);
  color: var(--crm-primary);
}

.lead-type-tag.contact {
  background: #F3F4F6;
  color: #4B5563;
}

.priority-pill {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.priority-urgent { background: #FEE2E2; color: #DC2626; border: 1px solid #FCA5A5; }
.priority-high { background: #FFEDD5; color: #EA580C; border: 1px solid #FDBA74; }
.priority-medium { background: #FEF3C7; color: #D97706; border: 1px solid #FDE68A; }
.priority-low { background: #F1F5F9; color: #64748B; border: 1px solid #E2E8F0; }

.lead-card-student {
  font-family: 'Poppins', sans-serif;
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--crm-primary-dark);
  line-height: 1.25;
}

.lead-card-parent {
  font-size: 0.8rem;
  color: var(--crm-text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lead-card-class {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--crm-primary-light);
  background: #F0F7FD;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #D5E8F7;
  max-width: fit-content;
}

.lead-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--crm-text-light);
  padding-top: 0.4rem;
  border-top: 1px dashed var(--crm-border-subtle);
}

.lead-followup-alert {
  color: #DC2626;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.lead-followup-alert.today {
  color: #D97706;
}

/* Card Quick Action Bar */
.lead-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.45rem;
  border-top: 1px solid var(--crm-border-subtle);
}

.quick-action-btns {
  display: flex;
  gap: 0.35rem;
}

.btn-card-action {
  width: 28px;
  height: 28px;
  border-radius: var(--crm-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--crm-surface-hover);
  color: var(--crm-text-muted);
  border: 1px solid var(--crm-border);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-card-action:hover {
  background: var(--crm-primary);
  color: #fff;
  border-color: var(--crm-primary);
}

.btn-card-action.btn-wa:hover {
  background: #25D366;
  border-color: #25D366;
  color: #fff;
}

.btn-stage-move {
  background: transparent;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  padding: 2px 6px;
  font-size: 0.72rem;
  color: var(--crm-text-muted);
  cursor: pointer;
}

/* Table View Styles */
.crm-table-container {
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  box-shadow: var(--crm-shadow-sm);
  overflow: hidden;
}

.crm-table-header-tools {
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--crm-border);
  background: #FAFAFA;
}

.crm-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.crm-table th {
  background: #F8FAFC;
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--crm-text-muted);
  border-bottom: 1px solid var(--crm-border);
  white-space: nowrap;
}

.crm-table td {
  padding: 0.95rem 1rem;
  font-size: 0.84rem;
  color: var(--crm-text);
  border-bottom: 1px solid var(--crm-border-subtle);
  vertical-align: middle;
}

.crm-table tr:hover td {
  background: #F8FAFC;
}

.table-student-cell {
  display: flex;
  flex-direction: column;
}

.table-student-name {
  font-weight: 700;
  color: var(--crm-primary-dark);
}

.table-parent-name {
  font-size: 0.76rem;
  color: var(--crm-text-muted);
}

/* Analytics View */
.crm-analytics-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.25rem;
}

.analytics-card {
  background: #fff;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-lg);
  padding: 1.5rem;
  box-shadow: var(--crm-shadow-sm);
}

.analytics-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--crm-primary);
  margin-bottom: 1rem;
}

.funnel-bar-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.funnel-step {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.funnel-step-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
}

.funnel-step-progress-bg {
  height: 14px;
  background: #F1F5F9;
  border-radius: 9999px;
  overflow: hidden;
}

.funnel-step-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

/* Lead Detail Drawer (Slide-over) */
.crm-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 39, 68, 0.45);
  backdrop-filter: blur(2px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.crm-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.crm-drawer {
  position: fixed;
  top: 0;
  right: -560px;
  width: 540px;
  max-width: 95vw;
  height: 100vh;
  background: #fff;
  box-shadow: var(--crm-shadow-xl);
  z-index: 201;
  transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.crm-drawer.active {
  right: 0;
}

.crm-drawer-header {
  padding: 1.25rem 1.5rem;
  background: var(--crm-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crm-drawer-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background 0.15s ease;
}

.crm-drawer-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.crm-drawer-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.drawer-action-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.btn-drawer-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  border-radius: var(--crm-radius-md);
  border: 1px solid var(--crm-border);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--crm-text);
  background: var(--crm-surface-hover);
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-drawer-action:hover {
  background: #fff;
  border-color: var(--crm-primary);
  color: var(--crm-primary);
  box-shadow: var(--crm-shadow-sm);
}

.btn-drawer-action.action-wa:hover {
  background: #25D366;
  border-color: #25D366;
  color: #fff;
}

/* Timeline & Notes in Drawer */
.crm-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  padding-left: 1.25rem;
}

.crm-timeline::before {
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 5px;
  width: 2px;
  background: var(--crm-border);
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.timeline-dot {
  position: absolute;
  left: -1.25rem;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--crm-primary);
}

.timeline-time {
  font-size: 0.7rem;
  color: var(--crm-text-light);
}

.timeline-content {
  background: #F8FAFC;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
}

/* Modals */
.crm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 39, 68, 0.55);
  backdrop-filter: blur(3px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

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

.crm-modal-card {
  background: #fff;
  border-radius: var(--crm-radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--crm-shadow-xl);
  display: flex;
  flex-direction: column;
}

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

.crm-modal-body {
  padding: 1.5rem;
}

.crm-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--crm-border);
  background: #F8FAFC;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form inputs for CRM */
.crm-form-group {
  margin-bottom: 1rem;
}

.crm-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--crm-text);
  margin-bottom: 0.35rem;
}

.crm-input, .crm-textarea, .crm-select-full {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--crm-border);
  border-radius: var(--crm-radius-md);
  font-family: inherit;
  font-size: 0.86rem;
  transition: all 0.15s ease;
  background: #fff;
}

.crm-input:focus, .crm-textarea:focus, .crm-select-full:focus {
  outline: none;
  border-color: var(--crm-primary);
  box-shadow: 0 0 0 3px var(--crm-primary-soft);
}

.crm-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .crm-kanban-board {
    grid-template-columns: repeat(6, 280px);
  }
}

@media (max-width: 768px) {
  .crm-header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .crm-search-box {
    max-width: 100%;
  }
  .crm-analytics-grid {
    grid-template-columns: 1fr;
  }
  .crm-grid-2 {
    grid-template-columns: 1fr;
  }
}
