/* =============================================================
   MAIN.CSS — CPM HUB — "Midnight Garage" Premium Theme v3
   Asphalt black · Ignition orange · Garage-LED teal
   Built for Car Parking Multiplayer. Same class API as v2 —
   every page keeps working, nothing breaks, nothing lost.
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700;800&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ══════════════════════════════════════════════════════════════
   ── DESIGN SYSTEM & COLOR PALETTE
   ══════════════════════════════════════════════════════════════ */

:root {
  /* ── BACKGROUNDS: asphalt & garage panel ──────────────────── */
  --bg-primary:       #08090c;
  --bg-secondary:     #0c0e12;
  --bg-tertiary:      #12151b;
  --bg-card:          #12151b;
  --bg-elevated:      #171b22;
  --bg-glass:         rgba(255,255,255,0.035);
  --bg-glass-sm:      rgba(255,255,255,0.015);
  --bg-hover:         rgba(255,107,53,0.08);
  --bg-active:        rgba(255,107,53,0.15);

  /* ── ACCENT COLORS: ignition orange, garage teal, gauge amber */
  --accent-primary:   #ff6b35;  /* Ignition Orange */
  --accent-secondary: #ffb800;  /* Gauge Amber */
  --accent-tertiary:  #e6491b;  /* Deep Ignition */
  --accent-blue:      #3b82f6;  /* Sky Blue */
  --accent-cyan:      #00d9c0;  /* Garage Teal (was cyan) */
  --accent-green:     #10b981;  /* Emerald */
  --accent-red:       #ff3b47;  /* Brake Red */
  --accent-gold:      #ffb800;  /* Premium Gold */
  --accent-pink:      #ec4899;  /* Hot Pink (rare use) */
  --accent-warning:   #ffb800;
  --accent-success:   #10b981;
  --accent-danger:    #ff3b47;
  --accent-info:      #00d9c0;

  /* ── GRADIENTS ─────────────────────────────────────────────── */
  --gradient-primary:      linear-gradient(135deg, #ff6b35 0%, #ffb800 50%, #ff6b35 100%);
  --gradient-secondary:    linear-gradient(135deg, #e6491b 0%, #ff6b35 100%);
  --gradient-cyan-blue:    linear-gradient(135deg, #00d9c0 0%, #3b82f6 100%);
  --gradient-gold:         linear-gradient(135deg, #ffb800 0%, #ffd75e 100%);
  --gradient-danger:       linear-gradient(135deg, #ff3b47 0%, #f97316 100%);
  --gradient-green:        linear-gradient(135deg, #10b981 0%, #34d399 100%);
  --gradient-card:         linear-gradient(135deg, rgba(255,107,53,0.08) 0%, rgba(255,184,0,0.04) 100%);
  --gradient-card-hover:   linear-gradient(135deg, rgba(255,107,53,0.12) 0%, rgba(255,184,0,0.08) 100%);
  --gradient-glow:         radial-gradient(ellipse at top, rgba(255,107,53,0.16) 0%, transparent 70%);
  --gradient-mesh:         linear-gradient(135deg, #ff6b35 0%, #ffb800 30%, #00d9c0 60%, #3b82f6 100%);
  --gradient-shimmer:      linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);

  /* ── TEXT COLORS ───────────────────────────────────────────── */
  --text-primary:     #f5f6f8;
  --text-secondary:   #a7adb8;
  --text-tertiary:    #7b8290;
  --text-muted:       #4d5360;
  --text-inverse:     #08090c;

  /* ── BORDERS ───────────────────────────────────────────────── */
  --border-light:     rgba(255,255,255,0.07);
  --border-medium:    rgba(255,255,255,0.12);
  --border-strong:    rgba(255,255,255,0.18);
  --border-focus:     rgba(255,107,53,0.55);
  --border-glow:      rgba(255,107,53,0.35);

  /* ── SHADOWS ───────────────────────────────────────────────── */
  --shadow-xs:        0 1px 3px rgba(0,0,0,0.8);
  --shadow-sm:        0 2px 8px rgba(0,0,0,0.6);
  --shadow-md:        0 4px 16px rgba(0,0,0,0.7);
  --shadow-lg:        0 8px 32px rgba(0,0,0,0.8);
  --shadow-xl:        0 12px 48px rgba(0,0,0,0.85);
  --shadow-card:      0 8px 32px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.04);
  --shadow-glow:      0 0 32px rgba(255,107,53,0.25), inset 0 1px 0 rgba(255,255,255,0.05);
  --shadow-glow-sm:   0 0 16px rgba(255,107,53,0.15);

  /* ── BORDER RADIUS ─────────────────────────────────────────── */
  --radius-xs:        4px;
  --radius-sm:        7px;
  --radius-md:        10px;
  --radius-lg:        14px;
  --radius-xl:        18px;
  --radius-2xl:       22px;
  --radius-pill:      999px;

  /* ── TRANSITIONS ───────────────────────────────────────────── */
  --transition:       all 0.22s cubic-bezier(.22,1,.36,1);
  --transition-slow:  all 0.35s cubic-bezier(.22,1,.36,1);
  --transition-fast:  all 0.14s cubic-bezier(.4,0,.2,1);

  /* ── LAYOUT CONSTANTS ──────────────────────────────────────── */
  --navbar-height:    68px;
  --sidebar-width:    276px;
  --spacing-xs:       4px;
  --spacing-sm:       8px;
  --spacing-md:       12px;
  --spacing-lg:       16px;
  --spacing-xl:       24px;
  --spacing-2xl:      32px;

  /* ── TYPOGRAPHY ────────────────────────────────────────────── */
  --font-display:     'Space Grotesk', sans-serif;
  --font-body:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:        'JetBrains Mono', monospace;
  --font-primary:     'Space Grotesk', sans-serif;

  /* ── Z-INDEX HIERARCHY ─────────────────────────────────────── */
  --z-dropdown:       100;
  --z-sticky:         120;
  --z-fixed:          150;
  --z-modal:          200;
  --z-tooltip:        300;
}

/* ══════════════════════════════════════════════════════════════
   ── GLOBAL RESETS & BASE STYLES
   ══════════════════════════════════════════════════════════════ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 0.95rem;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ── Atmospheric backdrop: subtle road-grid + glow ──────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    var(--gradient-glow),
    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 85% 60% at 50% 0%, black 35%, transparent 92%);
  mask-image: radial-gradient(ellipse 85% 60% at 50% 0%, black 35%, transparent 92%);
  pointer-events: none;
  z-index: 0;
}

/* ── Base element styles ────────────────────────────────────── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
}

input, textarea, select {
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

::selection { background: var(--accent-primary); color: #08090c; }

/* ══════════════════════════════════════════════════════════════
   ── ANIMATIONS & KEYFRAMES
   ══════════════════════════════════════════════════════════════ */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(255,107,53,0.4), inset 0 1px 0 rgba(255,255,255,0.05); }
  50%      { box-shadow: 0 0 28px rgba(255,107,53,0.8), inset 0 1px 0 rgba(255,255,255,0.1); }
}

@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-8px); }
}

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

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}

