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

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* Core palette */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-solid: #151d2e;
  --bg-input: rgba(15, 23, 42, 0.8);
  --bg-hover: rgba(99, 102, 241, 0.08);
  --bg-table-row: rgba(17, 24, 39, 0.5);
  --bg-table-row-alt: rgba(30, 41, 59, 0.35);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-accent: #a78bfa;

  /* Borders */
  --border-subtle: rgba(148, 163, 184, 0.08);
  --border-default: rgba(148, 163, 184, 0.12);
  --border-focus: rgba(139, 92, 246, 0.5);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --gradient-header: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --gradient-card: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.02) 100%);
  --gradient-glow: radial-gradient(ellipse at 50% 0%, rgba(139, 92, 246, 0.15) 0%, transparent 60%);

  /* Tool accent colors */
  --ahrefs-color: #ff8c00;
  --ahrefs-bg: rgba(255, 140, 0, 0.08);
  --ahrefs-border: rgba(255, 140, 0, 0.2);

  --ed-color: #06b6d4;
  --ed-bg: rgba(6, 182, 212, 0.08);
  --ed-border: rgba(6, 182, 212, 0.2);

  --moz-color: #3b82f6;
  --moz-bg: rgba(59, 130, 246, 0.08);
  --moz-border: rgba(59, 130, 246, 0.2);

  --majestic-color: #10b981;
  --majestic-bg: rgba(16, 185, 129, 0.08);
  --majestic-border: rgba(16, 185, 129, 0.2);

  /* Status colors */
  --color-buy: #10b981;
  --color-buy-bg: rgba(16, 185, 129, 0.12);
  --color-good: #6366f1;
  --color-good-bg: rgba(99, 102, 241, 0.12);
  --color-maybe: #f59e0b;
  --color-maybe-bg: rgba(245, 158, 11, 0.12);
  --color-reject: #ef4444;
  --color-reject-bg: rgba(239, 68, 68, 0.12);
  --color-excellent: #06b6d4;
  --color-excellent-bg: rgba(6, 182, 212, 0.12);
  --color-analyzed: #8b5cf6;
  --color-analyzed-bg: rgba(139, 92, 246, 0.12);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.1);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Animated background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 50% 50%, rgba(6, 182, 212, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.25); }

/* ===== LAYOUT ===== */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 1900px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* ===== HEADER ===== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: var(--gradient-header);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  margin-bottom: 18px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

.app-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.4), rgba(99, 102, 241, 0.4), transparent);
}

.header-left { display: flex; align-items: center; gap: 14px; }

.header-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.header-title h1 {
  font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(135deg, #f1f5f9 0%, #a78bfa 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.header-title p { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.header-actions { display: flex; gap: 10px; align-items: center; }

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  position: relative; overflow: hidden;
  transition: var(--transition-base);
  transition-property: transform, box-shadow, border-color;
}

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

.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; border-radius: 3px 3px 0 0;
}

