/* ============================================================
   Bicyclotron Master Stylesheet
   Bootstrap 5.3 + Bicyclotron Dark Theme Overrides
   ============================================================ */

/* Bootstrap 5.3 CDN */
@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css');

/* Google Fonts - Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ============================================================
   1. CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
  /* Brand Colors */
  --color-primary: #ff6b35;
  --color-primary-hover: #e55a2b;
  --color-primary-light: rgba(255, 107, 53, 0.15);
  --color-primary-border: rgba(255, 107, 53, 0.3);

  /* Semantic Colors */
  --color-success: #4ade80;
  --color-success-bg: rgba(74, 222, 128, 0.2);
  --color-error: #f87171;
  --color-error-bg: rgba(248, 113, 113, 0.2);
  --color-warning: #fbbf24;
  --color-warning-bg: rgba(251, 191, 36, 0.2);
  --color-info: #60a5fa;
  --color-info-bg: rgba(96, 165, 250, 0.2);
  --color-danger: #ef4444;

  /* BRM Distance Colors */
  --color-200km: #4ade80;
  --color-300km: #60a5fa;
  --color-400km: #f472b6;
  --color-600km: #fbbf24;
  --color-1000km: #a78bfa;
  --color-1200km: #ef4444;

  /* Background & Surfaces */
  --bg-body: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --bg-solid: #1a1a2e;
  --surface-1: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --surface-3: rgba(255, 255, 255, 0.03);
  --surface-border: rgba(255, 255, 255, 0.1);
  --surface-border-hover: rgba(255, 255, 255, 0.2);

  /* Text Colors */
  --text-primary: #ffffff;
  --text-highlight: #f1f5f9;
  --text-secondary: #a0aec0;
  --text-muted: #cbd5e1;
  --text-dim: #6b7280;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Aliases for backward compatibility (profile.html, settings.html, admin.html) */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --accent: #ff6b35;
  --accent-hover: #e55a25;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #334155;
}

/* ============================================================
   2. Bootstrap Dark Theme Overrides & Base Reset
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-body);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--color-info);
  text-decoration: none;
}

a:hover {
  color: #93bbfc;
  text-decoration: underline;
}

::selection {
  background: rgba(255, 107, 53, 0.3);
  color: #fff;
}

/* Override Bootstrap's light defaults for dark theme */
.bg-body { background: var(--bg-body) !important; }
.text-body { color: var(--text-primary) !important; }

:root {
  --bs-body-color: #ffffff;
  --bs-body-bg: #1a1a2e;
  --bs-heading-color: #f1f5f9;
  --bs-secondary-color: #a0aec0;
  --bs-tertiary-color: #cbd5e1;
  --bs-link-color: #60a5fa;
  --bs-link-hover-color: #93bbfc;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-highlight);
}

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

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

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

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

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

/* ============================================================
   3. Navbar
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0;
}

.nav-container {
  position: relative;
  z-index: 101;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo img {
  height: 48px;
  width: auto;
}

/* Navigation Links */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 16px;
  flex: 1;
  min-width: 0;
  overflow: visible;
  scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
  display: none;
}

.nav-menu .nav-link {
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  white-space: nowrap;
}

/* Group divider between nav sections (desktop) */
.nav-divider {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 6px;
  flex-shrink: 0;
}

.nav-menu .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-menu .nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Nav dropdowns (desktop) */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-dropdown-trigger:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown-trigger.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.nav-dropdown-chevron {
  font-size: 10px;
  opacity: 0.8;
  transition: transform 0.2s;
}

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

.nav-dropdown-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: -8px;
  right: -8px;
  padding-top: 6px;
  min-width: 180px;
  z-index: 200;
}

