/* ============================================================
   Generative Solutions UK - Glassmorphism Design System
   Brand: Cyan #00b4d8 → Purple #7b2ff7 → Pink #e040fb
   Background: Deep Navy #0a0a1a
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #0f0f2a;
  --bg-card: rgba(15, 15, 42, 0.6);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 180, 216, 0.3);

  --text-primary: #f0f0f5;
  --text-secondary: #a0a0c0;
  --text-muted: #6a6a8e;

  --cyan: #00b4d8;
  --blue: #0077b6;
  --purple: #7b2ff7;
  --pink: #e040fb;
  --magenta: #ff006e;
  --green: #00e676;
  --amber: #ffab00;
  --red: #ff5252;

  --gradient-brand: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
  --gradient-subtle: linear-gradient(135deg, rgba(0,180,216,0.15), rgba(123,47,247,0.15));
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 30px rgba(0,180,216,0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;

  /* Themeable mesh & accent colours */
  --mesh-color-1: rgba(0,180,216,0.08);
  --mesh-color-2: rgba(123,47,247,0.06);
  --mesh-color-3: rgba(224,64,251,0.05);
  --accent-glow: rgba(0,180,216,0.25);
  --accent-glow-hover: rgba(0,180,216,0.35);
  --accent-subtle: rgba(0,180,216,0.1);
  --grid-line: rgba(255,255,255,0.02);
  --navbar-bg: rgba(10, 10, 26, 0.92);
  --navbar-mobile-bg: rgba(10, 10, 26, 0.98);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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 mesh background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 20% 20%, var(--mesh-color-1), transparent),
    radial-gradient(ellipse 500px 500px at 80% 30%, var(--mesh-color-2), transparent),
    radial-gradient(ellipse 400px 300px at 50% 80%, var(--mesh-color-3), transparent);
  z-index: -1;
  animation: meshShift 20s ease-in-out infinite alternate;
}

@keyframes meshShift {
  0% { opacity: 1; }
  50% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* Grid lines background */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: -1;
}

a { color: var(--cyan); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--pink); }

img { max-width: 100%; height: auto; }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }

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

.section-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

/* --- Layout --- */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.flex { display: flex; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }

/* --- Glass Card --- */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

.glass:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.glass-card {
  background: var(--gradient-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

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

/* --- Navigation --- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 0;
  transition: var(--transition);
}

.navbar.scrolled {
  background: var(--navbar-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0.75rem 0;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.navbar-brand img {
  height: 64px;
  width: auto;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
}

.navbar-nav a {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.nav-cta {
  background: var(--gradient-brand) !important;
  color: white !important;
  padding: 0.5rem 1.25rem !important;
  border-radius: var(--radius-md) !important;
  font-weight: 600 !important;
}

.nav-cta:hover {
  opacity: 0.9;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* User dropdown */
.nav-user {
  position: relative;
  list-style: none;
}

.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  font-family: inherit;
}

.nav-user-btn:hover,
.nav-user.open .nav-user-btn {
  color: var(--text-primary);
  background: var(--bg-glass);
  border-color: var(--border-glass);
}

.nav-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.nav-chevron {
  transition: transform 0.2s ease;
}

.nav-user.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 200px;
  background: var(--navbar-mobile-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav-user.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 0.55rem 0.85rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.nav-dropdown a:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.nav-divider {
  height: 1px;
  background: var(--border-glass);
  margin: 0.3rem 0.5rem;
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .navbar-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--navbar-mobile-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    padding: 1rem;
  }
  .navbar-nav.open { display: flex; }
  .navbar-nav a { padding: 0.75rem 1rem; }

  .nav-user-name { display: none; }

  .nav-user { width: 100%; }

  .nav-user-btn {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0 0 0 1rem;
    min-width: 0;
  }

  .nav-user:not(.open) .nav-dropdown { display: none; }
  .nav-user.open .nav-dropdown { display: block; }
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding-top: 5rem;
  overflow: hidden;
}

.hero-content {
  max-width: 700px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero-visual {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  width: 45%;
  max-width: 600px;
  opacity: 0.2;
  filter: blur(0.5px);
}

/* Floating orbs */
.hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--mesh-color-2), transparent 70%);
  top: 20%;
  right: 10%;
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-30px) scale(1.05); }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  line-height: 1.4;
}

.btn-primary {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 30px var(--accent-glow-hover);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
  border-color: var(--border-glow);
}

.btn-outline {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--cyan);
}

.btn-outline:hover {
  background: var(--accent-subtle);
  color: var(--cyan);
}

.btn-danger {
  background: rgba(255,82,82,0.15);
  color: var(--red);
  border: 1px solid rgba(255,82,82,0.3);
}

.btn-danger:hover {
  background: rgba(255,82,82,0.25);
  color: var(--red);
}

.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn-block { width: 100%; justify-content: center; }

