/* ═══════════════════════════════════════════
   Phantom Halo Pro — Premium Link Shortener
   Dark Theme with Glassmorphism + Multi-User
   ═══════════════════════════════════════════ */

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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(18, 18, 30, 0.6);
  --bg-card-hover: rgba(25, 25, 40, 0.7);
  --bg-input: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.1);
  --text-primary: #f0f0f5;
  --text-secondary: #8888a0;
  --text-muted: #55556a;
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-green: #4ade80;
  --accent-red: #ef4444;
  --accent-yellow: #facc15;
  --gradient-main: linear-gradient(135deg, #a855f7, #06b6d4);
  --gradient-hover: linear-gradient(135deg, #b96cf7, #22d3ee);
  --gradient-danger: linear-gradient(135deg, #ef4444, #ec4899);
  --shadow-glow: 0 0 60px rgba(168, 85, 247, 0.15), 0 0 120px rgba(6, 182, 212, 0.08);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --sidebar-width: 240px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Background Orbs ── */
.bg-orbs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  animation: float 20s ease-in-out infinite;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  top: -150px;
  right: -100px;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: var(--accent-cyan);
  bottom: -100px;
  left: -100px;
  animation-delay: -7s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-pink);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  opacity: 0.18;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -40px) scale(1.05);
  }

  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }

  75% {
    transform: translate(15px, 35px) scale(1.02);
  }
}

/* ══════════════════════════════
   LAYOUT: Sidebar + Main
   ══════════════════════════════ */
.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(12, 12, 20, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--glass-border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  transition: transform var(--transition);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 20px;
}

.sidebar-logo svg {
  flex-shrink: 0;
}

.sidebar-logo h2 {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent-purple);
}

.nav-item.active svg {
  color: var(--accent-purple);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

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

.sidebar-footer {
  border-top: 1px solid var(--glass-border);
  padding-top: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  margin-bottom: 8px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--gradient-main);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.user-details {
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ── Main Content ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px 40px;
  max-width: 960px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.page-header .gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════
   AUTH PAGES (Login / Register)
   ══════════════════════════════ */
.auth-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.6s ease;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.auth-logo h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

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

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition);
}

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

.form-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.12);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  background: var(--gradient-main);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-hover);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn-primary:hover::before {
  opacity: 1;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary span {
  position: relative;
  z-index: 1;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-red);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--accent-purple);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.form-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--accent-red);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

/* ══════════════════════════════
   CARDS & STATS
   ══════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}

.stat-card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-card .stat-value.purple {
  color: var(--accent-purple);
}

.stat-card .stat-value.cyan {
  color: var(--accent-cyan);
}

.stat-card .stat-value.green {
  color: var(--accent-green);
}

.stat-card .stat-value.pink {
  color: var(--accent-pink);
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

/* ══════════════════════════════
   SHORTENER CARD
   ══════════════════════════════ */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

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

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h2 svg {
  color: var(--accent-cyan);
}

.input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.input-row .form-input {
  flex: 1;
  min-width: 200px;
}

/* ── Input Groups (Joined Input & Button) ── */
.input-group {
  display: flex;
  width: 100%;
  gap: 0 !important;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  transition: border-color var(--transition);
}

.input-group:focus-within {
  border-color: var(--accent-purple);
}

.input-group .form-input {
  border: none !important;
  border-radius: 0 !important;
  background: var(--bg-input);
  flex: 1;
}

.input-group .btn-primary {
  border-radius: 0 !important;
  margin: 0 !important;
  width: auto !important; /* Override global 100% width */
  flex-shrink: 0; /* Don't crush the button */
  padding: 0 32px; /* Generous side padding for the label */
  height: auto;
  border: none !important;
}

.result-box {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--glass-border);
  animation: fadeInUp 0.4s ease;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(34, 197, 94, 0.1);
  color: var(--accent-green);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.result-url-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.result-short-url {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-purple);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.result-short-url:hover {
  background: rgba(168, 85, 247, 0.12);
}

.result-original {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qr-box {
  display: flex;
  justify-content: center;
  padding: 16px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-md);
}

.qr-box img {
  width: 180px;
  height: 180px;
}

/* ══════════════════════════════
   LINKS LIST
   ══════════════════════════════ */
.links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition);
  animation: fadeInUp 0.4s ease both;
}

.link-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.link-info {
  flex: 1;
  min-width: 0;
}

.link-short {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-purple);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.link-short:hover {
  color: var(--accent-cyan);
}