@keyframes blink-live {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* ══════════════════════════════════════════════════════════════
   ── SCROLLBAR STYLING
   ══════════════════════════════════════════════════════════════ */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); border-radius: 10px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #ff6b35, #e6491b);
  border-radius: 10px;
  box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ff8c5e, #ff6b35); }

/* ══════════════════════════════════════════════════════════════
   ── LAYOUT CONTAINERS
   ══════════════════════════════════════════════════════════════ */

.app-container {
  position: relative;
  z-index: 1;
  margin-top: var(--navbar-height);
  padding: var(--spacing-xl) var(--spacing-lg);
  width: 100%;
  animation: fadeInUp 0.4s ease-out;
}

@media (min-width: 1024px) {
  .app-container {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding: var(--spacing-2xl);
  }
}

.container-fluid { width: 100%; padding: 0 var(--spacing-lg); }
.container { max-width: 1200px; margin: 0 auto; width: 100%; }

/* ══════════════════════════════════════════════════════════════
   ── NAVBAR STYLING
   ══════════════════════════════════════════════════════════════ */

.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--navbar-height);
  z-index: var(--z-fixed);
  display: flex;
  align-items: center;
  padding: 0 var(--spacing-lg);
  gap: var(--spacing-md);
  background: rgba(8,9,12,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

@media (min-width: 1024px) {
  .navbar { left: var(--sidebar-width); width: calc(100% - var(--sidebar-width)); }
}

/* ── Brand/Logo ─────────────────────────────────────────────── */
.navbar-brand,
.cpm-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: linear-gradient(100deg, #ffffff 0%, #ffb800 45%, #ff6b35 80%, #ff8c5e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 220% 220%;
  animation: gradient-shift 6s ease infinite;
  flex: 1;
  white-space: nowrap;
  text-shadow: none;
  filter: drop-shadow(0 0 18px rgba(255,107,53,0.35));
}

/* ── Navbar menu & links ────────────────────────────────────── */
.navbar-menu { display: flex; align-items: center; gap: var(--spacing-sm); margin-left: auto; }

.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 40px;
  height: 40px;
  position: relative;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.nav-link span { display: none; }
.nav-link:hover { color: var(--text-primary); background: var(--bg-glass); transform: translateY(-2px); }
.nav-link.active {
  color: var(--accent-secondary);
  background: rgba(255,184,0,0.14);
  border: 1px solid var(--border-glow);
}

.menu-toggle {
  background: none; border: none; color: var(--text-secondary);
  font-size: 1.2rem; padding: 0.4rem; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  width: 40px; height: 40px;
}
.menu-toggle:hover { background: var(--bg-glass); color: var(--text-primary); transform: scale(1.1); }

/* ══════════════════════════════════════════════════════════════
   ── BUTTONS
   ══════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  font-family: inherit;
  line-height: 1;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-shimmer);
  opacity: 0;
  animation: shimmer 2s infinite;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Primary Button (ignition) ──────────────────────────────── */
.btn-primary {
  background: var(--gradient-primary);
  color: #08090c;
  box-shadow: 0 4px 20px rgba(255,107,53,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  font-weight: 800;
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 32px rgba(255,107,53,0.5), inset 0 1px 0 rgba(255,255,255,0.25);
  transform: translateY(-2px);
  filter: brightness(1.06);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(255,107,53,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}

/* ── Secondary Button ───────────────────────────────────────── */
.btn-secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.1);
  border-color: var(--border-glow);
  box-shadow: 0 4px 16px rgba(255,107,53,0.15);
  transform: translateY(-2px);
}

/* ── Success Button ──────────────────────────────────────────── */
.btn-success {
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.4);
  color: #34d399;
}
.btn-success:hover:not(:disabled) {
  background: rgba(16,185,129,0.25);
  border-color: rgba(16,185,129,0.6);
  box-shadow: 0 4px 16px rgba(16,185,129,0.2);
}

