/* ============================================================
   MOTOHUB — STYLESHEET
   West Texas Motorsport Editorial · Dark + KTM Orange
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=IBM+Plex+Mono:wght@400;500;600&family=Barlow:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  --black: #0D0D0D;
  --surface-1: #111111;
  --surface-2: #171717;
  --surface-3: #1E1E1E;
  --surface-4: #242424;

  --border: rgba(255,255,255,0.07);
  --border-med: rgba(255,255,255,0.13);
  --border-light: rgba(255,255,255,0.20);

  --orange: #FF6B00;
  --orange-dim: rgba(255,107,0,0.12);
  --orange-glow: rgba(255,107,0,0.30);

  --white: #FFFFFF;
  --text-1: #F0EDE8;
  --text-2: #B8B3AC;
  --text-3: #7A7570;
  --text-4: #3A3530;

  --green: #4ade80;
  --green-dim: rgba(74,222,128,0.12);
  --red: #f87171;
  --red-dim: rgba(248,113,113,0.12);
  --yellow: #fbbf24;
  --yellow-dim: rgba(251,191,36,0.12);
  --blue: #60a5fa;
  --blue-dim: rgba(96,165,250,0.12);

  --font-display: 'Bebas Neue', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-body: 'Barlow', sans-serif;

  --nav-h: 64px;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.5);
  --shadow-orange: 0 8px 32px rgba(255,107,0,0.25);
}

/* ── Reset ─────────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--black);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
}

img {
  display: block;
  max-width: 100%;
}

input, select, textarea {
  font-family: var(--font-body);
}

ul, ol {
  list-style: none;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.018;
  pointer-events: none;
  z-index: 9999;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: var(--surface-1);
}

::-webkit-scrollbar-thumb {
  background: var(--text-4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--orange);
}

/* ── Typography ────────────────────────────────────────────── */
.t-display {
  font-family: var(--font-display);
  letter-spacing: 0.03em;
}

.t-mono {
  font-family: var(--font-mono);
}

.t-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}

.t-orange { color: var(--orange); }
.t-green  { color: var(--green); }
.t-red    { color: var(--red); }
.t-yellow { color: var(--yellow); }
.t-muted  { color: var(--text-3); }
.t-dim    { color: var(--text-2); }
.t-white  { color: var(--white); }

/* ── Layout ────────────────────────────────────────────────── */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}

.container-sm {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 768px) {
  .container, .container-sm {
    padding: 0 20px;
  }
}

.page {
  min-height: calc(100vh - var(--nav-h));
}

#app {
  padding-top: var(--nav-h);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

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

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

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }

.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.gap-32 { gap: 32px; }

.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }

.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }

.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }
.p-32 { padding: 32px; }

.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }

@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.card:hover {
  border-color: var(--border-med);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-beginner     { background: var(--green-dim);  color: var(--green); }
.badge-intermediate { background: var(--yellow-dim); color: var(--yellow); }
.badge-advanced     { background: var(--red-dim);    color: var(--red); }
.badge-expert       { background: rgba(168,85,247,0.15); color: #c084fc; }
.badge-orange       { background: var(--orange-dim); color: var(--orange); }
.badge-blue         { background: var(--blue-dim);   color: var(--blue); }
.badge-pending      { background: var(--yellow-dim); color: var(--yellow); }
.badge-approved     { background: var(--green-dim);  color: var(--green); }
.badge-rejected     { background: var(--red-dim);    color: var(--red); }
.badge-under_review { background: var(--blue-dim);   color: var(--blue); }
.badge-needs_info   { background: var(--yellow-dim); color: var(--yellow); }

/* ── Section header ────────────────────────────────────────── */
.section-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--white);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.accent-bar {
  width: 36px;
  height: 3px;
  background: var(--orange);
  margin-bottom: 16px;
}

.stars {
  color: var(--orange);
  letter-spacing: 2px;
}

/* ── Avatars ───────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--black);
  flex-shrink: 0;
}

.avatar-sm  { width: 28px;  height: 28px;  font-size: 11px; }
.avatar-md  { width: 36px;  height: 36px;  font-size: 14px; }
.avatar-lg  { width: 48px;  height: 48px;  font-size: 18px; }
.avatar-xl  { width: 80px;  height: 80px;  font-size: 30px; }
.avatar-2xl { width: 120px; height: 120px; font-size: 44px; }

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  text-align: center;
  gap: 12px;
}

.empty-state-icon {
  font-size: 48px;
  opacity: 0.4;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

.empty-state-sub {
  font-size: 14px;
  color: var(--text-3);
  max-width: 380px;
}

/* ── Loading ───────────────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-med);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--orange);
  color: var(--black);
  border-color: var(--orange);
}

.btn-primary:hover {
  background: #ff7a1a;
  transform: translateY(-1px);
  box-shadow: var(--shadow-orange);
}

.btn-outline {
  background: transparent;
  color: var(--text-1);
  border-color: var(--border-med);
}

.btn-outline:hover {
  border-color: var(--orange);
  color: var(--orange);
}

.btn-ghost {
  background: rgba(255,255,255,0.05);
  color: var(--text-1);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: rgba(255,255,255,0.09);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border-color: var(--red-dim);
}

.btn-danger:hover {
  background: rgba(248,113,113,0.25);
}

.btn-success {
  background: var(--green-dim);
  color: var(--green);
  border-color: var(--green-dim);
}

.btn-sm { padding: 7px 16px; font-size: 11px; }
.btn-lg { padding: 15px 36px; font-size: 13px; }
.btn-xl { padding: 18px 48px; font-size: 14px; }
.btn-full { width: 100%; justify-content: center; }

/* ════════════════════════════════════════════════════════════
   NAVIGATION
   ════════════════════════════════════════════════════════════ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(13,13,13,0.9);
  backdrop-filter: blur(24px) saturate(1.3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 36px;
  z-index: 1000;
  transition: border-color 0.3s;
}

#nav.scrolled {
  border-bottom-color: var(--border-med);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
}

.nav-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--orange);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--black);
}

.nav-logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.08em;
  color: var(--white);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}

.nav-link.active {
  color: var(--orange);
  background: var(--orange-dim);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-avatar-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-1);
}

.nav-avatar-btn:hover {
  border-color: var(--border-med);
  background: rgba(255,255,255,0.04);
}

.nav-avatar-name {
  font-size: 12px;
  font-weight: 600;
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  margin-left: auto;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-1);
  border-radius: 2px;
}

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  background: rgba(13,13,13,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  z-index: 998;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu.open {
  display: flex;
}

.mobile-nav-link {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}

.mobile-nav-link:hover {
  color: var(--white);
  background: rgba(255,255,255,0.06);
}

@media (max-width: 900px) {
  .nav-links, .nav-right { display: none; }
  .nav-hamburger { display: flex; }
  #nav { padding: 0 20px; gap: 12px; }
}

/* ════════════════════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
}

.form-label .required {
  color: var(--orange);
  margin-left: 3px;
}

.form-input, .form-select, .form-textarea {
  background: var(--surface-3);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-1);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-dim);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-3);
}

.form-select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A7570' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

option {
  background: var(--surface-3);
  color: var(--text-1);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

.form-hint {
  font-size: 11px;
  color: var(--text-3);
}

.form-error {
  font-size: 11px;
  color: var(--red);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

.upload-area {
  border: 2px dashed var(--border-med);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area:hover {
  border-color: var(--orange);
  background: var(--orange-dim);
}

.upload-area-icon {
  font-size: 30px;
  margin-bottom: 8px;
}

.upload-area-text {
  font-size: 14px;
  color: var(--text-2);
}

.upload-area-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--surface-2);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }

.modal-header {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 5px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

.modal-close:hover {
  color: var(--white);
}

.modal-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ════════════════════════════════════════════════════════════
   TABS
   ════════════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  gap: 0;
}

.tab {
  padding: 14px 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab:hover:not(.active) {
  color: var(--text-1);
}

.tab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

/* ════════════════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  min-width: 260px;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  border-left: 3px solid var(--orange);
}

.toast.success { border-left-color: var(--green); }
.toast.error   { border-left-color: var(--red); }
.toast.info    { border-left-color: var(--blue); }

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-msg {
  font-size: 13px;
  color: var(--text-1);
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 16px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════
   DROPDOWN
   ════════════════════════════════════════════════════════════ */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-lg);
  min-width: 210px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: fadeIn 0.15s ease;
  overflow: hidden;
}