.link-original {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
  font-weight: 500;
}

.link-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.link-tag {
  display: inline-flex;
  padding: 2px 8px;
  background: rgba(168, 85, 247, 0.08);
  border-radius: 100px;
  font-size: 0.7rem;
  color: var(--accent-purple);
  font-weight: 500;
}

.link-badges {
  display: flex;
  gap: 6px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
}

.badge-clicks {
  background: rgba(6, 182, 212, 0.08);
  color: var(--accent-cyan);
}

.badge-lock {
  background: rgba(250, 204, 21, 0.08);
  color: var(--accent-yellow);
}

.badge-expired {
  background: rgba(239, 68, 68, 0.08);
  color: var(--accent-red);
}

.badge-active {
  background: rgba(74, 222, 128, 0.08);
  color: var(--accent-green);
}

.link-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--glass-border);
}

.icon-btn.delete:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.2);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  opacity: 0.25;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.empty-state span {
  font-size: 0.85rem;
}

/* ══════════════════════════════
   ADMIN TABLE
   ══════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}

.data-table td {
  padding: 12px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  vertical-align: middle;
}

.data-table tr {
  transition: background var(--transition);
}

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

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.status-dot.active {
  background: var(--accent-green);
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
}

.status-dot.inactive {
  background: var(--accent-red);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.role-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.role-badge.admin {
  background: rgba(168, 85, 247, 0.1);
  color: var(--accent-purple);
}

.role-badge.user {
  background: rgba(6, 182, 212, 0.08);
  color: var(--accent-cyan);
}

/* ══════════════════════════════
   CLICK CHART
   ══════════════════════════════ */
.chart-container {
  position: relative;
  width: 100%;
  height: 200px;
  margin: 16px 0;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ══════════════════════════════
   MODAL
   ══════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
  animation: fadeInUp 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

/* ══════════════════════════════
   PASSWORD GATE
   ══════════════════════════════ */
.gate-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.gate-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  text-align: center;
  animation: fadeInUp 0.6s ease;
}

.gate-card svg {
  margin-bottom: 16px;
  color: var(--accent-yellow);
}

.gate-card h2 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.gate-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ══════════════════════════════
   API KEYS
   ══════════════════════════════ */
.key-reveal {
  padding: 12px;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius-md);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent-purple);
  word-break: break-all;
  margin: 12px 0;
}

.key-warning {
  font-size: 0.8rem;
  color: var(--accent-yellow);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ══════════════════════════════
   TOAST
   ══════════════════════════════ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(30, 30, 50, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 100px;
  color: var(--accent-green);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 300;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════
   MOBILE HAMBURGER
   ══════════════════════════════ */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(12, 12, 20, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 40;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

.hamburger {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
}

.mobile-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

/* ══════════════════════════════
   ANIMATIONS
   ══════════════════════════════ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.milestone-switcher {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 8px 12px;
    backdrop-filter: blur(8px);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeInUp 0.4s ease;
}

.milestone-switcher select {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-weight: 500;
    min-width: 180px;
}

.milestone-switcher select:hover {
    border-color: var(--accent-purple);
}

.milestone-switcher .btn-pill {
    white-space: nowrap;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes shake {

  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-8px);
  }

  40% {
    transform: translateX(8px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

/* ══════════════════════════════
   RESPONSIVE
   ══════════════════════════════ */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
    padding: 72px 16px 32px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .link-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .link-meta {
    width: 100%;
    justify-content: space-between;
  }

  .input-row {
    flex-direction: column;
  }

  .data-table {
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
  }

  .result-url-box {
    flex-direction: column;
  }
}

/* ══════════════════════════════
   LIGHT THEME
   ══════════════════════════════ */
[data-theme="light"] {
  --bg-primary: #f5f5fa;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-input: rgba(0, 0, 0, 0.03);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-hover: rgba(0, 0, 0, 0.14);
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a7a;
  --text-muted: #8a8aa0;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] body {
  background: var(--bg-primary);
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .mobile-header {
  background: rgba(255, 255, 255, 0.92);
}

[data-theme="light"] .orb {
  opacity: 0.12;
}

[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--glass-border);
}

[data-theme="light"] .modal {
  background: #ffffff;
}

[data-theme="light"] .form-input {
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .logout-btn {
  border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="light"] .nav-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .nav-item.active {
  background: rgba(168, 85, 247, 0.08);
}

[data-theme="light"] .icon-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .data-table td {
  border-bottom-color: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .data-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

/* ══════════════════════════════
   SECTION INTROS & FORM HINTS
   ══════════════════════════════ */
.section-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 1.25rem;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.section-intro .intro-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.form-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
  font-style: italic;
}

[data-theme="light"] .section-intro {
  background: rgba(168, 85, 247, 0.04);
  border-color: rgba(168, 85, 247, 0.12);
}

/* ══════════════════════════════
   INLINE HELP TOOLTIPS
   ══════════════════════════════ */
.inline-help {
  display: inline; /* Revert display: contents to avoid flexbox grid breakage */
}

.inline-help-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 12px;
  color: var(--accent-purple);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 8px 3px 8px; /* Slim pill */
  font-family: var(--font);
  transition: all var(--transition);
  outline: none;
  text-transform: none; /* override uppercase from labels */
  letter-spacing: normal;
  vertical-align: middle;
  margin-left: 6px;
  margin-top: -2px;
  position: relative;
  z-index: 2;
}

.inline-help-toggle:hover,
.inline-help.open .inline-help-toggle {
  border-color: var(--accent-purple);
  color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.15);
}

/* ── Premium Enhancements ── */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transform: rotate(45deg);
  transition: 0.6s;
  pointer-events: none;
}

