/* ===================================================================
   MapLead Pro Enterprise CRM — Modern Glassmorphism Design System
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --bg-base: #060911;
  --bg-surface: #0b0f1a;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-card-hover: rgba(24, 36, 62, 0.82);
  --bg-card-elevated: rgba(20, 30, 52, 0.9);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.14);
  --border-highlight: rgba(0, 242, 254, 0.4);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --accent-cyan: #00f2fe;
  --accent-cyan-rgb: 0, 242, 254;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', 'Plus Jakarta Sans', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Glows */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.28;
}

.glow-1 {
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  top: -120px;
  left: -120px;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #00f2fe 0%, transparent 70%);
  bottom: -150px;
  right: -120px;
}

.glow-3 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  top: 35%;
  left: 55%;
  opacity: 0.18;
}

/* Main Container */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 1.75rem 4rem;
}

/* Header & Brand */
.app-header {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 1.25rem 1.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

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

.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #00f2fe, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #060911;
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.35);
  position: relative;
}

.brand-icon svg {
  width: 26px;
  height: 26px;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.gradient-text {
  background: linear-gradient(135deg, #00f2fe, #60a5fa, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-weight: 500;
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid var(--border-subtle);
  font-weight: 600;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.status-dot.scanning {
  background: var(--accent-amber);
  box-shadow: 0 0 12px var(--accent-amber);
  animation: pulse-dot 1.2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Navigation Bar */
.main-nav {
  display: flex;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active {
  background: linear-gradient(135deg, var(--accent-blue), #00d2ff);
  color: #060911;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 242, 254, 0.3);
}

.badge-count {
  background: var(--accent-rose);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  font-weight: 700;
}

/* Views Visibility */
.app-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

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

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

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 1.5rem;
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
}

/* ===================================================================
   Dashboard Metrics Grid
   =================================================================== */

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

.metric-card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.75), rgba(15, 23, 42, 0.65));
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.35rem 1.25rem;
  backdrop-filter: blur(16px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.5), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 242, 254, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-title {
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.metric-value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.dashboard-sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.gap-bars-container, .payments-currency-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gap-bar-item, .currency-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
}

/* ===================================================================
   Discovery Form & Controls
   =================================================================== */

.search-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group.flex-2 { flex: 2; min-width: 280px; }
.form-group.flex-1 { flex: 1; min-width: 200px; }

.form-group label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-group input[type="text"] {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.925rem;
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.2rem;
}

.quick-tag, .city-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.quick-tag:hover, .city-tag:hover {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.limit-selector {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.limit-selector input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  outline: none;
}

.limit-selector input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-cyan);
}

.limit-badge {
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--accent-cyan);
  align-self: flex-start;
  background: rgba(0, 242, 254, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 242, 254, 0.25);
}

/* ===================================================================
   Cascading Geotargeting Panel
   =================================================================== */

.geo-panel {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.geo-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 4px 0 0 4px;
}

.geo-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.geo-panel-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.geo-hierarchy-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(0, 242, 254, 0.1);
  padding: 0.15rem 0.55rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 242, 254, 0.25);
  margin-left: 0.35rem;
}

.geo-restriction-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

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

.label-with-filter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.compact-filter-input {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  font-size: 0.75rem;
  width: 120px;
  transition: all 0.2s ease;
}

.compact-filter-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: rgba(0, 0, 0, 0.75);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.25);
}

.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  pointer-events: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.select-wrapper:focus-within::after {
  border-color: var(--accent-cyan);
  transform: rotate(-135deg);
}

.styled-select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(10, 15, 29, 0.85);
  border: 1px solid var(--border-subtle);
  color: #f1f5f9;
  padding: 0.75rem 2.2rem 0.75rem 0.95rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.styled-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: rgba(13, 20, 39, 0.95);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.22);
}

.styled-select option {
  background: #0f172a;
  color: #f8fafc;
  padding: 0.6rem 0.8rem;
}

.geo-scope-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(0, 242, 254, 0.35);
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.geo-scope-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.geo-scope-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.geo-scope-target {
  font-size: 0.9rem;
  color: #fff;
  font-weight: 500;
}

.geo-scope-target strong {
  color: var(--accent-cyan);
  font-weight: 700;
  transition: color 0.3s ease;
}

/* Dynamic Scan States for Scope Bar */
.geo-scope-bar.is-scanning {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.12), rgba(16, 185, 129, 0.08), rgba(11, 15, 26, 0.85));
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.25), inset 0 0 15px rgba(0, 242, 254, 0.08);
  animation: geo-border-pulse 2s infinite ease-in-out;
}

.geo-scope-bar.is-scanning .geo-scope-target strong {
  color: #38bdf8;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.geo-scope-bar.is-extracting {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(0, 242, 254, 0.08), rgba(11, 15, 26, 0.9));
  border: 1px solid #10b981;
  box-shadow: 0 0 32px rgba(16, 185, 129, 0.4), inset 0 0 20px rgba(16, 185, 129, 0.14);
  animation: geo-extract-flicker 1.1s infinite ease-in-out;
}

.geo-scope-bar.is-complete {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(11, 15, 26, 0.85));
  border: 1px solid rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.geo-scope-bar.is-stopped {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(11, 15, 26, 0.85));
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