.dropdown-menu.hidden {
  display: none;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(255,255,255,0.05);
  color: var(--white);
}

.dropdown-item.danger:hover {
  color: var(--red);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ════════════════════════════════════════════════════════════
   STEPS WIZARD
   ════════════════════════════════════════════════════════════ */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.3s;
  border: 2px solid var(--border-med);
  color: var(--text-3);
  background: var(--surface-3);
}

.step.active .step-number {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-dim);
}

.step.complete .step-number {
  border-color: var(--green);
  color: var(--black);
  background: var(--green);
}

.step-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.step.active .step-label { color: var(--orange); }
.step.complete .step-label { color: var(--green); }

.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 8px;
}

/* ════════════════════════════════════════════════════════════
   LEADERBOARD ROWS
   ════════════════════════════════════════════════════════════ */
.lb-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.lb-row:hover {
  background: rgba(255,255,255,0.03);
}

.lb-row + .lb-row {
  border-top: 1px solid var(--border);
}

.lb-rank {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}

.lb-rank.gold   { color: #F5C842; }
.lb-rank.silver { color: #B4B4B4; }
.lb-rank.bronze { color: #CD7F32; }

.lb-time {
  font-family: var(--font-mono);
  color: var(--orange);
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
#footer {
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  padding: 60px 0 32px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

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

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

.footer-col-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 18px;
}

.footer-desc {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.8;
  max-width: 240px;
  margin-top: 16px;
}

.footer-link {
  display: block;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 10px;
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  padding: 0;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--orange);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 12px;
  color: var(--text-3);
}

.notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
  animation: pulse 2s infinite;
}

.sidebar-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 1024px) {
  .sidebar-layout { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   LEAFLET DARK THEME
   ════════════════════════════════════════════════════════════ */
.leaflet-container {
  background: #0a0a0a !important;
}

.leaflet-tile {
  filter: invert(1) hue-rotate(180deg) brightness(0.88) saturate(1.3);
}

.leaflet-control-zoom {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: var(--surface-2) !important;
  color: var(--text-1) !important;
  border: none !important;
  border-bottom: 1px solid var(--border) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--surface-3) !important;
  color: var(--orange) !important;
}

.leaflet-control-attribution {
  background: rgba(13,13,13,0.75) !important;
  color: var(--text-3) !important;
  font-size: 10px !important;
}

.leaflet-control-attribution a {
  color: var(--text-3) !important;
}

.leaflet-popup-content-wrapper {
  background: var(--surface-2) !important;
  border: 1px solid var(--border-med) !important;
  color: var(--text-1) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-tip {
  background: var(--surface-2) !important;
}

.leaflet-popup-content {
  margin: 14px 18px !important;
}

.leaflet-popup-close-button {
  color: var(--text-3) !important;
}

/* ════════════════════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--black);
}

.hero-canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#hero-canvas {
  width: 100%;
  height: 100%;
  opacity: 0.6;
}

.hero-diagonal {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 45%;
  background: linear-gradient(135deg, transparent 0%, rgba(255,107,0,0.03) 100%);
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0% 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
  padding-top: 70px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--orange-dim);
  border: 1px solid rgba(255,107,0,0.3);
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 28px;
  animation: fadeUp 0.7s ease both;
}

.hero-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  animation: pulse 2s infinite;
}

.hero-headline {
  font-family: var(--font-display);
  font-size: clamp(60px, 10vw, 138px);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--white);
  animation: fadeUp 0.8s 0.1s ease both;
}

.hero-headline .line-orange {
  color: var(--orange);
}

.hero-sub {
  font-size: clamp(15px, 1.8vw, 19px);
  font-weight: 300;
  color: var(--text-2);
  margin-top: 24px;
  max-width: 500px;
  animation: fadeUp 0.8s 0.2s ease both;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
  animation: fadeUp 0.8s 0.3s ease both;
}

.hero-stats-strip {
  margin-top: 72px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
  animation: fadeUp 0.9s 0.4s ease both;
}

.hero-stat-num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 600;
  color: var(--white);
  line-height: 1;
}

.hero-stat-num .stat-count {
  color: var(--orange);
}

.hero-stat-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-top: 4px;
}

@media (max-width: 768px) {
  .hero-inner { padding-top: 50px; }
  .hero-stats-strip { gap: 24px; }
}

/* ════════════════════════════════════════════════════════════
   TRAIL CARD
   ════════════════════════════════════════════════════════════ */
.trail-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
}

.trail-card:hover {
  border-color: var(--orange);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px var(--orange-dim);
}

.trail-card-img {
  position: relative;
  height: 190px;
  overflow: hidden;
  background: var(--surface-3);
}

.trail-card-img canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.trail-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,13,13,0.9) 0%, transparent 60%);
}

