/* =============================================================
   Website Automata — Dashboard Styles
   Premium dark-mode SaaS dashboard with glassmorphism
   ============================================================= */

/* ----- CSS Custom Properties (Design Tokens) ----- */
:root {
  /* Backgrounds */
  --bg-base: #0a0e1a;
  --bg-surface: #1a1f36;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-sidebar: rgba(10, 14, 30, 0.92);

  /* Accents */
  --primary: #3b82f6;
  --primary-light: #60a5fa;
  --violet: #8b5cf6;
  --gradient-primary: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-primary-hover: linear-gradient(135deg, #60a5fa, #a78bfa);

  /* Semantic */
  --success: #10b981;
  --success-muted: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-muted: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-muted: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-muted: rgba(59, 130, 246, 0.15);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.15);
  --border-focus: rgba(59, 130, 246, 0.5);

  /* Layout */
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow-primary: 0 0 20px rgba(59, 130, 246, 0.3);
  --shadow-glow-success: 0 0 20px rgba(16, 185, 129, 0.3);
  --shadow-glow-danger: 0 0 20px rgba(239, 68, 68, 0.3);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.35s ease;
}

/* ----- Reset & Base ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(145deg, var(--bg-base) 0%, var(--bg-surface) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--violet);
}

img {
  max-width: 100%;
}

/* ----- Scrollbar ----- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* =============================================================
   SIDEBAR
   ============================================================= */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-sidebar);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition-base);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo-icon {
  font-size: 28px;
  line-height: 1;
}

.sidebar-logo-text {
  font-size: 17px;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-base);
  position: relative;
  border-left: 3px solid transparent;
}

.sidebar-nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.sidebar-nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-left-color: var(--primary);
  box-shadow: inset 0 0 20px rgba(59, 130, 246, 0.05);
}

.sidebar-nav-link.active::before {
  content: '';
  position: absolute;
  left: -3px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  border-radius: 0 2px 2px 0;
}

.sidebar-nav-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.sidebar-nav-label {
  white-space: nowrap;
}

/* Sidebar Stats */
.sidebar-stats {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sidebar-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
}

.sidebar-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-stat-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Sidebar Toggle (Mobile) */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.sidebar-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: transform var(--transition-base);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
}

/* =============================================================
   MAIN CONTENT
   ============================================================= */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  position: relative;
}

.top-bar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(10, 14, 30, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.top-bar-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-container {
  padding: 28px;
  animation: fadeIn 0.3s ease;
}

/* =============================================================
   CARDS (Glassmorphism)
   ============================================================= */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card:hover {
  border-color: var(--border-hover);
}

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h2,
.card-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.card-body {
  padding: 20px 24px 24px;
}

/* =============================================================
   BUTTONS
   ============================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Primary — gradient with glow */
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--gradient-primary-hover);
  box-shadow: var(--shadow-glow-primary);
  transform: translateY(-1px);
}

/* Success */
.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover:not(:disabled) {
  background: #34d399;
  box-shadow: var(--shadow-glow-success);
  transform: translateY(-1px);
}

/* Danger */
.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #f87171;
  box-shadow: var(--shadow-glow-danger);
  transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* Sizes */
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
}

/* Icon only */
.btn-icon {
  padding: 8px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
  padding: 4px;
}

/* =============================================================
   BADGES
   ============================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Tier badges */
