/* =====================================================
   CRM CSS Framework - RE-AI
   Component-based responsive design system
   ===================================================== */

/* =====================================================
   RESET & BASE STYLES
   ===================================================== */

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
}

/* =====================================================
   CSS VARIABLES - THEME COLORS
   ===================================================== */

:root {
  /* Primary Colors */
  --primary-color: #4caf50;
  --primary-hover: #45a049;
  --primary-light: #e8f5e8;
  --secondary-color: #2196f3;
  --secondary-hover: #1976d2;
  --secondary-light: #e3f2fd;

  /* Status Colors */
  --success-color: #4caf50;
  --warning-color: #ff9800;
  --danger-color: #f44336;
  --info-color: #2196f3;

  /* Neutral Colors */
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --medium-gray: #e9ecef;
  --dark-gray: #6c757d;
  --text-color: #333333;
  --text-muted: #6c757d;
  --border-color: #ddd;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-xxl: 3rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* =====================================================
   LAYOUT CONTAINERS
   ===================================================== */

.crm-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--spacing-md);
  min-height: 100vh;
}

/* =====================================================
   HEADER STYLES
   ===================================================== */

.crm-header {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-lg);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-md);
}

.crm-header h1 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.crm-header h1 i {
  color: var(--primary-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.date-filter {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.filter-select {
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.filter-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-light);
}

/* =====================================================
   NAVIGATION STYLES
   ===================================================== */

.crm-nav {
  display: flex;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-lg);
  background: var(--white);
  padding: var(--spacing-sm);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.nav-item {
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--light-gray);
  color: var(--text-color);
}

.nav-item.active {
  background: var(--primary-color);
  color: var(--white);
}

.nav-item.back {
  margin-left: auto;
  background: var(--medium-gray);
}

.nav-item.back:hover {
  background: var(--dark-gray);
  color: var(--white);
}

/* =====================================================
   CARD COMPONENT
   ===================================================== */

.crm-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  transition: var(--transition-fast);
}

.crm-card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--medium-gray);
}

.card-header h3 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.view-all-btn {
  background: none;
  border: none;
  color: var(--primary-color);
  font-size: 0.875rem;
  cursor: pointer;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.view-all-btn:hover {
  background: var(--primary-light);
}

/* =====================================================
   BUTTON COMPONENT
   ===================================================== */

.crm-button {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
  line-height: 1.4;
}

.crm-button.primary {
  background: var(--primary-color);
  color: var(--white);
}

.crm-button.primary:hover {
  background: var(--primary-hover);
}

.crm-button.secondary {
  background: var(--medium-gray);
  color: var(--text-color);
}

.crm-button.secondary:hover {
  background: var(--dark-gray);
  color: var(--white);
}

.crm-button.danger {
  background: var(--danger-color);
  color: var(--white);
}

.crm-button.danger:hover {
  background: #d32f2f;
}

.crm-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =====================================================
   METRICS SECTION
   ===================================================== */

.metrics-section {
  margin-bottom: var(--spacing-lg);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.metric-card {
  margin-bottom: 0;
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
}

.metric-header h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.metric-value {
  margin-bottom: var(--spacing-md);
}

.metric-value .value {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  line-height: 1;
}

.metric-value .change {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: var(--spacing-xs);
}

.change.positive {
  color: var(--success-color);
}

.change.negative {
  color: var(--danger-color);
}

.change.neutral {
  color: var(--text-muted);
}

.change.pending {
  color: var(--warning-color);
}

.metric-footer {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* =====================================================
   QUICK ACTIONS SECTION
   ===================================================== */

.quick-actions-section {
  margin-bottom: var(--spacing-lg);
}

.quick-actions-section h3 {
  margin: 0 0 var(--spacing-lg) 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.action-buttons {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

/* =====================================================
   DASHBOARD GRID
   ===================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

/* =====================================================
   ACTIVITY FEED
   ===================================================== */

.activity-feed {
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  gap: var(--spacing-md);
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--medium-gray);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item.loading {
  justify-content: center;
  color: var(--text-muted);
}

.activity-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-content h4 {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
}

.activity-content p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--spacing-xs);
}

/* =====================================================
   PIPELINE STAGES
   ===================================================== */

.pipeline-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--spacing-md);
}

.pipeline-stage {
  text-align: center;
  padding: var(--spacing-md);
  background: var(--light-gray);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.pipeline-stage:hover {
  background: var(--medium-gray);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-sm);
}

.stage-header h4 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-color);
}

