/* ============================================================
   LINKLADDER — PREMIUM SEO SUITE
   Complete UI Redesign 2026
   ============================================================ */

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

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* Background Layers */
  --bg-root:        #f3f4f6;
  --bg-surface:     #ffffff;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f8fafc;
  --bg-glass:       rgba(255, 255, 255, 0.85);
  --bg-glass-hover: rgba(255, 255, 255, 0.95);
  --bg-input:       #f8fafc;

  /* Brand Colors */
  --blue:           #3b82f6;
  --blue-bright:    #2563eb;
  --blue-dim:       rgba(59, 130, 246, 0.1);
  --violet:         #8b5cf6;
  --violet-bright:  #7c3aed;
  --violet-dim:     rgba(139, 92, 246, 0.1);
  --cyan:           #06b6d4;
  --cyan-dim:       rgba(6, 182, 212, 0.1);
  --emerald:        #10b981;
  --emerald-dim:    rgba(16, 185, 129, 0.1);
  --amber:          #f59e0b;
  --amber-dim:      rgba(245, 158, 11, 0.1);
  --rose:           #f43f5e;
  --rose-dim:       rgba(244, 63, 94, 0.1);

  /* Gradients */
  --grad-primary:   linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --grad-success:   linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
  --grad-danger:    linear-gradient(135deg, #f43f5e 0%, #f97316 100%);
  --grad-warm:      linear-gradient(135deg, #f59e0b 0%, #f43f5e 100%);
  --grad-glow:      linear-gradient(135deg, rgba(59,130,246,0.05) 0%, rgba(139,92,246,0.05) 100%);

  /* Text */
  --text-primary:   #1e293b;
  --text-secondary: #64748b;
  --text-muted:     #94a3b8;
  --text-accent:    #2563eb;

  /* Borders */
  --border:         #e2e8f0;
  --border-hover:   #cbd5e1;
  --border-focus:   #94a3b8;

  /* Shadows */
  --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:      0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.05);
  --shadow-glow:    0 0 20px rgba(59, 130, 246, 0.1);
  --shadow-violet:  0 0 20px rgba(139, 92, 246, 0.1);

  /* Spacing */
  --sidebar-w: 260px;
  --header-h:  64px;

  /* Radii */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 28px;

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --t-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   BASE RESET
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-root);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Ambient background effect */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(79, 142, 255, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(ellipse, rgba(168, 85, 247, 0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.15); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: fixed;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

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

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--grad-primary);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(79, 142, 255, 0.4);
}
.logo-icon svg { color: white; }

.logo-text { display: flex; flex-direction: column; gap: 1px; }

.logo-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.logo-subtitle {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
}

/* Domain Badge */
.domain-badge {
  margin: 12px 16px;
  background: var(--blue-dim);
  border: 1px solid rgba(79, 142, 255, 0.2);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--t-smooth);
}

.domain-dot {
  width: 7px;
  height: 7px;
  background: var(--emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--emerald);
  flex-shrink: 0;
  animation: pulse-dot 2.5s ease-in-out infinite;
}

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