.trail-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

.trail-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trail-card-name {
  font-family: var(--font-display);
  font-size: 25px;
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
}

.trail-card-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  flex-wrap: wrap;
}

.trail-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.trails-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

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

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

/* ════════════════════════════════════════════════════════════
   STATS SECTION (home page)
   ════════════════════════════════════════════════════════════ */
.stats-section {
  padding: 70px 0;
  background: var(--surface-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  background: var(--border);
}

.stat-block {
  background: var(--surface-1);
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ════════════════════════════════════════════════════════════
   TRAIL DETAIL PAGE
   ════════════════════════════════════════════════════════════ */
.trail-hero {
  height: 420px;
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}

.trail-hero canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.trail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,13,13,0.97) 0%, rgba(13,13,13,0.4) 50%, rgba(13,13,13,0.2) 100%);
}

.trail-hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 36px;
}

.trail-hero-name {
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 92px);
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
}

.trail-hero-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.trail-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 26px 0;
}

.trail-stat-cell {
  background: var(--surface-2);
  padding: 16px;
}

.trail-stat-val {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--orange);
  font-weight: 600;
}

.trail-stat-key {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-top: 3px;
}

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

.trail-lb-row {
  display: grid;
  grid-template-columns: 36px 1fr 150px 120px;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.trail-lb-row:hover {
  background: rgba(255,255,255,0.03);
}

.trail-lb-row + .trail-lb-row {
  border-top: 1px solid var(--border);
}

.trail-lb-bike {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.trail-lb-time {
  font-family: var(--font-mono);
  color: var(--orange);
  font-weight: 600;
  font-size: 15px;
  text-align: right;
}

.sector-strip {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.sector-chip {
  padding: 8px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.sector-chip:hover, .sector-chip.active {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-dim);
}

.sector-detail {
  background: var(--surface-2);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: none;
}

.sector-detail.show {
  display: block;
  animation: fadeIn 0.2s ease;
}

.review-card {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}

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

.review-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-1);
}

.review-date {
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
}

.review-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.7;
}

.record-history {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  overflow: hidden;
}

.trail-report-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.trail-report-item:last-child {
  border-bottom: none;
}

.report-badge {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ── Replay bar ──────────────────────────────────────────── */
.replay-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(17,17,17,0.95);
  border-top: 1px solid var(--border);
  padding: 14px 18px;
  display: none;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(12px);
  z-index: 400;
}