.btn-primary:hover::after {
  left: 100%;
}

.glass-card-header {
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.options-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.options-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 0;
  width: fit-content;
  transition: color var(--transition);
}

.options-toggle:hover {
  color: var(--text-primary);
}

.options-toggle svg {
  transition: transform var(--transition);
}

.options-toggle.open svg {
  transform: rotate(90deg);
}


.help-text {
  line-height: 1;
}

.help-chevron {
  width: 14px;
  height: 14px;
  fill: currentColor;
  transition: transform 0.3s ease;
  margin-right: -4px; /* Pull it slightly to the right */
}

.inline-help.open .help-chevron {
  transform: rotate(180deg);
}

.inline-help-content {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  margin-top: 0;
  width: 100%; /* Force grid to take full width of block parent */
}

.inline-help.open .inline-help-content {
  grid-template-rows: 1fr;
  margin-top: 8px;
  margin-bottom: 8px;
}

.inline-help-inner {
  min-height: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
  background: rgba(168, 85, 247, 0.04);
  border-left: 3px solid var(--accent-purple);
  padding: 0;
  opacity: 0;
  transition: opacity 0.3s ease, padding 0.3s ease;
  border-radius: 0 4px 4px 0;
  text-transform: none; /* Override parent label styles */
  letter-spacing: normal;
  font-weight: 400;
}


.inline-help.open .inline-help-inner {
  padding: 10px 14px;
  opacity: 1;
}

[data-theme="light"] .inline-help-inner {
  background: rgba(168, 85, 247, 0.03);
}

/* ══════════════════════════════
   SETTINGS
   ══════════════════════════════ */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-label {
  font-size: 0.92rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.setting-label span {
  font-size: 1.1rem;
}

.toggle-group {
  display: flex;
  gap: 2px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 3px;
}

.toggle-option {
  padding: 6px 14px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.toggle-option:hover {
  color: var(--text-primary);
}

.toggle-option.active {
  background: var(--gradient-main);
  color: white;
  font-weight: 600;
}

/* ══════════════════════════════
   MOBILE SIDEBAR BACKDROP
   ══════════════════════════════ */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
}

@media (max-width: 768px) {
  .sidebar-backdrop.show {
    display: block;
  }
}

/* ══════════════════════════════
   RESPONSIVE - TABLET
   ══════════════════════════════ */
@media (max-width: 1024px) and (min-width: 769px) {
  .sidebar {
    width: 200px;
  }

  .main-content {
    margin-left: 200px;
    padding: 24px 24px;
  }

  .sidebar-logo h2 {
    font-size: 1rem;
  }

  .nav-item {
    font-size: 0.84rem;
    padding: 8px 10px;
  }
}

/* ══════════════════════════════
   ADMIN TABLE SCROLL (Mobile)
   ══════════════════════════════ */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -24px;
  padding: 0 24px;
}