.domain-info { display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.domain-label { font-size: 9px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.domain-name { font-size: 12px; font-weight: 600; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Nav */
.nav-menu {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-section-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  padding: 12px 8px 4px;
}

.nav-item {
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 9px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: var(--t-smooth);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.nav-item svg {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: var(--t-smooth);
}

.nav-item:hover {
  background: rgba(0,0,0, 0.04);
  color: var(--text-primary);
  border-color: var(--border);
}

.nav-item:hover svg { color: var(--blue); }

.nav-item.active {
  background: var(--blue-dim);
  color: var(--blue-bright);
  border-color: rgba(79, 142, 255, 0.25);
}

.nav-item.active svg { color: var(--blue-bright); }

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 25%; bottom: 25%;
  width: 3px;
  background: var(--grad-primary);
  border-radius: 0 4px 4px 0;
}

.nav-item.nav-pro {
  border-color: rgba(168, 85, 247, 0.15);
}
.nav-item.nav-pro:hover, .nav-item.nav-pro.active {
  background: var(--violet-dim);
  color: var(--violet-bright);
  border-color: rgba(168, 85, 247, 0.3);
}
.nav-item.nav-pro:hover svg, .nav-item.nav-pro.active svg {
  color: var(--violet-bright);
}
.nav-item.nav-pro.active::before {
  background: linear-gradient(to bottom, var(--violet), var(--violet-bright));
}

.nav-item.nav-ai {
  background: linear-gradient(135deg, rgba(168,85,247,0.08), rgba(79,142,255,0.08));
  border-color: rgba(168, 85, 247, 0.2);
  color: var(--violet-bright);
}
.nav-item.nav-ai svg { color: var(--violet-bright); }
.nav-item.nav-ai:hover { background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(79,142,255,0.15)); }

.nav-badge {
  margin-left: auto;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.nav-badge.pro-badge {
  background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(79,142,255,0.25));
  color: var(--violet-bright);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.nav-badge.ai-badge {
  background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(79,142,255,0.3));
  color: var(--violet-bright);
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.server-status-label { display: flex; align-items: center; gap: 5px; }
.status-online { color: var(--emerald); font-weight: 600; }
.status-offline { color: var(--rose); font-weight: 600; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 6, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 20px;
}

.header-left { display: flex; flex-direction: column; gap: 1px; }

.main-header h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

#view-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

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

.agency-badge {
  background: linear-gradient(135deg, rgba(168,85,247,0.2), rgba(79,142,255,0.2));
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: var(--violet-bright);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* Page Content */
.page-content {
  padding: 28px 32px;
  flex: 1;
}

/* ============================================================
   CONTENT VIEWS
   ============================================================ */
.content-view {
  display: none;
  animation: fadeSlide 0.3s ease;
}

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

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

/* ============================================================
   GLASS CARDS
   ============================================================ */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  transition: var(--t-smooth);
}

.glass-panel:hover {
  border-color: rgba(0,0,0,0.1);
  box-shadow: var(--shadow-md);
}

/* Hero/Highlight panel */
.highlight-panel {
  background: linear-gradient(135deg, rgba(79,142,255,0.06) 0%, rgba(168,85,247,0.06) 100%);
  border: 1px solid rgba(79, 142, 255, 0.15);
  position: relative;
  overflow: hidden;
}

.highlight-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--grad-primary);
  opacity: 0.4;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

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

/* ============================================================
   STAT CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  transition: var(--t-smooth);
  position: relative;
  overflow: hidden;
  cursor: default;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 60px; height: 60px;
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0;
  transition: var(--t-smooth);
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,0,0,0.1);
  box-shadow: var(--shadow-md);
}

.stat-card:hover::after { opacity: 0.3; }

.stat-card.card-blue::after  { background: var(--blue);    top: -10px; right: -10px; }
.stat-card.card-green::after { background: var(--emerald); top: -10px; right: -10px; }
.stat-card.card-violet::after{ background: var(--violet);  top: -10px; right: -10px; }
.stat-card.card-amber::after { background: var(--amber);   top: -10px; right: -10px; }
.stat-card.card-cyan::after  { background: var(--cyan);    top: -10px; right: -10px; }

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

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

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

.stat-icon.blue   { background: var(--blue-dim);    color: var(--blue); }
.stat-icon.green  { background: var(--emerald-dim); color: var(--emerald); }
.stat-icon.violet { background: var(--violet-dim);  color: var(--violet-bright); }
.stat-icon.amber  { background: var(--amber-dim);   color: var(--amber); }
.stat-icon.cyan   { background: var(--cyan-dim);    color: var(--cyan); }
.stat-icon.rose   { background: var(--rose-dim);    color: var(--rose); }

.stat-value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 4px;
  line-height: 1;
}

.stat-trend {
  font-size: 11px;
  color: var(--text-muted);
}

.text-primary  { color: var(--blue)!important; }
.text-success  { color: var(--emerald)!important; }
.text-danger   { color: var(--rose)!important; }
.text-warning  { color: var(--amber)!important; }
.text-violet   { color: var(--violet-bright)!important; }
.text-cyan     { color: var(--cyan)!important; }
.text-muted    { color: var(--text-secondary)!important; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: none;
  cursor: pointer;
  transition: var(--t-smooth);
  outline: none;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: var(--t-fast);
}

.btn:hover::after { opacity: 0.06; }
.btn:active::after { opacity: 0.12; }

/* Primary */
.btn-primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 2px 12px rgba(79, 142, 255, 0.35);
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(79, 142, 255, 0.5); transform: translateY(-1px); }

/* Gradient */
.btn-gradient {
  background: var(--grad-primary);
  color: white;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}
.btn-gradient:hover { box-shadow: 0 6px 24px rgba(168, 85, 247, 0.5); transform: translateY(-1px); }

/* Secondary */
.btn-secondary {
  background: rgba(0,0,0,0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(0,0,0,0.1); border-color: rgba(0,0,0,0.12); }

/* Outline */
.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { color: var(--text-primary); border-color: rgba(0,0,0,0.2); background: rgba(0,0,0,0.04); }

/* Danger */
.btn-danger {
  background: rgba(244, 63, 94, 0.1);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.18); }

/* Success */
.btn-success {
  background: var(--emerald-dim);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Sizes */
.btn-sm { font-size: 11px; padding: 5px 12px; }
.btn-lg { font-size: 15px; padding: 13px 28px; }
.btn-block { width: 100%; }

/* Spinner */
.btn-spinner {
  width: 13px; height: 13px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.btn-spinner.hidden { display: none; }

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

/* ============================================================
   FORM CONTROLS
   ============================================================ */
.clean-form { display: flex; flex-direction: column; gap: 16px; }

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

.form-group label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.form-control {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  padding: 11px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
  transition: var(--t-smooth);
  width: 100%;
}

.form-control:hover { border-color: rgba(0,0,0,0.12); }

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 142, 255, 0.12);
  background: var(--bg-surface);
}

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

textarea.form-control { resize: vertical; min-height: 90px; line-height: 1.6; }

select.form-control option { background: var(--bg-card); color: var(--text-primary); }

/* ============================================================
   TOOLBAR
   ============================================================ */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Filter Tabs */
.filter-group { display: flex; gap: 4px; flex-wrap: wrap; }

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--t-smooth);
}
.filter-btn:hover { border-color: rgba(0,0,0,0.15); color: var(--text-primary); }
.filter-btn.active {
  background: var(--blue-dim);
  border-color: rgba(79,142,255,0.35);
  color: var(--blue-bright);
  font-weight: 600;
}