.stage-count {
  background: var(--primary-color);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.stage-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-color);
}

/* =====================================================
   LEADS & TASKS LISTS
   ===================================================== */

.leads-list,
.tasks-list {
  max-height: 350px;
  overflow-y: auto;
}

.lead-item,
.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--medium-gray);
}

.lead-item:last-child,
.task-item:last-child {
  border-bottom: none;
}

.lead-item.loading,
.task-item.loading {
  justify-content: center;
  color: var(--text-muted);
}

.lead-info,
.task-info {
  flex: 1;
  min-width: 0;
}

.lead-info h4,
.task-info h4 {
  margin: 0 0 var(--spacing-xs) 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
}

.lead-info p,
.task-info p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* =====================================================
   STATUS BADGES
   ===================================================== */

.crm-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.crm-status.new {
  background: var(--info-color);
  color: var(--white);
}

.crm-status.qualified {
  background: var(--success-color);
  color: var(--white);
}

.crm-status.interested {
  background: var(--warning-color);
  color: var(--white);
}

.crm-status.pending {
  background: var(--warning-color);
  color: var(--white);
}

.crm-status.completed {
  background: var(--success-color);
  color: var(--white);
}

.crm-status.overdue {
  background: var(--danger-color);
  color: var(--white);
}

/* =====================================================
   PRIORITY INDICATORS
   ===================================================== */

.crm-priority {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.crm-priority.low {
  background: #e8f5e8;
  color: var(--success-color);
}

.crm-priority.medium {
  background: #fff3e0;
  color: var(--warning-color);
}

.crm-priority.high {
  background: #ffebee;
  color: var(--danger-color);
}

.crm-priority.urgent {
  background: var(--danger-color);
  color: var(--white);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* =====================================================
   CHART SECTION
   ===================================================== */

.chart-section {
  margin-bottom: var(--spacing-lg);
}

.chart-controls {
  display: flex;
  gap: var(--spacing-xs);
}

.chart-btn {
  background: none;
  border: 1px solid var(--border-color);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chart-btn:hover {
  background: var(--light-gray);
}

.chart-btn.active {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.chart-container {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-gray);
  border-radius: var(--radius-md);
  margin-top: var(--spacing-md);
}

.chart-placeholder {
  text-align: center;
  color: var(--text-muted);
}

.chart-placeholder i {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  opacity: 0.5;
}

/* =====================================================
   MODAL COMPONENT
   ===================================================== */

.crm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.crm-modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: var(--transition-normal);
}

.crm-modal.show .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--medium-gray);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-color);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: var(--light-gray);
  color: var(--text-color);
}

/* =====================================================
   FORM COMPONENT
   ===================================================== */

.crm-form {
  padding: var(--spacing-lg);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--spacing-md);
  padding: var(--spacing-lg);
  border-top: 1px solid var(--medium-gray);
}

/* =====================================================
   TABLE COMPONENT
   ===================================================== */

.crm-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.crm-table th,
.crm-table td {
  padding: var(--spacing-md);
  text-align: left;
  border-bottom: 1px solid var(--medium-gray);
}

