/**
 * PIXL Admin Console - Modern Design System
 * A clean, professional admin dashboard with glassmorphism and smooth animations
 * Version: 2.0
 */

/* =================================================================
   CSS VARIABLES - DESIGN TOKENS
   ================================================================= */
:root {
  /* Colors - Dark Theme */
  --bg-primary: #0a0e14;
  --bg-secondary: #0d1117;
  --bg-tertiary: #161b22;
  --bg-elevated: #1c2128;
  --bg-hover: #21262d;
  
  /* Accent Colors */
  --accent-primary: #00ff94;
  --accent-secondary: #00d177;
  --accent-tertiary: #00b368;
  --accent-subtle: rgba(0, 255, 148, 0.1);
  --accent-glow: rgba(0, 255, 148, 0.4);
  
  /* Status Colors */
  --success: #00ff94;
  --success-bg: rgba(0, 255, 148, 0.12);
  --warning: #ffb800;
  --warning-bg: rgba(255, 184, 0, 0.12);
  --danger: #ff4757;
  --danger-bg: rgba(255, 71, 87, 0.12);
  --info: #00b4d8;
  --info-bg: rgba(0, 180, 216, 0.12);
  
  /* Text Colors */
  --text-primary: #f0f6fc;
  --text-secondary: #8b949e;
  --text-tertiary: #6e7681;
  --text-inverse: #0a0e14;
  
  /* Borders */
  --border-primary: rgba(0, 255, 148, 0.15);
  --border-secondary: rgba(139, 148, 158, 0.15);
  --border-hover: rgba(0, 255, 148, 0.4);
  
  /* Effects */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 30px rgba(0, 255, 148, 0.2);
  --shadow-glow-strong: 0 0 50px rgba(0, 255, 148, 0.35);
  
  /* Blur Effects */
  --blur-sm: blur(8px);
  --blur-md: blur(16px);
  --blur-lg: blur(24px);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Typography */
  --font-sans: 'Inter', 'Poppins', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  
  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
  --z-tooltip: 500;
}

/* =================================================================
   BASE RESET & FOUNDATIONS
   ================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animated Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(0, 255, 148, 0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0, 180, 216, 0.05), transparent 50%),
    radial-gradient(ellipse 100% 100% at 50% 0%, rgba(0, 255, 148, 0.03), transparent 60%);
  animation: ambientPulse 12s ease-in-out infinite alternate;
}

@keyframes ambientPulse {
  0% { opacity: 0.4; transform: scale(1); }
  100% { opacity: 0.7; transform: scale(1.02); }
}

/* Grid Pattern Overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.015;
  background-image: 
    linear-gradient(var(--accent-primary) 1px, transparent 1px),
    linear-gradient(90deg, var(--accent-primary) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* =================================================================
   TYPOGRAPHY
   ================================================================= */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.text-gradient {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-glow {
  text-shadow: 0 0 20px var(--accent-glow), 0 0 40px rgba(0, 255, 148, 0.2);
}

/* =================================================================
   HEADER - MODERN NAVIGATION
   ================================================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: var(--blur-md) saturate(180%);
  border-bottom: 1px solid var(--border-primary);
  padding: 0 var(--space-xl);
  height: 70px;
  display: flex;
  align-items: center;
  transition: var(--transition-base);
}

header.scrolled {
  background: rgba(10, 14, 20, 0.95);
  box-shadow: var(--shadow-lg);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* Brand Logo */
.brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-decoration: none;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: var(--transition-base);
}

.brand::before {
  content: '';
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-glow);
}

.brand:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.header-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-subtle);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-base);
}

.header-btn:hover {
  background: rgba(0, 255, 148, 0.15);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

.header-btn i {
  font-size: 1.1rem;
  color: var(--accent-primary);
}

/* User Avatar */
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-inverse);
  cursor: pointer;
  transition: var(--transition-base);
  border: 2px solid transparent;
}