.replay-bar.active {
  display: flex;
}

.replay-progress {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}

.replay-progress-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 2px;
  width: 0%;
}

.replay-info {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.replay-rider {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: 0.04em;
  color: var(--white);
}

.replay-elapsed {
  font-family: var(--font-mono);
  font-size: 19px;
  color: var(--orange);
  font-weight: 600;
  margin-left: auto;
}

/* ── Weather block ───────────────────────────────────────── */
.weather-current {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

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

.weather-temp {
  font-family: var(--font-display);
  font-size: 64px;
  color: var(--white);
  line-height: 1;
}

.weather-unit {
  font-size: 28px;
  color: var(--text-3);
}

.weather-condition {
  font-size: 15px;
  color: var(--text-2);
  margin-top: 8px;
}

.weather-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.weather-detail-item {
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.weather-detail-val {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--text-1);
  font-weight: 600;
}

.weather-detail-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-top: 3px;
}

.riding-score-bar {
  height: 8px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}

.riding-score-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

.forecast-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.forecast-card {
  min-width: 88px;
  padding: 14px 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  flex-shrink: 0;
}

.forecast-day {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
}

.forecast-icon {
  font-size: 22px;
  margin: 8px 0;
}

.forecast-high {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-1);
  font-weight: 600;
}

.forecast-low {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

.forecast-rain {
  font-size: 10px;
  color: var(--blue);
  margin-top: 4px;
}

/* ════════════════════════════════════════════════════════════
   MAP PAGE
   ════════════════════════════════════════════════════════════ */
.map-page {
  height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
}

.map-toolbar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.map-search {
  flex: 1;
  max-width: 300px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-3);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
}

.map-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-1);
  font-size: 13px;
  flex: 1;
}

.map-main {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

#main-map {
  flex: 1;
}

.map-sidebar {
  width: 380px;
  background: var(--surface-1);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.map-sidebar.hidden {
  display: none;
}

.map-sidebar-hdr {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.map-sidebar-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}

.map-sidebar-ftr {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-trail-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 16px 0;
}

.map-trail-stat {
  background: var(--surface-2);
  padding: 12px 14px;
}

.map-trail-stat-val {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--orange);
  font-weight: 600;
}

.map-trail-stat-key {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-top: 2px;
}

@media (max-width: 900px) {
  .map-sidebar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
    width: min(380px, 100%);
  }
}

/* ── Tracer panel ────────────────────────────────────────── */
.trail-request-map {
  height: 480px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 24px;
  position: relative;
}

#tracer-map {
  width: 100%;
  height: 100%;
}

.tracer-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 500;
  width: 280px;
  background: rgba(17,17,17,0.96);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-lg);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.tracer-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tracer-title {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.06em;
  color: var(--white);
}

.tracer-body {
  padding: 14px 18px;
}

.tracer-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}

.tracer-stat:last-child {
  border-bottom: none;
}

.tracer-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

.tracer-stat-val {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--orange);
  font-weight: 600;
}

.tracer-actions {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════
   LEADERBOARDS PAGE
   ════════════════════════════════════════════════════════════ */
.lb-hero {
  padding: 56px 0 0;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}

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

.lb-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
}

.lb-table td {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.lb-table tbody tr {
  transition: background 0.15s;
  cursor: pointer;
}

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

/* ════════════════════════════════════════════════════════════
   COMMUNITY PAGE
   ════════════════════════════════════════════════════════════ */
.post-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
  margin-bottom: 20px;
}

.post-card:hover {
  border-color: var(--border-med);
}