.nav-dropdown-panel-inner {
  padding: 6px 0;
  background: var(--bg-solid);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.nav-dropdown.open .nav-dropdown-panel {
  display: block;
}

.nav-dropdown-item {
  display: block;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-dropdown-item.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Nav Right Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-user-name {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin-right: 8px;
}

.nav-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #ff9a3c);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  overflow: hidden;
  margin-right: 12px;
  flex-shrink: 0;
}

.nav-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-btn-ghost {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Hamburger (Mobile) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  opacity: 1;
  border-radius: 2px;
  transition: all 0.3s;
  flex-shrink: 0;
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu — padding-top must match navbar height so "RIDE" etc. start below the bar (nav-container 12+48+12 ≈ 72px) */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding-top: 80px;
  padding-left: 24px;
  padding-right: 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  background: rgba(22, 33, 62, 0.99);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1001;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-link {
  display: block;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all 0.2s;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.mobile-menu-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.mobile-menu-link-danger {
  color: var(--color-error);
}

.mobile-menu-link-danger:hover {
  background: var(--color-error-bg);
}

/* Mobile menu group headings */
.mobile-menu-group {
  padding: 16px 20px 4px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-menu-group:first-child {
  padding-top: 8px;
}

/* Mobile/tablet: hide desktop nav and right-side block so only logo + hamburger show; hamburger stays far right */
@media (max-width: 992px) {
  .nav-menu,
  .nav-actions,
  #nav-user-actions,
  #nav-login {
    display: none !important;
  }

  .nav-hamburger {
    display: flex !important;
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    z-index: 1002;
  }
}

/* Section Switcher (Rider / Organiser toggle in navbar) */
.section-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 2px;
  margin-left: 12px;
}

.section-sw-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.section-sw-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}

.section-sw-btn.active {
  background: rgba(255, 107, 53, 0.15);
  color: var(--color-primary);
}

.section-sw-icon {
  font-size: 14px;
  line-height: 1;
}

.section-sw-label {
  display: inline;
}

/* Mobile section switcher */
.mobile-section-switcher {
  display: flex;
  gap: 4px;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 8px;
}

.mobile-section-switcher .section-sw-btn {
  flex: 1;
  justify-content: center;
  padding: 8px 12px;
  font-size: 14px;
}

@media (max-width: 768px) {
  .section-switcher {
    display: none;
  }
}

/* ============================================================
   4. Notification Bell
   ============================================================ */
.notif-bell-wrapper {
  position: relative;
}

.notif-bell-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  position: relative;
  line-height: 1;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: 0;
  background: var(--color-error);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.notif-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 360px;
  max-height: 480px;
  background: #1a1a2e;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 200;
}

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

.notif-header h3 {
  font-size: 16px;
  margin: 0;
}

.notif-header a {
  font-size: 12px;
  color: var(--color-primary);
  text-decoration: none;
}

.notif-list-container {
  max-height: 360px;
  overflow-y: auto;
}

.notif-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--surface-border);
  text-align: center;
}

.notif-footer a {
  font-size: 13px;
  color: var(--color-primary);
  text-decoration: none;
}

/* ============================================================
   5. Layout
   ============================================================ */
.main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 100px 24px 32px;
}

.container-narrow {
  max-width: 1000px;
  margin: 0 auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ============================================================
   6. Panels & Cards
   ============================================================ */
.panel {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 24px;
}

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

.panel-title {
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-icon {
  font-size: 28px;
}

.card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--surface-border);
}

.card-header h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.card-header p {
  font-size: 14px;
  color: var(--text-secondary);
}

.card-body {
  padding: 24px;
}

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

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

/* Placeholder card */
.placeholder-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 32px;
  text-align: center;
}

.placeholder-card .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.placeholder-card h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.placeholder-card p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ============================================================
   7. Buttons
   ============================================================ */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1.4;
}

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

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  color: #fff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--surface-border-hover);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-danger {
  background: var(--color-error-bg);
  color: var(--color-error);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

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

.btn-success {
  background: var(--color-success);
  color: #000;
}

.btn-success:hover:not(:disabled) {
  background: #22c55e;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--surface-border-hover);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.btn-audax {
  background: #e67817;
  color: #fff;
}

.btn-audax:hover:not(:disabled) {
  background: #d06a10;
}

.btn-strava {
  background: #fc4c02;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-strava:hover:not(:disabled) {
  background: #e04400;
}

.btn-garmin {
  background: #007cc3;
  color: #fff;
}

.btn-garmin:hover:not(:disabled) {
  background: #006ba8;
}

.btn-wahoo {
  background: #0099e5;
  color: #fff;
}