@keyframes geo-border-pulse {
  0%, 100% {
    border-color: rgba(0, 242, 254, 0.6);
    box-shadow: 0 0 18px rgba(0, 242, 254, 0.22);
  }
  50% {
    border-color: rgba(16, 185, 129, 0.85);
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.35), inset 0 0 18px rgba(16, 185, 129, 0.1);
  }
}

@keyframes geo-extract-flicker {
  0%, 100% {
    border-color: rgba(16, 185, 129, 0.75);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.32), inset 0 0 14px rgba(16, 185, 129, 0.1);
  }
  50% {
    border-color: rgba(0, 242, 254, 0.65);
    box-shadow: 0 0 38px rgba(16, 185, 129, 0.55), inset 0 0 22px rgba(0, 242, 254, 0.1);
  }
}

/* Target Live Status Pill */
.target-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.target-live-pill.active {
  background: rgba(0, 242, 254, 0.16);
  border-color: rgba(0, 242, 254, 0.55);
  color: #00f2fe;
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.4);
}

.target-live-pill.extracting {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.65);
  color: #34d399;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.45);
}

.target-live-pill.complete {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.target-live-pill.stopped {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

.target-live-pill.awaiting {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.field-error {
  border-color: #f43f5e !important;
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.35) !important;
  animation: shake-error 0.35s ease-in-out;
}

@keyframes shake-error {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.styled-select:disabled,
.compact-filter-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(10, 15, 29, 0.45);
  border-color: rgba(255, 255, 255, 0.08);
}

.target-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.target-live-pill.active .target-live-dot,
.target-live-pill.extracting .target-live-dot {
  animation: radar-pulse 1.2s infinite ease-in-out;
}

@keyframes radar-pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  50% { transform: scale(1.4); opacity: 1; filter: drop-shadow(0 0 4px currentColor); }
  100% { transform: scale(0.9); opacity: 0.6; }
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.filter-toggles {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.toggle-control {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
  color: var(--text-main);
}

.toggle-control input {
  display: none;
}

.toggle-slider {
  width: 38px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-control input:checked + .toggle-slider {
  background: var(--accent-cyan);
}

.toggle-control input:checked + .toggle-slider::after {
  transform: translateX(18px);
  background: #060911;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #3b82f6);
  color: #060911;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(0, 242, 254, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 242, 254, 0.5);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
}

.btn-danger:hover:not(:disabled) {
  background: var(--accent-rose);
  color: #fff;
}

.btn-outline {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-glass);
}

.btn-emerald {
  background: #10b981;
  color: #fff;
  font-weight: 700;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Scan Progress Bar & Interactive Scanning States */
.scan-progress {
  margin-top: 1.25rem;
  background: rgba(11, 15, 26, 0.75);
  padding: 1.15rem 1.35rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
}

.scan-progress.hidden {
  display: none;
}

.scan-progress.is-scanning {
  border-color: rgba(0, 242, 254, 0.45);
  box-shadow: 0 4px 25px rgba(0, 242, 254, 0.12), inset 0 0 20px rgba(0, 242, 254, 0.04);
}

.scan-progress.is-extracting {
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow: 0 4px 30px rgba(16, 185, 129, 0.22), inset 0 0 25px rgba(16, 185, 129, 0.08);
}

.scan-progress.is-complete {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 4px 22px rgba(16, 185, 129, 0.15);
}

.scan-progress.is-stopped {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.12);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.progress-status-container {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: #fff;
  flex: 1;
  min-width: 260px;
}

.progress-text {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  word-break: break-word;
}

/* Status Indicator Tag */
.status-indicator-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
}

.status-indicator-tag.tag-cyan {
  background: rgba(0, 242, 254, 0.16);
  border: 1px solid rgba(0, 242, 254, 0.45);
  color: #00f2fe;
}

.status-indicator-tag.tag-emerald {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.55);
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
  animation: extract-tag-pop 0.3s ease-out;
}

.status-indicator-tag.tag-blue {
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
}

.status-indicator-tag.tag-amber {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fbbf24;
}

@keyframes extract-tag-pop {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Pulse Dot States */
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan);
  animation: pulse-dot 1.4s infinite ease-in-out;
  transition: background 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

/* Explicit active state — cyan scanning pulse */
.pulse-dot.active {
  background: var(--accent-cyan);
  box-shadow: 0 0 14px var(--accent-cyan), 0 0 28px rgba(0, 242, 254, 0.4);
  animation: pulse-dot 1.2s infinite ease-in-out;
}

/* Emerald green — lead being extracted */
.pulse-dot.extracting {
  background: #10b981;
  box-shadow: 0 0 16px #10b981, 0 0 32px rgba(16, 185, 129, 0.4);
  animation: pulse-dot-extract 0.65s infinite ease-in-out;
}

/* Static green — scan complete */
.pulse-dot.complete {
  background: #10b981;
  box-shadow: 0 0 12px #10b981;
  animation: none;
}

/* Static amber — stopped/cancelled */
.pulse-dot.stopped {
  background: #f59e0b;
  box-shadow: 0 0 12px #f59e0b;
  animation: none;
}

/* Base cyan pulse keyframe */
@keyframes pulse-dot {
  0%   { transform: scale(0.85); opacity: 0.6; }
  50%  { transform: scale(1.45); opacity: 1;   box-shadow: 0 0 22px rgba(0, 242, 254, 0.85); }
  100% { transform: scale(0.85); opacity: 0.6; }
}

/* Fast emerald extract keyframe */
@keyframes pulse-dot-extract {
  0%   { transform: scale(0.9);  opacity: 0.75; box-shadow: 0 0 8px #10b981; }
  50%  { transform: scale(1.5);  opacity: 1;    box-shadow: 0 0 24px #10b981, 0 0 40px rgba(16, 185, 129, 0.5); }
  100% { transform: scale(0.9);  opacity: 0.75; box-shadow: 0 0 8px #10b981; }
}

/* Counters Container & Distinct Pill Badges */
.scan-counters-pills {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.pill-counter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 500;
  backdrop-filter: blur(8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.pill-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.pill-counter strong {
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 0.95rem;
  display: inline-block;
  transition: transform 0.2s ease;
}

/* 1. Encountered: Vibrant Cyan / Ice Blue */
.pill-enc {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.pill-enc strong {
  color: #f0f9ff;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
}

/* 2. New Saved: High-Impact Emerald Green */
.pill-saved {
  color: #34d399;
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}

.pill-saved strong {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.9);
}

/* 3. Skipped Fresh: Warm Amber / Gold */
.pill-skipped {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.15);
}

.pill-skipped strong {
  color: #fffbeb;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

/* 4. Refreshed: Modern Violet / Purple */
.pill-refreshed {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.pill-refreshed strong {
  color: #faf5ff;
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.7);
}

/* Dynamic counter pop animation when numbers update */
@keyframes counter-bump {
  0% { transform: scale(1); }
  45% { transform: scale(1.35); filter: brightness(1.7); }
  100% { transform: scale(1); }
}

.counter-bump {
  animation: counter-bump 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Dynamic Button Scan States */
.btn-primary.is-scanning {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.28), rgba(59, 130, 246, 0.3));
  border: 1px solid rgba(0, 242, 254, 0.55);
  color: #a5f3fc;
  box-shadow: 0 0 18px rgba(0, 242, 254, 0.28);
}

.btn-danger-active {
  background: linear-gradient(135deg, #f43f5e, #be123c) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.6) !important;
  animation: danger-pulse 1.8s infinite ease-in-out;
}

@keyframes danger-pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(244, 63, 94, 0.4);
  }
  50% {
    box-shadow: 0 0 26px rgba(244, 63, 94, 0.75);
  }
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #00f2fe;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Progress Bar Track & Shimmering Glowing Fill */
.progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f2fe, #3b82f6, #10b981);
  border-radius: 10px;
  transition: width 0.35s ease;
  position: relative;
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.4);
}

.progress-bar-fill.complete {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.5);
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Live Table Row Extraction Flash */
@keyframes row-extract-glow {
  0% {
    background: rgba(0, 242, 254, 0.3);
    box-shadow: inset 0 0 18px rgba(0, 242, 254, 0.4);
    transform: translateY(-4px);
  }
  40% {
    background: rgba(16, 185, 129, 0.22);
    box-shadow: inset 0 0 14px rgba(16, 185, 129, 0.35);
  }
  100% {
    background: transparent;
    box-shadow: none;
    transform: translateY(0);
  }
}

.row-just-extracted {
  animation: row-extract-glow 2.5s ease-out forwards;
}

/* ===================================================================
   Table Styling & Toolbar
   =================================================================== */

.crm-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.crm-input, .crm-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.65rem 0.95rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.875rem;
}

.crm-input:focus, .crm-select:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.toolbar-search {
  flex: 1;
  min-width: 260px;
}

.toolbar-search .crm-input {
  width: 100%;
}

.toolbar-filters {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.filter-exact-date {
  max-width: 155px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.leads-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}

.leads-table th {
  background: rgba(11, 15, 26, 0.85);
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.725rem;
  letter-spacing: 0.06em;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.leads-table td {
  padding: 1rem 1.15rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  vertical-align: middle;
}

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

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

.empty-row td {
  text-align: center;
  color: var(--text-dim);
  padding: 3rem 1rem;
}

.btn-copy-small {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
  margin-left: 0.3rem;
}

.btn-copy-small:hover {
  opacity: 1;
}

/* Badges & Pills */
.score-pill {
  font-size: 0.775rem;
  font-weight: 800;
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.35);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}

.stage-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}

.status-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-danger { background: rgba(244, 63, 94, 0.2); color: #fda4af; }
.badge-neutral { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }

/* Colors */
.text-amber { color: var(--accent-amber); }
.text-rose { color: var(--accent-rose); }
.text-cyan { color: var(--accent-cyan); }
.text-emerald { color: var(--accent-emerald); }

/* ===================================================================
   Kanban Board View
   =================================================================== */

.pipeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.15rem;
  overflow-x: auto;
  align-items: flex-start;
  padding-bottom: 1rem;
}

.kanban-column {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.15rem;
  min-height: 440px;
}

.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fff;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
}

.kanban-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.kanban-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.kanban-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.07);
}