@media (max-width: 768px) {
  .table-scroll {
    margin: 0 -16px;
    padding: 0 16px;
  }

  /* Larger touch targets */
  .icon-btn {
    width: 40px;
    height: 40px;
  }

  .btn-sm {
    padding: 8px 14px;
    font-size: 0.82rem;
  }

  .nav-item {
    padding: 12px 12px;
    min-height: 44px;
  }

  .form-input {
    padding: 16px;
    font-size: 1rem;
  }

  /* Settings toggle */
  .toggle-option {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  /* Help tooltip position on mobile */
  .help-tip-popup {
    position: fixed;
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100vw - 48px);
    max-width: 320px;
  }

  .help-tip-popup::after {
    display: none;
  }
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

::selection {
  background: rgba(168, 85, 247, 0.3);
  color: var(--text-primary);
}

/* ══════════════════════════════
   LANDING PAGE
   ══════════════════════════════ */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-hero {
  text-align: center;
  padding: 80px 24px 40px;
  background: radial-gradient(ellipse at 50% 0%, rgba(168, 85, 247, 0.12) 0%, transparent 60%);
}

.landing-title {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 16px 0 8px;
  line-height: 1.2;
}

.landing-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

.landing-shortener {
  max-width: 640px;
  margin: 0 auto;
}

.landing-features {
  padding: 48px 24px;
  max-width: 960px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all var(--transition);
  animation: fadeInUp 0.5s ease both;
}

.feature-card:nth-child(1) {
  animation-delay: 0.05s;
}

.feature-card:nth-child(2) {
  animation-delay: 0.1s;
}

.feature-card:nth-child(3) {
  animation-delay: 0.15s;
}

.feature-card:nth-child(4) {
  animation-delay: 0.2s;
}

.feature-card:nth-child(5) {
  animation-delay: 0.25s;
}

.feature-card:nth-child(6) {
  animation-delay: 0.3s;
}

.feature-card:hover {
  border-color: var(--accent-purple);
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(168, 85, 247, 0.15);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.landing-cta {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.landing-cta h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.landing-cta p {
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
  font-size: 0.92rem;
}

.landing-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .landing-title {
    font-size: 1.6rem;
  }

  .landing-hero {
    padding: 48px 16px 32px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }
}
/* Tiered Access & VIP Styles */
.vip-crown {
  margin-left: 6px;
  font-size: 1.1rem;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.4));
  animation: crown-glow 2s ease-in-out infinite;
  display: inline-block;
}

@keyframes crown-glow {
  0%, 100% { transform: scale(1) rotate(-5deg); filter: drop-shadow(0 0 2px rgba(255, 215, 0, 0.3)); }
  50% { transform: scale(1.1) rotate(5deg); filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6)); }
}

.premium-badge-micro {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 4px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.2);
}

.icon-btn.premium-locked {
  position: relative;
  border-color: rgba(245, 158, 11, 0.3);
}

.icon-btn.premium-locked svg {
  opacity: 0.7;
}

.premium-locked-overlay {
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  margin: 1rem 0;
}

