/* ============================================
   PROTON v2 — ProtonMail-Inspired Design System
   ============================================ */

/* --- Light Theme (default vars) --- */
:root {
  --bg: #f5f3ff;
  --bg-alt: #ede9fe;
  --surface: #ffffff;
  --surface-raised: #f7f5ff;
  --surface-hover: #f0edff;
  --border: #e0daf5;
  --border-light: #d4ccf0;
  --text: #1c1639;
  --text-secondary: #6b6180;
  --text-muted: #9a91b0;
  --accent: #6d4aff;
  --accent-hover: #5b3de6;
  --accent-dim: rgba(109, 74, 255, 0.10);
  --success: #1ea656;
  --success-dim: rgba(30, 166, 86, 0.12);
  --danger: #dc3545;
  --danger-dim: rgba(220, 53, 69, 0.10);
  --warning: #e67e22;
  --warning-dim: rgba(230, 126, 34, 0.10);
  --gold: #d4a017;
  --purple: #8b5cf6;
  --blue: #3b82f6;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
  --sidebar-width: 240px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(28, 22, 57, 0.04);
  --shadow-md: 0 4px 12px rgba(28, 22, 57, 0.06);
  --shadow-lg: 0 8px 24px rgba(28, 22, 57, 0.08);
  --transition: 0.18s ease;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  --bg: #0c0b12;
  --bg-alt: #12111a;
  --surface: #19172a;
  --surface-raised: #221f38;
  --surface-hover: #2a2645;
  --border: #2e2a4a;
  --border-light: #3a3560;
  --text: #eae8f5;
  --text-secondary: #9590b0;
  --text-muted: #605a80;
  --accent: #7c5cff;
  --accent-hover: #9b80ff;
  --accent-dim: rgba(124, 92, 255, 0.14);
  --success: #2dd36f;
  --success-dim: rgba(45, 211, 111, 0.14);
  --danger: #ff4961;
  --danger-dim: rgba(255, 73, 97, 0.12);
  --warning: #ffa940;
  --warning-dim: rgba(255, 169, 64, 0.12);
  --gold: #fbbf24;
  --purple: #a78bfa;
  --blue: #60a5fa;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.35);
}

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

html, body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

::selection {
  background: var(--accent-dim);
  color: var(--accent);
}

/* ============================================
   LAYOUT
   ============================================ */

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand svg {
  margin-right: 10px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  overflow-y: auto;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all var(--transition);
  margin-bottom: 2px;
  border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-nav a.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-nav .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-nav .nav-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.sidebar-bottom {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-sans);
  transition: all var(--transition);
  width: 100%;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--text);
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.sidebar-bottom .btn-logout {
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-sans);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-bottom .btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.sidebar-bottom .btn-logout svg {
  width: 16px;
  height: 16px;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

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

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-content {
  padding: 0 28px 28px;
}

/* Mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 18px;
}

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

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

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

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

  .mobile-menu-btn {
    display: flex;
  }
}

/* ============================================
   LOGIN
   ============================================ */

.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px;
  width: 400px;
  box-shadow: var(--shadow-lg);
}

.login-box h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  letter-spacing: 2px;
}

.login-box p {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 14px;
}

/* ============================================
   FORMS
   ============================================ */

input, select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

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

input[type="color"] {
  padding: 2px;
  height: 40px;
  cursor: pointer;
}

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

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

.form-row {
  display: flex;
  gap: 14px;
}

.form-row > * {
  flex: 1;
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.checkbox-group input[type="checkbox"],
.checkbox-group input[type="radio"] {
  width: auto;
  cursor: pointer;
  accent-color: var(--accent);
}

.checkbox-group label {
  margin-bottom: 0;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  font-family: var(--font-sans);
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px var(--accent-dim);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--border-light);
  background: var(--surface-hover);
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: white;
}

.btn-success {
  background: var(--success-dim);
  color: var(--success);
}
.btn-success:hover {
  background: var(--success);
  color: white;
}