.badge-strong {
  background: var(--success-muted);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-medium {
  background: var(--warning-muted);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-skip {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-muted);
  border: 1px solid rgba(100, 116, 139, 0.25);
}

/* Status badges */
.badge-status-new {
  background: var(--info-muted);
  color: var(--primary-light);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-status-scored {
  background: rgba(139, 92, 246, 0.15);
  color: var(--violet);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.badge-status-demo_built {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.badge-status-contacted {
  background: var(--warning-muted);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-status-won {
  background: var(--success-muted);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-status-lost {
  background: var(--danger-muted);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

/* =============================================================
   FORMS / INPUTS
   ============================================================= */
.input,
.select,
textarea.input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: all var(--transition-base);
  outline: none;
}

.input:focus,
.select:focus,
textarea.input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.input::placeholder {
  color: var(--text-muted);
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

textarea.input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

.input-group {
  display: flex;
  gap: 0;
}

.input-group .input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  flex-shrink: 0;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group {
  margin-bottom: 18px;
}

/* Search Form */
.search-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 14px;
  align-items: end;
}

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

/* =============================================================
   PROSPECT TABLE
   ============================================================= */
.prospect-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}

.prospect-table thead th {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.prospect-row {
  transition: all var(--transition-base);
}

.prospect-row td {
  padding: 14px;
  background: var(--bg-card);
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  vertical-align: middle;
}

.prospect-row td:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-left: 1px solid transparent;
}

.prospect-row td:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-right: 1px solid transparent;
}

.prospect-row:hover td {
  background: var(--bg-card-hover);
  border-color: var(--border);
}

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

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

.prospect-row .prospect-rating {
  color: #fbbf24;
  font-size: 13px;
}

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

/* =============================================================
   PROSPECT CARDS (Grid View)
   ============================================================= */
.prospect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.prospect-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  transition: all var(--transition-base);
  cursor: pointer;
}

.prospect-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.prospect-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

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

.prospect-card-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prospect-card-category {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.prospect-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.prospect-card-meta .stars {
  color: #fbbf24;
}

.prospect-card-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.prospect-card-details {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.prospect-card-details p {
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* =============================================================
   SCORE GAUGE
   ============================================================= */
.score-gauge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.score-gauge svg {
  transform: rotate(-90deg);
}

.score-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.score-gauge-lg .score-value {
  font-size: 28px;
}

/* =============================================================
   STATUS PIPELINE
   ============================================================= */
.status-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 0;
}

.pipeline-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  flex: 1;
}

.pipeline-stage::before {
  content: '';
  position: absolute;
  top: 14px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.pipeline-stage:first-child::before {
  display: none;
}

.pipeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  z-index: 1;
  transition: all var(--transition-base);
}

.pipeline-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: capitalize;
}

.pipeline-stage.completed .pipeline-dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.pipeline-stage.completed::before {
  background: var(--success);
}

.pipeline-stage.completed .pipeline-label {
  color: var(--success);
}

.pipeline-stage.active .pipeline-dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
  animation: glow 2s ease-in-out infinite;
}

.pipeline-stage.active::before {
  background: var(--success);
}

.pipeline-stage.active .pipeline-label {
  color: var(--primary-light);
  font-weight: 600;
}

/* =============================================================
   CALL SCRIPT
   ============================================================= */
.call-script {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.call-script-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.call-script-tab {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-base);
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.call-script-tab:hover {
  color: var(--text-secondary);
}

.call-script-tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

.call-script-content {
  padding: 20px 24px;
  display: none;
}

.call-script-content.active {
  display: block;
}

.call-script-section {
  margin-bottom: 18px;
}

.call-script-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.call-script-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.call-script-section strong {
  color: var(--text-primary);
}

.call-script-section .highlight {
  color: var(--warning);
  font-weight: 600;
}

/* =============================================================
   SETTINGS PANEL
   ============================================================= */
.settings-panel {
  max-width: 640px;
}

.settings-panel .card {
  margin-bottom: 20px;
}

.weight-slider {
  margin-bottom: 20px;
}

.weight-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.weight-slider-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.weight-slider-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-light);
  min-width: 28px;
  text-align: right;
}

.weight-slider input[type="range"] {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-input);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.weight-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: 2px solid #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast);
}

.weight-slider input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: var(--shadow-glow-primary);
}

.weight-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  cursor: pointer;
}

/* =============================================================
   TOAST NOTIFICATIONS
   ============================================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.35s ease;
  font-size: 14px;
  color: var(--text-primary);
  backdrop-filter: blur(16px);
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
  line-height: 1;
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

.toast-info {
  border-left: 3px solid var(--info);
}

.toast-warning {
  border-left: 3px solid var(--warning);
}

.toast.removing {
  animation: slideOut 0.3s ease forwards;
}

/* =============================================================
   MODAL
   ============================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeInFast 0.2s ease;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn 0.25s ease;
}

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

.modal-title {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--transition-fast);
}

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

.modal-body {
  padding: 24px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* =============================================================
   LOADING SPINNER
   ============================================================= */
.loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner.sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.loading-spinner.lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  flex-direction: column;
  gap: 16px;
}

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

/* =============================================================
   SKELETON LOADING
   ============================================================= */
.skeleton {
  background: linear-gradient(90deg,
    var(--bg-card) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    var(--bg-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 80%;
}

.skeleton-text.short {
  width: 40%;
}

.skeleton-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.skeleton-card {
  height: 160px;
  border-radius: var(--radius-xl);
}

/* =============================================================
   EMPTY STATE
   ============================================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state-message {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 400px;
  line-height: 1.6;
}

/* =============================================================
   STATS GRID
   ============================================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--transition-base);
}

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

.stat-card-icon {
  font-size: 22px;
  margin-bottom: 4px;
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =============================================================
   DETAIL VIEW SECTIONS
   ============================================================= */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.detail-full {
  grid-column: 1 / -1;
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.detail-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-info-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.detail-info-value {
  font-size: 14px;
  color: var(--text-primary);
}

.demo-preview-frame {
  width: 100%;
  height: 400px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.danger-zone {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.danger-zone .card-header h3 {
  color: var(--danger);
}

/* =============================================================
   FILTER BAR
   ============================================================= */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-bar .select,
.filter-bar .input {
  width: auto;
  min-width: 160px;
}

.filter-bar .filter-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}

/* =============================================================
   MINI BAR (Score Breakdown)
   ============================================================= */
.mini-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.mini-bar-label {
  font-size: 12px;
  color: var(--text-secondary);
  width: 100px;
  flex-shrink: 0;
}

.mini-bar-track {
  flex: 1;
  height: 6px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.mini-bar-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* =============================================================
   ANIMATIONS
   ============================================================= */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(80px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(80px);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 12px rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 0 24px rgba(59, 130, 246, 0.7); }
}

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

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-overlay.active {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .top-bar {
    padding: 0 16px 0 56px;
  }

  .view-container {
    padding: 16px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-info-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .prospect-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .select,
  .filter-bar .input {
    width: 100%;
  }

  .filter-bar .filter-count {
    margin-left: 0;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    max-width: none;
  }

  .status-pipeline {
    flex-wrap: wrap;
    gap: 8px;
  }

  .pipeline-stage::before {
    display: none;
  }
}

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

  .prospect-card-actions {
    flex-direction: column;
  }

  .prospect-card-actions .btn {
    width: 100%;
  }
}

/* =============================================================
   UTILITIES
   ============================================================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--primary-light); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

.hidden { display: none !important; }

.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =============================================================
   API KEYS
   ============================================================= */
.api-keys-grid {
  display: grid;
  gap: 4px;
}

.api-keys-grid .form-group {
  margin-bottom: 14px;
}

.api-keys-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-status {
  font-size: 11px;
  font-weight: 600;
}

code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--primary-light);
}

/* =============================================================
   MOBILE FIRST PREVIEW & PHONE FRAME
   ============================================================= */
.preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
}

.preview-toggle-bar {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
  margin-bottom: 20px;
  gap: 2px;
}

.preview-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 99px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.preview-toggle-btn.active {
  background: var(--gradient-primary);
  color: #fff;
}

/* Responsive view wrapper */
.demo-preview-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all var(--transition-base);
}

/* Desktop Preview Frame default */
.demo-preview-wrapper.view-desktop .demo-preview-frame {
  width: 100%;
  height: 500px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  background: #000;
}

/* CSS iPhone Frame Mockup */
.demo-preview-wrapper.view-mobile .phone-frame {
  width: 330px;
  height: 660px;
  background: #111;
  border: 12px solid #222;
  border-radius: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(0,0,0,0.8);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  animation: fadeIn 0.4s ease;
}