.kanban-card-title {
  font-weight: 700;
  font-size: 0.925rem;
  color: #fff;
  margin-bottom: 0.35rem;
}

.kanban-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

/* ===================================================================
   Follow-ups View
   =================================================================== */

.followups-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.followup-column {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.35rem;
  border-radius: 16px;
}

.border-rose { border-top: 4px solid var(--accent-rose); }
.border-amber { border-top: 4px solid var(--accent-amber); }
.border-cyan { border-top: 4px solid var(--accent-cyan); }
.border-emerald { border-top: 4px solid var(--accent-emerald); }

.column-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.task-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.task-biz-name {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
}

.task-due {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.task-notes {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.task-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

/* ===================================================================
   Modals & Slide-Over Drawers
   =================================================================== */

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: #090e1c;
  border: 1px solid rgba(0, 242, 254, 0.3);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 1px rgba(0, 242, 254, 0.4);
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.modal-large {
  width: 980px;
  max-width: 95vw;
}

.modal-small {
  width: 520px;
  max-width: 95vw;
  height: auto;
  max-height: 90vh;
}

.modal-header {
  padding: 1.25rem 1.85rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0a0f1d;
  gap: 1.25rem;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

.modal-header-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.modal-badge-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0.15rem 0;
}

.modal-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.2rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.8rem;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.modal-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: var(--accent-rose);
  color: #fff;
  transform: rotate(90deg);
}

.dnc-pill {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.4);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

/* Modal Tab Bar - Sticky & Solid Pinned */
.modal-tabs {
  display: flex;
  align-items: center;
  background: #070c18;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.65rem 1.85rem;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 15;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 254, 0.25) transparent;
}

.modal-tabs::-webkit-scrollbar {
  height: 4px;
}

.modal-tabs::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.25);
  border-radius: 4px;
}