.btn-warning {
  background: var(--warning-dim);
  color: var(--warning);
}
.btn-warning:hover {
  background: var(--warning);
  color: white;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 20px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================
   TABS
   ============================================ */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}

.tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font-sans);
}

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

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Sub-tabs (within Breakdowns etc) */
.sub-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--surface-raised);
  border-radius: var(--radius);
  padding: 4px;
}

.sub-tab {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition);
  background: none;
  border: none;
  font-family: var(--font-sans);
}

.sub-tab:hover {
  color: var(--text);
}

.sub-tab.active {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
}

/* ============================================
   TABLE
   ============================================ */

.table-container {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: var(--surface-raised);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

thead th:hover {
  color: var(--text);
}

thead th.sorted-asc::after { content: ' \2191'; color: var(--accent); }
thead th.sorted-desc::after { content: ' \2193'; color: var(--accent); }

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-hover);
}

tbody tr.expandable {
  cursor: pointer;
}

tbody tr.sub-row td {
  padding-left: 36px;
  font-size: 12px;
  color: var(--text-secondary);
}

tbody tr.sub-row:hover td {
  color: var(--text);
}

tbody tr.total-row {
  background: var(--surface-raised);
  font-weight: 700;
}

tbody tr.total-row td {
  border-top: 2px solid var(--border);
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.positive { color: var(--success); }
.negative { color: var(--danger); }

/* ============================================
   KPI CARDS
   ============================================ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: all var(--transition);
}

.kpi-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.kpi-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 20px;
}

.kpi-delta.positive {
  color: var(--success);
  background: var(--success-dim);
}

.kpi-delta.negative {
  color: var(--danger);
  background: var(--danger-dim);
}

.kpi-delta svg {
  width: 12px;
  height: 12px;
}

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}

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

/* ============================================
   CHART CONTAINERS
   ============================================ */

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  min-height: 280px;
}

.chart-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chart-card-title svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.chart-wrapper {
  width: 100%;
  height: 220px;
}

@media (max-width: 900px) {
  .charts-row { grid-template-columns: 1fr; }
}

/* ============================================
   CARDS (generic)
   ============================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

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

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================
   FILTERS
   ============================================ */

.filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.date-btn {
  padding: 6px 16px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  transition: all var(--transition);
}

.date-btn:hover {
  border-color: var(--border-light);
  color: var(--text);
}

.date-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 2px 8px var(--accent-dim);
}

.filter-select {
  width: auto;
  min-width: 160px;
  border-radius: 24px;
  padding: 6px 14px;
  font-size: 13px;
}

.filter-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}

/* ============================================
   MODAL
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-large {
  max-width: 860px;
}

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

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.modal-close {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 6px 8px;
  line-height: 1;
  border-radius: var(--radius);
  transition: all var(--transition);
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

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

/* ============================================
   WIZARD STEPS
   ============================================ */

.wizard-steps {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
}

.wizard-step {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 3px solid var(--border);
  transition: all var(--transition);
}

.wizard-step.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.wizard-step.done {
  color: var(--success);
  border-bottom-color: var(--success);
}

/* ============================================
   URL PREVIEW
   ============================================ */

.url-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  word-break: break-all;
  margin-top: 14px;
}

.url-copy {
  display: flex;
  gap: 8px;
  align-items: start;
  margin-bottom: 12px;
}