/* ── Danger Button ──────────────────────────────────────────── */
.btn-danger {
  background: rgba(255,59,71,0.15);
  border: 1px solid rgba(255,59,71,0.4);
  color: #ff6b74;
}
.btn-danger:hover:not(:disabled) {
  background: rgba(255,59,71,0.25);
  border-color: rgba(255,59,71,0.6);
  box-shadow: 0 4px 16px rgba(255,59,71,0.2);
}

/* ── Warning Button ─────────────────────────────────────────── */
.btn-warning {
  background: rgba(255,184,0,0.15);
  border: 1px solid rgba(255,184,0,0.4);
  color: #ffd75e;
}
.btn-warning:hover:not(:disabled) {
  background: rgba(255,184,0,0.25);
  border-color: rgba(255,184,0,0.6);
}

/* ── Ghost Button ───────────────────────────────────────────── */
.btn-ghost { background: transparent; border: none; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-glass); color: var(--text-primary); }

/* ── Outline Buttons ────────────────────────────────────────── */
.btn-outline-primary {
  background: transparent;
  border: 1.5px solid rgba(255,107,53,0.5);
  color: var(--accent-primary);
}
.btn-outline-primary:hover:not(:disabled) {
  background: rgba(255,107,53,0.1);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}
.btn-outline-secondary {
  background: transparent;
  border: 1.5px solid var(--border-medium);
  color: var(--text-secondary);
}
.btn-outline-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-strong);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* ── Button Sizes ───────────────────────────────────────────── */
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.8rem; border-radius: var(--radius-md); }
.btn-lg { padding: 0.85rem 1.95rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-xl { padding: 1rem 2.5rem; font-size: 1.05rem; border-radius: var(--radius-lg); }

/* ── Icon-only buttons (navbar) ─────────────────────────────── */
.navbar-menu .btn span,
.navbar-menu .btn-sm span,
.navbar-menu a.btn span,
.navbar-menu a.btn-sm span { display: none; }

.navbar-menu .btn,
.navbar-menu .btn-sm { padding: 0.5rem 0.65rem; min-width: 40px; height: 40px; }

/* ══════════════════════════════════════════════════════════════
   ── CARDS & BOXES
   ══════════════════════════════════════════════════════════════ */

.card, .box, .panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  pointer-events: none;
  opacity: 0;
  transition: var(--transition);
}

