﻿:root {
  --bg1: #0b1220;
  --bg2: #0a0f1a;
  --brand1: #0ea5e9;
  --brand2: #0284c7;
  --accent2: #3b82f6;
  --card: #0f172a;
  --muted: #94a3b8;
  --text: #e5e7eb;
  --ring: rgba(56,189,248,.45);
  --success: #3b82f6;
  --warning: #f59e0b;
  --danger: #ef4444;
  --neutral: #6b7280;
  --ai-suggestion: #1e3a8a;
  --ai-text: #7dd3fc;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Poppins', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 15% -10%, rgba(56,189,248,.12), transparent), 
              linear-gradient(180deg, var(--bg1), var(--bg2));
  color: var(--text);
  min-height: 100vh;
  transition: opacity 0.3s ease;
  line-height: 1.5;
}

.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 24px;
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, rgba(11,18,32,.96), rgba(11,18,32,.88));
  backdrop-filter: blur(8px);
  border-bottom: 2px solid rgba(148,163,184,.2);
  padding: 16px 0;
  border-radius: 12px;
}

.title {
  font-weight: 800;
  font-size: clamp(22px, 2.8vw, 32px);
  color: #7dd3fc;
  margin: 0;
}

.subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(56,189,248,.15);
  color: #bfe8ff;
  font-size: 12px;
  border: 1px solid rgba(56,189,248,.35);
  font-weight: 600;
}

/* Navigation */
.workflow-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(15,23,42,.8), rgba(15,23,42,.9));
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.2);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: transparent;
  border: 2px solid rgba(148,163,184,.3);
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 14px;
  min-width: 160px;
}

.nav-btn:hover {
  border-color: var(--brand1);
  color: var(--text);
  transform: translateY(-2px);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--brand1), var(--brand2));
  border-color: var(--brand1);
  color: white;
  box-shadow: 0 4px 12px rgba(14,165,233,.3);
}

.nav-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  font-weight: 700;
  font-size: 14px;
}

.nav-btn.active .nav-number {
  background: rgba(255,255,255,.3);
}

/* Page Management */
.page {
  min-height: 60vh;
}

.hidden {
  display: none !important;
}

.page-header {
  text-align: center;
  margin-bottom: 32px;
}

.page-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.page-header-content > div {
  flex: 1;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: #7dd3fc;
  margin: 0 0 8px 0;
}

.page-header p {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

/* Cards */
.card {
  background: linear-gradient(180deg, rgba(15,23,42,.9), rgba(15,23,42,.94));
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(2,6,23,.35);
}

.card h3 {
  margin: 0 0 16px 0;
  color: #7dd3fc;
  font-size: 18px;
  font-weight: 600;
}

/* Setup Page Layout */
\.setup-layout {\n  display: grid;\n  grid-template-columns: 1.6fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-group label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* Filter Groups */
.filter-group {
  margin-bottom: 20px;
}

.filter-group h4 {
  margin: 0 0 12px 0;
  color: #7dd3fc;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.geo-simple {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.filter-preview {
  margin-top: 20px;
  padding: 16px;
  background: rgba(34,197,94,.05);
  border: 1px dashed rgba(34,197,94,.3);
  border-radius: 12px;
}

.preview-text {
  margin-top: 8px;
  color: var(--text);
  font-size: 14px;
}

/* Enhanced Setup Page Elements */
.selected-count {
  background: rgba(34,197,94,.2);
  color: #22c55e;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  margin-left: auto;
  font-weight: 600;
}

.quick-filters {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.quick-filter-btn {
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(14,165,233,.08);
  border: 1px solid rgba(14,165,233,.2);
  color: #7dd3fc;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.quick-filter-btn:hover {
  background: rgba(14,165,233,.15);
  border-color: rgba(14,165,233,.3);
  transform: translateY(-1px);
}

/* Tips Card */
.tips-card {
  background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(34,197,94,.04));
  border-color: rgba(34,197,94,.3);
}

.tips-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tip {
  color: #86efac;
  font-size: 13px;
  line-height: 1.4;
  display: flex;
  align-items: start;
  gap: 8px;
}

.tip::before {
  content: "*";
  color: #22c55e;
  font-weight: 700;
  margin-top: 1px;
}

/* Start Session */
.start-session {
  background: linear-gradient(135deg, rgba(34,197,94,.1), rgba(34,197,94,.05));
  border-color: rgba(34,197,94,.4);
  text-align: center;
}

.start-content h3 {
  color: #22c55e;
  margin-bottom: 8px;
}

.start-content p {
  color: var(--muted);
  margin-bottom: 20px;
}

.lead-estimate {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(34,197,94,.05);
  border-radius: 12px;
}

.estimate-item {
  text-align: center;
}

.estimate-number {
  font-size: 24px;
  font-weight: 700;
  color: #86efac;
}

.estimate-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* Call Page Layout */
/* Enhanced Call Layout - Script Right, Data Left, Calendar Below */
.call-layout-enhanced {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 20px;
  min-height: calc(100vh - 200px);
}


/* Legacy support */
.call-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 500px;
  gap: 20px;
}

/* Primary Column - Script/Conversation (Most Important) */
.primary-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.conversation-card.primary {
  flex: 1;
  min-height: 500px;
  background: linear-gradient(135deg, rgba(14,165,233,.08), rgba(14,165,233,.04));
  border-color: rgba(14,165,233,.3);
  border-width: 2px;
  box-shadow: 0 4px 12px -2px rgba(14,165,233,.2);
}

/* Left Column - Lead Info & Supporting Elements */
.left-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 420px;
}

/* Right Column - Script/Conversation */
.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Legacy support */
.secondary-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 360px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* Lead Card Styles */
.lead-card {
  background: linear-gradient(135deg, rgba(14,165,233,.08), rgba(14,165,233,.04));
  border-color: rgba(14,165,233,.3);
}