.post-header {
  padding: 18px 22px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.post-username {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}

.post-time {
  font-size: 11px;
  color: var(--text-3);
}

.post-body {
  padding: 14px 22px;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  white-space: pre-wrap;
}

.post-img-wrap {
  max-height: 420px;
  overflow: hidden;
  position: relative;
  background: var(--surface-3);
}

.post-img-wrap img {
  width: 100%;
  object-fit: cover;
}

.post-footer {
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.post-action {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

.post-action:hover {
  color: var(--orange);
  background: var(--orange-dim);
}

.post-action.liked {
  color: var(--orange);
}

.post-trail-tag {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-3);
  background: var(--surface-3);
  padding: 4px 10px;
  border-radius: 3px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.comment-row {
  display: flex;
  gap: 10px;
  padding: 10px 22px;
  border-top: 1px solid var(--border);
}

.comment-body {
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface-3);
  border-radius: var(--radius);
  padding: 8px 12px;
  flex: 1;
}

.comment-name {
  font-weight: 600;
  color: var(--text-1);
  font-size: 12px;
  margin-bottom: 2px;
}

.community-sidebar-widget {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}

.community-sidebar-hdr {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.community-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
}

.sidebar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-row:hover {
  background: rgba(255,255,255,0.03);
}

.sidebar-row + .sidebar-row {
  border-top: 1px solid var(--border);
}

/* ════════════════════════════════════════════════════════════
   GARAGE PAGE
   ════════════════════════════════════════════════════════════ */
.bike-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
}

.bike-card:hover {
  border-color: var(--orange);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.bike-card-img {
  height: 190px;
  background: var(--surface-3);
  overflow: hidden;
  position: relative;
}

.bike-card-img canvas {
  width: 100%;
  height: 100%;
}

.bike-card-body {
  padding: 20px;
}

.bike-year {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
}

.bike-name {
  font-family: var(--font-display);
  font-size: 27px;
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
}

.bike-mod-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 11px;
  color: var(--text-2);
  margin: 2px;
}

.bike-stats {
  display: flex;
  gap: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}

.bike-stat-val {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-1);
  font-weight: 600;
}

.bike-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
}

.customizer-preview {
  height: 280px;
  background: var(--surface-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.customizer-canvas {
  width: 100%;
  height: 100%;
}

.customizer-option-group {
  margin-bottom: 18px;
}

.customizer-option-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 10px;
}

.customizer-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.customizer-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
  flex-shrink: 0;
}

.customizer-swatch:hover, .customizer-swatch.active {
  border-color: var(--white);
  transform: scale(1.15);
}

/* ════════════════════════════════════════════════════════════
   PROFILE PAGE
   ════════════════════════════════════════════════════════════ */
.profile-banner {
  height: 240px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0D0D0D 0%, #1a0a00 50%, #0D0D0D 100%);
}

.profile-banner canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.45;
}

.profile-header {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.profile-avatar-wrap {
  margin-top: -50px;
  position: relative;
  z-index: 1;
  border: 4px solid var(--black);
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-name {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
}

.profile-handle {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
}

.profile-location {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 6px;
}

.profile-bio {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 10px;
  max-width: 520px;
  line-height: 1.7;
}

.profile-actions {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-self: flex-end;
  padding-bottom: 4px;
}

.profile-stats-bar {
  display: flex;
  gap: 36px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
  overflow-x: auto;
}

.profile-stat-num {
  font-family: var(--font-mono);
  font-size: 22px;
  color: var(--orange);
  font-weight: 600;
}

.profile-stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  margin-top: 3px;
}

.achievement-badge {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}

.achievement-badge.common {
  background: rgba(156,163,175,0.1);
  border: 1px solid rgba(156,163,175,0.2);
  color: #9ca3af;
}

.achievement-badge.uncommon {
  background: var(--green-dim);
  border: 1px solid rgba(74,222,128,0.2);
  color: var(--green);
}

.achievement-badge.rare {
  background: var(--blue-dim);
  border: 1px solid rgba(96,165,250,0.2);
  color: var(--blue);
}

.achievement-badge.legendary {
  background: var(--yellow-dim);
  border: 1px solid rgba(251,191,36,0.25);
  color: var(--yellow);
}

/* ════════════════════════════════════════════════════════════
   AUTH PAGES
   ════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: radial-gradient(ellipse at 30% 20%, rgba(255,107,0,0.05) 0%, transparent 60%), radial-gradient(ellipse at 70% 80%, rgba(255,107,0,0.03) 0%, transparent 60%);
}

.auth-box {
  width: 100%;
  max-width: 460px;
  background: var(--surface-2);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.auth-box-header {
  padding: 34px 36px 26px;
  border-bottom: 1px solid var(--border);
}

.auth-box-title {
  font-family: var(--font-display);
  font-size: 38px;
  letter-spacing: 0.04em;
  color: var(--white);
}

.auth-box-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 6px;
}

.auth-box-body {
  padding: 26px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-box-footer {
  padding: 20px 36px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

.auth-switch {
  color: var(--orange);
  cursor: pointer;
  font-weight: 600;
}

.auth-switch:hover {
  text-decoration: underline;
}

.auth-error {
  background: var(--red-dim);
  border: 1px solid var(--red-dim);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--red);
  display: none;
}

.auth-error.show {
  display: block;
}

/* ════════════════════════════════════════════════════════════
   DASHBOARD PAGE
   ════════════════════════════════════════════════════════════ */
.dashboard-page {
  padding: 48px 0 80px;
}

.dashboard-welcome-name {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 58px);
  letter-spacing: 0.04em;
  color: var(--white);
  line-height: 1;
}