.user-avatar:hover {
  transform: scale(1.05);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

/* =================================================================
   ADMIN CONTAINER - MAIN LAYOUT
   ================================================================= */
.admin-container {
  padding: calc(70px + var(--space-2xl)) var(--space-xl) var(--space-2xl);
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* =================================================================
   AUTH CONTAINER - LOGIN CARD
   ================================================================= */
.auth-container {
  max-width: 420px;
  margin: var(--space-3xl) auto;
  padding: var(--space-2xl);
  background: rgba(22, 27, 34, 0.8);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-container h2 {
  font-size: 1.75rem;
  text-align: center;
  margin-bottom: var(--space-xl);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =================================================================
   FORM ELEMENTS - INPUTS, BUTTONS, SELECTS
   ================================================================= */
.form-group {
  margin-bottom: var(--space-lg);
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input,
.form-input:is(input, textarea, select) {
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-base);
}

.form-input::placeholder {
  color: var(--text-tertiary);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 255, 148, 0.15), var(--shadow-glow);
  background: var(--bg-secondary);
}

.form-input:hover:not(:focus) {
  border-color: var(--border-hover);
}

/* Form Row Layout */
.form-row {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.form-col {
  flex: 1;
  min-width: 200px;
}

/* Textarea */
textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

/* Select Styling */
select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238b949e' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* =================================================================
   BUTTONS - ALL VARIANTS
   ================================================================= */
.btn,
.action-btn,
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

/* Primary Button */
.auth-btn,
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--text-inverse);
  box-shadow: var(--shadow-md), 0 0 20px rgba(0, 255, 148, 0.2);
}

.auth-btn:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-strong);
  filter: brightness(1.05);
}

.auth-btn:active,
.btn-primary:active {
  transform: translateY(0);
}

/* Secondary Button */
.action-btn,
.btn-secondary {
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border: 1px solid var(--border-primary);
}

.action-btn:hover,
.btn-secondary:hover {
  background: rgba(0, 255, 148, 0.15);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

/* Danger Button */
.btn-danger,
.action-btn.danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(255, 71, 87, 0.3);
}

.btn-danger:hover,
.action-btn.danger:hover {
  background: rgba(255, 71, 87, 0.2);
  border-color: var(--danger);
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.2);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.75rem;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

/* Button Loading State */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
  margin-left: var(--space-sm);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =================================================================
   TABS - MODERN TAB NAVIGATION
   ================================================================= */
.admin-tabs {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  position: relative;
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-base);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.tab-btn.active {
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: var(--shadow-glow);
}

/* Tab Badge */
.tab-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tab Content */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =================================================================
   CARDS - DASHBOARD CARDS
   ================================================================= */
.card {
  background: rgba(22, 27, 34, 0.6);
  backdrop-filter: var(--blur-sm);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition-base);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-secondary);
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-title i {
  color: var(--accent-primary);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

/* Stat Card */
.stat-card {
  background: linear-gradient(135deg, rgba(22, 27, 34, 0.8), rgba(13, 17, 23, 0.9));
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: var(--transition-base);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 4px 0 0 4px;
}

.stat-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  border-color: var(--border-hover);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--accent-primary);
  margin-bottom: var(--space-md);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card .stat-trend {
  position: absolute;
  top: var(--space-lg);
  right: var(--space-lg);
  font-size: 0.75rem;
  font-weight: 600;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
}

.stat-card .stat-trend.up {
  background: var(--success-bg);
  color: var(--success);
}

.stat-card .stat-trend.down {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Revenue Card */
.revenue-card {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(22, 27, 34, 0.9), rgba(13, 17, 23, 0.95));
}

/* =================================================================
   TABLES - MODERN DATA TABLES
   ================================================================= */
.item-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.item-table thead {
  position: sticky;
  top: 0;
  z-index: 10;
}

.item-table th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: var(--space-md);
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
}

.item-table th:first-child {
  border-radius: var(--radius-md) 0 0 0;
}

.item-table th:last-child {
  border-radius: 0 var(--radius-md) 0 0;
}

.item-table td {
  padding: var(--space-md);
  background: rgba(22, 27, 34, 0.4);
  border-bottom: 1px solid var(--border-secondary);
  transition: var(--transition-fast);
}

.item-table tbody tr:hover td {
  background: var(--bg-hover);
}

.item-table tbody tr:last-child td {
  border-bottom: none;
}

.item-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 var(--radius-md);
}