.stat-card.total::before { background: var(--gradient-primary); }
.stat-card.analyzed::before { background: linear-gradient(90deg, #8b5cf6, #c084fc); }
.stat-card.excellent::before { background: linear-gradient(90deg, #06b6d4, #22d3ee); }
.stat-card.strong::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card.maybe::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.reject::before { background: linear-gradient(90deg, #ef4444, #f87171); }

.stat-label {
  font-size: 0.7rem; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}

.stat-value {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em;
  font-family: 'JetBrains Mono', monospace;
}

.stat-card.total .stat-value { color: var(--text-accent); }
.stat-card.analyzed .stat-value { color: #c084fc; font-size: 1.4rem; }
.stat-card.excellent .stat-value { color: var(--color-excellent); }
.stat-card.strong .stat-value { color: var(--color-buy); }
.stat-card.maybe .stat-value { color: var(--color-maybe); }
.stat-card.reject .stat-value { color: var(--color-reject); }

/* ===== IMPORT SECTION ===== */
.import-section {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  position: relative; overflow: hidden;
  transition: var(--transition-base);
}

.import-section::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

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

.import-section-header-left { display: flex; align-items: center; gap: 10px; }

.import-section-header-left .icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}

.import-section-header h2 { font-size: 1rem; font-weight: 700; }
.import-section-header p { font-size: 0.76rem; color: var(--text-secondary); margin-top: 2px; }

.import-section-body { padding: 18px 20px; }
.import-section.collapsed .import-section-body { display: none; }

/* ===== UPLOAD CARDS GRID ===== */
.upload-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.upload-card {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  position: relative;
  transition: var(--transition-base);
  cursor: pointer;
  background: var(--bg-input);
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.upload-card:hover {
  border-color: var(--border-default);
  background: rgba(15, 23, 42, 0.9);
  transform: translateY(-2px);
}

.upload-card.ahrefs:hover, .upload-card.ahrefs.loaded { border-color: var(--ahrefs-color); }
.upload-card.expireddomains:hover, .upload-card.expireddomains.loaded { border-color: var(--ed-color); }
.upload-card.moz:hover, .upload-card.moz.loaded { border-color: var(--moz-color); }
.upload-card.majestic:hover, .upload-card.majestic.loaded { border-color: var(--majestic-color); }

.upload-card.loaded {
  border-style: solid;
  background: rgba(15, 23, 42, 0.6);
}

.upload-card.drag-over {
  border-color: var(--text-accent) !important;
  background: rgba(99, 102, 241, 0.06) !important;
  transform: translateY(-2px) scale(1.01);
}

.upload-card .tool-icon {
  font-size: 24px;
  margin-bottom: 2px;
}

.upload-card .tool-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.upload-card .tool-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.upload-card .tool-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-top: 3px;
  padding: 2px 9px;
  border-radius: 20px;
}

.upload-card.ahrefs .tool-status { color: var(--ahrefs-color); background: var(--ahrefs-bg); }
.upload-card.expireddomains .tool-status { color: var(--ed-color); background: var(--ed-bg); }
.upload-card.moz .tool-status { color: var(--moz-color); background: var(--moz-bg); }
.upload-card.majestic .tool-status { color: var(--majestic-color); background: var(--majestic-bg); }

.upload-card .tool-status .check { font-size: 0.82rem; }

.upload-card .upload-actions {
  display: flex;
  gap: 5px;
  margin-top: 3px;
}

.upload-card .upload-actions button {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-default);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: var(--transition-fast);
}

.upload-card .upload-actions button:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.upload-card .upload-actions button.remove-btn:hover {
  color: var(--color-reject);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ===== UNIVERSAL PASTE AREA ===== */
.universal-paste {
  margin-top: 2px;
}

.universal-paste-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.universal-paste-label .divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.paste-area {
  width: 100%;
  min-height: 95px;
  max-height: 220px;
  background: var(--bg-input);
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-primary);
  resize: vertical;
  transition: var(--transition-base);
  outline: none;
}

.paste-area::placeholder {
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
}

.paste-area:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  background: rgba(15, 23, 42, 0.95);
}

.paste-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.paste-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.paste-hint kbd {
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.67rem;
}

/* ===== IMPORT STATUS BAR ===== */
.import-status-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 20px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.3);
  font-size: 0.74rem;
  flex-wrap: wrap;
}

.import-status-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  color: var(--text-secondary);
  font-weight: 500;
  border-right: 1px solid var(--border-subtle);
}

.import-status-item:last-child { border-right: none; }

.import-status-item .status-count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
}

.import-status-item.ahrefs .status-count { color: var(--ahrefs-color); }
.import-status-item.expireddomains .status-count { color: var(--ed-color); }
.import-status-item.moz .status-count { color: var(--moz-color); }
.import-status-item.majestic .status-count { color: var(--majestic-color); }
.import-status-item.matched .status-count { color: var(--text-accent); }
.import-status-item.total .status-count { color: var(--text-primary); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.45);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-reject);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
}

.btn-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-buy);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.35);
}

.btn .icon { font-size: 0.92rem; }

/* Save status indicator */
#btn-save-indicator {
  font-size: 0.74rem;
  padding: 5px 10px;
  border-color: rgba(16, 185, 129, 0.3);
  color: #34d399;
  background: rgba(16, 185, 129, 0.08);
  cursor: default;
}

/* ===== ADD DOMAIN BAR ===== */
.add-domain-bar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.add-domain-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  outline: none;
  width: 180px;
  transition: var(--transition-fast);
}

.add-domain-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.12);
}