.modal-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}

.modal-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.modal-tab.active {
  background: rgba(0, 242, 254, 0.14);
  color: var(--accent-cyan);
  font-weight: 700;
  border: 1px solid rgba(0, 242, 254, 0.45);
  box-shadow: 0 2px 14px rgba(0, 242, 254, 0.22);
}

.modal-body {
  padding: 1.5rem 1.85rem;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  z-index: 5;
}

.modal-tab-content {
  display: none;
  animation: fadeIn 0.2s ease-out;
}

.modal-tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Overview Key Metrics Grid (Briefing Tab) */
.briefing-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.briefing-kpi-card {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.briefing-kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.4), transparent);
}

.kpi-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Sections inside Briefing */
.briefing-section {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.briefing-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.briefing-section-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.12);
  font-size: 0.85rem;
}

.icon-purple { background: rgba(168, 85, 247, 0.15); }
.icon-amber { background: rgba(245, 158, 11, 0.15); }
.icon-rose { background: rgba(244, 63, 94, 0.15); }
.icon-emerald { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.icon-cyan { background: rgba(0, 242, 254, 0.15); color: #00f2fe; }

.badge-pill-cyan {
  font-size: 0.725rem;
  font-weight: 700;
  background: rgba(0, 242, 254, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

.badge-pill-purple {
  font-size: 0.725rem;
  font-weight: 700;
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

.badge-pill-amber {
  font-size: 0.725rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

.badge-pill-rose {
  font-size: 0.725rem;
  font-weight: 700;
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
}

/* Sourced Facts Cards Grid */
.facts-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}

.fact-card {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.95rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: all 0.2s ease;
}

.fact-card:hover {
  border-color: rgba(0, 242, 254, 0.3);
  background: rgba(15, 23, 42, 0.8);
}

.fact-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.fact-card-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
}

.fact-card-source {
  font-size: 0.725rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.conf-badge {
  font-size: 0.675rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
}

.conf-high { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.conf-medium { background: rgba(0, 242, 254, 0.15); color: var(--accent-cyan); border: 1px solid rgba(0, 242, 254, 0.3); }
.conf-low { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }

/* Hypotheses Grid */
.hypotheses-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hypothesis-card {
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-left: 4px solid #a855f7;
  border-radius: 12px;
  padding: 0.9rem 1.15rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.hypothesis-tag {
  font-size: 0.725rem;
  font-weight: 800;
  background: rgba(168, 85, 247, 0.18);
  color: #d8b4fe;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
}

.hypothesis-text {
  font-size: 0.885rem;
  color: #f1f5f9;
  line-height: 1.45;
}

/* Questions Checklist */
.questions-checklist {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.question-item {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.885rem;
  color: #e2e8f0;
  transition: all 0.2s ease;
  cursor: pointer;
}

.question-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.question-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Objections Flashcards Grid */
.objections-flashcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1rem;
}

.objection-flashcard {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.objection-flashcard-header {
  background: rgba(244, 63, 94, 0.08);
  border-bottom: 1px solid rgba(244, 63, 94, 0.15);
  padding: 0.85rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: #fda4af;
}

.objection-flashcard-body {
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.objection-script-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #34d399;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.objection-script-text {
  font-size: 0.885rem;
  color: #f1f5f9;
  line-height: 1.5;
}

.objection-flashcard-footer {
  padding: 0.65rem 1.15rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

/* Pitch Cards Box (Tab 2) */
.pitch-card-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.pitch-card-box.border-emerald {
  border-color: rgba(16, 185, 129, 0.3);
}

.pitch-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pitch-card-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pitch-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.pitch-card-title strong {
  font-size: 0.95rem;
  color: #fff;
  display: block;
}

.pitch-sub {
  font-size: 0.775rem;
  color: var(--text-dim);
  font-weight: normal;
}

.pitch-textarea {
  width: 100%;
  background: rgba(5, 9, 19, 0.7);
  border: 1px solid var(--border-subtle);
  color: #f8fafc;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.55;
  resize: vertical;
  transition: all 0.2s ease;
}

.pitch-textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

/* Deal & Maintenance Pricing Calculator Inside Modal */
.pricing-calculator-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pricing-calc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1rem 1.35rem;
}

.currency-selector-box {
  display: flex;
  align-items: center;
}

.pricing-presets-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-preset-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-preset-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-preset-chip.active {
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(0, 242, 254, 0.35);
}

.pricing-calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.pricing-inputs-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pricing-input-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: all 0.2s ease;
}

.pricing-input-card:hover {
  border-color: rgba(0, 242, 254, 0.3);
}

.pricing-input-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.pricing-badge-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0, 242, 254, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.pricing-badge-icon.icon-emerald {
  background: rgba(16, 185, 129, 0.15);
}

.pricing-input-label strong {
  display: block;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.15rem;
}

.pricing-input-label small {
  font-size: 0.775rem;
  line-height: 1.35;
}

.pricing-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-prefix {
  position: absolute;
  left: 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--accent-cyan);
  pointer-events: none;
}

.pricing-number-input {
  width: 100%;
  padding-left: 2.5rem !important;
  font-family: var(--font-display);
  font-size: 1.35rem !important;
  font-weight: 800;
  color: #fff !important;
  background: rgba(0, 0, 0, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

.pricing-number-input:focus {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2) !important;
}

.pricing-summary-card {
  background: rgba(10, 16, 30, 0.85);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 16px;
  padding: 1.35rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.pricing-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
}

.pricing-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.metric-title span {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.metric-title small {
  font-size: 0.725rem;
  color: var(--text-dim);
}

.metric-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
}

.pricing-metric-row.highlight-cyan .metric-val {
  color: var(--accent-cyan);
}

.pricing-metric-row.highlight-total {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-top: 0.35rem;
}

.pricing-metric-row.highlight-total .metric-title strong {
  font-size: 0.95rem;
  color: #fff;
  display: block;
}

.pricing-metric-row.highlight-total .metric-val {
  font-size: 1.55rem;
  color: var(--accent-amber);
}

.pricing-actions-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

/* Modal Form Controls */
.modal-form {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.modal-form .form-group textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.875rem;
}

.modal-form .form-group textarea:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.full-width {
  width: 100%;
}

/* Timeline Inside Modal */
.timeline-action-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 380px;
  overflow-y: auto;
}

.timeline-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.timeline-outcome {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--accent-cyan);
}

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

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--accent-emerald);
  color: #060911;
  font-weight: 700;
  padding: 0.85rem 1.4rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(30px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast.bg-rose {
  background: var(--accent-rose);
  color: #fff;
}

/* ===================================================================
   RESPONSIVE DESIGN SYSTEM — MOBILE & TABLET ULTRA-COMPATIBILITY
   Strictly prevents any content from extending beyond its bounding box.
   =================================================================== */

/* Universal Mobile Safeguards */
html, body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img, svg, video, canvas, iframe {
  max-width: 100%;
  height: auto;
}

p, span, h1, h2, h3, h4, h5, h6, a, label, strong, small {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.app-container, .app-view, .glass-card, .search-card, .geo-panel, .scan-progress,
.modal-card, .modal-body, .pitch-card-box, .pricing-calculator-card {
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 254, 0.3) transparent;
}

.table-responsive::-webkit-scrollbar {
  height: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.3);
  border-radius: 6px;
}

.btn-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
}

/* Tablet & Smaller Screens (<= 1024px) */
@media (max-width: 1024px) {
  .app-container {
    padding: 1.25rem 1.25rem 3rem;
  }
  .dashboard-sections-grid,
  .pricing-calc-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .modal-large {
    width: 95vw;
    max-width: 95vw;
  }
}

/* Mobile Screens (<= 768px) */
@media (max-width: 768px) {
  /* Ambient glow performance & clipping fix */
  .ambient-glow {
    filter: blur(80px);
    opacity: 0.18;
  }
  .glow-1 { width: 300px; height: 300px; }
  .glow-2 { width: 320px; height: 320px; }
  .glow-3 { width: 250px; height: 250px; }

  /* App container */
  .app-container {
    padding: 0.85rem 0.75rem 3rem;
    width: 100%;
    max-width: 100vw;
  }

  /* Header */
  .app-header {
    gap: 0.85rem;
    margin-bottom: 1.25rem;
  }

  .header-top-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    width: 100%;
  }

  .brand {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .brand-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
  }

  .brand-icon svg {
    width: 22px;
    height: 22px;
  }

  .brand-title {
    font-size: 1.35rem;
    line-height: 1.2;
    word-break: break-word;
  }

  .brand-subtitle {
    font-size: 0.75rem;
    line-height: 1.35;
    margin-top: 0.15rem;
  }

  .header-badges {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
  }

  .status-indicator {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
  }

  .user-profile-chip {
    padding: 0.25rem 0.5rem 0.25rem 0.3rem;
    max-width: 100%;
  }

  .user-email {
    max-width: 110px;
    font-size: 0.72rem;
  }

  /* Horizontal Navigation Tabs with Touch Momentum */
  .main-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    width: 100%;
    max-width: 100%;
    padding: 0.3rem;
    gap: 0.3rem;
    border-radius: 12px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .main-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex-shrink: 0;
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
    min-height: 40px;
    scroll-snap-align: start;
    user-select: none;
  }

  /* Dashboard Metrics Grid */
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .metric-card {
    padding: 0.85rem 0.75rem;
    min-width: 0;
    word-break: break-word;
    border-radius: 14px;
  }

  .metric-title {
    font-size: 0.78rem;
  }

  .metric-value {
    font-size: 1.45rem;
    word-break: break-all;
  }

  .metric-sub {
    font-size: 0.72rem;
  }

  .dashboard-sections-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Glass Cards */
  .glass-card {
    padding: 1.1rem 0.95rem;
    border-radius: 15px;
    margin-bottom: 1.25rem;
    width: 100%;
  }

  .section-title {
    font-size: 1.15rem;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .section-desc {
    font-size: 0.8rem;
    line-height: 1.45;
  }

  /* Forms & Discovery */
  .form-row {
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
  }

  .form-group {
    width: 100%;
    min-width: 0 !important;
  }

  .form-group.flex-2, .form-group.flex-1 {
    width: 100%;
    min-width: 0 !important;
    flex: none;
  }

  .form-group input[type="text"],
  .styled-select,
  .crm-input,
  .crm-select {
    width: 100%;
    max-width: 100%;
    font-size: 0.9rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    box-sizing: border-box;
    min-height: 42px;
  }

  .styled-select {
    padding-right: 2.2rem;
  }

  .tag-row {
    gap: 0.3rem;
    margin-top: 0.35rem;
    max-height: 130px;
    overflow-y: auto;
    padding-bottom: 2px;
  }

  .quick-tag {
    font-size: 0.72rem;
    padding: 0.25rem 0.55rem;
  }

  .limit-selector {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .limit-selector input[type="range"] {
    flex: 1;
    min-width: 0;
  }

  .limit-badge {
    font-size: 0.78rem;
    padding: 0.3rem 0.65rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Cascading Geotargeting Panel */
  .geo-panel {
    padding: 1rem 0.85rem;
    border-radius: 14px;
    gap: 0.85rem;
    width: 100%;
  }

  .geo-panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    width: 100%;
  }

  .geo-panel-title {
    font-size: 0.9rem;
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .geo-hierarchy-tag {
    margin-left: 0;
    font-size: 0.7rem;
    display: inline-block;
  }

  .geo-restriction-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    align-self: flex-start;
  }

  .geo-selectors-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
  }

  .label-with-filter {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }

  .compact-filter-input {
    max-width: 135px;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }

  .geo-scope-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.8rem 0.9rem;
    width: 100%;
  }

  .geo-scope-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    width: 100%;
  }

  .geo-scope-target {
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
    width: 100%;
  }

  .target-live-pill {
    align-self: flex-start;
    font-size: 0.75rem;
  }

  /* Scan Controls & Buttons */
  .controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    width: 100%;
    padding-top: 0.75rem;
  }

  .filter-toggles {
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
  }

  .toggle-control {
    font-size: 0.82rem;
    width: 100%;
    align-items: flex-start;
  }

  .toggle-label {
    line-height: 1.35;
    flex: 1;
  }

  .action-buttons {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }

  .action-buttons .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
    font-size: 0.92rem;
  }

  /* Live Scan Progress */
  .scan-progress {
    padding: 0.85rem 0.75rem;
    border-radius: 12px;
    width: 100%;
  }

  .progress-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
  }

  .progress-status-container {
    min-width: 0;
    width: 100%;
    font-size: 0.82rem;
  }

  .progress-text {
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  .scan-counters-pills {
    flex-wrap: wrap;
    gap: 0.35rem;
    width: 100%;
  }

  .pill-counter {
    font-size: 0.72rem;
    padding: 0.22rem 0.55rem;
  }

  /* Tables & Horizontal Scroll Safeguard */
  .leads-table {
    min-width: 680px;
    width: 100%;
    font-size: 0.82rem;
  }

  .leads-table th,
  .leads-table td {
    padding: 0.75rem 0.65rem;
    word-break: break-word;
  }

  /* CRM Toolbar */
  .crm-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
  }

  .toolbar-search {
    width: 100%;
    min-width: 0;
  }

  .toolbar-search .crm-input {
    width: 100%;
    min-height: 42px;
  }

  .toolbar-filters {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.55rem;
  }

  .toolbar-filters select.crm-select {
    width: 100% !important;
    min-height: 42px;
    min-width: 0 !important;
  }

  .date-filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }

  .date-filter-group select {
    flex: 1 1 140px;
    min-width: 0;
    width: 100%;
  }

  .date-filter-group input {
    flex: 1 1 130px;
    min-width: 0;
    width: 100%;
    max-width: 100% !important;
    min-height: 42px;
  }

  #crmExportBtn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }

  .pagination-bar {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
  }

  .pagination-btns {
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  /* Kanban Pipeline View */
  .pipeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
  }

  #newOppBtn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
  }

  .kanban-board {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    gap: 0.85rem;
    padding-bottom: 1.25rem;
    width: 100%;
    max-width: 100%;
  }

  .kanban-column {
    min-width: 82vw;
    max-width: 85vw;
    flex-shrink: 0;
    scroll-snap-align: center;
    border-radius: 14px;
    padding: 1rem;
    min-height: 380px;
  }

  /* Follow-ups Queue */
  .followups-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .followup-column {
    width: 100%;
    max-width: 100%;
    border-radius: 14px;
    padding: 1rem;
  }

  /* Settings View */
  .settings-card .form-row {
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
  }

  .settings-card .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  /* Modals: Dossier, Call Logger, Confirmation, Auth */
  .modal-overlay {
    padding: 0.4rem;
    align-items: center;
    justify-content: center;
  }

  .modal-card {
    border-radius: 16px;
    max-height: 94vh !important;
    height: auto !important;
  }

  .modal-large,
  .modal-small,
  .modal-confirm,
  .auth-card {
    width: 100% !important;
    max-width: 98vw !important;
    margin: auto;
  }

  .modal-header {
    padding: 0.85rem 0.95rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    position: relative;
    width: 100%;
  }

  .modal-header-info {
    width: 100%;
    padding-right: 36px;
  }

  .modal-title {
    font-size: 1.2rem;
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .modal-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    width: 34px;
    height: 34px;
    font-size: 1.35rem;
  }

  .modal-header-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-start;
  }

  .modal-header-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
    font-size: 0.78rem;
    min-height: 38px;
    padding: 0.45rem 0.65rem;
  }

  .modal-tabs {
    padding: 0.4rem 0.6rem;
    gap: 0.35rem;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  .modal-tab {
    padding: 0.45rem 0.75rem;
    font-size: 0.78rem;
    flex-shrink: 0;
    min-height: 36px;
  }

  .modal-body {
    padding: 0.85rem 0.75rem;
    width: 100%;
    overflow-x: hidden;
  }

  /* Tab 1: Briefing Grid */
  .briefing-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
    width: 100%;
  }

  .briefing-kpi-card {
    padding: 0.75rem;
    min-width: 0;
  }

  .facts-cards-grid,
  .objections-flashcards-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    width: 100%;
  }

  .briefing-section {
    padding: 0.85rem 0.75rem;
    border-radius: 12px;
    width: 100%;
    margin-bottom: 1rem;
  }

  .briefing-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  /* Tab 2: Pitches */
  .pitch-card-box {
    padding: 0.85rem 0.75rem;
    border-radius: 14px;
    width: 100%;
  }

  .pitch-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
  }

  .pitch-card-header .btn-copy {
    width: 100%;
    justify-content: center;
    min-height: 38px;
  }

  .pitch-textarea {
    font-size: 0.82rem;
    padding: 0.65rem;
    width: 100%;
  }

  /* Tab 3: Calculator */
  .pricing-calc-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
  }

  .currency-selector-box {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .currency-selector-box select {
    flex: 1;
    max-width: 200px;
  }

  .pricing-presets-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    width: 100%;
  }

  .btn-preset-chip {
    width: 100%;
    text-align: left;
    font-size: 0.78rem;
    padding: 0.45rem 0.75rem;
  }

  .pricing-calc-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
  }

  .pricing-input-card,
  .pricing-summary-card {
    padding: 0.85rem 0.75rem;
    border-radius: 14px;
    width: 100%;
  }

  .summary-metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  /* Tab 4 & 5: Activity & Deals */
  .timeline-action-bar,
  .opps-action-bar {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 1rem;
  }

  .timeline-action-bar .btn,
  .opps-action-bar .btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }

  /* Toast Notification */
  .toast-container {
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
    align-items: center;
  }

  .toast {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  /* Auth Card */
  .auth-card {
    padding: 1.5rem 1.15rem;
    border-radius: 18px;
  }

  .auth-title {
    font-size: 1.25rem;
  }

  .auth-subtitle {
    font-size: 0.8rem;
  }
}