/* Compact Lead Card for Enhanced Layout */
.lead-card.compact {
  background: linear-gradient(135deg, rgba(14,165,233,.06), rgba(14,165,233,.02));
  border-color: rgba(14,165,233,.2);
  padding: 16px;
}

.lead-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(14,165,233,.15);
}

.lead-header h3 {
  margin: 0;
  font-size: 16px;
  color: #0ea5e9;
}

.lead-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lead-actions .call-btn {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lead-actions .call-btn:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(59,130,246,.3);
}

.lead-actions .edit-btn {
  background: #6b7280;
  color: white;
  border: none;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.lead-actions .edit-btn:hover {
  background: #4b5563;
}

/* Action Icon Buttons */
.action-icon-btn {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #6b7280;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
}

.action-icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.email-btn {
  border-color: rgba(239, 68, 68, 0.3);
  color: #ef4444;
}

.email-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.sms-btn {
  border-color: rgba(59, 130, 246, 0.3);
  color: #3b82f6;
}

.sms-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Compact Lead Info */
.lead-info-compact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.lead-info-compact .lead-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lead-info-compact .lead-detail.primary {
  background: rgba(14,165,233,.05);
  padding: 8px;
  border-radius: 6px;
  border-left: 3px solid #0ea5e9;
  flex-direction: row !important;
}

.lead-info-compact .lead-detail strong {
  font-size: 11px;
  color: #0ea5e9;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lead-info-compact .lead-detail span,
.lead-info-compact .phone-display {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

/* Collapsible Sections */
.collapsed .config-content,
.collapsed .history-content {
  display: none;
}

.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

.config-toggle,
.history-toggle {
  width: 100%;
  background: rgba(14,165,233,.08);
  border: 1px solid rgba(14,165,233,.15);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: #0ea5e9;
  transition: all 0.2s;
  margin-bottom: 8px;
}

.config-toggle:hover,
.history-toggle:hover {
  background: rgba(14,165,233,.12);
  border-color: rgba(14,165,233,.25);
}

.toggle-icon {
  transition: transform 0.2s;
  font-size: 10px;
}

.config-content,
.history-content {
  padding: 0 8px 8px 8px;
}

/* Contact Card Compact - No Artificial Height Limits */
.contact-card.compact {
  background: linear-gradient(135deg, rgba(168,85,247,.06), rgba(168,85,247,.02));
  border-color: rgba(168,85,247,.2);
  padding: 16px;
  transition: all 0.3s ease;
}

.contact-card.compact #contactManagerContainer {
  /* Let it flow naturally with page scroll */
}

.contact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(59,130,246,.15);
}

.contact-header h3 {
  margin: 0;
  font-size: 16px;
  color: #3b82f6;
}

.expand-btn {
  background: transparent;
  border: 1px solid rgba(59,130,246,.3);
  color: #3b82f6;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.expand-btn:hover {
  background: rgba(168,85,247,.1);
  transform: scale(1.05);
}

.lead-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.lead-detail {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lead-detail strong {
  font-size: 12px;
  color: #7dd3fc;
  font-weight: 600;
}

.lead-detail span {
  font-size: 14px;
  color: var(--text);
}

.phone-link {
  color: #22c55e;
  text-decoration: none;
  font-weight: 500;
}

.phone-link:hover {
  text-decoration: underline;
}

.call-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Lead Status Field */
.lead-status-field {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(148,163,184,0.1);
}

.lead-status-select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148,163,184,0.3);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lead-status-select:hover {
  border-color: rgba(148,163,184,0.5);
  background: rgba(15, 23, 42, 0.8);
}

.lead-status-select:focus {
  outline: none;
  border-color: var(--brand1);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

/* Shared Notes Section */
.shared-notes-section {
  margin-top: 16px;
  padding: 16px;
  background: rgba(14,165,233,0.04);
  border: 1px solid rgba(14,165,233,0.15);
  border-radius: 8px;
}

.shared-notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.shared-notes-header strong {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.notes-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-notes-btn,
.save-notes-btn,
.cancel-notes-btn {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.edit-notes-btn {
  background: var(--brand1);
  border-color: var(--brand1);
  color: white;
}

.edit-notes-btn:hover {
  background: var(--brand2);
  border-color: var(--brand2);
}

.save-notes-btn {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.save-notes-btn:hover {
  background: #059669;
  border-color: #059669;
}

.cancel-notes-btn {
  background: transparent;
  border-color: rgba(148,163,184,0.3);
  color: var(--muted);
}

.cancel-notes-btn:hover {
  background: rgba(148,163,184,0.1);
  border-color: rgba(148,163,184,0.5);
  color: var(--text);
}

.notes-save-indicator {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.notes-save-indicator.saving {
  color: var(--brand1);
}

.notes-save-indicator.saved {
  color: #10b981;
}

.notes-save-indicator.error {
  color: var(--danger);
}

.shared-notes-warning {
  font-size: 11px;
  color: #f59e0b;
  background: rgba(245,158,11,0.1);
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  line-height: 1.4;
  border: 1px solid rgba(245,158,11,0.2);
}

.lead-notes-editor {
  min-height: 120px;
  max-height: 300px;
  overflow-y: auto;
  padding: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148,163,184,0.2);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  cursor: text;
  transition: all 0.2s ease;
}

.lead-notes-editor:focus {
  outline: none;
  border-color: var(--brand1);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
  background: rgba(15, 23, 42, 0.8);
}

.lead-notes-editor:empty:before {
  content: attr(data-placeholder);
  color: var(--muted);
  font-style: italic;
}

.lead-notes-editor ul,
.lead-notes-editor ol {
  margin-left: 20px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.lead-notes-editor li {
  margin-bottom: 4px;
}

.lead-notes-editor strong {
  font-weight: 600;
  color: #7dd3fc;
}

.lead-notes-editor em {
  font-style: italic;
  color: #f59e0b;
}

/* Wrap-Up Form Enhancements */
.optional-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  font-style: italic;
}

.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  font-style: italic;
}

/* Active Call Configuration */
.active-call-config {
  margin: 16px 0;
  padding: 12px;
  background: rgba(14,165,233,.05);
  border-radius: 8px;
}

.active-call-config h4 {
  margin: 0 0 12px 0;
  color: #7dd3fc;
  font-size: 14px;
}

/* Conversation Card */
.conversation-card {
  min-height: 500px;
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148,163,184,.2);
}

.stage-display {
  background: rgba(14,165,233,.1);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #7dd3fc;
}

.conversation-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.say-section,
.ask-section {
  background: rgba(148,163,184,.06);
  border: 1px dashed rgba(148,163,184,.25);
  padding: 16px;
  border-radius: 12px;
}

.script-text {
  margin-top: 8px;
  line-height: 1.6;
  font-size: 15px;
}

.response-section {
  background: rgba(14,165,233,.03);
  border: 1px solid rgba(14,165,233,.1);
  border-radius: 12px;
  padding: 16px;
}

.secondary-responses h4 {
  margin: 0 0 12px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.response-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.response-grid button {
  text-align: left;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  min-height: 48px;
  display: flex;
  align-items: center;
}


.guidance-section {
  background: rgba(34,197,94,.05);
  border: 1px dashed rgba(34,197,94,.2);
  border-radius: 8px;
  padding: 12px;
}

.guidance-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.hint-section {
  background: rgba(245,158,11,.05);
  border: 1px dashed rgba(245,158,11,.2);
  border-radius: 8px;
  padding: 12px;
}

.hint-text {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* Stats Card */
.stats-card {
  background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(245,158,11,.04));
  border-color: rgba(245,158,11,.3);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.stat-item {
  text-align: center;
  padding: 12px;
  background: rgba(245,158,11,.1);
  border-radius: 8px;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* Wrap Section */
.wrap-section {
  background: linear-gradient(135deg, rgba(34,197,94,.08), rgba(34,197,94,.04));
  border-color: rgba(34,197,94,.3);
  animation: slideIn 0.3s ease-out;
}

.wrap-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Session Page Layout */
.session-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.performance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.perf-item {
  text-align: center;
  padding: 16px;
  background: rgba(14,165,233,.1);
  border-radius: 12px;
}

.perf-number {
  font-size: 28px;
  font-weight: 700;
  color: #7dd3fc;
  margin-bottom: 4px;
}

.perf-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.outcome-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.outcome-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(148,163,184,.05);
  border-radius: 8px;
}

.outcome-label {
  font-size: 14px;
  color: var(--text);
}

.outcome-count {
  font-size: 16px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
}

.outcome-count.booked {
  background: rgba(34,197,94,.2);
  color: #22c55e;
}

.outcome-count.interested {
  background: rgba(59,130,246,.2);
  color: #3b82f6;
}

.outcome-count.not-interested {
  background: rgba(239,68,68,.2);
  color: #ef4444;
}

.outcome-count.callbacks {
  background: rgba(245,158,11,.2);
  color: #f59e0b;
}

.session-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Form Elements */
textarea, input, select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.25);
  background: #0b1326;
  color: #e5e7eb;
  padding: 12px;
  font-size: 14px;
  transition: all 0.2s ease;
  font-family: inherit;
}

textarea:focus, input:focus, select:focus {
  border-color: var(--brand1);
  box-shadow: 0 0 0 3px var(--ring);
  outline: none;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

select[multiple] {
  background-image: none;
  padding-right: 12px;
}

/* Button System */
button {
  background: #0b1326;
  border: 1px solid rgba(148,163,184,.25);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  font-size: 13px;
  font-family: inherit;
}

button:hover:not(:disabled) {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px var(--ring);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.primary {
  background: linear-gradient(180deg, var(--brand1), var(--brand2));
  border: none;
  color: white;
  font-weight: 700;
}

.success {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  border: none;
  color: white;
  font-weight: 700;
}

.large {
  padding: 16px 32px;
  font-size: 16px;
  font-weight: 700;
}

/* Follow-Up Tasks Button */
.follow-up-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.task-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  color: white;
  margin-left: 4px;
}

.ghost {
  background: transparent;
  border: 1px dashed rgba(148,163,184,.35);
}

.ghost-danger {
  background: transparent;
  border: 2px solid rgba(239,68,68,.5);
  color: #fca5a5;
  font-weight: 600;
  padding: 10px 20px;
  transition: all 0.2s ease;
}

.ghost-danger:hover {
  background: rgba(239,68,68,.15);
  border-color: rgba(239,68,68,.7);
  color: #ef4444;
}

.btn-positive {
  background: linear-gradient(135deg, rgba(34,197,94,.15), rgba(34,197,94,.08));
  border: 1px solid rgba(34,197,94,.4);
  color: #86efac;
}

.btn-warning {
  background: linear-gradient(135deg, rgba(245,158,11,.15), rgba(245,158,11,.08));
  border: 1px solid rgba(245,158,11,.4);
  color: #fbbf24;
}

.btn-negative {
  background: linear-gradient(135deg, rgba(239,68,68,.15), rgba(239,68,68,.08));
  border: 1px solid rgba(239,68,68,.4);
  color: #fca5a5;
}

.strongest {
  border: 2px solid var(--brand1);
  box-shadow: 0 0 0 3px var(--ring);
  background: rgba(14,165,233,.1);
}

.full-width {
  width: 100%;
}

/* Utility Classes */
.small {
  font-size: 13px;
  color: var(--muted);
}

.error {
  color: var(--danger);
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.success-message {
  color: var(--success);
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.3);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}

/* Validation and Error Classes */
.validation-error {
  color: var(--danger);
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  margin-top: 4px;
}

/* Lead History Classes */
.no-history {
  color: var(--muted);
  font-style: italic;
  padding: 12px;
  text-align: center;
  background: rgba(148,163,184,.05);
  border-radius: 8px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.history-item {
  background: rgba(148,163,184,.05);
  border: 1px solid rgba(148,163,184,.1);
  border-radius: 8px;
  padding: 12px;
}

/* Phone Call Container */
.phone-call-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.phone-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  color: #1f2937;
}

.call-btn {
  background: #10b981;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.2s;
}

.call-btn:hover {
  background: #059669;
}

.edit-btn {
  background: #6b7280;
  color: white;
  border: none;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  transition: background 0.2s;
}

.edit-btn:hover {
  background: #4b5563;
}

/* Calendar Section - Improved sizing */
.calendar-section {
  grid-column: 1 / -1;
  min-height: 700px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
}

.calendar-section h3 {
  margin: 0 0 20px 0;
  padding: 20px 20px 0 20px;
  color: #1f2937;
  font-size: 18px;
  font-weight: 600;
}

.calendar-container {
  height: calc(100% - 60px);
  padding: 0 20px 20px 20px;
}

.calendar-container iframe {
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  width: 100% !important;
  min-width: 800px !important;
  min-height: 700px !important;
  max-width: none !important;
}

/* Make calendar section full width */
.calendar-section {
  grid-column: 1 / -1;
  min-height: 800px !important;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  margin: 20px 0;
}

@media (min-width: 1024px) {
  .calendar-container iframe {
    min-width: 1000px !important;
    min-height: 750px !important;
  }

  .calendar-section {
    min-height: 850px !important;
  }
}

/* Phone Edit Modal */
.phone-edit-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.phone-edit-modal.hidden {
  display: none;
}

.phone-edit-modal .modal-content {
  background: #1f2937;
  color: white;
  padding: 24px;
  border-radius: 12px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  border: 1px solid #374151;
}

.phone-edit-modal h4 {
  color: white;
  margin: 0 0 16px 0;
  font-size: 18px;
}

.phone-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.phone-inputs label {
  font-weight: 500;
  color: #d1d5db;
  margin-bottom: 4px;
  font-size: 14px;
}

.phone-inputs input {
  padding: 12px 16px;
  border: 1px solid #4b5563;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  background: #374151;
  color: white;
  font-size: 16px;
}

.phone-inputs input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.phone-inputs input[readonly] {
  background: #4b5563;
  color: #9ca3af;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

.modal-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

.modal-actions .primary {
  background: #10b981;
  color: white;
}

.modal-actions .secondary {
  background: #e5e7eb;
  color: #374151;
}

/* Call Toolbar */
.call-toolbar {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(8, 13, 23, 0.55);
  z-index: 1001;
  min-width: 320px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  backdrop-filter: blur(12px);
  color: var(--text);
}

.call-toolbar.hidden {
  display: none;
}

.toolbar-content {
  padding: 22px;
}

.call-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

#callStatusText {
  font-weight: 600;
  color: var(--accent2);
}

#callTimer {
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
}

/* Keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.keypad-btn {
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  padding: 14px 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  color: var(--text);
}

.keypad-btn:hover {
  background: rgba(148, 163, 184, 0.22);
  border-color: var(--accent2);
}

.keypad-btn:active {
  background: var(--accent2);
  color: #0b1220;
}

.keypad-btn span {
  font-size: 10px;
  font-weight: 400;
  color: rgba(226, 232, 240, 0.7);
  margin-top: 4px;
}

/* Call Actions */
.call-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.control-btn {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.18);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s ease;
}

.control-btn:hover {
  border-color: var(--accent2);
}

.mute-btn {
  background: rgba(245, 158, 11, 0.28);
  color: #fde68a;
}

.mute-btn:hover {
  background: rgba(245, 158, 11, 0.4);
}

.hold-btn {
  background: rgba(148, 163, 184, 0.28);
  color: var(--text);
}

.hold-btn:hover {
  background: rgba(148, 163, 184, 0.4);
}

.end-call-btn {
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
}

.end-call-btn:hover {
  background: rgba(220, 38, 38, 0.85);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.history-outcome {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.history-notes {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.history-path {
  font-size: 11px;
  color: var(--muted);
  font-family: monospace;
}

/* Outcome-specific styling */
.outcome-booked, .history-outcome.outcome-booked {
  background: rgba(34,197,94,.2);
  color: #22c55e;
}

.outcome-interested, .history-outcome.outcome-interested {
  background: rgba(59,130,246,.2);
  color: #3b82f6;
}

.outcome-not_interested, .history-outcome.outcome-not_interested {
  background: rgba(239,68,68,.2);
  color: #ef4444;
}

.outcome-callbacks, .history-outcome.outcome-callbacks {
  background: rgba(245,158,11,.2);
  color: #f59e0b;
}

.outcome-qualified, .history-outcome.outcome-qualified {
  background: rgba(34,197,94,.15);
  color: #16a34a;
}

.outcome-unqualified, .history-outcome.outcome-unqualified {
  background: rgba(107,114,128,.2);
  color: #6b7280;
}

.outcome-no_answer, .history-outcome.outcome-no_answer {
  background: rgba(156,163,175,.2);
  color: #9ca3af;
}

.outcome-wrong_number, .history-outcome.outcome-wrong_number {
  background: rgba(239,68,68,.15);
  color: #dc2626;
}

/* Analytics Dashboard Classes */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.metric-card {
  background: linear-gradient(135deg, rgba(14,165,233,.08), rgba(14,165,233,.04));
  border: 1px solid rgba(14,165,233,.2);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: #7dd3fc;
  margin-bottom: 8px;
}

.metric-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trends-section {
  margin: 24px 0;
  padding: 20px;
  background: rgba(148,163,184,.03);
  border: 1px solid rgba(148,163,184,.1);
  border-radius: 12px;
}

.trends-section h4 {
  margin: 0 0 16px 0;
  color: #7dd3fc;
  font-size: 16px;
  font-weight: 600;
}

.trend-chart, .chart-container {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 4px;
  height: 120px;
  padding: 16px;
  background: rgba(14,165,233,.03);
  border-radius: 8px;
}

.chart-bar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  background: linear-gradient(180deg, var(--brand1), var(--brand2));
  border-radius: 4px 4px 0 0;
  min-width: 24px;
  position: relative;
  transition: all 0.3s ease;
}

.chart-bar:hover {
  background: linear-gradient(180deg, #38bdf8, var(--brand1));
  transform: translateY(-2px);
}

.bar-value {
  position: absolute;
  top: -20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.bar-label {
  position: absolute;
  bottom: -24px;
  font-size: 10px;
  color: var(--muted);
  transform: rotate(-45deg);
  transform-origin: center;
  white-space: nowrap;
}

.insights-section {
  margin: 24px 0;
  padding: 20px;
  background: linear-gradient(135deg, rgba(34,197,94,.05), rgba(34,197,94,.02));
  border: 1px solid rgba(34,197,94,.2);
  border-radius: 12px;
}

.insights-section h4 {
  margin: 0 0 16px 0;
  color: #22c55e;
  font-size: 16px;
  font-weight: 600;
}

.insights-content {
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
}

.no-data {
  color: var(--muted);
  font-style: italic;
  text-align: center;
  padding: 24px;
  background: rgba(148,163,184,.05);
  border-radius: 8px;
  border: 1px dashed rgba(148,163,184,.2);
}

/* Input error state */
input.error, select.error, textarea.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,.1);
}

/* Login Page */
#login {
  max-width: 400px;
  margin: 0 auto;
  margin-top: 40px;
}

/* Loading Overlay System */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.5);
  max-width: 320px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top: 3px solid #38bdf8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: #e5e7eb;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.loading-subtext {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.4;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Progress bar for longer operations */
.loading-progress {
  width: 200px;
  height: 4px;
  background: rgba(56, 189, 248, 0.2);
  border-radius: 2px;
  margin: 16px auto 0;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #0ea5e9);
  border-radius: 2px;
  animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
  0% { width: 0%; margin-left: 0%; }
  50% { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}

/* Inline loading states */
.btn-loading {
  position: relative;
  color: transparent !important;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Page transition loading */
.page-loading {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Form loading overlay */
.form-loading {
  position: relative;
}

.form-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 12px;
  z-index: 10;
}

.form-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-top: 2px solid #38bdf8;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 11;
}

/* Animations */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Focus improvements for accessibility */
.nav-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

/* Responsive Design */
@media(max-width: 1200px) {
  .setup-layout {
    grid-template-columns: 1fr 1fr;
  }
  
  .call-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .call-layout-enhanced {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .left-column {
    width: 100%;
    max-height: none;
    order: -1; /* Show lead info first on mobile */
  }

  .right-column {
    order: 1;
  }

  /* Legacy support */
  .secondary-column {
    width: 100%;
    max-height: none;
    order: -1;
  }

  .primary-column {
    order: 1;
  }
  
  .session-layout {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@media(max-width: 768px) {
  .wrap {
    padding: 16px;
  }
  
  .setup-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .session-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .geo-simple {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .performance-grid {
    grid-template-columns: 1fr;
  }
  
  .response-grid {
    grid-template-columns: 1fr;
  }
  
  .workflow-nav {
    flex-direction: column;
    gap: 8px;
  }
  
  .nav-btn {
    min-width: auto;
    justify-content: center;
  }
  
  .analytics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  
  .chart-container {
    height: 100px;
    padding: 12px;
  }
  
  .bar-label {
    font-size: 9px;
  }
  
  .metric-value {
    font-size: 24px;
  }
  
  .quick-filter-btn {
    font-size: 10px;
    padding: 3px 6px;
  }
  
  .selected-count {
    font-size: 10px;
  }

  .loading-content {
    max-width: 280px;
    padding: 24px;
  }
  
  .loading-text {
    font-size: 14px;
  }
  
  .loading-subtext {
    font-size: 12px;
  }
}

/* Print styles */
@media print {
  .workflow-nav,
  .call-controls,
  button,
  .loading-overlay {
    display: none !important;
  }
  
  .page {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    border: 1px solid #ccc;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --bg1: #000000;
    --bg2: #000000;
    --card: #111111;
    --text: #ffffff;
    --muted: #cccccc;
  }
  
  .card {
    border: 2px solid #ffffff;
  }
  
  button {
    border: 2px solid #ffffff;
  }
  
  .loading-overlay {
    background: rgba(0, 0, 0, 0.95);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .loading-spinner,
  .loading-progress-bar,
  .btn-loading::after {
    animation: none !important;
  }
}

/* AI Conversation Suggestions */
.ai-alternatives {
  margin: 16px 0;
  padding: 12px;
  background: linear-gradient(135deg, var(--ai-suggestion) 0%, rgba(30, 58, 138, 0.3) 100%);
  border-radius: 8px;
  border-left: 3px solid var(--ai-text);
}

.ai-suggestion {
  color: var(--text);
}

.ai-suggestion strong {
  color: var(--ai-text);
  font-size: 14px;
}

.ai-suggestion p {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.4;
}

.ai-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-ai-email, .btn-ai-text {
  padding: 6px 12px;
  border: 1px solid var(--ai-text);
  background: rgba(125, 211, 252, 0.1);
  color: var(--ai-text);
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-ai-email:hover, .btn-ai-text:hover {
  background: var(--ai-text);
  color: var(--bg1);
  transform: translateY(-1px);
}

.stored-preference {
  margin: 12px 0;
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 6px;
  border-left: 3px solid var(--success);
}

.preference-note {
  font-size: 12px;
  color: var(--success);
}

.preference-note strong {
  color: var(--text);
}


/* Admin Dashboard Styles */
.admin-only {
  display: none !important;
}

.user-role-admin .admin-only {
  display: block !important;
}

/* Analytics Filter Buttons */
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--card);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.analytics-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.analytics-controls {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid rgba(148,163,184,0.3);
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.filter-btn:hover {
  background: rgba(148,163,184,0.1);
  border-color: rgba(148,163,184,0.5);
  color: var(--text);
}

.filter-btn.active {
  background: var(--brand1);
  border-color: var(--brand1);
  color: white;
}

.admin-analytics {
  padding: 20px;
  background: transparent;
  min-height: 100vh;
}

/* Admin Layout Container */
.admin-layout {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.admin-dashboard {
  max-width: 1200px;
  margin: 0 auto;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(148,163,184,.2);
}

.admin-nav {
  display: flex;
  gap: 8px;
}

.admin-nav-btn {
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid rgba(148,163,184,.3);
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.admin-nav-btn:hover {
  background: rgba(148,163,184,.1);
  color: var(--text);
}

.admin-nav-btn.active {
  background: var(--brand1);
  color: white;
  border-color: var(--brand2);
}

/* Overview Dashboard */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--card);
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(148,163,184,.2);
}

.stat-icon {
  font-size: 32px;
  opacity: 0.8;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.chart-container {
  background: var(--card);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid rgba(148,163,184,.2);
}

.chart-container h3 {
  margin: 0 0 16px 0;
  color: var(--text);
  font-size: 16px;
}

.chart-placeholder {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border: 2px dashed rgba(148,163,184,.3);
  border-radius: 6px;
}

/* Performance List */
.performance-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.performer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(148,163,184,.05);
  border-radius: 6px;
}

.performer-rank {
  width: 24px;
  height: 24px;
  background: var(--brand1);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.performer-info {
  flex: 1;
}

.performer-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.performer-stats {
  font-size: 12px;
  color: var(--muted);
}

.performer-rate {
  font-weight: 700;
  color: var(--success);
  font-size: 14px;
}

/* User Management */
.user-management {
  background: var(--card);
  border-radius: 8px;
  padding: 24px;
  border: 1px solid rgba(148,163,184,.2);
}

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.user-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.user-filters select,
.user-filters input {
  padding: 8px 12px;
  background: var(--bg2);
  border: 1px solid rgba(148,163,184,.3);
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
}

.user-table {
  overflow-x: auto;
}

.user-table table {
  width: 100%;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(148,163,184,.2);
}

.user-table th {
  background: rgba(148,163,184,.05);
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-table td {
  color: var(--text);
  font-size: 14px;
}

.role-select {
  padding: 4px 8px;
  background: var(--bg2);
  border: 1px solid rgba(148,163,184,.3);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
}

.btn-small {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Recent Activity */
.recent-activity {
  background: var(--card);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid rgba(148,163,184,.2);
}

.recent-activity h3 {
  margin: 0 0 16px 0;
  color: var(--text);
  font-size: 16px;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148,163,184,.1);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-time {
  font-size: 11px;
  color: var(--muted);
  min-width: 60px;
}

.activity-description {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}

.activity-user {
  font-size: 12px;
  color: var(--muted);
  min-width: 80px;
  text-align: right;
}

.no-data {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 20px;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 16px;
  border-radius: 6px;
  text-align: center;
}


/* Contact Search & Management Styles */
.lead-search-section {
  margin: 16px 0;
  border-top: 1px solid rgba(148,163,184,.2);
  padding-top: 16px;
}

.search-toggle {
  margin-bottom: 12px;
}

.contact-search-container {
  background: rgba(148,163,184,.05);
  border-radius: 6px;
  padding: 16px;
  border: 1px solid rgba(148,163,184,.2);
}

.contact-search {
  width: 100%;
}

.search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.search-header h4 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.search-input-group {
  position: relative;
  margin-bottom: 12px;
}

.search-input-group input {
  width: 100%;
  padding: 8px 30px 8px 8px;
  border: 1px solid rgba(148,163,184,.3);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--text);
  font-size: 14px;
}

.search-input-group input:focus {
  outline: none;
  border-color: var(--brand1);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.btn-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  border-radius: 2px;
}

.btn-clear:hover {
  color: var(--text);
  background: rgba(148,163,184,.1);
}

.search-results {
  max-height: 300px;
  overflow-y: auto;
}

.search-loading,
.search-hint,
.search-error,
.no-results {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 13px;
}

.search-error {
  color: var(--danger);
}

.search-info {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  padding: 4px 8px;
}

.contact-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: var(--card);
  border: 1px solid rgba(148,163,184,.2);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.contact-item:hover {
  background: rgba(148,163,184,.05);
  border-color: var(--brand1);
}

.contact-main {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 14px;
}

.contact-details {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contact-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-small {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-small.btn-primary {
  background: var(--brand1);
  color: white;
  border-color: var(--brand2);
}

.btn-small.btn-primary:hover {
  background: var(--brand2);
}

.btn-small.btn-secondary {
  background: transparent;
  color: var(--muted);
  border-color: rgba(148,163,184,.3);
}

.btn-small.btn-secondary:hover {
  background: rgba(148,163,184,.1);
  color: var(--text);
}

.btn-small.btn-success {
  background: var(--success);
  color: white;
  border-color: #16a34a;
}

.btn-small.btn-success:hover {
  background: #16a34a;
}

.small {
  font-size: 12px !important;
}

/* Contact Form Modal */
.contact-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.contact-modal.hidden {
  display: none;
}

.modal-content {
  background: var(--card);
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,.2);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148,163,184,.2);
}

.modal-header h4 {
  margin: 0;
  color: var(--text);
}

.btn-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 18px;
}

.btn-close:hover {
  background: rgba(148,163,184,.1);
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.contact-form {
  width: 100%;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px;
  border: 1px solid rgba(148,163,184,.3);
  border-radius: 4px;
  background: var(--bg2);
  color: var(--text);
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand1);
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(148,163,184,.2);
}

.no-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

/* Activity Timeline Styles */
.lead-timeline-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.timeline-toggle {
  margin-bottom: 12px;
}

.timeline-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.timeline-header h4 {
  margin: 0;
  font-size: 16px;
  color: var(--ai-text);
}

.timeline-count {
  font-size: 12px;
  color: var(--muted);
  background: rgba(148, 163, 184, 0.1);
  padding: 4px 8px;
  border-radius: 12px;
}

.timeline-content {
  position: relative;
}

.timeline-date-group {
  margin-bottom: 24px;
}

.timeline-date-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
}

.timeline-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--ai-text);
  background: rgba(14, 165, 233, 0.1);
  padding: 4px 12px;
  border-radius: 16px;
  white-space: nowrap;
}

.timeline-date-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(148, 163, 184, 0.2), transparent);
}

.timeline-activities {
  position: relative;
  padding-left: 24px;
}

.timeline-activities::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--brand1), rgba(14, 165, 233, 0.3));
}

.timeline-activity {
  position: relative;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
}

.timeline-activity:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

.timeline-activity-marker {
  position: absolute;
  left: -30px;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 2px solid var(--card);
  z-index: 1;
}

.timeline-activity-content {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.timeline-activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.timeline-activity-type {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

.timeline-activity-time {
  font-size: 12px;
  color: var(--muted);
}

.timeline-activity-description {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.timeline-activity-notes {
  font-size: 13px;
  color: var(--text);
  background: rgba(148, 163, 184, 0.05);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid var(--brand1);
  margin-top: 8px;
}

.timeline-activity-metadata {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.timeline-metadata {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}

.timeline-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.timeline-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.timeline-empty-text {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.timeline-empty-subtext {
  font-size: 14px;
  color: var(--muted);
}

.timeline-error {
  text-align: center;
  padding: 32px 20px;
  color: var(--muted);
}

.timeline-error-icon {
  font-size: 32px;
  margin-bottom: 12px;
  color: var(--warning);
}

.timeline-error-text {
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--text);
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .contact-item {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .contact-actions {
    justify-content: center;
  }

  .timeline-container {
    max-height: 300px;
    padding: 12px;
  }

  .timeline-activities {
    padding-left: 20px;
  }

  .timeline-activity-marker {
    left: -26px;
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .timeline-activity-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .timeline-activity-content {
    padding: 10px 12px;
  }
}

/* Communication Actions Styles */
.communication-actions {
  background: rgba(14, 165, 233, 0.05);
  border-radius: 8px;
}

.communication-actions h4 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.comm-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.comm-buttons .btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  padding: 8px 12px;
  transition: all 0.2s ease;
}

.comm-buttons .btn-secondary:hover {
  background: var(--brand1);
  color: white;
  transform: translateY(-1px);
}





/* Communication Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--ai-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
}

.modal-body {
  padding: 20px 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.field-group {
  margin-bottom: 16px;
}

.field-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s ease;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--brand1);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.field-group textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
  line-height: 1.5;
}

.field-group .small {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.4;
}

.field-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  transform: scale(1.1);
}

.field-group label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 400;
}

/* SMS Character Counter */
#smsCharCount {
  font-weight: 600;
  font-size: 11px;
}

/* Animation Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Mobile Responsive Communication */
@media (max-width: 768px) {
  .comm-buttons {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .modal-content {
    margin: 16px;
    max-height: calc(100vh - 32px);
    width: calc(100% - 32px);
  }

  .modal-header,
  .modal-body {
    padding: 16px 20px;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .modal-actions button {
    width: 100%;
  }
}

/* Booking Calendar Styles */
.booking-card {
  margin-top: 16px;
}

.booking-container {
  border-radius: 8px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.booking-placeholder {
  padding: 24px;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.7);
}

.booking-placeholder code {
  display: inline-block;
  background: rgba(148, 163, 184, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: inherit;
}

.booking-container iframe {
  display: block;
  background: white;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .booking-container iframe {
    min-height: 600px;
  }
}

/* Enhanced Layout Components */

/* Mini Stats Card (Least Important) */
.stats-card.mini {
  background: linear-gradient(135deg, rgba(99,102,241,.04), rgba(99,102,241,.02));
  border-color: rgba(99,102,241,.15);
  padding: 12px;
  min-height: auto;
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stats-header h4 {
  margin: 0;
  font-size: 14px;
  color: #6366f1;
  font-weight: 500;
}

.stats-toggle {
  background: transparent;
  border: 1px solid rgba(99,102,241,.3);
  color: #6366f1;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}

.stats-toggle:hover {
  background: rgba(99,102,241,.1);
  transform: scale(1.05);
}

.stats-summary {
  display: flex;
  gap: 12px;
  align-items: center;
}

.stat-mini {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  padding: 4px 8px;
  background: rgba(99,102,241,.05);
  border-radius: 4px;
}

.stat-mini span {
  font-weight: 600;
  color: #6366f1;
}

.stats-details {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(99,102,241,.15);
}

.stats-card.mini.expanded .stats-details {
  display: block;
}

.stats-card.mini.expanded .stats-summary {
  display: none;
}

/* Booking Card - Now in Right Column Below Script */
.booking-card {
  background: linear-gradient(135deg, rgba(14,165,233,.06), rgba(14,165,233,.04));
  border-color: rgba(14,165,233,.3);
  margin-top: 16px;
  min-width: 970px; /* Ensure minimum width for calendar */
  width: 100%;
}

.booking-card.hidden {
  display: none;
}

.booking-container {
  min-height: 700px;
  min-width: 970px;
  width: 100%;
  overflow-x: auto; /* Allow horizontal scroll if needed */
}

.booking-container iframe {
  min-width: 970px !important;
  width: 100% !important;
  min-height: 700px !important;
}

/* When screen is narrower than 970px, allow horizontal scroll */
@media (max-width: 969px) {
  .booking-card {
    min-width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
  }

  .booking-container {
    min-width: 970px;
    overflow-x: auto;
  }
}

/* Enhanced Booking Card */
.booking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(34,197,94,.2);
}

.booking-header h3 {
  margin: 0;
  color: #3b82f6;
  font-size: 18px;
}

.minimize-btn {
  background: transparent;
  border: 1px solid rgba(59,130,246,.3);
  color: #3b82f6;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.2s;
}

.minimize-btn:hover {
  background: rgba(59,130,246,.1);
  transform: scale(1.05);
}

/* Minimized Booking State */
.booking-card.minimized {
  min-height: auto;
}

.booking-card.minimized .booking-container {
  height: 60px;
  overflow: hidden;
  background: rgba(34,197,94,.05);
  border: 2px dashed rgba(34,197,94,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #22c55e;
  font-size: 14px;
  font-weight: 500;
}

/* Enhanced Call Wrap-Up Modal */
/* Call Wrap-Up Card (inline section, not modal) */
.wrap-up-card {
  background: linear-gradient(135deg, rgba(34,197,94,.12), rgba(34,197,94,.06));
  border: 2px solid rgba(34,197,94,.4);
  box-shadow: 0 4px 12px -2px rgba(34,197,94,.3);
  animation: wrapUpSlideIn 0.3s ease-out;
}

@keyframes wrapUpSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wrap-up-card .wrap-up-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(34,197,94,.2);
}

.wrap-up-card .wrap-up-header h3 {
  margin: 0 0 6px 0;
  color: #22c55e;
  font-size: 18px;
  font-weight: 600;
}

.wrap-up-card .wrap-up-progress {
  color: #86efac;
  font-size: 13px;
  font-style: italic;
}

.wrap-up-card .wrap-form {
  color: white;
}

.wrap-up-card .field-group label {
  color: #e5e7eb;
  font-weight: 500;
  margin-bottom: 6px;
  display: block;
  font-size: 13px;
}

.wrap-up-card select,
.wrap-up-card textarea {
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(34,197,94,.3);
  color: white;
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  font-size: 14px;
}

.wrap-up-card select:focus,
.wrap-up-card textarea:focus {
  outline: none;
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

.wrap-up-card select option {
  background: #1f2937;
  color: white;
  padding: 8px;
}

.wrap-up-card textarea::placeholder {
  color: #9ca3af;
}

.wrap-up-card #successMsg {
  color: #86efac;
  margin-top: 8px;
  font-size: 13px;
}

/* Admin Analytics Styles */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-metric-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.admin-metric-number {
  font-size: 28px;
  font-weight: 700;
  color: #7dd3fc;
  margin-bottom: 8px;
}

.admin-metric-label {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-leaderboard {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
}

.admin-leaderboard h4 {
  margin: 0 0 16px 0;
  color: #7dd3fc;
  font-size: 16px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.leaderboard-item:last-child {
  border-bottom: none;
}

.leaderboard-rank {
  font-size: 18px;
  font-weight: 700;
  margin-right: 12px;
  min-width: 30px;
}

.rank-1 { color: #ffd700; }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

.leaderboard-user {
  flex: 1;
  font-weight: 500;
}

.leaderboard-stats {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.admin-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-chart-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  padding: 20px;
}

.admin-chart-card h4 {
  margin: 0 0 16px 0;
  color: #7dd3fc;
  font-size: 16px;
}

.chart-canvas {
  width: 100%;
  height: 200px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.admin-activity-feed {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}

.admin-activity-feed h4 {
  margin: 0 0 16px 0;
  color: #7dd3fc;
  font-size: 16px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.05);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 24px;
  height: 24px;
  background: #7dd3fc;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #0f172a;
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-text {
  font-size: 14px;
  margin-bottom: 4px;
}

.activity-time {
  font-size: 12px;
  color: var(--muted);
}

.admin-timeframe-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  justify-content: center;
}

.timeframe-btn {
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.timeframe-btn:hover {
  border-color: #7dd3fc;
  color: #7dd3fc;
}

.timeframe-btn.active {
  background: #7dd3fc;
  color: #0f172a;
  border-color: #7dd3fc;
}

/* Searchable Category Filters */
.category-search-container {
  position: relative;
}

#categorySearch {
  width: 100%;
  padding: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s;
}

#categorySearch:focus {
  outline: none;
  border-color: var(--brand1);
  box-shadow: 0 0 0 3px var(--ring);
}

.category-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.category-results.show {
  display: block;
}

.category-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  width: 100%;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  font-size: 14px;
  color: var(--text);
  border-radius: 8px;
  box-sizing: border-box;
}

.category-result-item:hover {
  background: rgba(14, 165, 233, 0.12);
}

.category-result-item.selected {
  background: rgba(34, 197, 94, 0.18);
  color: var(--success);
}

.category-result-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--brand1);
}

.category-result-item span {
  flex: 1;
  line-height: 1.35;
  word-break: break-word;
}

.category-result-item.empty {
  cursor: default;
  color: var(--muted);
}






.selected-categories {
  margin-top: 12px;
}

.selected-categories-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selected-categories-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.selected-categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.4);
  max-height: 72px;
  overflow-y: auto;
}

.selected-categories-list.expanded {
  max-height: 220px;
}

.link-button {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.link-button:hover {
  text-decoration: underline;
}

.selected-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 16px;
  font-size: 12px;
  color: var(--success);
}

.selected-category-tag .remove-tag {
  cursor: pointer;
  font-weight: bold;
  color: var(--danger);
  font-size: 14px;
  line-height: 1;
}

.selected-category-tag .remove-tag:hover {
  color: #ef4444;
}

@media (max-width: 1024px) {
  .admin-charts-grid {
    grid-template-columns: 1fr;
  }

  .admin-metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}
.setup-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup-side {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lead-targeting {
  height: 100%;
}

.lead-estimates {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 1200px) {
  .setup-layout {
    grid-template-columns: 1fr;
  }

  .setup-side {
    flex-direction: column;
  }
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-card h3 {
  margin: 0 0 8px 0;
}

.contact-card .contact-search {
  flex: 1;
}

.contact-card .search-results {
  background: rgba(15, 23, 42, 0.35);
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.15);
}