.btn-wahoo:hover:not(:disabled) {
  background: #0080c0;
}

.btn-admin {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  width: 100%;
}

.btn-admin:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

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

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================================
   8. Forms
   ============================================================ */
.form-group {
  margin-bottom: 16px;
}

.form-group label,
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea,
.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--surface-border-hover);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

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

.form-group input:disabled,
.form-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-group .hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.form-group option,
.form-input option {
  background: #1a1a2e;
  color: #fff;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row input {
  flex: 1;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* Filter Group (events page style) */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.filter-group select,
.filter-group input {
  padding: 10px 14px;
  border: 1px solid var(--surface-border-hover);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: #fff;
  font-size: 14px;
  min-width: 150px;
}

.filter-group select:focus,
.filter-group input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.filter-group option {
  background: #1a1a2e;
  color: #fff;
}

.filters-panel {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

/* ============================================================
   9. Badges & Status
   ============================================================ */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.badge.connected,
.badge-success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.badge.disconnected {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

/* Compact status pill (e.g. dashboard India Audax) */
.badge-pill {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
}

/* India Audax panel: one compact header row */
.audax-header-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--surface-border);
}

.audax-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-highlight);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.audax-header-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: auto;
}

.audax-profile-compact {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.audax-avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 14px;
  flex-shrink: 0;
}

.audax-name-sm {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-highlight);
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
}

.status-connected {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.status-disconnected {
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-secondary);
}

/* BRM Status Colors */
.status-finished { color: var(--color-success); }
.status-dnf { color: var(--color-error); }
.status-dns { color: var(--text-secondary); }
.status-lf { color: var(--color-warning); }

/* BRM Distance Badges */
.distance-badge {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.distance-badge.d-200,
.d-200 .distance-badge { background: rgba(74, 222, 128, 0.2); color: var(--color-200km); }
.distance-badge.d-300,
.d-300 .distance-badge { background: rgba(96, 165, 250, 0.2); color: var(--color-300km); }
.distance-badge.d-400,
.d-400 .distance-badge { background: rgba(244, 114, 182, 0.2); color: var(--color-400km); }
.distance-badge.d-600,
.d-600 .distance-badge { background: rgba(251, 191, 36, 0.2); color: var(--color-600km); }
.distance-badge.d-1000,
.d-1000 .distance-badge { background: rgba(167, 139, 250, 0.2); color: var(--color-1000km); }
.distance-badge.d-1200,
.d-1200 .distance-badge { background: rgba(239, 68, 68, 0.2); color: var(--color-1200km); }

/* ============================================================
   10. Messages & Alerts
   ============================================================ */
.message {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 14px;
}

.message.success,
.message-success {
  background: rgba(74, 222, 128, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.message.error,
.message-error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--color-error);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.message.warning,
.message-warning {
  background: rgba(251, 191, 36, 0.15);
  color: var(--color-warning);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.message.info,
.message-info {
  background: rgba(96, 165, 250, 0.15);
  color: var(--color-info);
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.error-message {
  color: var(--color-error);
  font-size: 13px;
  margin-bottom: 12px;
}

/* ============================================================
   11. Stats Cards
   ============================================================ */
.stats-overview,
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: center;
}

.stat-card .value {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-card .label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ============================================================
   12. Filter Pills & Distance Pills
   ============================================================ */
.filter-pills,
.distance-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill,
.distance-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: 1px solid transparent;
}

.filter-pill:hover,
.distance-pill:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.filter-pill.active,
.distance-pill.active {
  background: var(--color-primary);
  color: #fff;
}

/* Status-specific filter pills */
.filter-pill.status-finished.active { background: var(--color-success); color: #000; }
.filter-pill.status-dnf.active { background: var(--color-error); color: #fff; }
.filter-pill.status-dns.active { background: var(--text-secondary); color: #000; }

/* Distance-specific pills */
.distance-pill.d-200.active { background: var(--color-200km); color: #000; }
.distance-pill.d-300.active { background: var(--color-300km); color: #000; }
.distance-pill.d-400.active { background: var(--color-400km); color: #000; }
.distance-pill.d-600.active { background: var(--color-600km); color: #000; }
.distance-pill.d-1000.active { background: var(--color-1000km); color: #000; }
.distance-pill.d-1200.active { background: var(--color-1200km); color: #fff; }

/* Filter Row */
.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 60px;
}

/* ============================================================
   13. Tables
   ============================================================ */
.history-table-container {
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-lg);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.history-table th,
.history-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--surface-border);
}

.history-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.2);
}

.history-table td {
  font-size: 14px;
}

.history-table tr:hover td {
  background: var(--surface-3);
}

.history-table tr.personal-best td {
  background: rgba(255, 215, 0, 0.1);
}

.history-table .trophy {
  font-size: 14px;
  margin-right: 4px;
}

/* ============================================================
   14. Modal
   ============================================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #1a1a2e;
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 30px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h3 {
  font-size: 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   15. Loading & Spinners
   ============================================================ */
.loading,
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 107, 53, 0.3);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 107, 53, 0.3);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.processing-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 107, 53, 0.3);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.processing-message {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #e2e8f0;
  margin-bottom: 12px;
}

.loading-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 20px;
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

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

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

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

/* ============================================================
   16. Pagination
   ============================================================ */
.pagination,
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px;
}

.pagination-controls {
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
}

.pagination button,
.pagination-controls button {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--surface-border-hover);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled),
.pagination-controls button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}

.pagination button:disabled,
.pagination-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .page-info,
.pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================================
   17. View Toggle
   ============================================================ */
.view-toggle {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: var(--radius-md);
}

.view-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.view-btn:hover {
  color: #fff;
}

.view-btn.active {
  background: var(--color-primary);
  color: #fff;
}

/* ============================================================
   18. Event Cards
   ============================================================ */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.event-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
  transition: all 0.2s;
}

