/* ===== Variables ===== */
:root {
  --primary:        #6366f1;
  --primary-dark:   #4f46e5;
  --primary-light:  #eef2ff;
  --primary-glow:   rgba(99,102,241,.14);
  --accent:         #7c3aed;

  --gradient:       linear-gradient(135deg, #6366f1, #7c3aed);
  --gradient-hover: linear-gradient(135deg, #4f46e5, #6d28d9);
  --gradient-line:  linear-gradient(90deg, #6366f1, #7c3aed, #a78bfa);

  --danger:         #ef4444;
  --danger-dark:    #dc2626;
  --danger-light:   #fee2e2;
  --success:        #22c55e;
  --success-light:  #dcfce7;

  --bg:             #f5f7ff;
  --surface:        #ffffff;

  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;

  --text:           #0f172a;
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  --nav-bg:         #0f172a;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 16px;

  --shadow-sm:  0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:     0 4px 8px rgba(0,0,0,.06), 0 2px 4px rgba(0,0,0,.04);
  --shadow-md:  0 10px 24px rgba(0,0,0,.09), 0 4px 8px rgba(0,0,0,.05);
  --shadow-lg:  0 24px 48px rgba(0,0,0,.13), 0 8px 16px rgba(0,0,0,.07);
  --shadow-primary: 0 4px 16px rgba(99,102,241,.35);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(99,102,241,.07) 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }

/* ===== Top Nav ===== */
.topnav {
  background: var(--nav-bg);
  padding: 0 32px;
  height: 58px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
}
.topnav::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-line);
}
.topnav-brand {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topnav-brand::before {
  content: '';
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--gradient);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(99,102,241,.5);
}

/* ===== Main layout ===== */
.main { max-width: 1120px; margin: 0 auto; padding: 40px 32px; }

/* ===== Breadcrumb ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--text); text-decoration: none; }
.breadcrumb .sep { color: var(--border-strong); }
.breadcrumb span { color: var(--text); font-weight: 600; }

/* ===== Page header ===== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--text);
}
.page-header .muted { color: var(--text-muted); font-size: 0.875rem; margin-top: 4px; font-weight: 400; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.14s, border-color 0.14s, color 0.14s, box-shadow 0.14s, transform 0.1s;
  white-space: nowrap;
  line-height: 1.4;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--gradient-hover);
  box-shadow: 0 6px 20px rgba(99,102,241,.45);
  text-decoration: none;
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--text);
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); }

.btn-sm { padding: 5px 12px; font-size: 0.75rem; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ===== Cards (companies / campaigns) ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  position: relative;
  overflow: hidden;
}
.card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card.clickable { cursor: pointer; }
.card.clickable:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-3px);
}
.card.clickable:hover::after { transform: scaleX(1); }
.card-body { padding: 22px; }
.card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.stats {
  display: flex;
  gap: 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
  font-weight: 500;
}

/* ===== QR Code grid ===== */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.qr-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  position: relative;
}
.qr-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-line);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.qr-card.clickable { cursor: pointer; }
.qr-card.clickable:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-3px);
}
.qr-card.clickable:hover::after { transform: scaleX(1); }
.qr-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
  padding: 16px;
}
.qr-card-body { padding: 14px 16px; }
.qr-card-body h4 {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.url-preview {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
}
.qr-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.scan-count { font-size: 0.75rem; color: var(--text-muted); font-variant-numeric: tabular-nums; font-weight: 500; }

/* ===== Badges ===== */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.badge-success { background: var(--success-light); color: #15803d; }
.badge-muted   { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ===== QR Code detail page ===== */
.qr-detail {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 760px) { .qr-detail { grid-template-columns: 1fr; } }

.qr-detail-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 78px;
}
.qr-large {
  width: 280px;
  height: 280px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(99,102,241,.2), 0 8px 20px rgba(0,0,0,.1);
  background: #fff;
  padding: 10px;
}
.qr-downloads { display: flex; gap: 8px; }

.qr-detail-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ===== Detail sections ===== */
.detail-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-section:last-child { border-bottom: none; }

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.detail-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.detail-section label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detail-section label::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gradient);
  flex-shrink: 0;
}
.hint { font-size: 0.75rem; color: var(--text-muted); line-height: 1.55; }
.scan-stat {
  font-size: 3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
  line-height: 1;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== URL display ===== */
.url-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.url-display code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}
.url-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  font-family: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.url-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.mt-1 { margin-top: 8px; }