/* Extra Small Phones (<= 420px) */
@media (max-width: 420px) {
  .app-container {
    padding: 0.65rem 0.5rem 3rem;
  }

  .brand-title {
    font-size: 1.18rem;
  }

  .brand-subtitle {
    font-size: 0.7rem;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .briefing-kpi-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .tag-row {
    max-height: 100px;
  }

  .pill-counter {
    font-size: 0.68rem;
    padding: 0.2rem 0.45rem;
  }

  .kanban-column {
    min-width: 90vw;
    max-width: 92vw;
  }
}

/* ==========================================================================
   CONFIRMATION WARNING MODAL (DANGER DELETION)
   ========================================================================== */
.modal-confirm {
  max-width: 460px;
  width: 90%;
  text-align: center;
  padding: 2.2rem 2rem 1.8rem 2rem;
  border: 1px solid rgba(244, 63, 94, 0.35);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(244, 63, 94, 0.2);
  background: linear-gradient(145deg, rgba(24, 14, 20, 0.95), rgba(12, 10, 16, 0.98));
  position: relative;
  border-radius: 20px;
}

.modal-admin-card {
  width: 90%;
  max-width: 650px;
  max-height: 85vh;
}

.confirm-warning-icon-box {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.25rem;
}

.warning-icon-pulse {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(244, 63, 94, 0.15);
  border: 1.5px solid rgba(244, 63, 94, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fb7185;
  box-shadow: 0 0 30px rgba(244, 63, 94, 0.3);
  animation: pulseWarning 2s infinite ease-in-out;
}

@keyframes pulseWarning {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(244, 63, 94, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.confirm-warning-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.confirm-warning-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.confirm-item-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fb7185;
  margin-bottom: 1.6rem;
  word-break: break-word;
}

.confirm-warning-actions {
  display: flex;
  gap: 0.85rem;
  justify-content: center;
}

.confirm-warning-actions .btn {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-icon-danger {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  border-radius: 6px;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-icon-danger:hover {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border-color: rgba(244, 63, 94, 0.35);
}

/* =================================================================== */
/* GLOBAL UTILITIES & SUPABASE AUTHENTICATION SYSTEM */
/* =================================================================== */

/* Universal Hidden Utility - strictly enforce across all components */
.hidden {
  display: none !important;
}

.user-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.3rem 0.65rem 0.3rem 0.35rem;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.user-profile-chip.hidden {
  display: none !important;
}

.user-profile-chip:hover {
  border-color: rgba(0, 242, 254, 0.35);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #030712;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.user-email {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f8fafc;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38bdf8;
  font-weight: 700;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.15);
}

/* Auth Modal Overlay */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.2s ease-out;
}

.auth-modal-overlay.hidden {
  display: none !important;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.98), rgba(11, 16, 30, 0.99));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 2.25rem 2rem 2rem 2rem;
  box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.9), 0 0 50px rgba(0, 242, 254, 0.12);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.auth-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  transform: rotate(90deg);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(59, 130, 246, 0.15));
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: #00f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.85rem auto;
  box-shadow: 0 0 30px rgba(0, 242, 254, 0.25);
}