.add-domain-input::placeholder {
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-size: 0.74rem;
}

.btn-add-domain {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-buy);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.btn-add-domain:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

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

.btn-add-domain .icon {
  font-size: 0.95rem;
  font-weight: 800;
}

/* ===== TABLE SECTION ===== */
.table-section {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}

.table-section::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
  z-index: 1;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 10px;
}

.table-toolbar-left { display: flex; align-items: center; gap: 8px; }
.table-toolbar-center { display: flex; align-items: center; }

.table-toolbar h3 { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }

.domain-count-badge {
  background: rgba(99, 102, 241, 0.1);
  color: var(--text-accent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
}

.table-toolbar-right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.filter-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
  border: 1px solid var(--border-default);
  background: transparent; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition-fast);
  font-family: 'Inter', sans-serif;
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--border-focus);
  color: var(--text-accent);
  background: rgba(99, 102, 241, 0.06);
}

.filter-btn .dot { width: 6px; height: 6px; border-radius: 50%; }
.filter-btn .dot.green { background: var(--color-buy); }
.filter-btn .dot.blue { background: var(--color-good); }
.filter-btn .dot.amber { background: var(--color-maybe); }
.filter-btn .dot.red { background: var(--color-reject); }
.filter-btn .dot.purple { background: #a78bfa; }
.filter-btn .dot.cyan { background: #06b6d4; }

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; overflow-y: auto; max-height: 74vh; }

.domain-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}

.domain-table thead { position: sticky; top: 0; z-index: 10; }

.domain-table thead th {
  background: rgba(15, 23, 42, 0.97);
  backdrop-filter: blur(8px);
  padding: 9px 6px;
  font-size: 0.66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary);
  text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border-default);
  cursor: pointer; transition: var(--transition-fast);
  user-select: none; position: relative;
}

.domain-table thead th:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.06);
}

.domain-table thead th.sorted-asc::after,
.domain-table thead th.sorted-desc::after {
  content: ''; display: inline-block; margin-left: 4px;
  width: 0; height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  vertical-align: middle;
}

.domain-table thead th.sorted-asc::after { border-bottom: 4px solid var(--text-accent); }
.domain-table thead th.sorted-desc::after { border-top: 4px solid var(--text-accent); }

/* Column group headers */
.domain-table thead tr.group-header th {
  font-size: 0.63rem; padding: 4px 6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  cursor: default;
}

.domain-table thead tr.group-header th:hover {
  background: rgba(15, 23, 42, 0.97); color: var(--text-muted);
}