.card:hover {
  border-color: rgba(255,107,53,0.3);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
}
.card:hover::before { opacity: 1; }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-light);
}
.card-header h3, .card-header h2 { font-size: 1.2rem; font-weight: 700; margin: 0; color: var(--text-primary); }

.card-body { color: var(--text-secondary); line-height: 1.7; }

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid var(--border-light);
}

/* ══════════════════════════════════════════════════════════════
   ── FORMS & INPUTS
   ══════════════════════════════════════════════════════════════ */

.form-group { margin-bottom: var(--spacing-lg); display: flex; flex-direction: column; gap: var(--spacing-sm); }

label { font-weight: 600; color: var(--text-primary); font-size: 0.9rem; text-transform: capitalize; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="date"], input[type="url"], input[type="tel"],
textarea, select {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-fast);
  font-family: inherit;
}

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

input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus,
input[type="number"]:focus, input[type="search"]:focus, input[type="date"]:focus,
input[type="url"]:focus, input[type="tel"]:focus, textarea:focus, select:focus {
  outline: none;
  background-color: var(--bg-tertiary);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12), inset 0 1px 0 rgba(255,255,255,0.05);
}

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

input[type="checkbox"], input[type="radio"] {
  width: 18px; height: 18px; cursor: pointer; accent-color: var(--accent-primary);
}

/* ── Class-based form control aliases ──────────────────────────
   Several pages use class="form-control" / class="form-label"
   directly (rather than relying on element selectors above) so
   these need to exist as real classes too. */
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-fast);
  font-family: inherit;
}
.form-control:focus {
  outline: none;
  background-color: var(--bg-tertiary);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.12), inset 0 1px 0 rgba(255,255,255,0.05);
}
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 120px; }

.form-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: var(--spacing-sm);
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ══════════════════════════════════════════════════════════════
   ── ALERTS / FLASH MESSAGES
   Used across nearly every page for success/error/warning/info
   notices. Was previously referenced everywhere but never defined.
   ══════════════════════════════════════════════════════════════ */

@keyframes alertSlideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.alert {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-lg);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: var(--spacing-lg);
  backdrop-filter: blur(6px);
  animation: alertSlideIn .3s cubic-bezier(.22,1,.36,1) both;
  line-height: 1.5;
}
.alert i { flex-shrink: 0; font-size: 1rem; }

.alert-success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: #34d399;
}
.alert-danger, .alert-error {
  background: rgba(255,59,71,0.1);
  border: 1px solid rgba(255,59,71,0.3);
  color: #ff8c93;
}
.alert-warning {
  background: rgba(255,184,0,0.1);
  border: 1px solid rgba(255,184,0,0.3);
  color: #ffd75e;
}
.alert-info {
  background: rgba(0,217,192,0.1);
  border: 1px solid rgba(0,217,192,0.3);
  color: #3ce8d2;
}

/* ══════════════════════════════════════════════════════════════
   ── TYPOGRAPHY
   ══════════════════════════════════════════════════════════════ */

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 800; line-height: 1.2; margin-bottom: var(--spacing-md); }
h1 { font-size: 2.5rem; letter-spacing: -0.02em; }
h2 { font-size: 2rem; letter-spacing: -0.01em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); }