/* ============================================================
   DATA TABLES
   ============================================================ */
.table-panel { padding: 4px 0; }

.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--r-lg);
}

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

.data-table thead tr {
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

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

.data-table tbody tr {
  transition: var(--t-fast);
}
.data-table tbody tr:hover td {
  background: rgba(0,0,0,0.02);
}

.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-blue   { background: var(--blue-dim);    color: var(--blue-bright); border: 1px solid rgba(79,142,255,0.25); }
.badge-violet { background: var(--violet-dim);  color: var(--violet-bright); border: 1px solid rgba(168,85,247,0.25); }
.badge-da     { background: var(--violet-dim);  color: var(--violet-bright); border: 1px solid rgba(168,85,247,0.3); }
.badge-easy   { background: var(--emerald-dim); color: var(--emerald); border: 1px solid rgba(16,185,129,0.3); }
.badge-medium { background: var(--amber-dim);   color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
.badge-hard   { background: var(--rose-dim);    color: var(--rose); border: 1px solid rgba(244,63,94,0.3); }
.badge-cyan   { background: var(--cyan-dim);    color: var(--cyan); border: 1px solid rgba(6,182,212,0.3); }

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-status.live       { background: var(--emerald-dim); color: var(--emerald); border: 1px solid rgba(16,185,129,0.3); }
.badge-status.failed     { background: var(--rose-dim);    color: var(--rose);    border: 1px solid rgba(244,63,94,0.3); }
.badge-status.pending    { background: var(--amber-dim);   color: var(--amber);   border: 1px solid rgba(245,158,11,0.3); }
.badge-status.not-started{ background: rgba(0,0,0,0.04); color: var(--text-muted); border: 1px solid var(--border); }
.badge-status.pitched    { background: var(--blue-dim);    color: var(--blue-bright); border: 1px solid rgba(79,142,255,0.3); }
.badge-status.followed-up{ background: var(--cyan-dim);    color: var(--cyan);    border: 1px solid rgba(6,182,212,0.3); }
.badge-status.replied    { background: var(--violet-dim);  color: var(--violet-bright); border: 1px solid rgba(168,85,247,0.3); }
.badge-status.link-live  { background: var(--emerald-dim); color: var(--emerald); border: 1px solid rgba(16,185,129,0.3); }
.badge-status.rejected   { background: var(--rose-dim);    color: var(--rose);    border: 1px solid rgba(244,63,94,0.3); }

/* Intent Badges */
.intent-info { background: var(--blue-dim);    color: var(--blue-bright);  border: 1px solid rgba(79,142,255,0.3);  }
.intent-nav  { background: var(--violet-dim);  color: var(--violet-bright); border: 1px solid rgba(168,85,247,0.3); }
.intent-com  { background: var(--amber-dim);   color: var(--amber);        border: 1px solid rgba(245,158,11,0.3); }
.intent-tx   { background: var(--emerald-dim); color: var(--emerald);      border: 1px solid rgba(16,185,129,0.3); }

/* KD Markers */
.kd-marker {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
}
.kd-easy   { background: var(--emerald); box-shadow: 0 0 6px var(--emerald); }
.kd-medium { background: var(--amber);   box-shadow: 0 0 6px var(--amber); }
.kd-hard   { background: var(--rose);    box-shadow: 0 0 6px var(--rose); }

/* ============================================================
   SPARKLINES
   ============================================================ */
.sparkline-container {
  display: flex;
  align-items: flex-end;
  height: 22px;
  gap: 1.5px;
}
.sparkline-bar {
  width: 3px;
  background: var(--blue);
  border-radius: 2px 2px 0 0;
  opacity: 0.7;
  transition: var(--t-fast);
}
.sparkline-bar:hover { opacity: 1; }

/* ============================================================
   PIPELINE KANBAN
   ============================================================ */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  min-height: 400px;
}

.pipeline-col {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pipeline-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.col-count {
  background: rgba(0,0,0,0.08);
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-primary);
}

.pipeline-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
}