.event-card:hover {
  background: var(--surface-2);
  border-color: var(--surface-border-hover);
}

.event-date {
  text-align: center;
  min-width: 60px;
}

.event-date .day {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

.event-date .month {
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-top: 4px;
}

.event-date .year {
  font-size: 11px;
  color: var(--text-muted);
}

.event-info h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.event-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-width: 160px;
}

.events-count {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Register Button */
.register-btn {
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
  min-width: 140px;
  text-align: center;
  box-sizing: border-box;
}

.register-btn.open {
  background: var(--color-success);
  color: #000;
}

.register-btn.open:hover {
  background: #22c55e;
}

.register-btn.closed {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: default;
}

.register-btn.pending {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  cursor: default;
}

a.register-btn.pending { cursor: pointer; }
a.register-btn.pending:hover { color: #fcd34d; }
a.register-btn.closed { cursor: pointer; }

.register-btn.compact {
  font-size: 11px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* ============================================================
   19. Calendar
   ============================================================ */
.calendar-container {
  display: none;
}

.calendar-container.active {
  display: block;
}

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

.calendar-nav h3 {
  font-size: 20px;
}

.calendar-nav button {
  padding: 8px 16px;
  border: 1px solid var(--surface-border-hover);
  border-radius: var(--radius-md);
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
}

.calendar-nav button:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

.calendar-header {
  padding: 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.calendar-day {
  min-height: 100px;
  padding: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.calendar-day.other-month { opacity: 0.3; }
.calendar-day.today { border-color: var(--color-primary); }

.calendar-day .date {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.calendar-day.today .date { color: var(--color-primary); }

.calendar-event {
  padding: 4px 6px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event.d-200 { background: rgba(74, 222, 128, 0.3); color: var(--color-200km); }
.calendar-event.d-300 { background: rgba(96, 165, 250, 0.3); color: var(--color-300km); }
.calendar-event.d-400 { background: rgba(244, 114, 182, 0.3); color: var(--color-400km); }
.calendar-event.d-600 { background: rgba(251, 191, 36, 0.3); color: var(--color-600km); }
.calendar-event.d-1000 { background: rgba(167, 139, 250, 0.3); color: var(--color-1000km); }
.calendar-event.d-1200 { background: rgba(239, 68, 68, 0.3); color: var(--color-1200km); }

.list-container {
  display: none;
}

.list-container.active {
  display: block;
}

/* ============================================================
   20. Profile Components
   ============================================================ */
.profile-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--surface-3);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}

.profile-avatar {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  background: linear-gradient(135deg, #e67817, #ff9a3c);
  color: white;
  overflow: hidden;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info h3 {
  font-size: 20px;
  margin-bottom: 4px;
}

.profile-info p {
  font-size: 14px;
  color: var(--text-secondary);
}

.profile-info .highlight {
  color: var(--color-primary);
  font-weight: 500;
}

/* ============================================================
   21. BRM Stats & SR Badges
   ============================================================ */
.brm-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.brm-stat {
  text-align: center;
  padding: 10px 8px;
  background: rgba(255, 107, 53, 0.1);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 107, 53, 0.2);
  cursor: pointer;
  transition: all 0.2s;
}

.brm-stat:hover,
.brm-stat.active {
  background: rgba(255, 107, 53, 0.2);
  border-color: var(--color-primary);
}

.brm-stat .distance { font-size: 13px; font-weight: 600; color: var(--color-primary); }
.brm-stat .count { font-size: 20px; font-weight: 700; margin: 4px 0; }
.brm-stat .best { font-size: 10px; color: var(--text-secondary); }

/* SR Badges */
.sr-section { margin-bottom: 24px; }

.sr-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sr-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sr-badge {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
}

.sr-total {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 215, 0, 0.5);
  color: #ffd700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
}

/* Best Performances */
.best-performances {
  margin: 24px 0;
  padding: 20px;
  background: rgba(255, 215, 0, 0.05);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: var(--radius-lg);
}

.best-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

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

.best-card .distance { font-size: 12px; font-weight: 600; color: #ffd700; margin-bottom: 4px; }
.best-card .time { font-size: 16px; font-weight: 700; color: #fff; }
.best-card .event { font-size: 10px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; }
.best-card.no-data { opacity: 0.5; }
.best-card.no-data .time { color: var(--text-muted); }

/* ============================================================
   22. Verification
   ============================================================ */
.verification-card {
  background: var(--surface-3);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 16px;
}

.verification-content {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.verification-avatar {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #e67817, #ff9a3c);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 600;
  flex-shrink: 0;
}

.verification-details h4 { font-size: 18px; margin-bottom: 4px; }
.verification-details p { font-size: 14px; color: var(--text-secondary); }

.verification-actions {
  display: flex;
  gap: 12px;
}

.verify-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-1);
  border: 1px solid var(--surface-border-hover);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  font-family: monospace;
  margin-bottom: 12px;
}

.verify-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ============================================================
   23. Toggle Switch
   ============================================================ */
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--surface-border);
}

.toggle-group:last-child { border-bottom: none; }

.toggle-info h4 { font-size: 15px; margin-bottom: 4px; }
.toggle-info p { font-size: 13px; color: var(--text-secondary); }

.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: background-color 0.25s ease;
  border-radius: 14px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  top: 3px;
  background-color: #fff;
  transition: transform 0.25s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle input:checked + .toggle-slider { background-color: var(--success); }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }
.toggle input:disabled + .toggle-slider { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   24. Tooltip
   ============================================================ */
.tooltip {
  position: relative;
  opacity: 1;  /* Override Bootstrap .tooltip { opacity: 0 } — we use CSS-only tooltips, not BS JS */
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
  z-index: 100;
  pointer-events: none;
  margin-bottom: 4px;
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   25. Favorite Buttons
   ============================================================ */
.btn-favorite {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
  color: var(--text-muted);
  transition: all 0.2s;
  line-height: 1;
}

.btn-favorite:hover { color: var(--color-warning); transform: scale(1.1); }
.btn-favorite.active { color: var(--color-warning); }

.btn-alert {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  color: var(--text-muted);
  transition: all 0.2s;
  border-radius: 6px;
  align-self: flex-end;
}

.btn-alert:hover { background: rgba(255, 255, 255, 0.1); color: var(--color-info); }
.btn-alert.active { color: var(--color-info); }

/* ============================================================
   26. Registration Section
   ============================================================ */
.registration-section {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.section-count {
  color: var(--color-success);
  font-size: 13px;
  font-weight: 500;
}

.registration-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.reg-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.2s;
}

.reg-card:hover {
  background: var(--surface-2);
  border-color: rgba(74, 222, 128, 0.3);
}

.reg-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.reg-card-date { font-size: 12px; color: var(--text-secondary); }
.reg-card-distance { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.reg-card h4 { font-size: 14px; font-weight: 600; margin: 0 0 8px; line-height: 1.3; }
.reg-card-meta { font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.reg-card-footer { display: flex; justify-content: space-between; align-items: center; }
.reg-card-spots { font-size: 11px; color: var(--color-warning); }

.btn-register {
  padding: 6px 14px;
  background: var(--color-success);
  color: #000;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-register:hover { background: #22c55e; color: #000; }

.registration-note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.4);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-warning);
  margin-bottom: 16px;
  font-weight: 500;
}

.registration-note .info-icon { font-size: 18px; flex-shrink: 0; }

.no-events-msg {
  color: var(--text-secondary);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

/* ============================================================
   27. Favorites Section
   ============================================================ */
.favorites-section {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.favorites-header-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.favorites-header-toggle .chevron {
  font-size: 12px;
  transition: transform 0.2s;
  color: var(--text-secondary);
}

.favorites-header-toggle.collapsed .chevron { transform: rotate(-90deg); }

.fav-section-body { overflow: hidden; transition: max-height 0.3s ease; }
.fav-section-body.collapsed { max-height: 0 !important; }

.fav-events-list { display: flex; flex-direction: column; gap: 10px; }

.fav-event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.fav-event-item:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, 0.15); }

.fav-event-info { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.fav-event-date { text-align: center; min-width: 46px; }
.fav-event-date .day { font-size: 18px; font-weight: 700; color: var(--color-primary); line-height: 1; }
.fav-event-date .month { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; }
.fav-event-details { flex: 1; min-width: 0; }
.fav-event-details h4 { font-size: 13px; font-weight: 600; margin: 0 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-event-details span { font-size: 11px; color: var(--text-secondary); }
.fav-event-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.fav-no-events { color: var(--text-secondary); font-size: 13px; padding: 16px; text-align: center; }
.fav-no-events a { color: var(--color-primary); text-decoration: none; }
.fav-no-events a:hover { text-decoration: underline; }

/* Manage Favorites Panel */
.fav-manage-panel { display: none; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--surface-border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.fav-manage-panel.open { display: block; }
.fav-manage-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.fav-manage-header h3 { font-size: 14px; font-weight: 600; margin: 0; color: #e2e8f0; }
.fav-manage-close { background: none; border: none; color: var(--text-secondary); font-size: 18px; cursor: pointer; padding: 0 4px; }
.fav-manage-close:hover { color: #fff; }
.fav-club-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.fav-club-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--color-primary-light); border: 1px solid var(--color-primary-border); border-radius: var(--radius-full); padding: 5px 10px 5px 12px; font-size: 12px; color: #ff9a3c; }
.fav-club-chip .remove-fav { background: none; border: none; color: rgba(255, 107, 53, 0.6); font-size: 14px; cursor: pointer; padding: 0; line-height: 1; }
.fav-club-chip .remove-fav:hover { color: #ff4444; }
.fav-add-row { display: flex; gap: 8px; align-items: center; }
.fav-add-row select { flex: 1; padding: 8px 12px; background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: var(--radius-md); color: #fff; font-size: 13px; }
.fav-add-row select option { background: #1a1a2e; color: #fff; }
.fav-add-btn { padding: 8px 14px; background: rgba(255, 107, 53, 0.2); border: 1px solid rgba(255, 107, 53, 0.4); border-radius: var(--radius-md); color: var(--color-primary); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.fav-add-btn:hover { background: rgba(255, 107, 53, 0.3); }

/* ============================================================
   28. Country Selector
   ============================================================ */
.header-controls { display: flex; align-items: center; gap: 16px; }
.country-selector { display: flex; align-items: center; }

.country-select {
  padding: 8px 32px 8px 12px;
  background: var(--surface-1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0aec0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.country-select:hover { border-color: rgba(255, 255, 255, 0.3); }
.country-select:focus { outline: none; border-color: var(--color-primary); }
.country-select option { background: #1a1a2e; color: #fff; }

/* ============================================================
   29. Bookmarklet & Challenge Verification
   ============================================================ */
.bookmarklet-container {
  margin: 16px 0;
  padding: 20px;
  background: rgba(255, 107, 53, 0.1);
  border: 2px dashed var(--color-primary);
  border-radius: 10px;
  text-align: center;
}

.bookmarklet {
  display: inline-block;
  background: linear-gradient(135deg, #ff6b35, #ff8c42);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  cursor: grab;
}

.bookmarklet-container small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12px;
}

.challenge-question {
  background: rgba(255, 107, 53, 0.1);
  border: 1px solid var(--color-primary-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.challenge-hint {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
}

.direct-connect-notice {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
  color: var(--color-success);
  font-size: 14px;
}

.time-input-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.time-input-group .time-field { display: flex; flex-direction: column; align-items: center; gap: 6px; }

.time-input-group input {
  width: 80px;
  padding: 12px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  background: var(--surface-1);
  border: 1px solid var(--surface-border-hover);
  border-radius: var(--radius-md);
  color: #fff;
}

.time-input-group input:focus { outline: none; border-color: var(--color-primary); }
.time-input-group label { font-size: 12px; color: var(--text-muted); }
.time-input-group .separator { font-size: 32px; font-weight: 600; color: var(--text-secondary); margin-top: -20px; }

/* Verify steps */
.verify-steps { margin: 20px 0; }
.verify-steps .step { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; font-size: 14px; }
.verify-steps .step-num { width: 24px; height: 24px; background: var(--color-primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.verify-steps a { color: var(--color-info); }

.mobile-instructions {
  background: var(--surface-1);
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-top: 12px;
}

.mobile-instructions strong { color: var(--color-primary); }

/* ============================================================
   30. Utility Classes
   ============================================================ */
.hidden { display: none !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-sm { font-size: 13px; }
.mb-md { margin-bottom: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

/* Avatar sizes */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  background: linear-gradient(135deg, var(--color-primary), #ff9a3c);
  color: white;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

/* Site logo (login page) */
.site-logo {
  height: 40px;
  width: auto;
}

/* ============================================================
   31. Global Responsive
   ============================================================ */
@media (max-width: 768px) {
  .main {
    padding-top: 80px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-header {
    flex-direction: column;
  }

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

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

  .event-card {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .event-date {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
  }

  .event-date .day { font-size: 20px; }

  .event-actions {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

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

  .filter-group {
    width: 100%;
  }

  .filter-group select,
  .filter-group input {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .calendar-day {
    min-height: 60px;
    padding: 4px;
  }

  .calendar-day .date { font-size: 12px; }
  .calendar-event { font-size: 9px; padding: 2px 4px; }

  .history-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-pills { width: 100%; }

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

  .favorites-dropdown-row { flex-direction: column; align-items: stretch; }
  .favorites-select { max-width: none; }

  .fav-event-item { flex-direction: column; align-items: flex-start; gap: 8px; }
  .fav-event-actions { width: 100%; justify-content: flex-end; }
}

@media (max-width: 600px) {
  .filter-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-label { margin-bottom: 4px; }
}

/* ============================================================
   32. Connection Status List (Profile sidebar)
   ============================================================ */
.connection-status-list {
  border-top: 1px solid var(--surface-border);
  padding-top: 16px;
  margin-bottom: 16px;
}

.connection-status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
}

.connection-icon { font-size: 18px; }
.connection-name { flex: 1; text-align: left; }

/* ============================================================
   33. Strava Profile (Login page)
   ============================================================ */
.strava-profile {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(252, 76, 2, 0.1);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-md);
}

.strava-profile img { width: 40px; height: 40px; border-radius: 50%; }
.strava-profile .name { font-weight: 600; font-size: 14px; }
.strava-profile .location { font-size: 12px; color: var(--text-secondary); }

/* ============================================================
   34. History Section
   ============================================================ */
.history-section { margin-top: 24px; }

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

.history-title {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Favorites dropdown for events page */
.favorites-dropdown-row { display: flex; align-items: center; gap: 16px; }

.favorites-select {
  flex: 1;
  max-width: 400px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.favorites-select:hover { border-color: rgba(255, 255, 255, 0.3); }
.favorites-select option { background: #1a1a2e; color: #fff; }
.favorite-events-count { color: var(--text-secondary); font-size: 13px; }

/* Club name wrapper */
.club-name-wrapper { display: flex; align-items: center; gap: 4px; }

/* ============================================================
   35. Wear Bars / Progress Bars
   ============================================================ */
.wear-bar-container {
  margin: 12px 0;
}

.wear-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.wear-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.wear-bar-fill.ok { background: var(--color-success); }
.wear-bar-fill.due-soon { background: var(--color-warning); }
.wear-bar-fill.overdue { background: var(--color-error); }

.wear-text {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.wear-pct-ok { color: var(--color-success); }
.wear-pct-due-soon { color: var(--color-warning); }
.wear-pct-overdue { color: var(--color-error); }

/* ============================================================
   36. Typeahead Dropdown
   ============================================================ */
.typeahead-wrapper { position: relative; }

.typeahead-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #16213e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-top: none;
  border-radius: 0 0 10px 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1001;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.typeahead-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-size: 14px;
}

.typeahead-item:hover,
.typeahead-item.highlighted {
  background: rgba(255, 107, 53, 0.15);
}

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

.typeahead-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.typeahead-subtext {
  font-size: 11px;
  color: #cbd5e1;
}

.typeahead-count {
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
}

.typeahead-empty {
  padding: 14px 16px;
  color: #cbd5e1;
  font-size: 13px;
  text-align: center;
}

.catalog-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--color-primary);
  padding: 2px 8px;
  background: var(--color-primary-light);
  border-radius: 12px;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  z-index: 2;
}

.catalog-badge:hover { background: rgba(255, 107, 53, 0.2); }
.badge-clear { font-size: 14px; font-weight: bold; }

/* ============================================================
   37. Empty State (extended)
   ============================================================ */
.empty-state p {
  margin-bottom: 16px;
  font-size: 14px;
}

.empty-state-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
}

.empty-state-text {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.empty-state-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s;
}

.empty-state-btn:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* ============================================================
   38. Step Indicators
   ============================================================ */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.3s;
  flex-shrink: 0;
}

.step-dot.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.step-dot.completed {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.step-line {
  flex: 1;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
}

.step-line.completed {
  background: var(--color-success);
}

@media (max-width: 768px) {
  .step-indicator { gap: 8px; }
  .step-dot { width: 28px; height: 28px; font-size: 12px; }
}

/* ============================================================
   39. Sidebar Layout
   ============================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 24px;
}

.sidebar-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 6px;
  text-align: left;
}

.sidebar-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: left;
}

.sidebar-note {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  text-align: left;
}

/* ============================================================
   40. Upload Area
   ============================================================ */
.upload-area {
  margin: 20px 0;
  padding: 28px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.02);
}

.upload-area:hover {
  border-color: var(--color-primary);
  background: rgba(255, 107, 53, 0.08);
}

.selected-file {
  margin: 16px 0;
  padding: 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.selected-file-info { flex: 1; }
.selected-file-name { font-weight: 500; }
.selected-file-size { font-size: 12px; color: var(--text-secondary); }

/* ============================================================
   41. Connection Row
   ============================================================ */
.connection-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.connection-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connection-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.connection-icon-box img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.connection-icon-box .btn-icon {
  width: 20px;
  height: 20px;
}

.connection-meta h4 {
  font-size: 14px;
  margin-bottom: 2px;
}

.connection-meta p {
  font-size: 11px;
  color: var(--text-secondary);
}

.connection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-secondary);
}

.status-dot--connected { background: var(--color-success); }
.status-dot--disconnected { background: var(--text-secondary); }

/* Connections Grid (settings page 2-col layout) */
.connections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 768px) {
  .connections-grid { grid-template-columns: 1fr; }
  .connection-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ============================================================
   42. Filter Bar (Components/Maintenance)
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 8px 32px 8px 12px;
  background: var(--surface-1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0aec0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-primary);
}

.filter-select option {
  background: #1a1a2e;
}
