/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  /* Color Palette */
  --bg-main: #f8fafc;
  --bg-sidebar: #0f172a;
  --bg-sidebar-hover: #1e293b;
  --bg-sidebar-active: #2563eb;
  
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --text-white: #ffffff;
  
  /* Brand/Accent Colors */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #dbeafe;
  
  /* Status Colors */
  --color-ready: #64748b;
  --color-generating: #d97706;
  --color-video-ready: #16a34a;
  --color-sent: #0284c7;
  --color-replied: #7c3aed;
  --color-interested: #db2777;
  --color-meeting: #059669;

  /* Fonts */
  --font-family-title: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Layout and Shadows */
  --sidebar-width: 280px;
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-premium: 0 20px 25px -5px rgba(15, 23, 42, 0.05), 0 10px 10px -5px rgba(15, 23, 42, 0.02);

  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   RESET & GLOBAL STYLES
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-title);
  color: var(--bg-sidebar);
  font-weight: 600;
}

/* App Layout Grid */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100vw;
}

/* ==========================================================================
   SIDEBAR COMPONENT
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  color: var(--text-white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 10;
}

.brand {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.logo-icon {
  color: var(--text-white);
  width: 22px;
  height: 22px;
}

.brand-name h2 {
  color: var(--text-white);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.brand-name h2 span {
  color: #60a5fa;
}

.badge-beta {
  font-size: 10px;
  padding: 1px 6px;
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border-radius: 4px;
  margin-top: 2px;
  display: inline-block;
}

.nav-menu {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-light);
  text-decoration: none;
  border-radius: var(--border-radius-md);
  font-weight: 500;
  font-size: 14px;
  transition: var(--transition-smooth);
}

.nav-item i {
  width: 18px;
  height: 18px;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  background-color: var(--bg-sidebar-hover);
  color: var(--text-white);
}

.nav-item.active {
  background-color: var(--bg-sidebar-active);
  color: var(--text-white);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-item.active i {
  transform: scale(1.05);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.03);
  border-radius: var(--border-radius-md);
}

.avatar-placeholder {
  width: 36px;
  height: 36px;
  background-color: var(--bg-sidebar-active);
  color: var(--text-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.user-details {
  display: flex;
  flex-direction: column;
}

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

.user-role {
  font-size: 11px;
  color: var(--text-light);
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: hidden;
}

.top-header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.header-titles h1 {
  font-size: 26px;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.content-body {
  padding: 32px;
  overflow-y: auto;
  flex-grow: 1;
}

/* Tab Views Management */
.tab-view {
  display: none;
  animation: fadeIn 0.4s ease;
}

.tab-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   CARDS & STATS COMPONENT
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon-wrapper i {
  width: 22px;
  height: 22px;
}