.crm-table th {
  background: var(--light-gray);
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.crm-table tr:hover {
  background: var(--light-gray);
}

.crm-table tr:last-child td {
  border-bottom: none;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
  .crm-container {
    padding: var(--spacing-sm);
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    justify-content: space-between;
  }

  .crm-nav {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .crm-nav::-webkit-scrollbar {
    display: none;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .pipeline-stages {
    grid-template-columns: repeat(2, 1fr);
  }

  .action-buttons {
    flex-direction: column;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    margin: var(--spacing-sm);
  }

  .chart-controls {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .pipeline-stages {
    grid-template-columns: 1fr;
  }

  .stage-header {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .crm-header h1 {
    font-size: 1.5rem;
  }

  .metric-value .value {
    font-size: 2rem;
  }
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.text-muted {
  color: var(--text-muted);
}
.text-success {
  color: var(--success-color);
}
.text-warning {
  color: var(--warning-color);
}
.text-danger {
  color: var(--danger-color);
}

.bg-light {
  background-color: var(--light-gray);
}
.bg-white {
  background-color: var(--white);
}

.d-none {
  display: none;
}
.d-block {
  display: block;
}
.d-flex {
  display: flex;
}
.d-grid {
  display: grid;
}

.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.align-center {
  align-items: center;
}

.mb-0 {
  margin-bottom: 0;
}
.mb-sm {
  margin-bottom: var(--spacing-sm);
}
.mb-md {
  margin-bottom: var(--spacing-md);
}
.mb-lg {
  margin-bottom: var(--spacing-lg);
}

.mt-0 {
  margin-top: 0;
}
.mt-sm {
  margin-top: var(--spacing-sm);
}
.mt-md {
  margin-top: var(--spacing-md);
}
.mt-lg {
  margin-top: var(--spacing-lg);
}

.p-0 {
  padding: 0;
}
.p-sm {
  padding: var(--spacing-sm);
}
.p-md {
  padding: var(--spacing-md);
}
.p-lg {
  padding: var(--spacing-lg);
}

.w-full {
  width: 100%;
}
.h-full {
  height: 100%;
}

.rounded {
  border-radius: var(--radius-sm);
}
.rounded-md {
  border-radius: var(--radius-md);
}
.rounded-lg {
  border-radius: var(--radius-lg);
}

.shadow-sm {
  box-shadow: var(--shadow-sm);
}
.shadow-md {
  box-shadow: var(--shadow-md);
}
.shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* =====================================================
   TIMELINE COMPONENTS
   ===================================================== */

.timeline-container {
  position: relative;
}

.timeline-stats {
  display: flex;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.timeline {
  position: relative;
  padding: 1rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.timeline-icon {
  position: relative;
  width: 60px;
  height: 60px;
  background: var(--white);
  border: 3px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-muted);
  flex-shrink: 0;
  z-index: 2;
}

.timeline-icon.call {
  border-color: var(--success-color);
  color: var(--success-color);
}

.timeline-icon.email {
  border-color: var(--info-color);
  color: var(--info-color);
}

.timeline-icon.sms {
  border-color: var(--warning-color);
  color: var(--warning-color);
}

.timeline-icon.meeting {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.timeline-icon.note {
  border-color: var(--dark-gray);
  color: var(--dark-gray);
}

.timeline-content {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  position: relative;
}

.timeline-content::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid var(--border-color);
}

.timeline-content::after {
  content: "";
  position: absolute;
  left: -7px;
  top: 20px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid var(--white);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.5rem;
}

.timeline-title {
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.timeline-meta {
  display: flex;
  flex-direction: column;
  align-items: end;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.timeline-date {
  font-weight: 500;
}

.timeline-lead {
  color: var(--primary-color);
  text-decoration: none;
}

.timeline-lead:hover {
  text-decoration: underline;
}

.timeline-subject {
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.timeline-content-text {
  line-height: 1.6;
  margin-bottom: 1rem;
}

.timeline-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.timeline-outcome {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.outcome-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.outcome-badge.connected {
  background: var(--success-light);
  color: var(--success-color);
}

.outcome-badge.voicemail {
  background: var(--warning-light);
  color: var(--warning-color);
}

.outcome-badge.no_answer {
  background: var(--medium-gray);
  color: var(--dark-gray);
}

.outcome-badge.bounced {
  background: var(--danger-light);
  color: var(--danger-color);
}

.outcome-badge.responded {
  background: var(--success-light);
  color: var(--success-color);
}

.outcome-badge.not_interested {
  background: var(--danger-light);
  color: var(--danger-color);
}

.outcome-badge.interested {
  background: var(--primary-light);
  color: var(--primary-color);
}

.outcome-badge.callback_requested {
  background: var(--info-light);
  color: var(--info-color);
}

.timeline-actions {
  display: flex;
  gap: 0.5rem;
}

.timeline-duration {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.communication-direction {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
}

.communication-direction.inbound {
  background: var(--success-light);
  color: var(--success-color);
}

.communication-direction.outbound {
  background: var(--info-light);
  color: var(--info-color);
}

/* =====================================================
   FILTER PANEL COMPONENTS
   ===================================================== */

.filter-panel {
  margin-bottom: 1.5rem;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-weight: 500;
  color: var(--text-color);
  font-size: 0.9rem;
}

/* =====================================================
   COMMUNICATION MODAL ENHANCEMENTS
   ===================================================== */

.crm-textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s ease;
}

.crm-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* =====================================================
   RESPONSIVE TIMELINE
   ===================================================== */

@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }

  .timeline-icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .timeline-header {
    flex-direction: column;
    align-items: start;
    gap: 0.5rem;
  }

  .timeline-meta {
    align-items: start;
  }

  .timeline-footer {
    flex-direction: column;
    align-items: start;
    gap: 0.5rem;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   COMMUNICATION DETAIL MODAL
   ===================================================== */

.communication-detail {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-section {
  padding: 1rem;
  background: var(--light-gray);
  border-radius: 6px;
}

.detail-section h4 {
  margin: 0 0 0.5rem 0;
  color: var(--text-color);
  font-size: 1rem;
  font-weight: 600;
}

.detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  align-items: center;
}

.detail-label {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.detail-value {
  color: var(--text-color);
}

.communication-full-content {
  background: var(--white);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* =====================================================
   SUCCESS/ERROR LIGHT COLORS (IF NOT DEFINED)
   ===================================================== */

:root {
  --success-light: #e8f5e8;
  --warning-light: #fff3cd;
  --danger-light: #f8d7da;
  --info-light: #d1ecf1;
}

/* =====================================================
   KANBAN BOARD COMPONENTS
   ===================================================== */

.view-toggle {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  margin-right: 1rem;
}

.toggle-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: var(--white);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.toggle-btn:hover {
  background: var(--light-gray);
}

.toggle-btn.active {
  background: var(--primary-color);
  color: var(--white);
}

.toggle-btn:first-child {
  border-right: 1px solid var(--border-color);
}

.kanban-view {
  margin-top: 1.5rem;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  min-height: 600px;
}

.kanban-column {
  background: var(--light-gray);
  border-radius: 8px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
}

.kanban-column.overdue-column {
  background: var(--danger-light);
  border: 1px solid var(--danger-color);
}

.column-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.column-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-color);
  font-size: 1.1rem;
}

.task-count {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.overdue-column .task-count {
  background: var(--danger-color);
}

.column-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 200px;
  padding: 0.5rem;
}

.task-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  cursor: move;
  transition: all 0.2s ease;
  position: relative;
}

.task-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.task-card.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

.task-card.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.task-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 0.5rem;
}

.task-title {
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
}

.task-priority {
  padding: 0.125rem 0.375rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.task-priority.urgent {
  background: var(--danger-color);
  color: var(--white);
}

.task-priority.high {
  background: var(--warning-color);
  color: var(--white);
}

.task-priority.medium {
  background: var(--info-color);
  color: var(--white);
}

.task-priority.low {
  background: var(--medium-gray);
  color: var(--dark-gray);
}

.task-description {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.task-type {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.task-due-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.task-due-date.overdue {
  color: var(--danger-color);
  font-weight: 600;
}

.task-due-date.today {
  color: var(--warning-color);
  font-weight: 600;
}

.task-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.task-lead {
  font-size: 0.8rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.task-lead:hover {
  text-decoration: underline;
}

.task-actions {
  display: flex;
  gap: 0.25rem;
}

.task-action-btn {
  padding: 0.25rem;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.task-action-btn:hover {
  background: var(--light-gray);
  color: var(--text-color);
}

.task-checkbox {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Drag and Drop States */
.column-content.drag-over {
  background: var(--primary-light);
  border: 2px dashed var(--primary-color);
  border-radius: 8px;
}

.task-card.drag-target {
  border-top: 3px solid var(--primary-color);
}

/* =====================================================
   CALENDAR VIEW COMPONENTS
   ===================================================== */

.calendar-view {
  margin-top: 1.5rem;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.calendar-header h3 {
  margin: 0;
  color: var(--text-color);
  font-size: 1.2rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-day-header {
  background: var(--medium-gray);
  color: var(--text-color);
  font-weight: 600;
  padding: 0.75rem;
  text-align: center;
  font-size: 0.9rem;
}

.calendar-day {
  background: var(--white);
  min-height: 120px;
  padding: 0.5rem;
  position: relative;
  transition: background-color 0.2s ease;
}

.calendar-day:hover {
  background: var(--light-gray);
}

.calendar-day.other-month {
  background: var(--light-gray);
  color: var(--text-muted);
}

.calendar-day.today {
  background: var(--primary-light);
  font-weight: 600;
}

.calendar-day-number {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.calendar-task {
  background: var(--primary-color);
  color: var(--white);
  padding: 0.125rem 0.25rem;
  border-radius: 3px;
  font-size: 0.7rem;
  margin-bottom: 0.125rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-task.high-priority {
  background: var(--warning-color);
}

.calendar-task.urgent-priority {
  background: var(--danger-color);
}

.calendar-task.overdue {
  background: var(--danger-color);
  text-decoration: line-through;
}

.calendar-task-count {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.25rem;
}

/* =====================================================
   TASK STATISTICS
   ===================================================== */

.task-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
  padding: 1rem;
  background: var(--white);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-color);
}

.stat-value.overdue {
  color: var(--danger-color);
}

.stat-value.today {
  color: var(--warning-color);
}

.stat-value.completed {
  color: var(--success-color);
}

/* =====================================================
   DEAL PIPELINE COMPONENTS
   ===================================================== */

.pipeline-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.stat-content h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.25rem 0;
}

.stat-content p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.875rem;
}

/* =====================================================
   WORKFLOW SWITCHER
   ===================================================== */

.workflow-switcher {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.workflow-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.workflow-btn {
  flex: 1;
  min-width: 200px;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  backdrop-filter: blur(10px);
}

.workflow-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.workflow-btn.active {
  background: white;
  color: #667eea;
  border-color: white;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.workflow-btn i {
  font-size: 1.1rem;
}

.workflow-description {
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  font-weight: 500;
}

.workflow-description p {
  margin: 0;
}

/* =====================================================
   DEAL CARD WORKFLOW BADGES
   ===================================================== */

.deal-card-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.deal-card-workflow {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.workflow-fix_flip {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.workflow-wholesaling {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  color: white;
}

.pipeline-filters {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  align-items: end;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  min-height: 600px;
}

.pipeline-column {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.pipeline-column-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--accent-color)
  );
  color: white;
  border-radius: 7px 7px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pipeline-column-title {
  font-weight: 600;
  font-size: 1rem;
}

.pipeline-column-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pipeline-column-content {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 200px;
}

.pipeline-column-content.drag-over {
  background: rgba(59, 130, 246, 0.1);
  border: 2px dashed var(--primary-color);
}

.deal-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  draggable: true;
}

.deal-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.deal-card.dragging {
  opacity: 0.5;
  transform: rotate(5deg);
}

.deal-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.deal-card-title {
  font-weight: 600;
  color: var(--text-color);
  font-size: 0.95rem;
  line-height: 1.3;
}

.deal-card-value {
  font-weight: 700;
  color: var(--success-color);
  font-size: 0.9rem;
}

.deal-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.deal-card-property {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.deal-card-type {
  display: inline-block;
  background: var(--accent-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.deal-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.deal-card-probability {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.probability-bar {
  width: 60px;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  overflow: hidden;
}

.probability-fill {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--warning-color),
    var(--success-color)
  );
  border-radius: 2px;
  transition: width 0.3s ease;
}

.deal-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.deal-card-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.deal-card:hover .deal-card-actions {
  opacity: 1;
}

.deal-action-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.25rem;
  margin-left: 0.25rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.deal-action-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.deal-value-high {
  color: var(--success-color) !important;
}

.deal-value-medium {
  color: var(--warning-color) !important;
}

.deal-value-low {
  color: var(--text-muted) !important;
}

.pipeline-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.pipeline-empty i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

/* Deal Stage Colors */
.pipeline-column[data-stage="initial_contact"] .pipeline-column-header {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.pipeline-column[data-stage="qualified"] .pipeline-column-header {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.pipeline-column[data-stage="needs_analysis"] .pipeline-column-header {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.pipeline-column[data-stage="proposal_sent"] .pipeline-column-header {
  background: linear-gradient(135deg, #10b981, #059669);
}

.pipeline-column[data-stage="negotiating"] .pipeline-column-header {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.pipeline-column[data-stage="verbal_agreement"] .pipeline-column-header {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.pipeline-column[data-stage="contract_pending"] .pipeline-column-header {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.pipeline-column[data-stage="under_contract"] .pipeline-column-header {
  background: linear-gradient(135deg, #84cc16, #65a30d);
}

.pipeline-column[data-stage="inspection"] .pipeline-column-header {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.pipeline-column[data-stage="financing"] .pipeline-column-header {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.pipeline-column[data-stage="closing_prep"] .pipeline-column-header {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

/* Wholesaling-specific stages */
.pipeline-column[data-stage="buyer_found"] .pipeline-column-header {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.pipeline-column[data-stage="assignment_prepared"] .pipeline-column-header {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.pipeline-column[data-stage="assignment_signed"] .pipeline-column-header {
  background: linear-gradient(135deg, #10b981, #059669);
}

/* Closed/Cancelled stages */
.pipeline-column[data-stage="closed_won"] .pipeline-column-header {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.pipeline-column[data-stage="closed_lost"] .pipeline-column-header {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.pipeline-column[data-stage="cancelled"] .pipeline-column-header {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* Deal Type Styles */
.deal-type-fix_flip {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.deal-type-wholesale {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.deal-type-buy_hold {
  background: linear-gradient(135deg, #10b981, #059669);
}

.deal-type-owner_finance {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.deal-type-other {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

/* Responsive Pipeline */
@media (max-width: 1200px) {
  .pipeline-board {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .pipeline-board {
    grid-template-columns: 1fr;
  }

  .pipeline-filters {
    grid-template-columns: 1fr;
  }

  .pipeline-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .pipeline-stats {
    grid-template-columns: 1fr;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .stat-content h3 {
    font-size: 1.5rem;
  }
}

/* =====================================================
   BULK ACTIONS
   ===================================================== */

.bulk-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.bulk-action-btn {
  padding: 1rem;
  border: 1px solid var(--border-color);
  background: var(--white);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-color);
  text-align: center;
}

.bulk-action-btn:hover {
  border-color: var(--primary-color);
  background: var(--primary-light);
}

.bulk-action-btn.danger {
  border-color: var(--danger-color);
  color: var(--danger-color);
}

.bulk-action-btn.danger:hover {
  background: var(--danger-light);
}

.bulk-action-btn i {
  font-size: 1.2rem;
}

/* =====================================================
   TASK FORM ENHANCEMENTS
   ===================================================== */

.recurring-options {
  background: var(--light-gray);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.filter-actions {
  display: flex;
  gap: 0.5rem;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-right {
    flex-direction: column;
    gap: 0.5rem;
  }

  .view-toggle {
    margin-right: 0;
    width: 100%;
  }

  .toggle-btn {
    flex: 1;
    justify-content: center;
  }

  .kanban-board {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .task-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .stat-item {
    min-width: 120px;
  }

  .calendar-day {
    min-height: 80px;
    padding: 0.25rem;
  }

  .bulk-actions-grid {
    grid-template-columns: 1fr;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }
}

/* =====================================================
   MODAL STYLES
   ===================================================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: white;
  border-radius: 8px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--light-gray);
  color: var(--text-color);
}

.modal-body {
  padding: 1.5rem;
}

.modal-actions {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.modal-large {
  max-width: 1200px;
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section h4 {
  margin: 0 0 1rem 0;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.detail-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-value {
  font-size: 1rem;
  color: var(--text-color);
  font-weight: 600;
}

.detail-notes {
  background: var(--light-gray);
  padding: 1rem;
  border-radius: 6px;
  white-space: pre-wrap;
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.6;
}