.dashboard-welcome-sub {
  font-size: 14px;
  color: var(--text-3);
  margin-top: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

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

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.activity-item:hover {
  background: rgba(255,255,255,0.03);
}

.activity-item + .activity-item {
  border-top: 1px solid var(--border);
}

.activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.activity-text {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.activity-text strong {
  color: var(--text-1);
}

.activity-time {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item:hover {
  background: rgba(255,255,255,0.03);
}

.notif-item.unread {
  background: var(--orange-dim);
}

.notif-item + .notif-item {
  border-top: 1px solid var(--border);
}

.notif-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.notif-text {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
  flex: 1;
}

.notif-time {
  font-size: 10px;
  color: var(--text-3);
  margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════
   ADMIN (admin.html)
   ════════════════════════════════════════════════════════════ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--nav-h));
}

.admin-sidebar-nav {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
}

.admin-nav-section {
  padding: 0 0 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.admin-nav-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 20px;
  margin-bottom: 8px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  border-left: 2px solid transparent;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  text-align: left;
}

.admin-nav-item:hover {
  color: var(--white);
  background: rgba(255,255,255,0.04);
}

.admin-nav-item.active {
  color: var(--orange);
  border-left-color: var(--orange);
  background: var(--orange-dim);
}

.admin-content {
  padding: 36px;
  overflow-y: auto;
}

.admin-page-title {
  font-family: var(--font-display);
  font-size: 38px;
  letter-spacing: 0.04em;
  color: var(--white);
  margin-bottom: 8px;
}

.admin-page-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 32px;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

@media (max-width: 1024px) {
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

.admin-kpi {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.admin-kpi-val {
  font-family: var(--font-display);
  font-size: 42px;
  color: var(--white);
  line-height: 1;
}

.admin-kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  margin-top: 4px;
}

.admin-kpi-trend {
  font-size: 11px;
  color: var(--green);
  margin-top: 10px;
  font-family: var(--font-mono);
}

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

.admin-table th {
  text-align: left;
  padding: 11px 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-3);
}

.admin-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  vertical-align: middle;
}

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

.admin-connection-card {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}

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

.admin-connection-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.connection-status.connected    { color: var(--green); }
.connection-status.disconnected { color: var(--red); }
.connection-status.pending      { color: var(--yellow); }

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.connection-dot.connected {
  animation: pulse 2s infinite;
}

@media (max-width: 900px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar-nav { display: none; }
}

.admin-mobile-tabs {
  display: none;
  overflow-x: auto;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 900px) {
  .admin-mobile-tabs { display: flex; }
}