.stat-icon-wrapper.blue { background-color: #eff6ff; color: #3b82f6; }
.stat-icon-wrapper.green { background-color: #f0fdf4; color: #22c55e; }
.stat-icon-wrapper.purple { background-color: #faf5ff; color: #a855f7; }
.stat-icon-wrapper.orange { background-color: #fff7ed; color: #f97316; }

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

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  margin-top: 2px;
}

.stat-trending {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 2px;
}

.stat-trending.up {
  color: #22c55e;
}

.stat-trending i {
  width: 12px;
  height: 12px;
}

/* ==========================================================================
   CARDS CONTAINER GENERAL
   ========================================================================== */
.card-box {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.section-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title h2 {
  font-size: 20px;
}

.search-box {
  position: relative;
  width: 240px;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  width: 16px;
  height: 16px;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ==========================================================================
   PROSPECT TABLE COMPONENT
   ========================================================================== */
.table-container {
  overflow-x: auto;
}

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

.data-table th {
  background-color: #f8fafc;
  padding: 16px 24px;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 14px;
}

.data-table tbody tr {
  transition: var(--transition-smooth);
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

.prospect-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prospect-avatar {
  width: 38px;
  height: 38px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

.prospect-info {
  display: flex;
  flex-direction: column;
}

.prospect-name-link {
  font-weight: 600;
  color: var(--bg-sidebar);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.prospect-name-link:hover {
  color: var(--primary);
}

.prospect-company-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Textarea input inside Table Cell */
.table-textarea-wrapper {
  position: relative;
}

.table-editable-textarea {
  width: 220px;
  min-height: 50px;
  border: 1px solid transparent;
  border-radius: var(--border-radius-sm);
  background-color: transparent;
  padding: 6px;
  font-size: 13px;
  color: var(--text-main);
  resize: vertical;
  font-family: inherit;
  transition: var(--transition-smooth);
  line-height: 1.4;
}

.table-editable-textarea:hover {
  background-color: #f1f5f9;
  border-color: var(--border-color);
}

.table-editable-textarea:focus {
  background-color: #ffffff;
  border-color: var(--primary);
  outline: none;
  box-shadow: var(--shadow-sm);
}

/* Insight Cell truncation */
.insight-cell-text {
  max-width: 240px;
  font-size: 13px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* Actions Cell buttons alignment */
.actions-cell-flex {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Video Column Dynamic Previews */
.video-preview-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-mini-thumb {
  width: 70px;
  height: 42px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-mini-thumb::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(15, 23, 42, 0.6));
  border-radius: 5px;
  z-index: 1;
}

.video-mini-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
  border-color: rgba(37, 99, 235, 0.6);
}

.premium-play-btn-circle {
  width: 24px;
  height: 24px;
  z-index: 2;
  background: #ffffff; /* Large white circular play button in the centre */
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Green corner dot indicator */
.video-mini-thumb::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  background-color: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
  z-index: 3;
  box-shadow: 0 0 4px #22c55e;
}

/* Tooltip on hover */
.video-preview-cell {
  position: relative;
}

.video-preview-cell:hover::after {
  content: 'Preview Video ↗';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background-color: #0f172a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  z-index: 10;
  border: 1px solid rgba(255,255,255,0.1);
}

.video-preview-cell:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  border: 4px solid transparent;
  border-top-color: #0f172a;
  pointer-events: none;
  z-index: 10;
}

/* ==========================================================================
   BADGES & STATUS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-neutral { background-color: #f1f5f9; color: var(--text-muted); }

/* Custom Status Badge Colors */
.badge-ready { background-color: #e2e8f0; color: var(--color-ready); }
.badge-generating { background-color: #fef3c7; color: var(--color-generating); }
.badge-video-ready { background-color: #dcfce7; color: var(--color-video-ready); }
.badge-sent { background-color: #e0f2fe; color: var(--color-sent); }
.badge-replied { background-color: #f3e8ff; color: var(--color-replied); }
.badge-interested { background-color: #fce7f3; color: var(--color-interested); }
.badge-meeting { background-color: #d1fae5; color: var(--color-meeting); }

/* Loader element */
.inline-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-generating);
  font-weight: 500;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(217, 119, 6, 0.2);
  border-top-color: var(--color-generating);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   BUTTONS COMPONENT
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--border-radius-md);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--text-white);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
}

.btn-outline {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

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

.btn-success {
  background-color: var(--color-video-ready);
  color: var(--text-white);
}

.btn-success:hover {
  background-color: #15803d;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 11px;
  border-radius: var(--border-radius-sm);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==========================================================================
   CAMPAIGN SETTINGS VIEW
   ========================================================================== */
.settings-card {
  max-width: 800px;
  margin: 0 auto;
}

.card-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 16px;
}

.card-header .header-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.settings-form-grid {
  padding: 32px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.col-span-2 {
  grid-column: span 2;
}

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

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--bg-sidebar);
}

.form-group input, 
.form-group select, 
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  background-color: #ffffff;
  transition: var(--transition-smooth);
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-actions {
  margin-top: 8px;
}

/* ==========================================================================
   INTEGRATIONS VIEW
   ========================================================================== */
.integrations-intro {
  margin-bottom: 28px;
}

.integrations-intro h2 {
  font-size: 22px;
  margin-bottom: 6px;
}

.integrations-intro p {
  color: var(--text-muted);
  font-size: 14px;
}

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

.integration-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.integration-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-status {
  position: absolute;
  top: 24px;
  right: 24px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-disconnected {
  color: var(--text-muted);
}
.status-disconnected .dot {
  background-color: var(--text-light);
}

.status-manual {
  color: var(--color-video-ready);
}
.status-manual .dot {
  background-color: var(--color-video-ready);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.5; }
  100% { transform: scale(0.9); opacity: 1; }
}

.integration-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.brand-logo-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
}

.brand-logo-circle i {
  width: 20px;
  height: 20px;
}

.sheet-color { background-color: #107c41; }
.make-color { background-color: #ea4335; }
.openai-color { background-color: #10a37f; }
.heygen-color { background-color: #6432ec; }
.linkedin-color { background-color: #0077b5; }

.integration-card h3 {
  font-size: 16px;
  font-weight: 600;
}

.integration-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  flex-grow: 1;
}

.integration-card.active-mode {
  border-color: var(--primary-light);
  background: linear-gradient(to bottom, #ffffff, #f0f7ff);
}

/* ==========================================================================
   MODAL COMPONENT
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-container {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  width: 90%;
  max-width: 920px;
  max-height: 90vh;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

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

.user-header-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-avatar {
  width: 48px;
  height: 48px;
  background-color: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.user-header-info h3 {
  font-size: 18px;
  margin-bottom: 2px;
}

.user-header-info p {
  font-size: 13px;
  color: var(--text-muted);
}

.close-btn {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-smooth);
}

.close-btn:hover {
  color: var(--bg-sidebar);
}

.modal-body-layout {
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  overflow-y: auto;
  max-height: calc(90vh - 160px);
}

.modal-pane-left, 
.modal-pane-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-section-card {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 16px;
}

.modal-section-card h4 {
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--bg-sidebar);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-section-card h4 i {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.modal-section-card p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-main);
}

.modal-section-card textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  background-color: #ffffff;
  outline: none;
  line-height: 1.4;
}

.modal-section-card textarea:focus {
  border-color: var(--primary);
}

.bg-highlight {
  background-color: var(--primary-light);
  border-color: rgba(37,99,235,0.15);
}

.section-title-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-title-flex h4 {
  margin-bottom: 0;
}

.link-section {
  display: flex;
  padding: 0;
  border: none;
  background: none;
}

.linkedin-profile-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background-color: #0077b5;
  color: var(--text-white);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--border-radius-md);
  width: 100%;
  transition: var(--transition-smooth);
}

.linkedin-profile-link:hover {
  background-color: #005a8a;
}

.linkedin-profile-link .small-icon {
  margin-left: auto;
  width: 14px;
  height: 14px;
}

/* Video Preview Block inside Modal */
.video-preview-placeholder {
  height: 160px;
  background-color: #0f172a;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-white);
  overflow: hidden;
  position: relative;
}

.video-placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.video-placeholder-content .play-icon {
  width: 44px;
  height: 44px;
  color: var(--text-light);
  opacity: 0.5;
}

.video-placeholder-content span {
  font-size: 13px;
  color: var(--text-light);
}

.video-preview-placeholder.ready-state {
  cursor: pointer;
}

.video-preview-placeholder.ready-state .play-icon {
  color: var(--primary);
  opacity: 1;
  transform: scale(1);
  transition: var(--transition-smooth);
}

.video-preview-placeholder.ready-state:hover .play-icon {
  transform: scale(1.1);
}

.video-preview-placeholder.generating-state {
  background-color: #1e293b;
}

.modal-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.modal-footer-actions {
  display: flex;
  gap: 12px;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: #0f172a;
  color: var(--text-white);
  padding: 12px 20px;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  display: flex;
  align-items: center;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.toast.active {
  transform: translateY(0);
  opacity: 1;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-icon {
  color: #22c55e;
  width: 18px;
  height: 18px;
}

.toast-message {
  font-size: 13px;
  font-weight: 500;
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 1024px) {
  .modal-body-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  
  .nav-menu {
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
    gap: 8px;
  }
  
  .nav-item {
    padding: 8px 12px;
    white-space: nowrap;
  }
  
  .sidebar-footer {
    display: none;
  }
  
  .main-content {
    height: auto;
    overflow-y: visible;
  }
  
  .top-header {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  .content-body {
    padding: 20px;
  }
  
  .settings-form-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  
  .col-span-2 {
    grid-column: span 1;
  }

  /* Wrap action buttons cleanly on narrow viewports */
  .actions-cell-flex {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .actions-cell-flex .btn {
    flex: 1 1 auto;
    min-height: 40px; /* Touch target enhancement */
    font-size: 12px;
    padding: 6px 10px;
  }
}

/* Ensure sticky th alignment stays above other body scrollbars */
.data-table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: #f8fafc;
}

.prospects-filter-bar, .followups-filter-bar {
  background-color: var(--card-bg);
}

@media (max-width: 768px) {
  .nav-menu {
    flex-direction: row !important;
    overflow-x: auto !important;
    padding: 8px !important;
    gap: 4px !important;
  }
  
  .nav-item {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  /* Responsive cards layout for tables on narrow viewports */
  #followups-table, #followups-table thead, #followups-table tbody, #followups-table tr, #followups-table td {
    display: block;
    width: 100%;
  }

  #followups-table thead {
    display: none; /* Hide header row on mobile */
  }

  #followups-table tr {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    margin-bottom: 12px;
    padding: 12px;
  }

  #followups-table td {
    text-align: right;
    padding: 8px 4px;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  #followups-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-light);
    font-size: 12px;
    text-align: left;
  }
}

/* Video Player Modal Styling Constraints */
#video-player-modal .modal-container {
  max-height: 95vh;
  overflow-y: auto;
}

#video-player-element {
  max-height: 65vh;
  width: 100%;
  object-fit: contain;
}

@media (max-height: 700px) {
  #video-player-element {
    max-height: 50vh;
  }
}

/* ==========================================================================\n   PROSPECTS DESKTOP FIT-TO-SCREEN\n   Keep the Prospect Database on a single desktop viewport without horizontal\n   table scrolling. Mobile/tablet behaviour remains unchanged.\n   ========================================================================== */
@media (min-width: 1025px) {
  /* Give this high-information page a little more usable width/height. */
  body:has(#view-prospects.active) .sidebar {
    width: 215px;
  }

  body:has(#view-prospects.active) .top-header {
    padding: 16px 24px;
  }

  body:has(#view-prospects.active) .header-titles h1 {
    font-size: 23px;
    margin-bottom: 2px;
  }

  body:has(#view-prospects.active) .content-body {
    padding: 14px 12px;
  }

  #view-prospects .card-box {
    padding: 14px !important;
  }

  #view-prospects .prospects-filter-bar {
    top: -16px !important;
    padding-bottom: 10px !important;
    margin-bottom: 10px !important;
  }

  #view-prospects .prospects-filter-bar > div:first-child {
    gap: 10px !important;
  }

  #view-prospects .prospects-filter-bar .section-title h2 {
    font-size: 18px;
  }

  #view-prospects #prospects-status-filters {
    gap: 6px !important;
    margin-top: 8px !important;
  }

  #view-prospects #prospects-status-filters .btn-xs {
    padding: 4px 8px;
    font-size: 10px;
  }

  #view-prospects .table-container {
    max-height: calc(100vh - 185px) !important;
    overflow-x: hidden !important;
  }

  #prospects-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  #prospects-table th,
  #prospects-table td {
    padding: 8px 7px;
    font-size: 12px;
    line-height: 1.22;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  #prospects-table th {
    font-size: 10px;
    letter-spacing: 0.25px;
    white-space: normal;
  }

  /* Eight columns sized to stay within the visible content area. */
  #prospects-table th:nth-child(1), #prospects-table td:nth-child(1) { width: 12%; }
  #prospects-table th:nth-child(2), #prospects-table td:nth-child(2) { width: 12%; }
  #prospects-table th:nth-child(3), #prospects-table td:nth-child(3) { width: 12%; }
  #prospects-table th:nth-child(4), #prospects-table td:nth-child(4) { width: 9%; }
  #prospects-table th:nth-child(5), #prospects-table td:nth-child(5) { width: 14%; }
  #prospects-table th:nth-child(6), #prospects-table td:nth-child(6) { width: 9%; }
  #prospects-table th:nth-child(7), #prospects-table td:nth-child(7) { width: 9%; }
  #prospects-table th:nth-child(8), #prospects-table td:nth-child(8) { width: 23%; }

  #prospects-table .prospect-meta {
    gap: 7px;
    align-items: flex-start;
  }

  #prospects-table .prospect-avatar {
    width: 26px;
    height: 26px;
    min-width: 26px;
    font-size: 9px;
  }

  #prospects-table .prospect-name-link {
    font-size: 12px;
    line-height: 1.15;
  }

  #prospects-table .prospect-company-tag {
    font-size: 9px;
    line-height: 1.15;
    margin-top: 2px;
  }

  #prospects-table .badge {
    padding: 3px 6px;
    font-size: 9.5px;
    line-height: 1.1;
  }

  #prospects-table .video-preview-cell {
    gap: 3px !important;
  }

  #prospects-table .video-mini-thumb {
    transform: scale(0.88);
    transform-origin: left center;
  }

  #prospects-table .actions-cell-flex {
    gap: 3px !important;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  #prospects-table .actions-cell-flex .btn,
  #prospects-table .actions-cell-flex a.btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 4px 5px !important;
    min-height: 0;
    font-size: 9px !important;
    line-height: 1.12;
    white-space: normal !important;
    text-align: center;
  }

  #prospects-table td:nth-child(5) > div {
    font-size: 10px !important;
    line-height: 1.3 !important;
  }
}