.item-table tbody tr:last-child td:last-child {
  border-radius: 0 0 var(--radius-md) 0;
}

/* Table Actions */
.table-actions {
  display: flex;
  gap: var(--space-xs);
}

.table-actions button {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
}

/* =================================================================
   STATUS BADGES
   ================================================================= */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

.status-active, .status-approved {
  background: var(--success-bg);
  color: var(--success);
}

.status-pending, .status-new, .status-review {
  background: var(--warning-bg);
  color: var(--warning);
}

.status-deleted, .status-rejected {
  background: var(--danger-bg);
  color: var(--danger);
}

.status-info, .status-invited {
  background: var(--info-bg);
  color: var(--info);
}

/* =================================================================
   CLIENT LIST & CARDS
   ================================================================= */
.client-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.client-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: rgba(22, 27, 34, 0.5);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-base);
}

.client-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.client-item .client-info {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.client-item .client-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-inverse);
}

.client-item .client-details h4 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.client-item .client-details p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Client Cards Grid */
.client-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.client-card {
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition-base);
  cursor: pointer;
}

.client-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
}

/* =================================================================
   SIGNUP CARDS - NEW SIGNUPS
   ================================================================= */
.signup-card {
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

.signup-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--warning);
  border-radius: 4px 0 0 4px;
}

.signup-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.signup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.signup-header h4 {
  font-size: 1rem;
  color: var(--text-primary);
}

.signup-details {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.signup-details p {
  margin: var(--space-xs) 0;
}

.signup-details strong {
  color: var(--text-primary);
}

.signup-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.signup-actions .btn {
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8rem;
  border-radius: var(--radius-md);
  font-weight: 600;
}

.signup-actions .btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: var(--text-inverse);
}

.signup-actions .btn-secondary {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid rgba(0, 180, 216, 0.3);
}

.signup-actions .btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(255, 71, 87, 0.3);
}

/* =================================================================
   TEMPLATES SECTION
   ================================================================= */
.templates-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-xl);
}

.template-list-panel {
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.template-editor-panel {
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}

.template-item {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: var(--space-xs);
}

.template-item:hover {
  background: var(--bg-hover);
}

.template-item.active {
  background: var(--accent-subtle);
  border-left: 3px solid var(--accent-primary);
}

.template-name {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
}

.template-type {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =================================================================
   SEARCH BAR
   ================================================================= */
.search-bar {
  display: flex;
  margin-bottom: var(--space-xl);
  position: relative;
}

.search-input {
  flex: 1;
  padding: var(--space-md) var(--space-lg);
  padding-left: 48px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-base);
}

.search-bar::before {
  content: '\F52A';
  font-family: 'bootstrap-icons';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(0, 255, 148, 0.15);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: var(--space-sm) var(--space-md);
  background: var(--accent-subtle);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--accent-primary);
  cursor: pointer;
  transition: var(--transition-base);
}

.search-btn:hover {
  background: rgba(0, 255, 148, 0.2);
}

/* =================================================================
   TOAST NOTIFICATIONS
   ================================================================= */
.toast-container {
  position: fixed;
  top: 90px;
  right: 20px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: rgba(22, 27, 34, 0.95);
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast.hiding {
  animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: var(--space-xs);
  transition: var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

/* =================================================================
   LOADING STATES
   ================================================================= */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-hover) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-secondary);
  border-top-color: var(--accent-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: var(--blur-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: inherit;
}

/* =================================================================
   EMPTY STATES
   ================================================================= */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-secondary);
}

.empty-state i {
  font-size: 3rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
  display: block;
}

.empty-state h4 {
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.empty-message {
  text-align: center;
  padding: var(--space-xl);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* =================================================================
   MODALS
   ================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: var(--blur-sm);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-base);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: var(--transition-base);
  box-shadow: var(--shadow-xl);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-secondary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--text-primary);
}

/* =================================================================
   DATA FORMS
   ================================================================= */