.btn-group { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* --- Forms --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  background: rgba(255,255,255,0.06);
}

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

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Phone input with country code */
.phone-wrap { display: flex; gap: 0; }
.phone-wrap .phone-code {
  width: 90px; flex-shrink: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  border-right: none;
  padding: 0.75rem 0.5rem; font-size: 0.9rem;
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%23a0a0c0'%3E%3Cpath d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; padding-right: 20px;
}
.phone-wrap .phone-code:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}
.phone-wrap .phone-code option { background: var(--bg-secondary); color: var(--text-primary); }
.phone-wrap .form-control { border-radius: 0 var(--radius-md) var(--radius-md) 0; flex: 1; min-width: 0; }
body.theme-slate .phone-wrap .phone-code {
  background: #f9fafb; color: #111827; border: 1px solid #d1d5db; border-right: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%236b7280'%3E%3Cpath d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center;
}
body.theme-slate .phone-wrap .phone-code option { background: #ffffff; color: #111827; }

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a0a0c0'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  color: var(--text-primary);
  cursor: pointer;
}

select.form-control option {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 8px 12px;
}

/* --- Pricing Cards --- */
.pricing-card {
  position: relative;
  padding: 2.5rem 2rem;
}

.pricing-card.popular {
  border-color: var(--cyan);
  box-shadow: 0 0 40px rgba(0,180,216,0.12);
}

.pricing-card.popular::after {
  content: 'Most Popular';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gradient-brand);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-price {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
  margin: 1.5rem 0 0.5rem;
}

.pricing-price .currency {
  font-size: 1.5rem;
  vertical-align: top;
  color: var(--text-secondary);
  font-weight: 600;
}

.pricing-price .period {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.pricing-features {
  list-style: none;
  margin: 1.5rem 0;
}

.pricing-features li {
  padding: 0.4rem 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pricing-features li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  font-size: 0.85rem;
}

/* --- Product Cards --- */
.product-card {
  position: relative;
  overflow: hidden;
}

.product-card .card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  background: var(--gradient-subtle);
  color: var(--cyan);
}

.product-card h3 {
  margin-bottom: 0.5rem;
}

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

.product-card .price-tag {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.product-card .price-tag strong {
  color: var(--cyan);
  font-size: 1.1rem;
}

/* --- Stats Bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

/* --- Feature Grid --- */
.feature-item {
  padding: 2rem;
}

.feature-item .icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
  background: var(--gradient-subtle);
}

.feature-item h4 { margin-bottom: 0.5rem; }
.feature-item p { color: var(--text-secondary); font-size: 0.9rem; }

/* --- Tables --- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: rgba(255,255,255,0.03);
}

th {
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}

td {
  padding: 0.875rem 1.25rem;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

tr:hover td {
  background: rgba(255,255,255,0.02);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-success { background: rgba(0,230,118,0.12); color: var(--green); }
.badge-warning { background: rgba(255,171,0,0.12); color: var(--amber); }
.badge-danger { background: rgba(255,82,82,0.12); color: var(--red); }
.badge-info { background: rgba(0,180,216,0.12); color: var(--cyan); }
.badge-purple { background: rgba(123,47,247,0.12); color: var(--purple); }

/* --- Flash Messages --- */
.flash-container {
  position: fixed;
  top: 5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
}

.flash {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  border: 1px solid;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideIn 0.3s ease;
  cursor: pointer;
}

.flash-success { background: rgba(0,230,118,0.1); border-color: rgba(0,230,118,0.3); color: var(--green); }
.flash-error { background: rgba(255,82,82,0.1); border-color: rgba(255,82,82,0.3); color: var(--red); }
.flash-info { background: rgba(0,180,216,0.1); border-color: rgba(0,180,216,0.3); color: var(--cyan); }
.flash-warning { background: rgba(255,171,0,0.1); border-color: rgba(255,171,0,0.3); color: var(--amber); }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 2rem;
  overflow-x: auto;
}

.tab {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* --- Footer --- */
.footer {
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--border-glass);
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 1rem;
  max-width: 300px;
}

.footer h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li { margin-bottom: 0.5rem; }

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--cyan);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* --- Page Header --- */
.page-header {
  padding: 8rem 0 3rem;
  text-align: center;
}

.page-header h1 { margin-bottom: 0.75rem; }
.page-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  font-size: 1.1rem;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  padding-top: 6rem;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb span { color: var(--text-muted); }

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.empty-state h3 { color: var(--text-secondary); margin-bottom: 0.5rem; }
.empty-state p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* --- Dashboard --- */
.dash-service-card {
  display: flex;
  flex-direction: column;
}
.dash-service-card .btn-primary {
  margin-top: auto;
}

.dash-quick-link {
  text-decoration: none;
  color: inherit;
  text-align: center;
  padding: 1.5rem 1rem;
  transition: var(--transition);
}
.dash-quick-link:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.dash-quick-link h4 {
  margin: 0.5rem 0 0.25rem;
}
.dash-quick-link p {
  font-size: 0.82rem;
  margin: 0;
}
.dash-quick-icon {
  font-size: 1.8rem;
}

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

/* --- Ticket / Support --- */
.ticket-list { display: flex; flex-direction: column; gap: 0.75rem; }