.premium-locked-overlay h3 {
  background: linear-gradient(135deg, #fcd34d 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 0.5rem;
}

.premium-locked-overlay p {
  opacity: 0.7;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* ══════════════════════════════
   EXPERIMENTS
   ══════════════════════════════ */
.exp-list {
  display: grid;
  gap: 16px;
}

.exp-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  transition: all var(--transition);
  animation: fadeInUp 0.4s ease both;
}

.exp-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.exp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.exp-card-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.exp-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.exp-card-code {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.exp-card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.exp-stat {
  text-align: center;
  padding: 10px 8px;
  background: var(--bg-input);
  border-radius: var(--radius-md);
}

.exp-stat-value {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.exp-stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Status badges */
.exp-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-draft {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.status-running {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.status-paused {
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.25);
}

.status-completed {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

/* Control & Winner badges */
.exp-control-badge {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  margin-left: 6px;
}

.exp-winner-badge {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  margin-left: 6px;
}

/* Experiment detail */
.exp-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.exp-link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  margin: 0 8px;
}

.exp-link:hover {
  text-decoration: underline;
}

.exp-url-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exp-analysis-banner {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.exp-analysis-banner.winner {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: #22c55e;
}

.exp-analysis-banner.pending {
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
}

.winner-row {
  background: rgba(34, 197, 94, 0.05) !important;
}

.winner-row td {
  border-bottom-color: rgba(34, 197, 94, 0.15) !important;
}

/* Table responsive */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Code block */
.code-block {
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 42px 12px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  word-break: break-all;
  margin-top: 8px;
}

.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
}

.exp-pixel-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Variant row in create form */
.variant-row {
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
}

.variant-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.variant-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.variant-remove {
  width: 24px;
  height: 24px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.variant-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.variant-row-fields {
  display: flex;
  gap: 8px;
}

.variant-row-fields .form-input {
  flex: 1;
}

/* Header actions */
.header-actions {
  display: flex;
  gap: 8px;
}

/* Button variants for experiments */
.btn-pill {
  border-radius: 999px !important;
}

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-primary-outline {
  background: rgba(168, 85, 247, 0.05);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 10px 24px;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary-outline:hover {
  background: rgba(168, 85, 247, 0.12);
  border-color: var(--accent-purple);
  transform: translateY(-2px);
}

.btn-danger-outline {
  background: rgba(239, 68, 68, 0.05);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 24px;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  transform: translateY(-2px);
}

.btn-ghost {
  background: none;
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-ghost:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

/* Responsive experiment cards */
@media (max-width: 768px) {
  .exp-card-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .variant-row-fields {
    flex-direction: column;
  }

  .variant-row-fields .form-input {
    width: 100% !important;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .exp-meta-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ══════════════════════════════
   PUBLIC REPORTING
   ══════════════════════════════ */
.variant-stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.variant-stat-card {
  position: relative;
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.variant-stat-card.winner-card {
  border-color: #facc15;
  background: rgba(250, 204, 21, 0.05);
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.1);
}

.winner-badge {
  position: absolute;
  top: -10px;
  right: 1.5rem;
  background: #facc15;
  color: #000;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
}

.variant-stat-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.var-main-stat {
  margin-bottom: 1rem;
}

.var-stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.var-stat-lab {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.var-sub-stats {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.var-sub-stats strong {
  color: var(--text-main);
}
/* ══════════════════════════════
   PHASE 6: PRO FEATURES TABS
   ══════════════════════════════ */
.modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.modal-tab {
  padding: 10px 16px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 500;
  transition: all 0.2s;
}

.modal-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px 8px 0 0;
}

.modal-tab.active {
  color: var(--accent-purple);
  border-bottom-color: var(--accent-purple);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

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

.status-killed {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

.status-winner {
  background: rgba(34, 197, 94, 0.1) !important;
  color: #22c55e !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
}

.time-slot-editor {
  background: rgba(255, 255, 255, 0.03);
  padding: 15px;
  border-radius: var(--radius-md);
  margin-top: 10px;
}

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

/* ══════════════════════════════
   ANALYTICS & REPORTING
   ══════════════════════════════ */
.border-left-purple { border-left: 4px solid var(--accent-purple); }
.border-left-green { border-left: 4px solid var(--success-color); }
.border-left-cyan { border-left: 4px solid var(--cyan-color); }

.bg-green-100 { background: rgba(16, 185, 129, 0.15) !important; border: 1px solid rgba(16, 185, 129, 0.3); }
.text-green-800 { color: #059669 !important; }

.bg-red-100 { background: rgba(239, 68, 68, 0.15) !important; border: 1px solid rgba(239, 68, 68, 0.3); }
.text-red-800 { color: #dc2626 !important; }

.bg-purple-100 { background: rgba(168, 85, 247, 0.15) !important; border: 1px solid rgba(168, 85, 247, 0.3); }
.text-purple-800 { color: #a855f7 !important; }

.warning-icon {
  font-size: 0.9em;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.warning-icon:hover {
  opacity: 1;
}

[data-theme="dark"] .text-green-800 { color: #34d399 !important; }
[data-theme="dark"] .text-red-800 { color: #f87171 !important; }
[data-theme="dark"] .text-purple-800 { color: #c084fc !important; }

/* Filter Bar Premium */
.filter-bar-premium {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

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

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

.date-range-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-sep {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.filter-actions {
  margin-left: auto;
}

@media (max-width: 768px) {
  .filter-actions {
    margin-left: 0;
    width: 100%;
  }
}

/* ── Client Switcher (Sidebar) ── */
.client-switcher-sidebar {
  padding: 0 16px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.switcher-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
  margin-left: 4px;
}

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

.switcher-select {
  appearance: none;
  width: 100%;
  padding: 10px 32px 10px 12px !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: var(--radius-md) !important;
  color: var(--text-primary) !important;
  cursor: pointer;
  transition: var(--transition);
  height: auto !important;
}

.switcher-select:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.switcher-select:focus {
  outline: none;
  border-color: var(--accent-purple) !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.switcher-icon {
  position: absolute;
  right: 12px;
  pointer-events: none;
  opacity: 0.5;
  color: var(--text-muted);
}