.demo-preview-wrapper.view-mobile .phone-notch {
  width: 150px;
  height: 20px;
  background: #222;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 10;
}

.demo-preview-wrapper.view-mobile .phone-screen {
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 28px;
  overflow: hidden;
}

.demo-preview-wrapper.view-mobile .demo-preview-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* =============================================================
   COMPETITORS & SOCIAL BADGES
   ============================================================= */
.competitors-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 8px;
}

.competitor-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all var(--transition-base);
}

.competitor-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-hover);
}

.competitor-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

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

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

.competitor-meta .stars {
  color: #fbbf24;
  margin-right: 4px;
}

/* Social Media Badges */
.socials-badge-list {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.social-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none !important;
  transition: all var(--transition-fast);
}

.social-badge-facebook {
  background: rgba(24, 119, 242, 0.15);
  color: #1877f2;
  border: 1px solid rgba(24, 119, 242, 0.25);
}

.social-badge-facebook:hover {
  background: rgba(24, 119, 242, 0.25);
}

.social-badge-instagram {
  background: rgba(225, 48, 108, 0.15);
  color: #e1306c;
  border: 1px solid rgba(225, 48, 108, 0.25);
}

.social-badge-instagram:hover {
  background: rgba(225, 48, 108, 0.25);
}

/* Last Review Freshness Indicator styling */
.freshness-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.freshness-green { background-color: var(--success); box-shadow: 0 0 8px var(--success); }
.freshness-amber { background-color: var(--warning); box-shadow: 0 0 8px var(--warning); }
.freshness-red { background-color: var(--danger); box-shadow: 0 0 8px var(--danger); }

/* Outreach Buttons Styling */
.btn-outreach-sms {
  background-color: var(--success);
  color: #fff;
}
.btn-outreach-sms:hover {
  background-color: #0d9488;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.btn-outreach-email {
  background-color: var(--primary);
  color: #fff;
}
.btn-outreach-email:hover {
  background-color: #2563eb;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

/* =============================================================
   SECURE ADMIN LOGIN SYSTEM & GLASSMORPHISM
   ============================================================= */

/* Global unauthenticated state overrides */
body.unauthenticated {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #0e172a 0%, #05050c 100%) !important;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

body.unauthenticated::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  background-position: center;
  pointer-events: none;
  z-index: 0;
}

body.unauthenticated .sidebar,
body.unauthenticated .top-bar,
body.unauthenticated .sidebar-overlay {
  display: none !important;
}

body.unauthenticated .main-content {
  margin-left: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  min-height: 100vh !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

body.unauthenticated .view-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* Login Wrapper & Card Visuals */
.login-view-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 420px;
  padding: 20px;
}

.login-card {
  width: 100%;
  background: rgba(10, 14, 26, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 36px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
              0 0 40px rgba(99, 102, 241, 0.05),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}

.login-card::after {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 28px;
  margin-bottom: 16px;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
  line-height: 1.4;
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form .form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.btn-block {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.btn-block:hover {
  transform: translateY(-1px);
}

.mt-2 {
  margin-top: 8px !important;
}

/* User Account Display & Logout in Sidebar */
.sidebar-user {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.01);
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-user-email {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar-user-role {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-logout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.sidebar-logout-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Lucide Vector Icons Style overrides */
.nav-icon-svg {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
  color: inherit;
  flex-shrink: 0;
  transition: transform var(--transition-base);
}

.sidebar-nav-link:hover .nav-icon-svg,
.sidebar-nav-link.active .nav-icon-svg {
  transform: scale(1.08);
}

.sidebar-logo-icon-svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.2px;
  color: var(--primary);
  flex-shrink: 0;
}

.logout-icon-svg {
  width: 18px;
  height: 18px;
  stroke-width: 2px;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* B2B Propensity & Telemetry Econographic styling overrides */
.recommendation-item:hover {
  transform: translateY(-2.5px);
  border-color: rgba(59, 130, 246, 0.45) !important;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.12);
  background: rgba(30, 41, 59, 0.45) !important;
}

.recommendation-item {
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