p { margin-bottom: var(--spacing-md); color: var(--text-secondary); line-height: 1.8; }

.text-primary   { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-success   { color: var(--accent-success) !important; }
.text-danger    { color: var(--accent-danger) !important; }
.text-warning   { color: var(--accent-warning) !important; }
.text-info      { color: var(--accent-cyan) !important; }
.text-center    { text-align: center; }
.text-bold      { font-weight: 700; }
.text-uppercase { text-transform: uppercase; }
.text-mono      { font-family: var(--font-mono); }

/* ══════════════════════════════════════════════════════════════
   ── BADGES & TAGS
   ══════════════════════════════════════════════════════════════ */

.badge, .tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem; font-weight: 700; white-space: nowrap;
}
.badge-primary { background: rgba(255,107,53,0.18); color: #ff8c5e; border: 1px solid rgba(255,107,53,0.4); }
.badge-success { background: rgba(16,185,129,0.2);  color: #34d399; border: 1px solid rgba(16,185,129,0.4); }
.badge-danger  { background: rgba(255,59,71,0.18);  color: #ff6b74; border: 1px solid rgba(255,59,71,0.4); }
.badge-warning { background: rgba(255,184,0,0.18);  color: #ffd75e; border: 1px solid rgba(255,184,0,0.4); }
.badge-info    { background: rgba(0,217,192,0.18);  color: #3ce8d2; border: 1px solid rgba(0,217,192,0.4); }
.badge-purple  { background: rgba(255,184,0,0.14);   color: #ffd75e; border: 1px solid rgba(255,184,0,0.3); }

/* ── Social / creator badges (YouTube, TikTok, Discord, Custom) ─ */
.social-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px; font-size: 0.7rem;
  flex-shrink: 0; transition: var(--transition-fast); cursor: pointer;
}
.social-badge:hover { transform: scale(1.15); }
.social-badge.sb-youtube { background: #ff0000; color: #fff; }
.social-badge.sb-tiktok  { background: #000;    color: #fff; border: 1px solid #333; }
.social-badge.sb-discord { background: #5865F2; color: #fff; }
.social-badge.sb-twitch  { background: #9146FF; color: #fff; }
.social-badge.sb-instagram { background: linear-gradient(135deg,#f58529,#dd2a7b,#8134af,#515bd4); color: #fff; }
.social-badge.sb-whatsapp { background: #25D366; color: #fff; }
.social-badge.sb-telegram  { background: #0088cc; color: #fff; }
.social-badge.sb-custom  { background: var(--gradient-primary); color: #08090c; }

/* ══════════════════════════════════════════════════════════════
   ── UTILITIES
   ══════════════════════════════════════════════════════════════ */

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

.gap-xs { gap: var(--spacing-xs); } .gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); } .gap-lg { gap: var(--spacing-lg); } .gap-xl { gap: var(--spacing-xl); }

.p-xs { padding: var(--spacing-xs); } .p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); } .p-lg { padding: var(--spacing-lg); } .p-xl { padding: var(--spacing-xl); }

.m-xs { margin: var(--spacing-xs); } .m-sm { margin: var(--spacing-sm); }
.m-md { margin: var(--spacing-md); } .m-lg { margin: var(--spacing-lg); } .m-xl { margin: var(--spacing-xl); }

.mt-xs { margin-top: var(--spacing-xs); } .mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); } .mt-lg { margin-top: var(--spacing-lg); } .mt-xl { margin-top: var(--spacing-xl); }

.mb-xs { margin-bottom: var(--spacing-xs); } .mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); } .mb-lg { margin-bottom: var(--spacing-lg); } .mb-xl { margin-bottom: var(--spacing-xl); }

.opacity-50 { opacity: 0.5; } .opacity-75 { opacity: 0.75; }

.rounded { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-pill); }
.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.bg-gradient { background: var(--gradient-primary); }
.bg-glass { background: var(--bg-glass); }
.cursor-pointer { cursor: pointer; }
.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* ══════════════════════════════════════════════════════════════
   ── PERMISSION / BATCH SYSTEM COMPONENTS (new)
   ══════════════════════════════════════════════════════════════ */

/* Individual permission toggle row — used in owner's grant panel */
.perm-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}
.perm-toggle-row:hover { border-color: var(--border-medium); }
.perm-toggle-row.granted { border-color: rgba(0,217,192,0.35); background: rgba(0,217,192,0.05); }
.perm-toggle-info b { display: block; font-size: 0.88rem; color: var(--text-primary); }
.perm-toggle-info span { font-size: 0.76rem; color: var(--text-tertiary); }

.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-track {
  position: absolute; inset: 0; background: var(--bg-elevated);
  border: 1px solid var(--border-medium); border-radius: 999px;
  cursor: pointer; transition: var(--transition-fast);
}
.switch-track::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: var(--text-tertiary); border-radius: 50%; transition: var(--transition-fast);
}
.switch input:checked + .switch-track { background: rgba(0,217,192,0.25); border-color: var(--accent-cyan); }
.switch input:checked + .switch-track::before { transform: translateX(20px); background: var(--accent-cyan); box-shadow: 0 0 8px rgba(0,217,192,0.6); }

/* Batch / pool cards — per-admin isolated accounts pool */
.batch-card {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 1.4rem; position: relative; overflow: hidden;
}
.batch-card::after {
  content: ''; position: absolute; top: 0; right: 0; width: 70px; height: 70px;
  background: var(--gradient-primary); opacity: .12; border-radius: 50%; filter: blur(20px);
}
.batch-owner { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.batch-owner .av { width: 30px; height: 30px; border-radius: 8px; background: var(--gradient-primary); flex-shrink: 0; }
.batch-owner b { font-size: 0.85rem; }
.batch-owner span { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.batch-stat-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.batch-stat-row .n { font-family: var(--font-mono); font-weight: 700; font-size: 1.1rem; color: var(--accent-primary); }
.batch-stat-row .l { font-size: .78rem; color: var(--text-tertiary); }

/* Extract action button — pulls from own pool only */
.btn-extract {
  background: rgba(255,184,0,0.14); border: 1px solid rgba(255,184,0,0.35); color: #ffd75e;
  display: inline-flex; align-items: center; gap: .5rem; font-weight: 700;
}
.btn-extract:hover { background: rgba(255,184,0,0.24); box-shadow: 0 4px 16px rgba(255,184,0,0.2); }

/* ══════════════════════════════════════════════════════════════
   ── AUTOMOTIVE SIGNATURE ELEMENTS
   ══════════════════════════════════════════════════════════════ */

/* Speed-stripe angled divider */
.stripe-divider { position: relative; height: 3px; margin: var(--spacing-xl) 0; overflow: hidden; }
.stripe-divider::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(-45deg, var(--accent-primary) 0 10px, transparent 10px 20px);
  opacity: .25;
}

/* Gauge-arc ring for stats */
.gauge-ring { position: relative; display: inline-flex; }
.gauge-ring svg { transform: rotate(-90deg); }
.gauge-ring .ring-bg { fill: none; stroke: rgba(255,255,255,.06); }
.gauge-ring .ring-fg { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.22,1,.36,1); }
.gauge-ring .ring-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* Live pulse dot (online/live indicators) */
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); animation: blink-live 1.6s ease-in-out infinite; display: inline-block; }
.pulse-dot.dot-red { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }
.pulse-dot.dot-amber { background: var(--accent-secondary); box-shadow: 0 0 8px var(--accent-secondary); }

/* ══════════════════════════════════════════════════════════════
   ── RESPONSIVE DESIGN
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  :root { --navbar-height: 60px; --spacing-lg: 12px; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .navbar { padding: 0 var(--spacing-md); }
  .navbar-brand, .cpm-brand { font-size: 1.05rem; }
  .app-container { padding: var(--spacing-lg) var(--spacing-md); }
  .card { padding: var(--spacing-md); }
}

@media (max-width: 480px) {
  :root { --spacing-xl: 16px; --spacing-lg: 10px; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  .btn { padding: 0.55rem 1rem; font-size: 0.85rem; }
}

/* Mobile bottom tab bar (new) */
.bottom-tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: var(--z-fixed);
  background: rgba(8,9,12,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  padding: 0.4rem 0.4rem calc(0.4rem + env(safe-area-inset-bottom));
  justify-content: space-around;
  align-items: center;
}
@media (max-width: 1023px) { .bottom-tabbar { display: flex; } body { padding-bottom: 62px; } }
.bottom-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 0.4rem 0.6rem; border-radius: var(--radius-md);
  color: var(--text-tertiary); font-size: 0.62rem; font-weight: 700;
  min-width: 54px; position: relative;
}
.bottom-tab i { font-size: 1.05rem; }
.bottom-tab.active { color: var(--accent-primary); }
.bottom-tab .tab-dot { position: absolute; top: 2px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-red); }