.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  cursor: pointer;
  transition: var(--t-smooth);
}

.campaign-card:hover {
  border-color: rgba(79,142,255,0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.cc-site { font-weight: 700; font-size: 13px; margin-bottom: 3px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-type { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.cc-footer { display: flex; justify-content: space-between; align-items: center; font-size: 11px; }

/* ============================================================
   DASHBOARD GRID
   ============================================================ */
.dashboard-layout-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 1280px) {
  .dashboard-layout-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .dashboard-layout-grid { grid-template-columns: 1fr; }
  .pipeline-board { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   WIZARD
   ============================================================ */
.wizard-container { max-width: 700px; margin: 0 auto; }

.wizard-stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 36px;
  position: relative;
  padding: 0 20px;
}

.wizard-stepper::before {
  content: '';
  position: absolute;
  top: 16px; left: 60px; right: 60px;
  height: 1px;
  background: var(--border);
}

.step-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.step-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--text-muted);
  transition: var(--t-smooth);
}

.step-item.active .step-circle {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 0 4px rgba(79,142,255,0.12);
}

.step-item.completed .step-circle {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.step-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.step-item.active .step-label { color: var(--text-primary); }
.step-item.completed .step-label { color: var(--blue); }

.wizard-step-content { display: none; animation: fadeSlide 0.3s ease; }
.wizard-step-content.active { display: block; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 3, 10, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: var(--t-smooth);
}

.modal-overlay.hidden { opacity: 0; pointer-events: none; }

.modal-content {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--r-2xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  transform: scale(1);
  transition: var(--t-smooth);
}

.modal-overlay.hidden .modal-content { transform: scale(0.96); }

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

.modal-close {
  background: rgba(0,0,0,0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--t-smooth);
}
.modal-close:hover { color: var(--text-primary); background: rgba(0,0,0,0.1); }

/* ============================================================
   EMAIL PREVIEW
   ============================================================ */
.email-preview-box {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  margin: 14px 0;
}

.email-preview-subject {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.email-preview-body {
  white-space: pre-wrap;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ============================================================
   FUNNEL
   ============================================================ */
.funnel-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  padding: 16px 0;
}

.funnel-stage {
  background: var(--grad-primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--r-md);
}

.funnel-stage:nth-child(1) { width: 100%; opacity: 1; }
.funnel-stage:nth-child(2) { width: 82%; opacity: 0.82; }
.funnel-stage:nth-child(3) { width: 64%; opacity: 0.64; }
.funnel-stage:nth-child(4) { width: 46%; opacity: 0.46; }

/* ============================================================
   GRIDS
   ============================================================ */
.grid-layout-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.grid-layout-1-1 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

@media (max-width: 768px) {
  .grid-layout-2-1, .grid-layout-1-1 { grid-template-columns: 1fr; }
}

/* ============================================================
   TOASTS
   ============================================================ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards, fadeOut 0.3s ease 4.7s forwards;
  min-width: 280px;
  font-size: 13px;
  font-weight: 500;
}

.toast.success { border-left: 3px solid var(--emerald); }
.toast.error   { border-left: 3px solid var(--rose); }
.toast.info    { border-left: 3px solid var(--blue); }

@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ============================================================
   HIDDEN / UTILS
   ============================================================ */
.hidden { display: none !important; }

/* ============================================================
   SECTION DIVIDER
   ============================================================ */
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   RANK TRACKER MODULE
   ============================================================ */

/* Tab bar */
.rank-tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-root);
  border-radius: var(--r-lg);
  padding: 4px;
  margin-bottom: 24px;
  width: fit-content;
  border: 1px solid var(--border);
}
.rank-tab {
  padding: 8px 20px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--t-smooth);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.rank-tab:hover { color: var(--text-primary); background: var(--bg-surface); }
.rank-tab.active {
  background: var(--bg-surface);
  color: var(--blue);
  box-shadow: var(--shadow-md);
}
.rank-tab-panel { display: none; }
.rank-tab-panel.active { display: block; }

/* Period pills */
.period-pill-group {
  display: flex;
  gap: 4px;
  background: var(--bg-root);
  border-radius: var(--r-md);
  padding: 3px;
  border: 1px solid var(--border);
}
.period-pill {
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--t-fast);
}
.period-pill.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.period-pill:hover:not(.active) { color: var(--text-primary); }

/* Rank stats row */
.rank-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.rank-stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: box-shadow var(--t-smooth), border-color var(--t-smooth);
}
.rank-stat-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.rank-stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }
.rank-stat-value { font-size: 26px; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.rank-stat-sub { font-size: 11px; color: var(--text-secondary); }

/* Position badge */
.pos-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 24px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}
.pos-badge.top1-3   { background: linear-gradient(135deg,#10b981,#06b6d4); color:#fff; }
.pos-badge.top4-10  { background: var(--emerald-dim); color: var(--emerald); }
.pos-badge.top11-30 { background: var(--blue-dim); color: var(--blue); }
.pos-badge.top31-50 { background: var(--amber-dim); color: var(--amber); }
.pos-badge.top51    { background: var(--rose-dim); color: var(--rose); }
.pos-badge.untracked { background: #f1f5f9; color: var(--text-muted); }

/* Position change indicator */
.pos-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
}
.pos-change.up   { color: var(--emerald); }
.pos-change.down { color: var(--rose); }
.pos-change.flat { color: var(--text-muted); }

/* Sparkline cell */
.sparkline-cell { width: 80px; height: 28px; }

/* Add keyword form */
.rank-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 20px;
}
@media (max-width: 900px) {
  .rank-add-form { grid-template-columns: 1fr 1fr; }
  .rank-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* Suggestion cards */
.suggestion-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.suggestion-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--t-smooth);
  cursor: default;
}
.suggestion-card:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-dim), var(--shadow-md);
  transform: translateY(-1px);
}
.suggestion-card-keyword {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}
.suggestion-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.intent-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.intent-info { background: var(--blue-dim); color: var(--blue); }
.intent-transact { background: var(--emerald-dim); color: var(--emerald); }
.intent-commercial { background: var(--violet-dim); color: var(--violet); }
.intent-navigational { background: var(--amber-dim); color: var(--amber); }
.diff-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-secondary);
}
.diff-bar {
  flex: 1;
  height: 5px;
  background: var(--bg-root);
  border-radius: 3px;
  overflow: hidden;
}
.diff-bar-fill {
  height: 100%;
  border-radius: 3px;
}
.diff-easy   { background: var(--emerald); }
.diff-medium { background: var(--amber); }
.diff-hard   { background: var(--rose); }
.vol-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-root);
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