.ticket-item {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.ticket-item:hover { color: inherit; }

.ticket-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Message thread */
.message-thread {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.message {
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
}

.message.staff {
  border-left: 3px solid var(--cyan);
  background: rgba(0,180,216,0.04);
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.message-author { font-weight: 600; color: var(--text-primary); }
.message-time { color: var(--text-muted); }
.message-body { color: var(--text-secondary); line-height: 1.7; }

/* --- Billing cycle toggle --- */
.billing-toggle {
  display: inline-flex;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  padding: 4px;
  gap: 2px;
}

.billing-toggle button {
  padding: 0.5rem 1.5rem;
  border-radius: 100px;
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
  color: var(--text-secondary);
  background: transparent;
}

.billing-toggle button.active {
  background: var(--gradient-brand);
  color: white;
}

.save-badge {
  font-size: 0.7rem;
  background: rgba(0,230,118,0.15);
  color: var(--green);
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  margin-left: 0.25rem;
}

/* --- Admin sidebar (kept simple for MVP) --- */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  padding-top: 4.5rem;
}

.admin-sidebar {
  padding: 1.5rem;
  border-right: 1px solid var(--border-glass);
  position: sticky;
  top: 4.5rem;
  height: calc(100vh - 4.5rem);
  overflow-y: auto;
}

.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.admin-main {
  padding: 2rem 2.5rem;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

/* Admin stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  padding: 1.5rem;
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card .value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

/* Admin menu toggle — hidden on desktop */
.admin-menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  .admin-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .admin-menu-toggle {
    display: block;
    position: sticky;
    top: 4.5rem;
    z-index: 50;
    width: 100%;
    padding: 0.65rem 1rem;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: none;
    border-bottom: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
  }
  .admin-sidebar {
    position: sticky;
    top: calc(4.5rem + 42px);
    height: auto;
    max-height: calc(100vh - 4.5rem - 42px);
    overflow-y: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem;
    z-index: 40;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
  }
  .admin-sidebar.open {
    display: flex;
  }
  .admin-sidebar a { white-space: nowrap; }
  .admin-main {
    padding: 1rem;
    overflow-x: hidden;
    max-width: 100vw;
  }
  .admin-header { flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
  .admin-header h1 { font-size: 1.3rem; }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
  .stat-card { padding: 0.75rem; }
  .stat-card .value { font-size: 1.25rem; }
  .stat-card .label { font-size: 0.7rem; }
  .glass-card h3 { font-size: 1rem; }
  .flex-between { flex-wrap: wrap; gap: 0.5rem; }
  /* Tables scroll horizontally */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -0.5rem; padding: 0 0.5rem; }
  table { min-width: 500px; }
  /* Forms wrap better */
  .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
  .form-control, select.form-control { font-size: 0.85rem; }
  /* Buttons */
  .btn-sm { font-size: 0.78rem; padding: 0.4rem 0.75rem; }
}

/* --- Admin Enhancements --- */

.glass-card canvas {
  max-height: 280px;
}

.sidebar-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0.75rem 1rem 0.25rem;
  margin-top: 0.25rem;
}

.admin-sidebar hr {
  border: none;
  border-top: 1px solid var(--border-glass);
  margin: 0.5rem 1rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.connected { background: var(--green, #00e676); box-shadow: 0 0 6px var(--green, #00e676); }
.status-dot.disconnected { background: var(--red, #ff6b6b); box-shadow: 0 0 6px var(--red, #ff6b6b); }

tr[onclick] { cursor: pointer; }
tr[onclick]:hover td { background: rgba(0, 180, 216, 0.05); }

.detail-table { width: 100%; }
.detail-table td { padding: 0.4rem 0; vertical-align: top; }
.detail-table td:first-child { width: 140px; white-space: nowrap; padding-right: 1rem; }

.filter-bar { padding: 1rem !important; }

.badge-success { background: rgba(0, 230, 118, 0.15); color: #00e676; }
.badge-danger { background: rgba(255, 107, 107, 0.15); color: #ff6b6b; }
.badge-warning { background: rgba(255, 171, 0, 0.15); color: #ffab00; }
.badge-purple { background: rgba(123, 47, 247, 0.15); color: #b47aff; }
.badge-info { background: rgba(0, 180, 216, 0.15); color: #00b4d8; }

/* --- Tenant Management --- */
.product-tenant-card { padding: 1rem 1.25rem !important; }

.master-card { padding: 1.5rem !important; }

.tenant-timeline { position: relative; padding-left: 1.5rem; }
.timeline-item { position: relative; padding-bottom: 1.25rem; padding-left: 1rem; }
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: -1.15rem;
  top: 0.75rem;
  width: 2px;
  height: 100%;
  background: var(--border-glass);
}
.timeline-dot {
  position: absolute;
  left: -1.5rem;
  top: 0.25rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-primary);
}
.timeline-item.done .timeline-dot {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.cred-value {
  background: rgba(255,255,255,0.05);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
  user-select: all;
}

.grid-1 { grid-template-columns: 1fr; }

/* --- Auth Forms --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2.5rem;
}

.auth-card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.auth-card .subtitle {
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.auth-divider {
  text-align: center;
  margin: 1.5rem 0;
  position: relative;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border-glass);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

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

/* --- Checkout --- */
.checkout-summary {
  padding: 2rem;
}

.checkout-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-glass);
}

.checkout-total {
  display: flex;
  justify-content: space-between;
  padding: 1rem 0 0;
  font-size: 1.25rem;
  font-weight: 700;
}

/* --- Payment method selector --- */
.payment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.payment-option {
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  transition: var(--transition);
}

.payment-option:hover {
  border-color: var(--border-glow);
}

.payment-option.selected {
  border-color: var(--cyan);
  background: rgba(0,180,216,0.05);
}

.payment-option input[type="radio"] { display: none; }

.payment-option .name {
  font-weight: 600;
  margin-top: 0.5rem;
  display: block;
}

.payment-option .desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* --- KB Articles --- */
.kb-grid { gap: 1rem; }

.kb-card {
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.kb-card .icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-subtle);
  color: var(--cyan);
}

.kb-card h4 { margin-bottom: 0.25rem; font-size: 1rem; }
.kb-card p { color: var(--text-muted); font-size: 0.85rem; }

/* Article content */
.article-content {
  max-width: 800px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.article-content h2 { margin: 2rem 0 1rem; color: var(--text-primary); }
.article-content h3 { margin: 1.5rem 0 0.75rem; color: var(--text-primary); }
.article-content p { margin-bottom: 1rem; }
.article-content code {
  background: rgba(255,255,255,0.06);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.article-content pre {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.article-content pre code {
  background: none;
  padding: 0;
}

/* --- Invoice --- */
.invoice-card { padding: 2.5rem; }

.invoice-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-glass);
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.6s ease forwards;
}

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

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.2);
}

/* --- Utility --- */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* --- Screenshot Snippets --- */
.screenshot-strip {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.screenshot-strip::-webkit-scrollbar { height: 6px; }
.screenshot-strip::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.screenshot-snippet {
  flex: 0 0 auto;
  width: 260px;
  padding: 0.75rem;
  scroll-snap-align: start;
  cursor: pointer;
  text-align: center;
}

.snippet-img-wrap {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border-glass);
}

.snippet-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top left;
  display: block;
  transition: transform 0.4s ease;
}

.screenshot-snippet:hover .snippet-img-wrap img {
  transform: scale(1.05);
}

.snippet-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: fadeIn 0.2s ease;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
  .screenshot-snippet { width: 200px; }
  .snippet-img-wrap { height: 120px; }
}

/* --- AI Message Styles --- */
.message.ai-message {
  border-left: 3px solid var(--purple);
  background: rgba(123,47,247,0.04);
}

.badge-ai {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
}

.confidence-badge {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.1rem 0.5rem;
  border-radius: 100px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Internal notes */
.message.internal-note {
  border-left: 3px solid var(--amber);
  background: rgba(255,171,0,0.04);
}

.badge-internal {
  background: rgba(255,171,0,0.2);
  color: var(--amber);
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Star rating */
.star-rating {
  display: flex;
  flex-direction: row-reverse;
  justify-content: flex-end;
  gap: 0.25rem;
}

.star-rating input { display: none; }

.star-rating label {
  cursor: pointer;
  font-size: 1.75rem;
  color: rgba(255,255,255,0.15);
  transition: color 0.15s ease;
}

.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
  color: var(--amber);
}

/* Stat card number */
.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* Filter bar */
.filter-bar {
  padding: 1rem 1.5rem;
}

.filter-bar .form-control-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

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

/* --- Detail Table (admin) --- */
.detail-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.detail-table td { padding: 0.5rem 0; border-bottom: 1px solid var(--border-glass); }
.detail-table td:first-child { width: 140px; }
.detail-table tr:last-child td { border-bottom: none; }

/* ============================================================
   Theme System — Each theme has distinct visual personality
   ============================================================ */

/* ----------------------------------------------------------
   OCEAN — Calm deep blue, frosted glass, rounded soft feel
   ---------------------------------------------------------- */
body.theme-ocean {
  --bg-primary: #080e1e;
  --bg-secondary: #0c1629;
  --bg-card: rgba(12, 22, 41, 0.7);
  --bg-glass: rgba(120, 180, 255, 0.04);
  --bg-glass-hover: rgba(120, 180, 255, 0.08);
  --border-glass: rgba(100, 160, 240, 0.12);
  --border-glow: rgba(56, 189, 248, 0.35);
  --text-primary: #e2ecf7;
  --text-secondary: #8bacc8;
  --text-muted: #5678a0;
  --cyan: #38bdf8;
  --blue: #0284c7;
  --purple: #6366f1;
  --pink: #818cf8;
  --gradient-brand: linear-gradient(135deg, #0284c7, #38bdf8, #818cf8);
  --gradient-subtle: linear-gradient(135deg, rgba(56,189,248,0.12), rgba(99,102,241,0.12));
  --gradient-card: linear-gradient(160deg, rgba(56,189,248,0.06) 0%, rgba(99,102,241,0.03) 100%);
  --shadow-glow: 0 0 40px rgba(56,189,248,0.12);
  --mesh-color-1: rgba(56,189,248,0.07);
  --mesh-color-2: rgba(99,102,241,0.05);
  --mesh-color-3: rgba(129,140,248,0.04);
  --accent-glow: rgba(56,189,248,0.25);
  --accent-glow-hover: rgba(56,189,248,0.4);
  --accent-subtle: rgba(56,189,248,0.1);
  --navbar-bg: rgba(8, 14, 30, 0.92);
  --navbar-mobile-bg: rgba(8, 14, 30, 0.98);
  --radius-lg: 24px;
  --radius-md: 14px;
}
/* Ocean: frosted glass cards with blue tint top border */
body.theme-ocean .glass-card {
  border-top: 2px solid rgba(56,189,248,0.25);
  box-shadow: 0 4px 30px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.04);
}
body.theme-ocean .glass-card::before {
  background: linear-gradient(90deg, transparent, rgba(56,189,248,0.08), transparent);
  height: 1px;
}
body.theme-ocean .glass-card:hover {
  border-top-color: rgba(56,189,248,0.5);
}
body.theme-ocean .navbar.scrolled {
  border-bottom-color: rgba(56,189,248,0.15);
}
body.theme-ocean .btn-primary {
  box-shadow: 0 4px 20px rgba(56,189,248,0.3), inset 0 1px 0 rgba(255,255,255,0.15);
}
body.theme-ocean .badge { border-radius: 20px; }

/* ----------------------------------------------------------
   SLATE — Clean light theme, crisp shadows, corporate feel
   ---------------------------------------------------------- */
body.theme-slate {
  --bg-primary: #f4f6f9;
  --bg-secondary: #ebeef3;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-glass: rgba(0, 0, 0, 0.02);
  --bg-glass-hover: rgba(0, 0, 0, 0.04);
  --border-glass: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(79, 70, 229, 0.25);
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --cyan: #4f46e5;
  --blue: #4338ca;
  --purple: #7c3aed;
  --pink: #a78bfa;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --gradient-brand: linear-gradient(135deg, #4f46e5, #7c3aed, #a78bfa);
  --gradient-subtle: linear-gradient(135deg, rgba(79,70,229,0.06), rgba(124,58,237,0.06));
  --gradient-card: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
  --shadow-glow: 0 4px 20px rgba(79,70,229,0.08);
  --mesh-color-1: rgba(79,70,229,0.03);
  --mesh-color-2: rgba(124,58,237,0.02);
  --mesh-color-3: rgba(167,139,250,0.02);
  --accent-glow: rgba(79,70,229,0.18);
  --accent-glow-hover: rgba(79,70,229,0.25);
  --accent-subtle: rgba(79,70,229,0.06);
  --grid-line: rgba(0,0,0,0.025);
  --navbar-bg: rgba(255, 255, 255, 0.95);
  --navbar-mobile-bg: rgba(255, 255, 255, 0.98);
}
/* Slate: solid white cards with clean shadow, no glass/blur */
body.theme-slate .glass-card {
  background: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
}
body.theme-slate .glass-card::before {
  background: none;
  height: 0;
}
body.theme-slate .glass-card:hover {
  background: #ffffff;
  border-color: #d1d5db;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
body.theme-slate .glass,
body.theme-slate .glass:hover {
  background: #ffffff;
  backdrop-filter: none;
  border: 1px solid #e5e7eb;
}
body.theme-slate .navbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e5e7eb;
}
body.theme-slate .navbar.scrolled {
  background: var(--navbar-bg);
  border-bottom: 1px solid #d1d5db;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
body.theme-slate .nav-cta:hover { opacity: 0.9; }
body.theme-slate .navbar-brand img { filter: brightness(0.15); }
body.theme-slate .navbar-nav a { color: #4b5563; }
body.theme-slate .navbar-nav a:hover { color: #111827; background: rgba(0,0,0,0.04); }
body.theme-slate .navbar-nav a.active { color: #4f46e5; background: rgba(79,70,229,0.06); }
body.theme-slate .nav-cta { color: white !important; }
body.theme-slate a { color: #4f46e5; }
body.theme-slate a:hover { color: #7c3aed; }
body.theme-slate .form-control {
  background: #f9fafb;
  color: #111827;
  border: 1px solid #d1d5db;
}
body.theme-slate .form-control:focus {
  background: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
body.theme-slate .form-control::placeholder { color: #9ca3af; }
body.theme-slate select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b7280'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}
body.theme-slate select.form-control option {
  background: #ffffff;
  color: #111827;
}
body.theme-slate .admin-sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
}
body.theme-slate .admin-sidebar a { color: #4b5563; }
body.theme-slate .admin-sidebar a:hover { background: #f3f4f6; color: #111827; }
body.theme-slate .admin-sidebar a.active { background: rgba(79,70,229,0.08); color: #4f46e5; }
body.theme-slate .admin-sidebar hr { border-top-color: #e5e7eb; }
body.theme-slate .footer { background: #111827; color: #e5e7eb; }
body.theme-slate .footer h4 { color: #f9fafb; }
body.theme-slate .footer a { color: #9ca3af; }
body.theme-slate .footer a:hover { color: #ffffff; }
body.theme-slate .btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}
body.theme-slate .btn-secondary:hover { background: #e5e7eb; }
body.theme-slate .btn-primary { color: #ffffff; }
body.theme-slate .btn-outline { border-color: #4f46e5; color: #4f46e5; }
body.theme-slate .btn-outline:hover { background: rgba(79,70,229,0.06); }
body.theme-slate .table-wrapper { background: #ffffff; border: 1px solid #e5e7eb; }
body.theme-slate table th { background: #f9fafb; color: #374151; border-color: #e5e7eb; }
body.theme-slate table td { border-color: #f3f4f6; color: #374151; }
body.theme-slate tr:hover td { background: #f9fafb; }
body.theme-slate .badge { border: 1px solid transparent; }
body.theme-slate .badge-success { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
body.theme-slate .badge-warning { background: #fffbeb; color: #d97706; border-color: #fde68a; }
body.theme-slate .badge-danger { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
body.theme-slate .badge-info { background: #eef2ff; color: #4f46e5; border-color: #c7d2fe; }
body.theme-slate .badge-purple { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }
body.theme-slate .flash { backdrop-filter: none; border-width: 1px; }
body.theme-slate .flash-success { background: #ecfdf5; border-color: #a7f3d0; color: #059669; }
body.theme-slate .flash-error { background: #fef2f2; border-color: #fecaca; color: #dc2626; }
body.theme-slate .flash-info { background: #eef2ff; border-color: #c7d2fe; color: #4f46e5; }
body.theme-slate .flash-warning { background: #fffbeb; border-color: #fde68a; color: #d97706; }
body.theme-slate .breadcrumb a { color: #4f46e5; }
body.theme-slate .breadcrumb span { color: #9ca3af; }
body.theme-slate h1, body.theme-slate h2, body.theme-slate h3, body.theme-slate h4 { color: #111827; }
body.theme-slate .nav-toggle { color: #374151; }
/* Slate: mobile nav uses cookie banner same light treatment */
@media (max-width: 768px) {
  body.theme-slate .navbar-nav {
    background: rgba(255,255,255,0.98);
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  }
  body.theme-slate .navbar-nav a { color: #4b5563; }
  body.theme-slate .navbar-nav a:hover,
  body.theme-slate .navbar-nav a.active { color: #4f46e5; background: #f3f4f6; }
  body.theme-slate .glass-card { padding: 1.25rem; }
}
/* Slate: cookie banner override */
body.theme-slate #cookie-banner {
  background: rgba(255,255,255,0.97) !important;
  border-top-color: #e5e7eb !important;
}
body.theme-slate #cookie-banner strong { color: #111827; }
body.theme-slate #cookie-banner p { color: #4b5563 !important; }
body.theme-slate #cookie-banner a { color: #4f46e5 !important; }

/* ----------------------------------------------------------
   EMERALD — Dark forest, organic curves, nature-inspired
   ---------------------------------------------------------- */
body.theme-emerald {
  --bg-primary: #071410;
  --bg-secondary: #0c201a;
  --bg-card: rgba(12, 32, 26, 0.65);
  --bg-glass: rgba(52, 211, 153, 0.04);
  --bg-glass-hover: rgba(52, 211, 153, 0.08);
  --border-glass: rgba(52, 211, 153, 0.1);
  --border-glow: rgba(16, 185, 129, 0.35);
  --text-primary: #e6f5ed;
  --text-secondary: #86c4a5;
  --text-muted: #4e8a6e;
  --cyan: #10b981;
  --blue: #059669;
  --purple: #34d399;
  --pink: #6ee7b7;
  --gradient-brand: linear-gradient(135deg, #059669, #10b981, #34d399);
  --gradient-subtle: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(52,211,153,0.12));
  --gradient-card: linear-gradient(160deg, rgba(16,185,129,0.05) 0%, rgba(52,211,153,0.02) 100%);
  --shadow-glow: 0 0 35px rgba(16,185,129,0.12);
  --mesh-color-1: rgba(16,185,129,0.07);
  --mesh-color-2: rgba(52,211,153,0.05);
  --mesh-color-3: rgba(110,231,183,0.04);
  --accent-glow: rgba(16,185,129,0.25);
  --accent-glow-hover: rgba(16,185,129,0.4);
  --accent-subtle: rgba(16,185,129,0.1);
  --navbar-bg: rgba(7, 20, 16, 0.92);
  --navbar-mobile-bg: rgba(7, 20, 16, 0.98);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}
/* Emerald: cards with left green accent bar, organic feel */
body.theme-emerald .glass-card {
  border-left: 3px solid rgba(16,185,129,0.4);
  border-radius: 4px 16px 16px 4px;
}
body.theme-emerald .glass-card::before {
  background: linear-gradient(90deg, rgba(16,185,129,0.12), transparent 50%);
  height: 100%;
  width: 60px;
  right: auto;
}
body.theme-emerald .glass-card:hover {
  border-left-color: rgba(16,185,129,0.7);
}
body.theme-emerald .navbar.scrolled {
  border-bottom-color: rgba(16,185,129,0.15);
}
body.theme-emerald .btn-primary {
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(16,185,129,0.3);
}
body.theme-emerald .badge { border-radius: 6px; }
body.theme-emerald .btn { border-radius: 8px; }

/* ----------------------------------------------------------
   SUNSET — Warm dark, ember glow, bold angular feel
   ---------------------------------------------------------- */
body.theme-sunset {
  --bg-primary: #140c06;
  --bg-secondary: #1f150c;
  --bg-card: rgba(31, 21, 12, 0.7);
  --bg-glass: rgba(255, 152, 0, 0.04);
  --bg-glass-hover: rgba(255, 152, 0, 0.08);
  --border-glass: rgba(255, 152, 0, 0.1);
  --border-glow: rgba(251, 146, 60, 0.35);
  --text-primary: #faf0e6;
  --text-secondary: #c8a882;
  --text-muted: #8a6c4e;
  --cyan: #fb923c;
  --blue: #f97316;
  --purple: #ef4444;
  --pink: #f87171;
  --gradient-brand: linear-gradient(135deg, #f97316, #ef4444, #f87171);
  --gradient-subtle: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(239,68,68,0.12));
  --gradient-card: linear-gradient(160deg, rgba(249,115,22,0.05) 0%, rgba(239,68,68,0.03) 100%);
  --shadow-glow: 0 0 35px rgba(249,115,22,0.12);
  --mesh-color-1: rgba(249,115,22,0.07);
  --mesh-color-2: rgba(239,68,68,0.05);
  --mesh-color-3: rgba(248,113,113,0.04);
  --accent-glow: rgba(249,115,22,0.3);
  --accent-glow-hover: rgba(249,115,22,0.45);
  --accent-subtle: rgba(249,115,22,0.1);
  --navbar-bg: rgba(20, 12, 6, 0.92);
  --navbar-mobile-bg: rgba(20, 12, 6, 0.98);
  --radius-lg: 10px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --radius-xl: 14px;
}
/* Sunset: sharp edges, top gradient stripe, ember glow */
body.theme-sunset .glass-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(249,115,22,0.12);
  box-shadow: 0 2px 20px rgba(0,0,0,0.4), 0 0 60px rgba(249,115,22,0.04);
}
body.theme-sunset .glass-card::before {
  height: 3px;
  background: linear-gradient(90deg, #f97316, #ef4444, transparent 70%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
body.theme-sunset .glass-card:hover {
  box-shadow: 0 4px 30px rgba(0,0,0,0.5), 0 0 40px rgba(249,115,22,0.1);
}
body.theme-sunset .navbar.scrolled {
  border-bottom-color: rgba(249,115,22,0.15);
}
body.theme-sunset .btn-primary {
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(249,115,22,0.35);
}
body.theme-sunset .badge { border-radius: 4px; font-weight: 700; text-transform: uppercase; font-size: 0.65rem; letter-spacing: 0.05em; }
body.theme-sunset .btn { border-radius: 6px; }
body.theme-sunset a:hover { color: #fb923c; }

/* ----------------------------------------------------------
   ROYAL — Rich purple+gold, luxurious, elegant borders
   ---------------------------------------------------------- */
body.theme-royal {
  --bg-primary: #0d0815;
  --bg-secondary: #150e22;
  --bg-card: rgba(21, 14, 34, 0.7);
  --bg-glass: rgba(212, 175, 55, 0.03);
  --bg-glass-hover: rgba(212, 175, 55, 0.06);
  --border-glass: rgba(212, 175, 55, 0.1);
  --border-glow: rgba(212, 175, 55, 0.3);
  --text-primary: #f0e8f8;
  --text-secondary: #b8a0d0;
  --text-muted: #7a6898;
  --cyan: #d4af37;
  --blue: #c49b2a;
  --purple: #8b5cf6;
  --pink: #a78bfa;
  --gradient-brand: linear-gradient(135deg, #c49b2a, #d4af37, #8b5cf6);
  --gradient-subtle: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(139,92,246,0.1));
  --gradient-card: linear-gradient(160deg, rgba(212,175,55,0.04) 0%, rgba(139,92,246,0.03) 100%);
  --shadow-glow: 0 0 35px rgba(212,175,55,0.1);
  --mesh-color-1: rgba(212,175,55,0.06);
  --mesh-color-2: rgba(139,92,246,0.05);
  --mesh-color-3: rgba(167,139,250,0.04);
  --accent-glow: rgba(212,175,55,0.25);
  --accent-glow-hover: rgba(212,175,55,0.4);
  --accent-subtle: rgba(212,175,55,0.08);
  --navbar-bg: rgba(13, 8, 21, 0.92);
  --navbar-mobile-bg: rgba(13, 8, 21, 0.98);
}
/* Royal: double gold border, ornate feel */
body.theme-royal .glass-card {
  border: 1px solid rgba(212,175,55,0.15);
  box-shadow: 0 4px 30px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(212,175,55,0.06);
}
body.theme-royal .glass-card::before {
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, rgba(212,175,55,0.4) 30%, rgba(139,92,246,0.3) 70%, transparent 95%);
}
body.theme-royal .glass-card:hover {
  border-color: rgba(212,175,55,0.3);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(212,175,55,0.1), 0 0 30px rgba(212,175,55,0.08);
}
body.theme-royal .navbar.scrolled {
  border-bottom-color: rgba(212,175,55,0.15);
}
body.theme-royal .nav-cta {
  background: linear-gradient(135deg, #c49b2a, #d4af37) !important;
  color: #0d0815 !important;
  font-weight: 700 !important;
}
body.theme-royal .btn-primary {
  background: linear-gradient(135deg, #c49b2a, #d4af37, #8b5cf6);
  box-shadow: 0 4px 20px rgba(212,175,55,0.3);
}
body.theme-royal .badge { border-radius: 4px; }
body.theme-royal a:hover { color: #d4af37; }
body.theme-royal .footer { border-top: 1px solid rgba(212,175,55,0.12); }

/* ============================================================
   Theme Picker UI
   ============================================================ */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.theme-swatch {
  cursor: pointer;
  text-align: center;
  position: relative;
}
.theme-swatch input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.swatch-preview {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-glass);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}
/* Mini mock UI inside swatch */
.swatch-mockbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: rgba(255,255,255,0.08);
}
.swatch-mockcard {
  position: absolute;
  top: 12px;
  left: 8px;
  right: 8px;
  bottom: 6px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.swatch-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.theme-swatch:hover .swatch-preview {
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.theme-swatch.active .swatch-preview,
.theme-swatch input:checked + .swatch-preview {
  border-color: var(--cyan);
  box-shadow: 0 0 16px var(--accent-glow);
  transform: translateY(-2px);
}
.swatch-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.theme-swatch.active .swatch-label {
  color: var(--cyan);
  font-weight: 600;
}
@media (max-width: 600px) {
  .theme-picker { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Mobile-Friendly Theme Adjustments
   ============================================================ */
@media (max-width: 768px) {
  /* Prevent any overflow at every level */
  body, main, .container { max-width: 100vw; }

  /* Tighter card padding on mobile */
  .glass-card { padding: 1.25rem; }

  /* Ensure card hover effects don't cause layout jank on touch */
  .glass-card:hover { transform: none; }
  .glass:hover { transform: none; }

  /* Hero adjustments */
  .hero { min-height: auto; padding: 6rem 0 3rem; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .hero-visual { display: none; }
  .hero::after { width: 150px; height: 150px; right: -10%; opacity: 0.4; }

  /* Typography scaling */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.15rem; }

  /* Container tighter padding */
  .container { padding: 0 1rem; }

  /* Section padding reduced */
  .section { padding: 3rem 0; }

  /* Page header */
  .page-header { padding: 5rem 0 2rem; }
  .page-header h1 { font-size: 1.75rem; }

  /* Buttons stack vertically on mobile */
  .btn-group { flex-direction: column; gap: 0.5rem; }
  .btn-group .btn { width: 100%; justify-content: center; }
  .btn { font-size: 0.85rem; padding: 0.6rem 1rem; }
  .btn-lg { padding: 0.75rem 1.5rem; font-size: 0.95rem; }

  /* All grids single-column */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }

  /* Stat cards / stats bar: constrain on mobile */
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 1rem; padding: 1.25rem 0; }
  .stat-value { font-size: 1.75rem; }

  /* Tables: tighter padding + horizontal scroll */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th { padding: 0.6rem 0.75rem; font-size: 0.7rem; }
  td { padding: 0.6rem 0.75rem; font-size: 0.8rem; }
  .detail-table td:first-child { width: auto; white-space: normal; }

  /* Flash messages */
  .flash-container { right: 0.75rem; left: 0.75rem; }

  /* Footer */
  .footer { padding: 2.5rem 0 1.5rem; }
  .footer-grid { grid-template-columns: 1fr !important; gap: 1.5rem; }

  /* Admin sidebar mobile */
  .admin-sidebar a { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
  .admin-main { padding: 1rem; }
  .admin-header h1 { font-size: 1.5rem; }

  /* Admin filter bars: wrap into rows */
  .filter-bar { flex-wrap: wrap !important; }
  .filter-bar .form-group,
  .filter-bar form .form-group { min-width: 0 !important; flex: 1 1 100% !important; }
  .filter-bar form { flex-wrap: wrap !important; }

  /* Cookie banner stacks on mobile */
  #cookie-banner .container { flex-direction: column !important; text-align: center; }

  /* Flex layouts don't overflow */
  .flex-between { flex-wrap: wrap; gap: 0.5rem; }

  /* Emerald: left border thinner on mobile */
  body.theme-emerald .glass-card { border-left-width: 2px; }
  body.theme-emerald .glass-card::before { width: 30px; }

  /* Sunset: stripe thinner on mobile */
  body.theme-sunset .glass-card::before { height: 2px; }
}

@media (max-width: 480px) {
  /* Extra small screens */
  .glass-card { padding: 0.875rem; border-radius: var(--radius-md); }
  .container { padding: 0 0.75rem; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.2rem; }

  /* Hero: hide orb entirely, compact layout */
  .hero { padding: 5rem 0 2rem; }
  .hero h1 { font-size: 1.5rem; }
  .hero::after { display: none; }

  /* Stat cards stack to single column */
  .stat-cards { grid-template-columns: 1fr; }
  .stat-card .value { font-size: 1.35rem; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stat-value { font-size: 1.5rem; }

  /* Buttons full-width */
  .btn { width: 100%; justify-content: center; }

  /* Theme picker 2 columns */
  .theme-picker { gap: 0.5rem; grid-template-columns: repeat(2, 1fr); }
  .swatch-label { font-size: 0.7rem; }

  /* Breadcrumb */
  .breadcrumb { padding-top: 5rem; font-size: 0.75rem; }

  /* Tables even tighter */
  th { padding: 0.4rem 0.5rem; font-size: 0.65rem; }
  td { padding: 0.4rem 0.5rem; font-size: 0.75rem; }
  code { font-size: 0.65rem !important; word-break: break-all; }

  /* Smaller badges */
  .badge { font-size: 0.65rem; padding: 0.15rem 0.5rem; }

  /* Stack flex-between */
  .flex-between { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
}

/* --- Print --- */
@media print {
  .navbar, .footer, .flash-container, .admin-sidebar { display: none !important; }
  body { background: white; color: black; }
  body::before, body::after { display: none; }
  .glass, .glass-card { background: white; border: 1px solid #ddd; backdrop-filter: none; }
}