/* ══════════════════════════════════════════════════════════════
   ── ACCESSIBILITY
   ══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

*:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: 2px; }

/* ══════════════════════════════════════════════════════════════
   ── MODAL SYSTEM
   Used by profile editing, sharing, reporting, and settings across
   the site. Toggled by adding/removing the `.open` class via JS.
   ══════════════════════════════════════════════════════════════ */

@keyframes modalOverlayIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalContentIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal, 200);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  /* iOS-correct viewport height so the modal never sits behind the
     address bar or gets clipped on iPhone Safari */
  height: 100vh;
  height: 100dvh;
}

.modal.open {
  display: flex;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(4,5,7,0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: modalOverlayIn .22s ease both;
}

.modal-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  max-height: calc(100dvh - 2 * var(--spacing-lg));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-xl), 0 0 40px rgba(255,107,53,.08);
  animation: modalContentIn .28s cubic-bezier(.22,1,.36,1) both;
}

.modal-content h3 {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
}

.modal-content::-webkit-scrollbar { width: 6px; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(255,107,53,.3); border-radius: 99px; }

@media (max-width: 480px) {
  .modal { padding: var(--spacing-md); align-items: flex-end; }
  .modal-content {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: calc(100dvh - 4rem);
    padding-bottom: calc(var(--spacing-xl) + env(safe-area-inset-bottom));
    animation: modalSlideUp .3s cubic-bezier(.22,1,.36,1) both;
  }
}