/* ===== Forms ===== */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8125rem; font-weight: 600; color: var(--text); }
.form-group input,
.form-group textarea,
.form-group select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  font-family: inherit;
  line-height: 1.4;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input[type="color"] {
  padding: 3px 5px;
  height: 38px;
  width: 56px;
  cursor: pointer;
  flex-shrink: 0;
}
.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-live-swatch {
  display: inline-block;
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: background 0.1s;
}
.color-live-hex {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 16px;
}
.modal-backdrop.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modal-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal::before {
  content: '';
  display: block;
  height: 3px;
  background: var(--gradient-line);
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: none; }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h3 { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted);
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; line-height: 1;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }

/* ===== Loading ===== */
.loading { display: flex; justify-content: center; align-items: center; padding: 100px 0; }
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Empty state ===== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
  background: linear-gradient(135deg, rgba(99,102,241,.04), rgba(124,58,237,.04));
  border: 1.5px dashed rgba(99,102,241,.3);
  border-radius: var(--radius);
}
.empty-state p { font-size: 0.875rem; font-weight: 500; }

/* ===== Toasts ===== */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column;
  gap: 8px;
  z-index: 300;
}
.toast {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: #1e293b;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.2s, transform 0.2s;
  max-width: 300px;
}
.toast.show { opacity: 1; transform: none; }
.toast-error { background: var(--danger); }

/* ===== Logo sections (company / campaign pages) ===== */
.logo-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-bottom: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.logo-section label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.logo-section label::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gradient);
  flex-shrink: 0;
}
.logo-preview { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-preview img {
  width: 64px; height: 64px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f9fafb;
  padding: 6px;
}

/* ===== Color swatches ===== */
.color-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  display: inline-block;
  width: 18px; height: 18px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,.1);
  flex-shrink: 0;
  box-shadow: inset 0 1px 1px rgba(255,255,255,.3);
}
.color-label {
  font-size: 0.8rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text-secondary);
}

/* ===== Analytics / Charts ===== */
.chart-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  margin-top: 28px;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.chart-header h3 {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chart-header h3::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gradient);
  flex-shrink: 0;
}
.chart-wrap { position: relative; height: 180px; }
.period-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

/* ===== Utility ===== */
.hidden { display: none !important; }
.muted  { color: var(--text-muted); }

/* ===== Pricing page ===== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.pricing-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.pricing-card--highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.pricing-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.pricing-plan-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.pricing-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.pricing-features li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}
.pricing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}
.pricing-select {
  width: 100%;
  margin-top: 8px;
}

.free-tier-note {
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ===== Locked chart (upgrade teaser) ===== */
.chart-locked {
  position: relative;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.chart-locked-bars {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 16px 8px 0;
}
.fake-bar {
  flex: 1;
  background: rgba(99,102,241,0.18);
  border-radius: 3px 3px 0 0;
  min-width: 0;
  filter: blur(0.5px);
}
.chart-locked-overlay {
  position: absolute;
  inset: 0;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  background: rgba(245,247,255,0.80);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.chart-locked-icon { font-size: 1.5rem; line-height: 1; }
.chart-locked-overlay p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ===== Locked section / upgrade chip ===== */
.section-lock-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-lock-group .btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.lock-upgrade-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--primary-light);
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 3px 10px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.lock-upgrade-chip:hover {
  background: #e0e7ff;
}
.detail-section--locked {
  opacity: 0.72;
}
.detail-section--locked label {
  color: var(--text-muted);
}

/* ===== Auth pages ===== */
.auth-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 48px;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 28px;
}
.auth-card .form-group { margin-bottom: 16px; }
.auth-submit { width: 100%; justify-content: center; margin-top: 8px; }
.auth-error {
  background: var(--danger-light);
  color: var(--danger-dark);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.8125rem;
  margin-bottom: 12px;
}
.auth-footer {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 20px;
}

/* ===== Top nav right slot ===== */
.topnav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-user {
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}
.topnav .btn-ghost {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
}
.topnav .btn-ghost:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ===== Team management ===== */
.team-section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.team-list { display: flex; flex-direction: column; gap: 12px; }
.team-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.team-member-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 160px;
}
.team-name  { font-weight: 700; font-size: 0.875rem; color: var(--text); }
.team-email { font-size: 0.75rem; color: var(--text-muted); }
.team-perm-label { font-size: 0.8125rem; color: var(--text-muted); margin-left: auto; }
.team-role-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: capitalize;
  align-self: flex-start;
}
.role-owner  { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #c7d2fe; }
.role-member { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.team-campaigns {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.campaign-perm-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}
.campaign-perm-select {
  border: none;
  background: transparent;
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
}
.campaign-perm-select:focus { outline: none; }