/* ==========================================================================\n   FOLLOW UPS DESKTOP TIDY-UP\n   Keep call statuses on one line and rebalance the nine columns so the\n   tracking controls read cleanly without changing mobile behaviour.\n   ========================================================================== */
.followup-called-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  color: #166534;
  font-weight: 600;
  background-color: #f0fdf4;
  padding: 4px 7px;
  border-radius: 4px;
  border: 1px solid #bbf7d0;
  line-height: 1.1;
}

@media (min-width: 1025px) {
  /* Match the roomier Prospect Database layout on this high-information page. */
  body:has(#view-followups.active) .sidebar {
    width: 215px;
  }

  body:has(#view-followups.active) .content-body {
    padding: 14px 12px;
  }

  #view-followups .card-box {
    padding: 18px !important;
  }

  #view-followups .followups-filter-bar {
    top: -20px !important;
    padding-bottom: 12px !important;
    margin-bottom: 12px !important;
  }

  #view-followups .table-container {
    max-height: calc(100vh - 220px) !important;
    overflow-x: hidden !important;
  }

  #followups-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
  }

  #followups-table th,
  #followups-table td {
    padding: 10px 8px;
    font-size: 12px;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  #followups-table th {
    font-size: 10px;
    letter-spacing: 0.25px;
    white-space: nowrap;
  }

  /* Rebalanced desktop widths: keep more room for company/email while
     protecting the call-tracking columns from wrapping. */
  #followups-table th:nth-child(1), #followups-table td:nth-child(1) { width: 15%; }
  #followups-table th:nth-child(2), #followups-table td:nth-child(2) { width: 18%; }
  #followups-table th:nth-child(3), #followups-table td:nth-child(3) { width: 8%; }
  #followups-table th:nth-child(4), #followups-table td:nth-child(4) { width: 18%; }
  #followups-table th:nth-child(5), #followups-table td:nth-child(5) { width: 9%; }
  #followups-table th:nth-child(6), #followups-table td:nth-child(6) { width: 7.5%; }
  #followups-table th:nth-child(7), #followups-table td:nth-child(7) { width: 7.5%; }
  #followups-table th:nth-child(8), #followups-table td:nth-child(8) { width: 9%; }
  #followups-table th:nth-child(9), #followups-table td:nth-child(9) { width: 8%; }

  #followups-table th:nth-child(n+5),
  #followups-table td:nth-child(n+5) {
    text-align: center;
  }

  #followups-table td:nth-child(6),
  #followups-table td:nth-child(7) {
    white-space: nowrap;
    overflow-wrap: normal;
  }

  #followups-table .followup-called-status {
    font-size: 11px;
    padding: 4px 6px;
  }

  #followups-table td:nth-child(5) .btn,
  #followups-table td:nth-child(6) .btn,
  #followups-table td:nth-child(7) .btn,
  #followups-table td:nth-child(8) .btn {
    white-space: nowrap;
  }

  #followups-table .prospect-meta {
    gap: 8px;
  }

  #followups-table .prospect-avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: 10px;
  }
}