.auth-brand-icon svg {
  width: 26px;
  height: 26px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: rgba(10, 15, 29, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 1.35rem;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.auth-tab-btn:hover {
  color: #fff;
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.16), rgba(59, 130, 246, 0.16));
  color: #00f2fe;
  border-color: rgba(0, 242, 254, 0.35);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  font-weight: 700;
}

/* Forms - strictly controlled display */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  width: 100%;
}

.auth-form.hidden {
  display: none !important;
}

.auth-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.auth-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.01em;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 0.95rem;
  color: #64748b;
  pointer-events: none;
  transition: color 0.2s ease;
  z-index: 2;
}

.crm-input.with-icon {
  padding-left: 2.75rem;
  height: 44px;
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  color: #fff;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.crm-input.with-icon:focus {
  outline: none;
  border-color: #00f2fe;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
  background: rgba(15, 23, 42, 0.95);
}

.crm-input.with-icon:focus + .input-icon,
.input-icon-wrapper:focus-within .input-icon {
  color: #00f2fe;
}

.auth-submit-btn {
  margin-top: 0.5rem;
  height: 46px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 11px;
  background: linear-gradient(135deg, #00f2fe 0%, #3b82f6 100%);
  color: #030712;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 242, 254, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 242, 254, 0.5);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Alert Box */
.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 1.15rem;
  line-height: 1.4;
  text-align: left;
}

.auth-alert.hidden {
  display: none !important;
}

.auth-alert.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

/* Collapsible Config Toggle & Notice */
.auth-config-toggle-row {
  margin-top: 1.15rem;
  text-align: center;
}

.btn-config-toggle {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-config-toggle:hover {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
}

.auth-config-notice {
  margin-top: 0.85rem;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 12px;
  padding: 0.95rem;
  text-align: left;
}

.auth-config-notice.hidden {
  display: none !important;
}

.config-notice-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 0.35rem;
}

.config-notice-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.65rem;
}