@keyframes modalSlideUp { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: translateY(0); } }

/* ══════════════════════════════════════════════════════════════
   ── PRINT STYLES
   ══════════════════════════════════════════════════════════════ */

@media print {
  body { background: white; color: black; }
  .navbar, .sidebar, .bottom-tabbar { display: none; }
  .app-container { margin-top: 0; margin-left: 0; }
}

/* ══════════════════════════════════════════════════════════════
   ── EMPTY STATE
   No-data placeholder used across list/grid pages.
   ══════════════════════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: rgba(255,255,255,0.02);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-2xl);
  color: var(--text-muted);
}
.empty-state i {
  font-size: 3rem;
  display: block;
  margin-bottom: 1.1rem;
  opacity: 0.3;
}
.empty-state h3 {
  color: var(--text-primary);
  font-family: var(--font-display);
  margin-bottom: 0.4rem;
}
.empty-state p { color: var(--text-muted); margin: 0; }

/* ══════════════════════════════════════════════════════════════
   ── CODE BLOCK & COPY BUTTON
   ══════════════════════════════════════════════════════════════ */

.code-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-secondary);
  word-break: break-all;
}
.copy-btn {
  flex-shrink: 0;
  background: rgba(255,107,53,0.12);
  border: 1px solid rgba(255,107,53,0.3);
  color: var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}
.copy-btn:hover { background: rgba(255,107,53,0.22); }
.copy-btn.copied { background: rgba(16,185,129,0.18); border-color: rgba(16,185,129,0.4); color: #34d399; }

/* ══════════════════════════════════════════════════════════════
   ── COMMON LAYOUT UTILITIES
   Small set of flex/grid helpers referenced by several pages.
   ══════════════════════════════════════════════════════════════ */

.flex { display: flex; }
.grid { display: grid; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.btn-block { display: flex; width: 100%; }
.auth-form { display: flex; flex-direction: column; gap: var(--spacing-lg); }

@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
}