.col-group-metrics { color: var(--ed-color) !important; }
.col-group-metrics .col-group-sub { color: var(--text-muted); font-weight: 400; font-style: italic; }
.col-group-manual { color: #a78bfa !important; }
.col-group-scores { color: #22d3ee !important; }
.col-group-result { color: #10b981 !important; }

.domain-table tbody tr { transition: background var(--transition-fast); }
.domain-table tbody tr:nth-child(odd) { background: var(--bg-table-row); }
.domain-table tbody tr:nth-child(even) { background: var(--bg-table-row-alt); }
.domain-table tbody tr:hover { background: var(--bg-hover); }

/* Analyzed row styling */
.domain-table tbody tr.row-analyzed {
  border-left: 3px solid #10b981;
}

.domain-table tbody td {
  padding: 5px 4px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap; vertical-align: middle;
}

/* Rank Badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border-subtle);
}

.rank-badge.top-1 {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(245, 158, 11, 0.2));
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}

.rank-badge.top-2 {
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.2), rgba(148, 163, 184, 0.15));
  color: #e2e8f0;
  border-color: rgba(226, 232, 240, 0.35);
}

.rank-badge.top-3 {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(217, 119, 6, 0.15));
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.35);
}

/* Checkpoint checkbox */
.checkpoint-cell {
  text-align: center;
  padding: 3px 2px !important;
}

.checkpoint-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1.5px solid var(--border-default);
  background: rgba(15, 23, 42, 0.6);
  color: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transition: var(--transition-fast);
}

.checkpoint-btn:hover {
  border-color: #a78bfa;
  background: rgba(139, 92, 246, 0.1);
  color: rgba(167, 139, 250, 0.5);
}

.checkpoint-btn.checked {
  background: #10b981;
  border-color: #10b981;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* Domain name column */
.domain-name {
  font-weight: 600; color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
}

.domain-ext { color: var(--text-muted); font-weight: 400; }

/* End date pill in domain column */
.end-date-tag {
  display: inline-block;
  font-size: 0.64rem;
  color: var(--ed-color);
  background: var(--ed-bg);
  border: 1px solid var(--ed-border);
  padding: 1px 4px;
  border-radius: 4px;
  margin-top: 1px;
  font-family: 'JetBrains Mono', monospace;
}

/* Source dots under domain name */
.source-dots {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}

.source-dot {
  width: 5px; height: 5px; border-radius: 50%;
  opacity: 0.2;
}

.source-dot.active { opacity: 1; }
.source-dot.ahrefs { background: var(--ahrefs-color); }
.source-dot.expireddomains { background: var(--ed-color); }
.source-dot.moz { background: var(--moz-color); }
.source-dot.majestic { background: var(--majestic-color); }
.source-dot.manual { background: #a78bfa; }

/* Numeric cells */
.cell-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem; text-align: right;
  color: var(--text-secondary);
}

.cell-num.highlight { color: var(--text-primary); font-weight: 600; }

/* Spam score coloring */
.spam-low { color: var(--color-buy); }
.spam-med { color: var(--color-maybe); }
.spam-high { color: var(--color-reject); }

/* ===== DATA INPUT (inline editable metric cells) ===== */
.data-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 3px 3px;
  text-align: right;
  outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

/* Width utility classes for data inputs */
.data-input.w50 { width: 44px; }
.data-input.w60 { width: 50px; }
.data-input.w65 { width: 56px; }
.data-input.w70 { width: 62px; }
.data-input.w75 { width: 68px; }

/* Data inputs that have values appear brighter */
.data-input:not(:placeholder-shown) {
  color: var(--text-primary);
}

/* Highlighted (important) data inputs */
.data-input.highlight-input:not(:placeholder-shown) {
  color: var(--text-primary);
  font-weight: 600;
}

/* Hover state: subtle border appears */
.data-input:hover {
  border-color: var(--border-default);
  background: rgba(15, 23, 42, 0.6);
}

/* Focus state: full edit mode */
.data-input:focus {
  border-color: var(--border-focus);
  background: rgba(15, 23, 42, 0.95);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
  color: var(--text-primary);
}

/* Remove number spinners */
.data-input::-webkit-outer-spin-button,
.data-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Spam score coloring for data inputs */
.data-input.spam-low { color: var(--color-buy); }
.data-input.spam-med { color: var(--color-maybe); }
.data-input.spam-high { color: var(--color-reject); }
.data-input.spam-low:focus,
.data-input.spam-med:focus,
.data-input.spam-high:focus { color: var(--text-primary); }

/* ===== INLINE SELECTS & INPUTS ===== */
.inline-select {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  padding: 3px 18px 3px 5px;
  cursor: pointer; transition: var(--transition-fast);
  outline: none; width: 100%; min-width: 90px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}

.inline-select:hover { border-color: var(--border-default); background-color: rgba(15, 23, 42, 0.95); }
.inline-select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.12); }
.inline-select option { background: var(--bg-secondary); color: var(--text-primary); }

/* ===== SCORE CELLS ===== */
.score-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 0.76rem; text-align: center;
}

.score-total { font-size: 0.92rem; font-weight: 800; }

/* ===== AUTO-ASSESSMENT BADGES ===== */
.auto-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.02em;
  cursor: default;
}