.url-copy input {
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ============================================
   FUNNEL
   ============================================ */

.funnel-bar {
  height: 8px;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.4s ease;
  opacity: 0.75;
}

.funnel-summary {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ============================================
   DEBUG TIMELINE
   ============================================ */

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding: 10px 0 18px 18px;
}

.timeline-dot {
  position: absolute;
  left: -22px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  transition: all var(--transition);
}

.timeline-dot.page_view { border-color: var(--blue); background: var(--blue); }
.timeline-dot.cta_click { border-color: var(--warning); background: var(--warning); }
.timeline-dot.return_visit { border-color: var(--success); background: var(--success); }
.timeline-dot.registration { border-color: var(--purple); background: var(--purple); }
.timeline-dot.ftd, .timeline-dot.qftd { border-color: var(--gold); background: var(--gold); }
.timeline-dot.bounce { border-color: var(--danger); background: var(--danger); }
.timeline-dot.conversion { border-color: var(--gold); background: var(--gold); }
.timeline-dot.capi { border-color: var(--accent); background: var(--accent); }

.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.timeline-type {
  font-size: 13px;
  font-weight: 600;
  margin: 3px 0;
}

.timeline-meta {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-top: 6px;
  font-family: var(--font-mono);
  word-break: break-all;
}

/* ============================================
   VISITOR CARD
   ============================================ */

.visitor-card {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 22px;
}

.visitor-field {
  font-size: 13px;
}

.visitor-field dt {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.visitor-field dd {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ============================================
   TAGS / BADGES
   ============================================ */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.tag-active { background: var(--success-dim); color: var(--success); }
.tag-paused { background: var(--warning-dim); color: var(--warning); }
.tag-archived { background: var(--danger-dim); color: var(--danger); }
.tag-cpa { background: var(--accent-dim); color: var(--accent); }
.tag-qftd { background: rgba(139, 92, 246, 0.15); color: var(--purple); }
.tag-revshare { background: rgba(59, 130, 246, 0.15); color: var(--blue); }
.tag-disabled { background: var(--danger-dim); color: var(--danger); }
.tag-pending { background: var(--warning-dim); color: var(--warning); }

/* ============================================
   MAPPING LIST
   ============================================ */

.mapping-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.mapping-row input, .mapping-row select {
  flex: 1;
}

.mapping-row button {
  flex-shrink: 0;
}

/* ============================================
   LAUNCH RESULT
   ============================================ */

.launch-result {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.launch-result h4 {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  margin-top: 14px;
}

.launch-result h4:first-child {
  margin-top: 0;
}

/* ============================================
   DROP ZONE & LP PREVIEW
   ============================================ */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  font-size: 14px;
  position: relative;
}

.drop-zone:hover {
  border-color: var(--border-light);
  color: var(--text);
}

.drop-zone--active {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

.drop-zone--has-file {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-dim);
}

.drop-zone--has-file .drop-zone-file {
  color: var(--text);
  font-weight: 600;
}

.drop-zone--has-file .drop-zone-size {
  color: var(--text-secondary);
  font-size: 12px;
}

.drop-zone--uploading {
  pointer-events: none;
  opacity: 0.7;
}

.drop-zone-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent);
}

.drop-zone .text-xs {
  margin-top: 6px;
}

.lp-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 14px;
}

.lp-preview iframe {
  width: 100%;
  height: 300px;
  border: none;
  pointer-events: none;
  background: white;
}

.lp-preview-label {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.file-size-warning {
  color: var(--warning);
  font-size: 11px;
  margin-top: 4px;
}

/* ============================================
   LP GRID (Landing Pages)
   ============================================ */

.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.lp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: all var(--transition);
}

.lp-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.lp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.lp-card-header strong {
  font-size: 14px;
}

.lp-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.lp-card-meta code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
}

.lp-card-stats {
  display: flex;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.lp-card-stats > div {
  display: flex;
  flex-direction: column;
}

.lp-card-stats .stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.lp-card-stats .stat-value {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* ============================================
   UTILITIES
   ============================================ */

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.p-3 { padding: 12px; }
.hidden { display: none; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

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

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-secondary);
  gap: 10px;
  font-size: 14px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}

.empty-state p {
  margin-bottom: 14px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  max-width: 400px;
}

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

.toast-error {
  background: var(--danger);
  color: white;
}

.toast-success {
  background: var(--success);
  color: white;
}