/* SEO Guide */
.seo-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
.seo-guide-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--t-smooth), border-color var(--t-smooth);
}
.seo-guide-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-lg); }
.seo-guide-card-header {
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.seo-guide-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.seo-guide-title { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.seo-guide-subtitle { font-size: 11px; color: var(--text-secondary); }
.seo-guide-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.seo-guide-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.step-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--bg-root);
  border: 1.5px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  flex-shrink: 0;
  margin-top: 1px;
}
.step-content { flex: 1; }
.step-action { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.step-detail { font-size: 11px; color: var(--text-secondary); line-height: 1.5; margin-top: 2px; }
.priority-chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
  vertical-align: middle;
}
.prio-critical { background: var(--rose-dim); color: var(--rose); }
.prio-high     { background: var(--amber-dim); color: var(--amber); }
.prio-medium   { background: var(--blue-dim); color: var(--blue); }
.prio-low      { background: var(--emerald-dim); color: var(--emerald); }

/* Check animation */
@keyframes rank-pulse {
  0%,100% { opacity:1; }
  50% { opacity:0.4; }
}
.checking-row td { animation: rank-pulse 1.4s ease-in-out infinite; }

/* Rank tracker table tweaks */
.rank-table-wrap { overflow-x: auto; }
.rank-table .keyword-col { max-width: 220px; font-weight: 600; }
.rank-table td { vertical-align: middle; }

/* Suggestion niche form */
.suggestion-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 4px;
}
.suggestion-input-row .form-control { flex: 1; }

/* Empty state */
.rank-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.rank-empty-state svg { opacity: 0.3; }
.rank-empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text-secondary); }
.rank-empty-state p { font-size: 13px; max-width: 320px; }