.config-notice-desc code {
  color: #fde68a;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.config-input-group {
  display: flex;
  gap: 0.45rem;
}

.config-key-input {
  font-size: 0.78rem;
  padding: 0.45rem 0.75rem;
  height: 36px;
  flex: 1;
}

/* Footer link */
.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
}

.btn-text-muted {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 0.8rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.btn-text-muted:hover {
  color: #94a3b8;
  text-decoration: underline;
}


/* =================================================================== */
/* SUPABASE AUTHENTICATION & USER PROFILE STYLES */
/* =================================================================== */
.user-profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 0.3rem 0.65rem 0.3rem 0.35rem;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
}

.user-profile-chip:hover {
  border-color: rgba(0, 242, 254, 0.35);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.1);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00f2fe 0%, #4facfe 100%);
  color: #030712;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.3);
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: left;
}

.user-email {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f8fafc;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #38bdf8;
  font-weight: 700;
}

.btn-logout {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  color: #fb7185;
  background: rgba(244, 63, 94, 0.15);
}

/* Auth Modal Overlay */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(20px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.25s ease-out;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 50px rgba(0, 242, 254, 0.1);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.2), rgba(79, 172, 254, 0.2));
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: #00f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.25);
}

.auth-brand-icon svg {
  width: 28px;
  height: 28px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.auth-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
  gap: 0.25rem;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.75rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.15), rgba(79, 172, 254, 0.15));
  color: #00f2fe;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  font-weight: 700;
}

.auth-alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
  text-align: left;
}

.auth-alert.error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

.auth-alert.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-dim);
  pointer-events: none;
  transition: color 0.2s ease;
}

.crm-input.with-icon {
  padding-left: 2.75rem;
}

.crm-input.with-icon:focus + .input-icon,
.input-icon-wrapper:focus-within .input-icon {
  color: #00f2fe;
}

.auth-submit-btn {
  margin-top: 1.5rem;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-config-notice {
  margin-top: 1.25rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 12px;
  padding: 1rem;
  text-align: left;
}

.config-notice-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fbbf24;
  margin-bottom: 0.35rem;
}

.config-notice-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.65rem;
}

.config-notice-desc code {
  color: #fde68a;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.config-input-group {
  display: flex;
  gap: 0.5rem;
}

.config-key-input {
  font-size: 0.75rem;
  padding: 0.45rem 0.65rem;
}

.auth-footer {
  margin-top: 1.5rem;
  text-align: center;
}

.btn-text-muted {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-text-muted:hover {
  color: var(--text-muted);
  text-decoration: underline;
}

