/**
 * Copyright (c) 2025 BlinkRQuotes. All Rights Reserved.
 * BlinkR 2.0 - CRM Module Styles
 */

.crm-container {
  padding: 18px 20px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.crm-header {
  margin-bottom: 24px;
}

.crm-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.crm-quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-card {
  background: var(--bg-surface);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent-primary);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tabs - Clean, professional styling */
.crm-tabs {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary, #1a1a2e);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

.crm-tab {
  background: transparent;
  border: 1px solid transparent;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--text-muted, #888);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-weight: 500;
}

.crm-tab:hover {
  color: var(--text-primary, #fff);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color);
}

.crm-tab.active {
  background: var(--accent-primary, #10b981);
  color: var(--button-text-on-accent, #000);
  border-color: var(--accent-primary, #10b981);
  font-weight: 600;
}

.crm-tab-content {
  min-height: 400px;
}

.crm-panel {
  display: none !important;
}

.crm-panel.active {
  display: block !important;
  background: var(--bg-secondary, #1a1a2e);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
}

/* Toolbar - cleaner styling */
.crm-toolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: var(--bg-primary, #0f0f1a);
  border-radius: 10px;
  flex-wrap: wrap;
  align-items: center;
  border: 1px solid var(--border-color);
}

.crm-toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
}

.crm-toolbar select {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* Communication Filters Bar - Scrollable */
#crm-comm-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}

#crm-comm-filters::-webkit-scrollbar {
  height: 8px;
}

#crm-comm-filters::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

#crm-comm-filters::-webkit-scrollbar-thumb {
  background: var(--accent-primary);
  border-radius: 4px;
}

#crm-comm-filters::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

#crm-comm-filters input,
#crm-comm-filters select,
#crm-comm-filters button {
  flex-shrink: 0;
}

#crm-comm-filters input[type="search"] {
  min-width: 200px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

#crm-comm-filters select {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

#crm-comm-filters input[type="date"] {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

#crm-comm-filters label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

#crm-comm-filters button {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

/* Tables - Clean, professional styling */
.crm-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-primary, #0f0f1a);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.crm-table thead {
  background: #1e293b;
}

.crm-table th {
  padding: 16px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-primary, #d4af37);
  border-bottom: 2px solid var(--border-color);
}

.crm-table td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 14px;
}

.crm-table tbody tr {
  transition: background 0.15s ease;
}

.crm-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

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

.crm-table .empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted, #666);
  font-style: italic;
  font-size: 0.95rem;
}

/* Margin color indicators for parts pricing */
.margin-good {
  color: #22c55e;
  font-weight: 600;
}

.margin-ok {
  color: #f59e0b;
  font-weight: 500;
}

.margin-low {
  color: #ef4444;
  font-weight: 600;
}

/* Project link in parts table */
.crm-project-link {
  color: var(--accent-primary, #3b82f6);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.crm-project-link:hover {
  color: var(--accent-secondary, #60a5fa);
  text-decoration: underline;
}

.btn-icon {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.btn-icon:hover {
  opacity: 1;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-lead {
  background: #3498db20;
  color: #3498db;
}

.status-quoted {
  background: #f39c1220;
  color: #f39c12;
}

.status-negotiation {
  background: #9b59b620;
  color: #9b59b6;
}

.status-won {
  background: #27ae6020;
  color: #27ae60;
}

.status-lost {
  background: #e7484820;
  color: #e74848;
}

/* Additional status classes for Project Status */
.status-complete {
  background: #27ae6020;
  color: #27ae60;
}

.status-progress {
  background: #3498db20;
  color: #3498db;
}

.status-warning {
  background: #f39c1220;
  color: #f39c12;
}

.status-danger {
  background: #e7484820;
  color: #e74848;
}

.status-new {
  background: #9b59b620;
  color: #9b59b6;
}

/* Needs Review Row Styling */
.needs-review-row {
  background: rgba(255, 152, 0, 0.05) !important;
  border-left: 3px solid #ff9800;
}

.needs-review-row:hover {
  background: rgba(255, 152, 0, 0.1) !important;
}

/* Inline Edit Fields */
.inline-edit {
  font-family: inherit;
  font-size: inherit;
  transition: all 0.2s ease;
}

.inline-edit:focus {
  outline: 2px solid var(--accent-primary, #10b981);
  border-color: var(--accent-primary, #10b981) !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

/* Win/Loss Summary */
.crm-win-loss-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.summary-box {
  background: var(--bg-surface);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.summary-box h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-number {
  font-size: 1.75rem;
  font-weight: bold;
  color: var(--accent-primary);
}

.stat-amount {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

/* Communications List */
.crm-comms-list {
  background: var(--bg-surface);
  border-radius: 8px;
  padding: 1.5rem;
  min-height: 300px;
  border: 1px solid var(--border-color);
}

.crm-email-summary {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-surface);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.crm-email-summary h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}

.crm-email-summary p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Communication Items */
.crm-comm-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.crm-comm-item:hover {
  border-color: var(--accent-primary);
}

.comm-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.comm-direction {
  font-size: 1.1rem;
}

.comm-subject {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.comm-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.comm-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.comm-from {
  color: var(--text-secondary);
}

.comm-customer,
.comm-project {
  color: var(--accent-primary);
  font-weight: 500;
}

.comm-summary {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-surface);
  border-radius: 4px;
}

.comm-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-small {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
}

.btn-small:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* Reports Grid */
.crm-reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.report-card {
  background: var(--bg-surface);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.report-card h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}

.chart-placeholder {
  background: var(--bg-primary);
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

/* Modals */
.crm-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.crm-modal-content {
  background: var(--bg-primary);
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  max-height: none;
  margin: 0 auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  animation: slideDown 0.3s ease-out;
  position: relative;
}

@keyframes slideDown {
  from {
    transform: translateY(-30px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

/* Modal backdrop click hint */
.crm-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    circle at center,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.85) 70%
  );
  pointer-events: none;
}

/* Add glow effect to modal when open */
.crm-modal-content {
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.crm-modal-wide .crm-modal-content {
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.05), 0 0 40px rgba(59, 130, 246, 0.15);
}

/* Modal Notification Banner */
.crm-modal-notification {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10001;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: slideInDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  transition: opacity 0.3s ease;
  min-width: 300px;
  max-width: 500px;
}

@keyframes slideInDown {
  from {
    transform: translateX(-50%) translateY(-100px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.notification-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.notification-icon {
  font-size: 2rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.notification-text {
  flex: 1;
}

.notification-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.notification-subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
}

/* Inline Status Dropdown in Pipeline Table */
.status-dropdown-inline {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 130px;
}

.status-dropdown-inline:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.status-dropdown-inline:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.status-dropdown-inline option {
  padding: 0.5rem;
}

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

.crm-modal-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.crm-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  line-height: 1;
}

.crm-modal-close:hover {
  color: var(--text-primary);
}

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

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.crm-modal-body label {
  display: block;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 500;
}

.crm-modal-body input,
.crm-modal-body select,
.crm-modal-body textarea {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.25rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: inherit;
}

.crm-modal-body textarea {
  resize: vertical;
  min-height: 100px;
}

.crm-modal-body small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.crm-modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* Wide Modal for Customer Details */
.crm-modal-wide .crm-modal-content {
  max-width: 1400px;
  width: 95%;
}

.crm-modal-wide {
  padding-top: 40px;
}

/* Ensure modal scrolls from top */
.crm-modal.show {
  display: flex !important;
}

/* Customer Health Badge */
.customer-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #888;
}

.customer-health-badge.health-excellent .health-dot {
  background: #10b981;
}
.customer-health-badge.health-good .health-dot {
  background: #3b82f6;
}
.customer-health-badge.health-fair .health-dot {
  background: #f59e0b;
}
.customer-health-badge.health-poor .health-dot {
  background: #ef4444;
}
.customer-health-badge.health-critical .health-dot {
  background: #dc2626;
}

/* Quick Stats in Detail Modal */
.customer-quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.quick-stat-card {
  background: var(--bg-surface);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-icon {
  font-size: 1.5rem;
  opacity: 0.8;
}

.stat-content {
  flex: 1;
}

.quick-stat-card .stat-value {
  font-size: 1.25rem;
  font-weight: bold;
  color: var(--accent-primary);
  margin-bottom: 0.125rem;
}

.quick-stat-card .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Quick Actions */
.customer-quick-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.btn-action {
  flex: 1;
  min-width: 150px;
  padding: 0.75rem 1rem;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Customer Detail Tabs */
.customer-detail-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.customer-detail-tab {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.customer-detail-tab:hover {
  color: var(--text-primary);
}

.customer-detail-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}

.customer-detail-content {
  min-height: 300px;
}

.customer-detail-panel {
  display: none;
}

.customer-detail-panel.active {
  display: block;
}

/* Detail Sections */
.detail-section {
  background: var(--bg-surface);
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.detail-section h4 {
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

/* Compact Table */
.crm-table-compact {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.crm-table-compact th {
  background: var(--bg-surface);
  padding: 0.75rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
}

.crm-table-compact td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.crm-table-compact tr:hover {
  background: var(--bg-surface);
}

/* Timeline */
.timeline-container {
  position: relative;
  padding-left: 2rem;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary);
  border: 2px solid var(--bg-primary);
}

.timeline-item::after {
  content: "";
  position: absolute;
  left: -1.75rem;
  top: 12px;
  width: 2px;
  height: 100%;
  background: var(--border-color);
}

.timeline-item:last-child::after {
  display: none;
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.timeline-content {
  background: var(--bg-surface);
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.timeline-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.timeline-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ============================================
   Email Recipient Accordion Groups
   Groups emails by "To:" recipient for easy
   coverage and team management
   ============================================ */

.email-recipient-groups {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.email-recipient-accordion {
  background: var(--bg-primary);
  border: none;
  border-bottom: 2px solid var(--border-color);
  border-radius: 0;
  overflow: hidden;
  transition: all 0.2s ease;
  border-left: 5px solid var(--accent-primary);
}

/* Last item doesn't need bottom border */
.email-recipient-accordion:last-child {
  border-bottom: none;
}

/* Color-coded left borders for different recipients */
.email-recipient-accordion:nth-child(6n + 1) {
  border-left-color: #2196f3;
} /* Blue */
.email-recipient-accordion:nth-child(6n + 2) {
  border-left-color: #9c27b0;
} /* Purple */
.email-recipient-accordion:nth-child(6n + 3) {
  border-left-color: #ff9800;
} /* Orange */
.email-recipient-accordion:nth-child(6n + 4) {
  border-left-color: #4caf50;
} /* Green */
.email-recipient-accordion:nth-child(6n + 5) {
  border-left-color: #e91e63;
} /* Pink */
.email-recipient-accordion:nth-child(6n + 6) {
  border-left-color: #00bcd4;
} /* Cyan */

/* Match avatar color to border color */
.email-recipient-accordion:nth-child(6n + 1) .email-recipient-avatar {
  background: #2196f3;
}
.email-recipient-accordion:nth-child(6n + 2) .email-recipient-avatar {
  background: #9c27b0;
}
.email-recipient-accordion:nth-child(6n + 3) .email-recipient-avatar {
  background: #ff9800;
}
.email-recipient-accordion:nth-child(6n + 4) .email-recipient-avatar {
  background: #4caf50;
}
.email-recipient-accordion:nth-child(6n + 5) .email-recipient-avatar {
  background: #e91e63;
}
.email-recipient-accordion:nth-child(6n + 6) .email-recipient-avatar {
  background: #00bcd4;
}

.email-recipient-accordion:hover {
  background: var(--bg-surface);
}

.email-recipient-accordion.expanded {
  box-shadow: inset 0 0 0 1px var(--border-color);
  background: var(--bg-surface);
}

.email-recipient-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(
    135deg,
    var(--bg-surface) 0%,
    var(--bg-secondary) 100%
  );
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.email-recipient-header:hover {
  background: linear-gradient(
    135deg,
    var(--bg-secondary) 0%,
    var(--bg-surface) 100%
  );
}

.email-recipient-header .toggle-icon {
  font-size: 14px;
  transition: transform 0.3s ease;
  color: var(--text-secondary);
}

.email-recipient-accordion.expanded .email-recipient-header .toggle-icon {
  transform: rotate(90deg);
}

.email-recipient-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.email-recipient-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
}

.email-recipient-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.email-recipient-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.email-recipient-email {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
}

.email-recipient-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.email-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.email-stat.has-action {
  background: rgba(255, 152, 0, 0.2);
  color: #ff9800;
}

.email-stat.unread {
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
}

.email-stat-count {
  font-weight: 700;
  font-size: 14px;
}

.email-recipient-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: var(--bg-surface);
}

.email-recipient-accordion.expanded .email-recipient-content {
  max-height: 2000px; /* Large enough to fit content */
  transition: max-height 0.4s ease-in;
}

.email-recipient-emails {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Nested email items within accordion */
.email-recipient-emails .crm-comm-item {
  margin-bottom: 0;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.email-recipient-emails .crm-comm-item:hover {
  border-left-color: var(--accent-primary);
}

/* Empty state within recipient group */
.email-recipient-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-style: italic;
  font-size: 13px;
}

/* View mode toggle - list vs grouped */
.email-view-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.email-view-btn {
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.email-view-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.email-view-btn.active {
  background: var(--accent-primary);
  color: var(--bg-primary);
  border-color: var(--accent-primary);
  font-weight: 600;
}

/* Coverage mode - highlight when someone else's inbox */
.email-recipient-accordion.coverage-mode .email-recipient-header::after {
  content: "📋 Coverage";
  margin-left: auto;
  font-size: 11px;
  padding: 4px 8px;
  background: rgba(156, 39, 176, 0.2);
  color: #9c27b0;
  border-radius: 4px;
  font-weight: 500;
}

/* ============================================
   Integrations Tab - LinkedIn & Pipedrive
   ============================================ */

.integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 24px;
  padding: 8px;
}

@media (max-width: 960px) {
  .integrations-grid {
    grid-template-columns: 1fr;
  }
}

.integration-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.integration-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.integration-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(
    135deg,
    var(--bg-surface) 0%,
    var(--bg-secondary) 100%
  );
  border-bottom: 1px solid var(--border-color);
}

.integration-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.integration-icon.linkedin {
  background: linear-gradient(135deg, #0077b5 0%, #005582 100%);
  color: white;
}

.integration-icon.pipedrive {
  background: linear-gradient(135deg, #1db954 0%, #178c3f 100%);
  color: white;
}

.integration-title {
  flex: 1;
}

.integration-title h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.integration-title p {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.integration-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
}

.integration-status .status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--error, #f97373);
}

.integration-status .status-dot.connected {
  background: var(--success, #22c55e);
}

.integration-status .status-dot.disconnected {
  background: var(--error, #f97373);
}

.integration-body {
  padding: 20px;
}

.integration-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.integration-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.integration-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.integration-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-form .form-row {
  margin-bottom: 0;
}

.prospects-list {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.prospect-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s ease;
}

.prospect-item:last-child {
  border-bottom: none;
}

.prospect-item:hover {
  background: var(--bg-hover);
}

.prospect-item input[type="checkbox"] {
  flex-shrink: 0;
}

.prospect-info {
  flex: 1;
}

.prospect-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.prospect-title {
  font-size: 12px;
  color: var(--text-secondary);
}

.prospect-company {
  font-size: 12px;
  color: var(--accent-primary);
}

.prospect-actions {
  display: flex;
  gap: 8px;
}

.sync-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
}

.sync-status-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.sync-stat {
  background: var(--bg-surface);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.sync-stat .stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.sync-stat .stat-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.sync-log {
  max-height: 200px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 12px;
  background: var(--bg-surface);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.sync-log-entry {
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
}

.sync-log-entry:last-child {
  border-bottom: none;
}

.sync-log-entry.success {
  color: var(--success, #22c55e);
}

.sync-log-entry.error {
  color: var(--error, #f97373);
}

.recent-imports {
  max-height: 200px;
  overflow-y: auto;
}

.import-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-surface);
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
}

.import-item:last-child {
  margin-bottom: 0;
}

.import-details {
  flex: 1;
}

.import-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.import-meta {
  font-size: 11px;
  color: var(--text-secondary);
}

.bulk-actions {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

/* Document Badge Styles */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-purple {
  background-color: #f3e8ff;
  color: #7c3aed;
}

.badge-blue {
  background-color: #dbeafe;
  color: #2563eb;
}

.badge-green {
  background-color: #dcfce7;
  color: #16a34a;
}

.badge-orange {
  background-color: #ffedd5;
  color: #ea580c;
}

.badge-gray {
  background-color: #f3f4f6;
  color: #4b5563;
}

.badge-teal {
  background-color: #ccfbf1;
  color: #0d9488;
}

.badge-default {
  background-color: #e5e7eb;
  color: #374151;
}

/* Contacts List */
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.contact-card:hover {
  background: var(--bg-hover);
}

.contact-card.primary {
  border-left: 3px solid var(--accent-primary);
}

.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-name .primary-badge {
  font-size: 0.7rem;
  background: var(--accent-primary);
  color: var(--bg-primary);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 500;
}

.contact-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.contact-details {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.contact-details a {
  color: var(--accent-primary);
  text-decoration: none;
}

.contact-details a:hover {
  text-decoration: underline;
}

.contact-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.contact-actions button {
  padding: 0.35rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.contact-actions button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.contact-actions button.btn-danger:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* Documents List */
.documents-list {
  max-height: 400px;
  overflow-y: auto;
}

.document-item {
  transition: background-color 0.15s ease;
}

.document-item:hover {
  background-color: var(--bg-hover);
}

/* Button Small */
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

/* Form Group Spacing */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-group textarea,
.form-group input,
.form-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* ============================================
   Calendar Styles
   ============================================ */

.crm-calendar-grid {
  background: var(--border-color, #333);
  border-radius: 8px;
  overflow: hidden;
}

.crm-calendar-day {
  background: var(--bg-primary, #0f0f1a);
  min-height: 100px;
  padding: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.crm-calendar-day:hover {
  background: var(--bg-surface, #1a1a2e);
}

.crm-calendar-day.other-month {
  background: rgba(15, 15, 26, 0.5);
  opacity: 0.5;
}

.crm-calendar-day.today {
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid var(--accent-primary, #10b981);
}

.crm-calendar-day.has-activities {
  background: rgba(59, 130, 246, 0.1);
}

.crm-calendar-day-number {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.crm-calendar-day.today .crm-calendar-day-number {
  color: var(--accent-primary, #10b981);
}

.crm-calendar-day.other-month .crm-calendar-day-number {
  color: var(--text-muted, #666);
}

.crm-calendar-activities {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crm-calendar-activity {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 3px;
  background: var(--accent-primary, #10b981);
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crm-calendar-activity:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.crm-calendar-activity.call {
  background: #3b82f6;
}

.crm-calendar-activity.email {
  background: #8b5cf6;
}

.crm-calendar-activity.meeting {
  background: #f59e0b;
}

.crm-calendar-activity.task {
  background: #ef4444;
}

.crm-calendar-activity.note {
  background: #6b7280;
}

.crm-calendar-activity.deadline {
  background: linear-gradient(135deg, #10b981, #059669);
  border-left: 3px solid #047857;
  font-weight: 600;
}

.crm-calendar-activity.deadline:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

/* Projects not yet in system - show with warning style */
.crm-calendar-activity.deadline[data-new="true"] {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-left: 3px solid #b45309;
}

/* Deadline source-specific styles */
.crm-calendar-activity.deadline[data-source="quote"] {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-left: 3px solid #1d4ed8;
}

.crm-calendar-activity.deadline[data-source="po-due"],
.crm-calendar-activity.deadline[data-source="po-requested"] {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  border-left: 3px solid #6d28d9;
}

.crm-calendar-activity.deadline[data-source="po-confirmed"] {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  border-left: 3px solid #15803d;
}

.crm-calendar-activity.deadline[data-source="po-estimated"] {
  background: linear-gradient(135deg, #ec4899, #db2777);
  border-left: 3px solid #be185d;
}

.crm-calendar-activity.deadline[data-source="rfq"] {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  border-left: 3px solid #0e7490;
}

/* Reminder badge on calendar activities */
.activity-reminder-badge {
  display: inline-block;
  font-size: 9px;
  padding: 1px 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  margin-left: 4px;
  font-weight: 600;
  vertical-align: middle;
}

.activity-reminder-fired {
  display: inline-block;
  font-size: 10px;
  margin-left: 4px;
  opacity: 0.7;
  vertical-align: middle;
}

/* Activities with reminders get a subtle glow */
.crm-calendar-activity:has(.activity-reminder-badge) {
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
  animation: pulse-reminder 2s ease-in-out infinite;
}

@keyframes pulse-reminder {
  0%,
  100% {
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
  }
  50% {
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.8);
  }
}

.crm-calendar-activity.project {
  background: #6366f1;
}

/* Activity completion toggle */
.activity-complete-toggle {
  display: inline-block;
  width: 16px;
  height: 16px;
  line-height: 14px;
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  margin-right: 4px;
  cursor: pointer;
  font-size: 10px;
  vertical-align: middle;
  transition: all 0.15s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.activity-complete-toggle:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

/* Completed activities */
.crm-calendar-activity.completed {
  opacity: 0.6;
  text-decoration: line-through;
  background: #6b7280 !important;
}

.crm-calendar-activity.completed .activity-complete-toggle {
  background: rgba(34, 197, 94, 0.8);
  border-color: #22c55e;
  color: white;
}

.crm-calendar-activity.completed:hover {
  opacity: 0.8;
}

.crm-calendar-more {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  padding: 2px;
  cursor: pointer;
}

.crm-calendar-more:hover {
  color: var(--accent-primary);
}

/* Upcoming Activities List */
.crm-upcoming-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.crm-upcoming-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-primary, #0f0f1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.crm-upcoming-item:hover {
  background: var(--bg-surface, #1a1a2e);
  border-color: var(--accent-primary, #10b981);
}

.crm-upcoming-date {
  text-align: center;
  min-width: 60px;
}

.crm-upcoming-date-day {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-primary, #10b981);
  line-height: 1;
}

.crm-upcoming-date-month {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.crm-upcoming-date-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.crm-upcoming-details {
  flex: 1;
}

.crm-upcoming-subject {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.crm-upcoming-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.crm-upcoming-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.crm-upcoming-type.call {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.crm-upcoming-type.email {
  background: rgba(139, 92, 246, 0.2);
  color: #8b5cf6;
}

.crm-upcoming-type.meeting {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.crm-upcoming-type.task {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.crm-upcoming-type.note {
  background: rgba(107, 114, 128, 0.2);
  color: #6b7280;
}

/* ==========================================
   CSV Import Modal Styles
   ========================================== */

.csv-import-modal .crm-modal-content {
  max-width: 900px;
}

.csv-import-steps {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0 1.5rem;
}

.csv-step-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.csv-step-indicator.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.csv-step-indicator.completed {
  background: rgba(16, 185, 129, 0.2);
  border-color: #10b981;
  color: #10b981;
}

.csv-step-indicator .step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 600;
  font-size: 0.75rem;
}

.csv-step-indicator.active .step-number {
  background: rgba(0, 0, 0, 0.2);
}

.csv-step-indicator.completed .step-number::after {
  content: "✓";
}

.csv-step-indicator.completed .step-number span {
  display: none;
}

/* Step content */
.import-step {
  padding: 0 1.5rem 1.5rem;
}

.import-step h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.import-step > p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0 0 1.5rem 0;
}

/* File upload area */
.csv-file-upload {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-surface);
}

.csv-file-upload:hover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.05);
}

.csv-file-upload.dragover {
  border-color: var(--accent-primary);
  background: rgba(59, 130, 246, 0.1);
}

.csv-file-upload .upload-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.csv-file-upload p {
  margin: 0;
  color: var(--text-secondary);
}

.csv-file-upload .browse-link {
  color: var(--accent-primary);
  text-decoration: underline;
  cursor: pointer;
}

.csv-file-input {
  display: none;
}

.csv-file-selected {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
  border-radius: 8px;
  margin-top: 1rem;
}

.csv-file-selected .file-icon {
  font-size: 1.5rem;
}

.csv-file-selected .file-info {
  flex: 1;
}

.csv-file-selected .file-name {
  font-weight: 600;
  color: var(--text-primary);
}

.csv-file-selected .file-size {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.csv-file-selected .remove-file {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1.25rem;
}

.csv-file-selected .remove-file:hover {
  color: #ef4444;
}

/* Mapping table */
.csv-mapping-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.csv-mapping-table th,
.csv-mapping-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.csv-mapping-table th {
  background: var(--bg-surface);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.csv-mapping-table td {
  color: var(--text-primary);
}

.csv-mapping-table .csv-header-name {
  font-weight: 500;
  color: var(--accent-primary);
}

.csv-mapping-table .csv-sample-data {
  color: var(--text-secondary);
  font-size: 0.8rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.csv-mapping-table select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.csv-mapping-table select:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Mapping options */
.csv-mapping-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--bg-surface);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.csv-mapping-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
}

.csv-mapping-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
}

/* Preview section */
.csv-preview-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.csv-preview-stat {
  background: var(--bg-surface);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  text-align: center;
}

.csv-preview-stat .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
}

.csv-preview-stat .stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.csv-preview-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.csv-preview-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.csv-preview-item:last-child {
  border-bottom: none;
}

.csv-preview-item .company-name {
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.csv-preview-item .contact-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  background: var(--bg-surface);
  border-radius: 4px;
}

.csv-preview-item.duplicate {
  opacity: 0.5;
}

.csv-preview-item.duplicate::after {
  content: "Duplicate - will skip";
  font-size: 0.75rem;
  color: #f59e0b;
}

/* Navigation buttons */
.csv-import-actions {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  border-radius: 0 0 12px 12px;
}

.csv-import-actions .btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.csv-import-actions .btn-primary {
  background: var(--accent-primary);
  border: none;
  color: #fff;
  padding: 0.625rem 1.5rem;
}

.csv-import-actions .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Success state */
.csv-import-success {
  text-align: center;
  padding: 2rem;
}

.csv-import-success .success-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.csv-import-success h4 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.csv-import-success p {
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   RMA (Return Material Authorization) Styles
   ============================================ */

/* RMA Photo Dropzone */
.rma-photo-dropzone {
  border: 2px dashed var(--border-color, #444);
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-primary, #0f0f1a);
}

.rma-photo-dropzone:hover {
  border-color: var(--accent-primary, #10b981);
  background: rgba(16, 185, 129, 0.05);
}

.rma-photo-dropzone.dragover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-primary, #10b981);
  border-style: solid;
}

.rma-photo-dropzone .dropzone-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.rma-photo-dropzone p {
  margin: 0.5rem 0;
  color: var(--text-secondary, #888);
}

/* Photo Preview Grid */
.rma-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.rma-photo-grid-large {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.rma-photo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-primary, #0f0f1a);
  border: 1px solid var(--border-color, #333);
}

.rma-photo-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

.rma-photo-grid-large .rma-photo-item img {
  height: 150px;
}

.rma-photo-item .photo-caption {
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-secondary, #888);
  background: var(--bg-surface, #1a1a2e);
}

.rma-photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.rma-photo-remove:hover {
  background: #dc3545;
}

/* RMA Status Badges */
.rma-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.rma-status.open {
  background: #fef3c7;
  color: #92400e;
}

.rma-status.pending {
  background: #dbeafe;
  color: #1e40af;
}

.rma-status.resolved {
  background: #d1fae5;
  color: #065f46;
}

.rma-status.closed {
  background: #e5e7eb;
  color: #374151;
}

/* Resolution Badges */
.rma-resolution {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.rma-resolution.credit {
  background: #fee2e2;
  color: #991b1b;
}

.rma-resolution.rerun {
  background: #fef3c7;
  color: #92400e;
}

.rma-resolution.no-fault {
  background: #d1fae5;
  color: #065f46;
}

.rma-resolution.none {
  background: var(--bg-surface, #1a1a2e);
  color: var(--text-muted, #666);
}

/* Severity Badges */
.rma-severity {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.rma-severity.minor {
  background: #d1fae5;
  color: #065f46;
}

.rma-severity.major {
  background: #fef3c7;
  color: #92400e;
}

.rma-severity.critical {
  background: #fee2e2;
  color: #991b1b;
}

/* Root Cause Dropzone */
.rma-rootcause-dropzone {
  border: 2px dashed var(--border-color, #444);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.2s ease;
  background: var(--bg-primary, #0f0f1a);
}

.rma-rootcause-dropzone:hover {
  border-color: var(--accent-primary, #10b981);
}

.rma-rootcause-dropzone.dragover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-primary, #10b981);
  border-style: solid;
}

.rma-rootcause-dropzone .dropzone-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}

/* Root Cause Document Preview */
.rma-rootcause-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface, #1a1a2e);
  border: 1px solid var(--border-color, #333);
  border-radius: 8px;
}

.rma-rootcause-file .file-icon {
  font-size: 2rem;
}

.rma-rootcause-file .file-info {
  flex: 1;
}

.rma-rootcause-file .file-name {
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.rma-rootcause-file .file-date {
  font-size: 12px;
  color: var(--text-secondary, #888);
}

/* Resolution Options */
.rma-resolution-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-resolution {
  padding: 12px 20px;
  border: 2px solid var(--border-color, #444);
  border-radius: 8px;
  background: var(--bg-primary, #0f0f1a);
  color: var(--text-primary, #fff);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-resolution:hover {
  border-color: var(--accent-primary, #10b981);
  background: rgba(16, 185, 129, 0.1);
}

.btn-resolution.active {
  border-color: var(--accent-primary, #10b981);
  background: var(--accent-primary, #10b981);
  color: #000;
}

.btn-resolution[data-resolution="credit"].active {
  background: #ef4444;
  border-color: #ef4444;
  color: #fff;
}

.btn-resolution[data-resolution="rerun"].active {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #000;
}

.btn-resolution[data-resolution="no_fault"].active {
  background: #10b981;
  border-color: #10b981;
  color: #000;
}

/* RMA Detail Summary */
.rma-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 16px;
  background: var(--bg-primary, #0f0f1a);
  border: 1px solid var(--border-color, #333);
  border-radius: 8px;
  margin-bottom: 16px;
}

.rma-detail-summary .summary-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rma-detail-summary .summary-label {
  font-size: 11px;
  color: var(--text-secondary, #888);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rma-detail-summary .summary-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary, #fff);
}

.rma-detail-summary .summary-value.large {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-primary, #10b981);
}

/* Form Section Headers */
.form-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color, #333);
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.form-section h4 {
  margin: 0 0 12px 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-primary, #10b981);
}

/* Large Modal */
.crm-modal-large {
  max-width: 800px;
  width: 95%;
}

/* Cost Impact Highlight */
.rma-cost-impact {
  font-size: 16px;
  font-weight: 700;
  color: #ef4444;
}

/* ===== PROJECT STATUS KANBAN ===== */
.project-kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 16px 0;
  min-height: 400px;
}

.kanban-lane {
  flex: 1;
  min-width: 180px;
  max-width: 220px;
  background: var(--bg-surface);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.kanban-lane-header {
  padding: 10px 12px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.kanban-lane-cards {
  flex: 1;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
  overflow-y: auto;
}

.kanban-lane-cards.drag-over {
  background: rgba(184, 146, 125, 0.1);
  border: 2px dashed var(--accent-primary, #b8927d);
}

.kanban-card {
  background: var(--bg-card, #1a1a2e);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 10px;
  cursor: grab;
  transition: transform 0.15s, box-shadow 0.15s;
}

.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.kanban-card-project {
  font-weight: 600;
  font-size: 13px;
  color: var(--accent-primary, #b8927d);
  margin-bottom: 4px;
}

.kanban-card-customer {
  font-size: 12px;
  color: var(--text-primary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kanban-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--text-secondary);
}

.kanban-card-due {
  color: var(--warning, #f59e0b);
}

.kanban-card-due.overdue {
  color: var(--danger, #ef4444);
}

/* View toggle buttons */
.project-status-view-btn {
  padding: 6px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s;
}

.project-status-view-btn:hover {
  opacity: 0.8;
}

.project-status-view-btn.active {
  opacity: 1;
  background: var(--accent-primary, #b8927d);
  color: white;
  border-color: var(--accent-primary, #b8927d);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* PROSPECTOR TAB STYLES                                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */

.prospector-top-section {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  margin-top: 16px;
}

@media (max-width: 768px) {
  .prospector-top-section {
    grid-template-columns: 1fr;
  }
}

.prospector-import-zone {
  padding: 20px;
  background: var(--bg-surface);
  border-radius: 8px;
  border: 2px dashed var(--border-color);
  transition: border-color 0.2s ease;
}

.prospector-import-zone:hover {
  border-color: var(--accent-primary);
}

.prospector-import-zone.drag-over {
  border-color: var(--accent-primary);
  background: rgba(184, 146, 125, 0.1);
}

.prospector-stats {
  padding: 20px;
  background: var(--bg-surface);
  border-radius: 8px;
}

.prospector-stats h4 {
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

.prospector-filters {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.prospector-filters select,
.prospector-filters input {
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.prospector-filters input {
  flex: 1;
  min-width: 200px;
}

/* Prospect table action buttons */
.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Score stars */
.prospect-score {
  display: inline-flex;
  gap: 2px;
}

.prospect-score-star {
  color: #fbbf24;
}

.prospect-score-star.empty {
  color: var(--text-muted);
  opacity: 0.3;
}

/* Import preview table */
.crm-table-compact {
  width: 100%;
  border-collapse: collapse;
}

.crm-table-compact th,
.crm-table-compact td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.crm-table-compact th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.crm-table-compact td {
  color: var(--text-primary);
  font-size: 13px;
}

/* Message modal styles */
#crm-prospect-message-modal .crm-modal-body > div {
  margin-bottom: 20px;
}

#prospect-message-linkedin,
#prospect-message-email-a,
#prospect-message-email-b {
  padding: 16px;
  background: var(--bg-surface);
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 14px;
}

#prospect-message-linkedin {
  border-left: 4px solid #0077b5; /* LinkedIn blue */
}

#prospect-message-email-a {
  border-left: 4px solid #3b82f6;
}

#prospect-message-email-b {
  border-left: 4px solid #8b5cf6;
}

/* Prospect status colors in table */
.crm-prospector-table tr[data-status="skipped"] {
  opacity: 0.5;
}

.crm-prospector-table tr[data-status="contacted"] {
  background: rgba(139, 92, 246, 0.05);
}

.crm-prospector-table tr[data-status="responded"] {
  background: rgba(16, 185, 129, 0.05);
}

.crm-prospector-table tr[data-status="converted"] {
  background: rgba(245, 158, 11, 0.05);
}

/* Sortable Table Headers */
.sortable-header {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.sortable-header:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

.sortable-header.active {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--primary-color, #3b82f6);
}

.sort-indicator {
  margin-left: 4px;
  opacity: 0.4;
  font-size: 0.8em;
}

.sortable-header.active .sort-indicator {
  opacity: 1;
}

.sortable-header.asc .sort-indicator::after {
  content: "▲";
}

.sortable-header.desc .sort-indicator::after {
  content: "▼";
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* EMPOWERMENT TAB - SALES MENTOR AGENT STYLES                                 */
/* ═══════════════════════════════════════════════════════════════════════════ */

.empowerment-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header Section */
.empowerment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.coach-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.coach-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.coach-info h3 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--text-primary);
  font-weight: 700;
}

.coach-tagline {
  margin: 4px 0 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.empowerment-quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-coach {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-coach:hover {
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.1);
}

.btn-primary-coach {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
  color: white;
}

.btn-primary-coach:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Stats Grid */
.empowerment-dashboard {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
}

.emp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.emp-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-primary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.emp-stat-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.emp-stat-card.highlight {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1) 0%,
    rgba(5, 150, 105, 0.05) 100%
  );
  border-color: rgba(16, 185, 129, 0.3);
}

.emp-stat-icon {
  font-size: 1.75rem;
  opacity: 0.9;
}

.emp-stat-content {
  display: flex;
  flex-direction: column;
}

.emp-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary, #10b981);
}

.emp-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Weekly Trend Section */
.emp-trend-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.emp-trend-section h4 {
  margin: 0 0 16px 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.emp-trend-chart {
  padding: 16px;
  background: var(--bg-primary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.trend-bar-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: 100px;
  gap: 8px;
}

.trend-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.trend-day .trend-bar {
  width: 100%;
  max-width: 40px;
  height: 0%;
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  border-radius: 4px 4px 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
}

.trend-day span {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Main Grid - Insights + Questions */
.empowerment-main-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

@media (max-width: 960px) {
  .empowerment-main-grid {
    grid-template-columns: 1fr;
  }
}

/* Insights Panel */
.emp-insights-panel {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
}

.emp-insights-panel h4 {
  margin: 0 0 16px 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.emp-insights-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
}

.emp-insight-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--bg-primary);
  border-radius: 8px;
  border-left: 4px solid var(--accent-primary);
}

.emp-insight-card.info {
  border-left-color: #3b82f6;
}

.emp-insight-card.success {
  border-left-color: #10b981;
}

.emp-insight-card.warning {
  border-left-color: #f59e0b;
}

.emp-insight-card.alert {
  border-left-color: #ef4444;
}

.emp-insight-card.celebration {
  border-left-color: #8b5cf6;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.1) 0%,
    rgba(139, 92, 246, 0.05) 100%
  );
}

.insight-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.insight-text {
  flex: 1;
}

.insight-text strong {
  display: block;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.insight-text p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Quick Questions Panel */
.emp-questions-panel {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
}

.emp-questions-panel h4 {
  margin: 0 0 16px 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.emp-quick-questions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quick-question-btn {
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-question-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.1);
  transform: translateX(4px);
}

/* Activity Log Section */
.emp-activity-log {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
}

.emp-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.emp-log-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1rem;
}

.emp-log-filters {
  display: flex;
  gap: 10px;
}

.emp-log-filters select {
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.emp-table {
  margin-top: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* COACH CHAT MODAL                                                            */
/* ═══════════════════════════════════════════════════════════════════════════ */

.coach-chat-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.coach-chat-modal.show {
  display: flex !important;
}

.coach-chat-container {
  background: var(--bg-primary, #0f0f1a);
  border-radius: 16px;
  width: 100%;
  max-width: 800px;
  height: 80vh;
  max-height: 700px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.coach-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.coach-chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coach-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.coach-chat-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.coach-chat-subtitle {
  font-size: 0.8rem;
  opacity: 0.9;
}

.coach-chat-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background 0.2s;
}

.coach-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.coach-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.coach-message {
  display: flex;
  gap: 12px;
  max-width: 85%;
}

.coach-message.from-coach {
  align-self: flex-start;
}

.coach-message.from-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.coach-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.coach-message.from-user .coach-message-avatar {
  background: var(--accent-primary, #10b981);
}

.coach-message-content {
  background: var(--bg-surface);
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.coach-message.from-user .coach-message-content {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  border-color: #10b981;
}

.coach-message-content p {
  margin: 0 0 10px 0;
}

.coach-message-content p:last-child {
  margin-bottom: 0;
}

.coach-message-content strong {
  color: inherit;
}

.coach-message-content ul,
.coach-message-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.coach-message-content li {
  margin-bottom: 4px;
}

.coach-message-content code {
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85em;
}

.coach-message-content pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 10px 0;
}

.coach-chat-input-area {
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
}

.coach-chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  resize: none;
  min-height: 44px;
  max-height: 120px;
}

.coach-chat-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.coach-chat-send {
  padding: 12px 24px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  border-radius: 8px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.coach-chat-send:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.coach-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Typing indicator */
.coach-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  width: fit-content;
}

.coach-typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.coach-typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}
.coach-typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}
.coach-typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ACTIVITY LOG MODAL                                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */

.emp-log-modal .crm-modal-content {
  max-width: 600px;
}

.emp-log-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.emp-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 480px) {
  .emp-form-row {
    grid-template-columns: 1fr;
  }
}

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

.emp-form-group label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.emp-form-group input,
.emp-form-group select,
.emp-form-group textarea {
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.emp-form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.emp-form-group input:focus,
.emp-form-group select:focus,
.emp-form-group textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.emp-outcome-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.emp-outcome-btn {
  padding: 8px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.emp-outcome-btn:hover {
  border-color: var(--accent-primary);
}

.emp-outcome-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

/* Weekly Review Styles */
.emp-weekly-review {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.emp-review-section {
  background: var(--bg-surface);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.emp-review-section h5 {
  margin: 0 0 12px 0;
  color: var(--accent-primary);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.emp-review-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .emp-review-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.emp-review-stat {
  text-align: center;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 6px;
}

.emp-review-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
}

.emp-review-stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.emp-review-stat-trend {
  font-size: 0.75rem;
  margin-top: 4px;
}

.emp-review-stat-trend.up {
  color: #10b981;
}

.emp-review-stat-trend.down {
  color: #ef4444;
}

.emp-review-stat-trend.neutral {
  color: var(--text-secondary);
}

/* Streak display */
.emp-streak-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.1) 0%,
    rgba(245, 158, 11, 0.05) 100%
  );
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.emp-streak-icon {
  font-size: 2rem;
}

.emp-streak-count {
  font-size: 2rem;
  font-weight: 700;
  color: #f59e0b;
}

.emp-streak-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* VALUE CALCULATOR STYLES                                                     */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Main Container */
.value-calculator-section {
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-top: 20px;
}

/* Header */
.value-calc-header {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.value-calc-header:hover {
  filter: brightness(1.1);
}

.value-calc-title-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.value-calc-icon {
  font-size: 2rem;
}

.value-calc-title-area h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
}

.value-calc-subtitle {
  margin: 2px 0 0 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
}

.value-calc-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.value-calc-total {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.value-calc-expand {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  transition: transform 0.3s ease;
}

.value-calculator-section.expanded .value-calc-expand {
  transform: rotate(180deg);
}

/* Body (Collapsible) */
.value-calc-body {
  padding: 16px;
  display: none;
}

.value-calculator-section.expanded .value-calc-body {
  display: block;
}

/* Value Sections */
.value-section {
  background: var(--bg-primary);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

/* Section Header (Collapsible) */
.value-section .section-header {
  background: var(--bg-surface);
  padding: 12px 15px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s ease;
  user-select: none;
}

.value-section .section-header:hover {
  background: rgba(13, 148, 136, 0.1);
}

.value-section .section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.value-section .section-icon {
  font-size: 1.1rem;
}

.value-section .section-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.value-section .section-result {
  font-weight: 700;
  color: #10b981;
  font-size: 0.95rem;
}

.value-section .expand-icon {
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.value-section .section-header.expanded .expand-icon {
  transform: rotate(180deg);
}

/* Section Content (Expandable) */
.value-section .section-content {
  padding: 15px;
  display: none;
  border-top: 1px solid var(--border-color);
}

.value-section .section-content.active {
  display: block;
}

/* Ask Prompt */
.ask-prompt {
  background: rgba(13, 148, 136, 0.1);
  border-left: 3px solid #0d9488;
  padding: 10px 12px;
  margin-bottom: 15px;
  font-size: 0.85rem;
  color: #14b8a6;
  font-style: italic;
  border-radius: 0 6px 6px 0;
}

/* Input Groups */
.value-section .input-group {
  margin-bottom: 12px;
}

.value-section .input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.value-section .input-group input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.value-section .input-group input:focus {
  outline: none;
  border-color: #0d9488;
}

.value-section .input-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.value-section .input-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Section Total */
.section-total {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid #10b981;
  border-radius: 6px;
  padding: 12px;
  margin-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-total-label {
  font-weight: 600;
  color: #10b981;
  font-size: 0.9rem;
}

.section-total-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: #10b981;
}

/* Grand Total */
.grand-total {
  background: linear-gradient(135deg, #064e3b, #065f46);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-top: 16px;
  border: 2px solid #10b981;
}

.grand-total-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9ca3af;
  margin-bottom: 6px;
}

.grand-total-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: #10b981;
}

.grand-total-hint {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 8px;
}

/* What to Say Section */
.what-to-say {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 15px;
  margin-top: 16px;
  border: 1px solid #f59e0b;
}

.what-to-say-header {
  font-weight: 600;
  color: #f59e0b;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.what-to-say-script {
  background: var(--bg-surface);
  border-radius: 6px;
  padding: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-primary);
  font-style: italic;
}

/* Buttons */
.copy-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: #0d9488;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}

.copy-btn:hover {
  background: #14b8a6;
}

.value-calc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.value-calc-actions .btn-coach {
  flex: 1;
  min-width: 150px;
}

.value-calc-actions .reset-btn {
  flex: 1;
  min-width: 150px;
  padding: 10px 18px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.value-calc-actions .reset-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* Animation for value updates */
@keyframes value-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.value-calculating {
  animation: value-pulse 0.4s ease-in-out;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* VOICE CHAT STYLES                                                            */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Voice toggle button in header */
.coach-chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.coach-voice-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.coach-voice-settings:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: rotate(45deg);
}

/* Coach Personalize Button */
.coach-personalize-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.2),
    rgba(6, 182, 212, 0.2)
  );
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 20px;
  color: #10b981;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.coach-personalize-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.3),
    rgba(6, 182, 212, 0.3)
  );
  border-color: rgba(16, 185, 129, 0.6);
  transform: scale(1.02);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.coach-personalize-btn .personalize-label {
  white-space: nowrap;
}

.coach-voice-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.coach-voice-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.coach-voice-toggle.active {
  background: rgba(239, 68, 68, 0.8);
  border-color: #ef4444;
  animation: voice-pulse 2s infinite;
}

.coach-voice-toggle .voice-icon {
  font-size: 1rem;
}

.coach-voice-toggle .voice-label {
  font-weight: 500;
}

/* Voice indicator bar */
.coach-voice-indicator {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.15) 0%,
    rgba(5, 150, 105, 0.1) 100%
  );
  border-top: 1px solid rgba(16, 185, 129, 0.3);
}

.coach-voice-indicator.active {
  display: flex;
}

/* Pulsing animation for voice listening */
.voice-pulse {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: voice-ring 1.5s infinite;
}

.voice-pulse::before,
.voice-pulse::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: inherit;
  opacity: 0.6;
  animation: voice-ripple 1.5s infinite;
}

.voice-pulse::after {
  animation-delay: 0.5s;
}

@keyframes voice-ripple {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

@keyframes voice-ring {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes voice-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

#voice-status-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  min-width: 150px;
  text-align: center;
}

.voice-stop-btn {
  padding: 10px 24px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  border-radius: 8px;
  color: #ef4444;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.voice-stop-btn:hover {
  background: #ef4444;
  color: white;
}

/* Speaking indicator style */
.coach-voice-indicator.speaking .voice-pulse {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  animation: voice-speaking 0.8s infinite alternate;
}

@keyframes voice-speaking {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.15);
  }
}

/* Roleplay quick buttons */
.roleplay-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.roleplay-btn {
  padding: 8px 14px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid #8b5cf6;
  border-radius: 6px;
  color: #a78bfa;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.roleplay-btn:hover {
  background: #8b5cf6;
  color: white;
}

/* Conversation state indicators */
.coach-voice-indicator.state-listening {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.15) 0%,
    rgba(5, 150, 105, 0.1) 100%
  );
  border-top-color: rgba(16, 185, 129, 0.4);
}

.coach-voice-indicator.state-listening .voice-pulse {
  background: linear-gradient(135deg, #10b981, #059669);
}

.coach-voice-indicator.state-speaking {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.15) 0%,
    rgba(37, 99, 235, 0.1) 100%
  );
  border-top-color: rgba(59, 130, 246, 0.4);
}

.coach-voice-indicator.state-speaking .voice-pulse {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  animation: voice-speaking 0.6s ease-in-out infinite alternate;
}

.coach-voice-indicator.state-thinking {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.15) 0%,
    rgba(217, 119, 6, 0.1) 100%
  );
  border-top-color: rgba(245, 158, 11, 0.4);
}

.coach-voice-indicator.state-thinking .voice-pulse {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  animation: voice-thinking 1.2s ease-in-out infinite;
}

.coach-voice-indicator.state-idle {
  background: linear-gradient(
    135deg,
    rgba(100, 116, 139, 0.1) 0%,
    rgba(71, 85, 105, 0.1) 100%
  );
  border-top-color: rgba(100, 116, 139, 0.3);
}

.coach-voice-indicator.state-idle .voice-pulse {
  background: linear-gradient(135deg, #64748b, #475569);
  animation: none;
}

@keyframes voice-thinking {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.95);
    opacity: 0.7;
  }
}

/* Waveform animation for voice activity */
#voice-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 24px;
}

#voice-waveform .bar {
  width: 4px;
  height: 8px;
  background: currentColor;
  border-radius: 2px;
  transition: height 0.1s ease;
}

#voice-waveform.active .bar {
  animation: waveform-bar 0.5s ease-in-out infinite;
}

#voice-waveform.active .bar:nth-child(1) {
  animation-delay: 0s;
}
#voice-waveform.active .bar:nth-child(2) {
  animation-delay: 0.1s;
}
#voice-waveform.active .bar:nth-child(3) {
  animation-delay: 0.2s;
}
#voice-waveform.active .bar:nth-child(4) {
  animation-delay: 0.3s;
}
#voice-waveform.active .bar:nth-child(5) {
  animation-delay: 0.4s;
}

#voice-waveform.listening {
  color: #10b981;
}

#voice-waveform.speaking {
  color: #3b82f6;
}

@keyframes waveform-bar {
  0%,
  100% {
    height: 8px;
  }
  50% {
    height: 20px;
  }
}

/* Mobile adjustments for voice */
@media (max-width: 480px) {
  .coach-voice-toggle .voice-label {
    display: none;
  }

  .coach-voice-indicator {
    flex-direction: column;
    gap: 12px;
  }

  .voice-pulse {
    width: 50px;
    height: 50px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SUCCESS PLAN STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

.success-plan-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.success-plan-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.success-plan-card:hover {
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

.success-plan-card.completed {
  opacity: 0.7;
  background: #f8fafc;
}

.success-plan-card.completed .success-plan-card-title {
  text-decoration: line-through;
  color: #94a3b8;
}

.success-plan-card-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-radius: 8px;
  flex-shrink: 0;
}

.success-plan-card-content {
  flex: 1;
  min-width: 0;
}

.success-plan-card-title {
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.success-plan-card-meta {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.success-plan-card-notes {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.5rem;
  font-style: italic;
}

.success-plan-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.success-plan-card-actions .btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.success-plan-card-actions .btn-icon:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.success-plan-card-actions .btn-icon.danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
}

/* Success Plan in Empowerment Dashboard */
.emp-success-plan-widget {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.emp-success-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.emp-success-plan-header h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.emp-success-plan-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.emp-success-plan-stat {
  text-align: center;
}

.emp-success-plan-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #166534;
}

.emp-success-plan-stat-label {
  font-size: 0.75rem;
  color: #4ade80;
  text-transform: uppercase;
}

.emp-success-plan-next {
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.emp-success-plan-next-icon {
  font-size: 1.25rem;
}

.emp-success-plan-next-content {
  flex: 1;
}

.emp-success-plan-next-title {
  font-weight: 500;
  color: #1e293b;
}

.emp-success-plan-next-time {
  font-size: 0.8rem;
  color: #64748b;
}

/* Dark mode support */
.dark-mode .success-plan-card {
  background: var(--dark-card-bg, #1e293b);
  border-color: var(--dark-border, #334155);
}

.dark-mode .success-plan-card-title {
  color: #f1f5f9;
}

.dark-mode .success-plan-card-actions .btn-icon {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

.dark-mode .success-plan-card-actions .btn-icon:hover {
  background: #334155;
}