.data-form {
  background: rgba(22, 27, 34, 0.5);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.data-form h4 {
  font-size: 1rem;
  color: var(--accent-primary);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.data-form h4 span {
  font-size: 0.6rem;
  padding: 4px 8px;
  background: var(--accent-subtle);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* =================================================================
   SECTION TITLES
   ================================================================= */
.section-title {
  font-size: 1.125rem;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 2px;
}

/* =================================================================
   ADMIN WELCOME
   ================================================================= */
.admin-welcome {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-primary);
}

.admin-welcome h2 {
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-xs);
}

.admin-welcome p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* =================================================================
   METRICS
   ================================================================= */
.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.metric {
  text-align: center;
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.metric-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Revenue Metrics Grid */
.revenue-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.rev-metric {
  background: var(--bg-tertiary);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  text-align: center;
}

.rev-metric .label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
}

.rev-metric .value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* =================================================================
   DASHBOARD CARDS
   ================================================================= */
.dashboard-card {
  background: rgba(22, 27, 34, 0.6);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: var(--transition-base);
}

.dashboard-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-lg);
}

.dashboard-card h3 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dashboard-card.full-width {
  grid-column: 1 / -1;
}

/* =================================================================
   VIEW TOGGLE
   ================================================================= */
.view-toggle {
  display: flex;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 4px;
}

.view-toggle button {
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.view-toggle button:hover {
  color: var(--text-primary);
}

.view-toggle button.active {
  background: var(--accent-subtle);
  color: var(--accent-primary);
}

/* =================================================================
   BACK LINK
   ================================================================= */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: var(--space-lg);
  transition: var(--transition-fast);
}

.back-link:hover {
  color: var(--accent-primary);
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */
@media (max-width: 1024px) {
  .templates-grid {
    grid-template-columns: 1fr;
  }
  
  .template-list-panel {
    order: 2;
  }
}

@media (max-width: 768px) {
  html { font-size: 13px; }
  
  header {
    padding: 0 var(--space-md);
    height: 60px;
  }
  
  .brand::before {
    width: 24px;
    height: 24px;
  }
  
  .admin-container {
    padding: calc(60px + var(--space-lg)) var(--space-md) var(--space-lg);
  }
  
  .admin-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: var(--space-xs);
  }
  
  .tab-btn {
    padding: var(--space-sm) var(--space-md);
    font-size: 0.8rem;
  }
  
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  
  .metrics {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .form-col {
    min-width: 100%;
  }
  
  .revenue-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .header-btn span {
    display: none;
  }
  
  .brand {
    font-size: 1.25rem;
    letter-spacing: 1px;
  }
  
  .admin-welcome h2 {
    font-size: 1.25rem;
  }
  
  .stat-card .stat-value {
    font-size: 1.5rem;
  }
  
  .signup-actions {
    flex-direction: column;
  }
  
  .signup-actions .btn {
    width: 100%;
  }
}

/* =================================================================
   UTILITY CLASSES
   ================================================================= */
.hidden { display: none !important; }
.visible { display: block !important; }
.flex { display: flex !important; }
.grid { display: grid !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.gap-1 { gap: var(--space-sm); }
.gap-2 { gap: var(--space-md); }
.gap-3 { gap: var(--space-lg); }

/* =================================================================
   CONFIRM DIALOG
   ================================================================= */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.confirm-overlay.confirm-visible {
  opacity: 1;
}

.confirm-overlay.confirm-exit {
  opacity: 0;
}

.confirm-dialog {
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-xl);
  transform: scale(0.9);
  transition: transform 0.2s ease;
}

.confirm-overlay.confirm-visible .confirm-dialog {
  transform: scale(1);
}

.confirm-title {
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.confirm-message {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.confirm-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
}

.confirm-btn {
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.confirm-cancel {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-secondary);
}

.confirm-cancel:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.confirm-ok {
  background: var(--accent-primary);
  color: var(--text-inverse);
}

.confirm-ok:hover {
  background: var(--accent-secondary);
  box-shadow: 0 0 20px var(--accent-glow);
}

.confirm-ok.danger {
  background: var(--danger);
}

.confirm-ok.danger:hover {
  background: #e63946;
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.4);
}

.confirm-ok.warning {
  background: var(--warning);
  color: var(--text-inverse);
}

.confirm-ok.warning:hover {
  background: #e6a700;
}