.auto-badge.auto-strong {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.auto-badge.auto-good {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.auto-badge.auto-maybe {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.auto-badge.auto-weak {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.auto-badge.auto-reject {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: pulse-reject 2s ease-in-out infinite;
}

.auto-badge.auto-none {
  background: rgba(148, 163, 184, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

@keyframes pulse-reject {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 0.67rem; font-weight: 700;
  letter-spacing: 0.03em; text-transform: uppercase; white-space: nowrap;
}

.badge-top, .badge-buy {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(16, 185, 129, 0.15));
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
}

.badge-promising, .badge-good {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.badge-consider, .badge-maybe {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-reject, .badge-low {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-dot {
  width: 5px; height: 5px; border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

.badge-top .badge-dot, .badge-buy .badge-dot { background: #22d3ee; }
.badge-promising .badge-dot, .badge-good .badge-dot { background: #818cf8; }
.badge-consider .badge-dot, .badge-maybe .badge-dot { background: #f59e0b; }
.badge-reject .badge-dot, .badge-low .badge-dot { background: #ef4444; }

@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Hard Reject Toggle */
.reject-toggle { display: flex; align-items: center; justify-content: center; }

.toggle-switch { position: relative; width: 32px; height: 17px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute; inset: 0;
  background: rgba(148, 163, 184, 0.15);
  border-radius: 10px; transition: var(--transition-fast);
}

.toggle-slider::before {
  content: ''; position: absolute;
  height: 11px; width: 11px; left: 3px; bottom: 3px;
  background: var(--text-secondary);
  border-radius: 50%; transition: var(--transition-fast);
}

.toggle-switch input:checked + .toggle-slider { background: rgba(239, 68, 68, 0.3); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(15px); background: var(--color-reject); }

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

.empty-state .icon { font-size: 40px; margin-bottom: 14px; opacity: 0.4; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 0.82rem; color: var(--text-muted); max-width: 440px; line-height: 1.6; }

/* ===== TOAST / NOTIFICATION ===== */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.82rem; font-weight: 500;
  animation: toast-in 0.3s ease-out;
  max-width: 400px;
}

.toast.success { border-left: 3px solid var(--color-buy); }
.toast.error { border-left: 3px solid var(--color-reject); }
.toast.info { border-left: 3px solid var(--color-good); }

.toast .toast-icon { font-size: 1rem; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(16px) scale(0.96); }
}

/* ===== ANIMATIONS ===== */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fade-in 0.4s ease-out; }

.stats-grid .stat-card:nth-child(1) { animation: slide-up 0.4s ease-out 0.05s both; }
.stats-grid .stat-card:nth-child(2) { animation: slide-up 0.4s ease-out 0.08s both; }
.stats-grid .stat-card:nth-child(3) { animation: slide-up 0.4s ease-out 0.11s both; }
.stats-grid .stat-card:nth-child(4) { animation: slide-up 0.4s ease-out 0.14s both; }
.stats-grid .stat-card:nth-child(5) { animation: slide-up 0.4s ease-out 0.17s both; }
.stats-grid .stat-card:nth-child(6) { animation: slide-up 0.4s ease-out 0.20s both; }

/* ===== COLLAPSE TOGGLE ===== */
.collapse-toggle {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.76rem; font-weight: 500;
  cursor: pointer; padding: 4px 8px;
  border-radius: 6px; transition: var(--transition-fast);
}

.collapse-toggle:hover { color: var(--text-primary); background: rgba(148, 163, 184, 0.06); }

.collapse-toggle .chevron {
  transition: transform var(--transition-fast);
  font-size: 0.7rem;
}

.collapse-toggle.collapsed .chevron { transform: rotate(-90deg); }

/* ===== DELETE ROW BUTTON ===== */
.btn-delete-row {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 0.95rem; padding: 1px 4px;
  border-radius: 4px; transition: var(--transition-fast);
  opacity: 0.4;
}

.domain-table tbody tr:hover .btn-delete-row { opacity: 1; }
.btn-delete-row:hover { color: var(--color-reject); background: rgba(239, 68, 68, 0.12); }

/* ===== SEARCH BOX ===== */
.search-box {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 9px; transition: var(--transition-fast);
}

.search-box:focus-within { border-color: var(--border-focus); box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.12); }
.search-box .icon { color: var(--text-muted); font-size: 0.82rem; }

.search-box input {
  background: transparent; border: none; outline: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif; font-size: 0.76rem;
  padding: 5px 0; width: 140px;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 1400px) {
  .upload-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .upload-cards-grid { grid-template-columns: 1fr; }
  .table-toolbar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 768px) {
  .app-container { padding: 12px; }
  .app-header { flex-direction: column; gap: 12px; text-align: center; padding: 14px; }
  .header-actions { width: 100%; justify-content: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .import-status-bar { flex-direction: column; gap: 4px; }
  .import-status-item { border-right: none; }
  .add-domain-bar { width: 100%; }
  .add-domain-input { flex: 1; }
}
