/* ============================================================
   OnlyDirt.gg — Main Stylesheet
   Dark dirt-track theme: Barlow Condensed + Barlow
   ============================================================ */

:root {
  --dirt:         #c0541a;
  --dirt-light:   #e8732a;
  --dirt-dark:    #8a3a0f;
  --dirt-faint:   rgba(192, 84, 26, 0.12);
  --night:        #0d0f14;
  --night-mid:    #161922;
  --night-panel:  #1e2130;
  --night-border: rgba(255, 255, 255, 0.08);
  --night-hover:  rgba(255, 255, 255, 0.04);
  --gold:         #f0b429;
  --gold-dim:     #c48f1a;
  --silver:       #9aa3b2;
  --bronze:       #cd7f32;
  --green:        #22c55e;
  --green-faint:  rgba(34, 197, 94, 0.12);
  --red:          #ef4444;
  --red-faint:    rgba(239, 68, 68, 0.10);
  --text:         #e8eaf0;
  --text-dim:     #7a8294;
  --text-muted:   #4a5162;
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body:    'Barlow', sans-serif;
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;
  --transition:   0.15s ease;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--night);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Navigation ──────────────────────────────────────────── */
.nav {
  background: var(--night-mid);
  border-bottom: 1px solid var(--night-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--dirt-light);
  margin-right: 24px;
  flex-shrink: 0;
  transition: color var(--transition);
}
.nav-logo:hover { color: #ff8c3a; }
.nav-logo span { color: var(--text); }
.nav-links { display: flex; gap: 2px; flex: 1; }
.nav-link {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--night-hover); }
.nav-link.active { color: var(--dirt-light); background: var(--dirt-faint); }
.nav-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-badge {
  background: rgba(192,84,26,0.2);
  border: 1px solid rgba(192,84,26,0.4);
  color: var(--dirt-light);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav-admin-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  padding: 4px 10px;
  border: 1px solid rgba(240,180,41,0.3);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.nav-admin-link:hover { background: rgba(240,180,41,0.1); }
.nav-mobile-toggle { display: none; }

/* ── Page Layout ─────────────────────────────────────────── */
.page-main { min-height: calc(100vh - 52px - 64px); }
.container  { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-wrap  { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: var(--night-mid);
  border-bottom: 1px solid var(--night-border);
  padding: 32px 24px 28px;
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}
.hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--dirt-light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 48px;
  line-height: 0.95;
  color: var(--text);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}
.hero-title .accent { color: var(--dirt-light); }
.hero-sub {
  font-size: 14px;
  color: var(--text-dim);
  max-width: 440px;
  line-height: 1.5;
  margin-bottom: 22px;
}
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-stat-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  color: var(--text);
  line-height: 1;
}
.hero-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Live Card ───────────────────────────────────────────── */
.live-card {
  background: var(--night-panel);
  border: 1px solid var(--night-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.live-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dirt), var(--dirt-light));
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-faint);
  border: 1px solid rgba(34,197,94,0.3);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 10px;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.live-event-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 3px;
}
.live-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.live-session {
  background: var(--dirt-faint);
  border: 1px solid rgba(192,84,26,0.25);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
}
.live-session-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--dirt-light);
  font-weight: 600;
  margin-bottom: 3px;
}
.live-session-name { font-size: 13px; font-weight: 600; color: var(--text); }
.live-leaders { display: flex; flex-direction: column; gap: 6px; }
.live-leader { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.live-pos {
  width: 20px;
  text-align: right;
  font-weight: 700;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 16px;
  flex-shrink: 0;
}
.live-pos.p1 { color: var(--gold); }
.live-driver { flex: 1; color: var(--text); font-weight: 500; }
.live-lap { color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* ── Page Tabs ───────────────────────────────────────────── */
.page-tabs {
  background: var(--night-mid);
  border-bottom: 1px solid var(--night-border);
}
.page-tabs-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.page-tab {
  font-size: 13px;
  font-weight: 500;
  padding: 11px 16px;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  display: block;
}
.page-tab:hover { color: var(--text); }
.page-tab.active {
  color: var(--dirt-light);
  border-bottom-color: var(--dirt-light);
}

/* ── Grid Layout ─────────────────────────────────────────── */
.main-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.sidebar { display: flex; flex-direction: column; gap: 16px; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--night-panel);
  border: 1px solid var(--night-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--night-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.card-body { padding: 16px; }
.card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--night-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Section Headers ─────────────────────────────────────── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
}
.section-link {
  font-size: 12px;
  color: var(--dirt-light);
  transition: color var(--transition);
}
.section-link:hover { color: #ff8c3a; }

/* ── Standings Table ─────────────────────────────────────── */
.standings-table {
  width: 100%;
  border-collapse: collapse;
}
.standings-table th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 8px 16px;
  text-align: left;
  border-bottom: 1px solid var(--night-border);
  background: rgba(255,255,255,0.02);
  white-space: nowrap;
}
.standings-table th.r { text-align: right; }
.standings-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
  vertical-align: middle;
}
.standings-table tr:last-child td { border-bottom: none; }
.standings-table tr:hover td { background: var(--night-hover); cursor: pointer; }
.td-r { text-align: right; }
.pos-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text-dim);
}
.pos-1 { color: var(--gold); }
.pos-2 { color: var(--silver); }
.pos-3 { color: var(--bronze); }
.driver-name-cell { font-weight: 600; color: var(--text); }
.driver-num  { font-size: 11px; color: var(--text-dim); margin-left: 6px; }
.pts-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
}
.pts-delta    { font-size: 11px; color: var(--text-dim); }
.delta-leader { font-size: 11px; color: var(--gold); }
.stat-cell    { color: var(--text-dim); font-size: 12px; }

/* ── Rating Pills ────────────────────────────────────────── */
.rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  white-space: nowrap;
}
.rating-up   { background: var(--green-faint); color: var(--green);  border: 1px solid rgba(34,197,94,0.25); }
.rating-down { background: var(--red-faint);   color: var(--red);    border: 1px solid rgba(239,68,68,0.2); }
.rating-flat { background: rgba(255,255,255,0.05); color: var(--text-dim); border: 1px solid var(--night-border); }

/* ── Series Tabs ─────────────────────────────────────────── */
.series-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.series-tab {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid var(--night-border);
  color: var(--text-dim);
  background: var(--night-panel);
  transition: all var(--transition);
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
}
.series-tab:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.series-tab.active { background: var(--dirt-dark); border-color: var(--dirt); color: var(--text); }

/* ── Status Badges ───────────────────────────────────────── */
.status-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
}
.status-complete  { background: var(--green-faint); color: var(--green); }
.status-pending   { background: rgba(240,180,41,0.12); color: var(--gold); }
.status-live      { background: var(--green-faint); color: var(--green); }
.status-cancelled { background: var(--red-faint); color: var(--red); }

/* ── Event Items ─────────────────────────────────────────── */
.event-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
}
.event-item:last-child { border-bottom: none; }
.event-item:hover { background: var(--night-hover); }
.event-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.event-item-name { font-size: 13px; font-weight: 600; color: var(--text); }
.event-item-meta {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.event-item-note { font-size: 11px; color: var(--dirt-light); margin-top: 3px; }

/* ── Driver Rows (sidebar) ───────────────────────────────── */
.driver-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.driver-row:last-child { border-bottom: none; }
.driver-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--night);
  border: 1.5px solid var(--night-border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.driver-avatar.gold { border-color: var(--gold-dim); color: var(--gold); }
.driver-avatar.silver { border-color: #6a7384; color: var(--silver); }
.driver-info { flex: 1; min-width: 0; }
.driver-info-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.driver-info-sub  { font-size: 11px; color: var(--text-dim); }
.driver-rating-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
  flex-shrink: 0;
}

/* ── Time Trial Rows ─────────────────────────────────────── */
.tt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.tt-row:last-child { border-bottom: none; }
.tt-pos {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-dim);
  width: 22px;
  flex-shrink: 0;
}
.tt-pos.p1 { color: var(--gold); }
.tt-name  { flex: 1; color: var(--text); font-weight: 500; margin-left: 6px; }
.tt-time  { color: var(--dirt-light); font-weight: 600; font-family: var(--font-display); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ── Upload Zone ─────────────────────────────────────────── */
.upload-zone {
  border: 1.5px dashed rgba(192,84,26,0.4);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--dirt-light);
  background: var(--dirt-faint);
}
.upload-icon { font-size: 28px; color: var(--dirt-light); margin-bottom: 8px; line-height: 1; }
.upload-text { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.upload-text strong { color: var(--text); }
.upload-filename { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }
.upload-input { display: none; }

/* ── Sidebar Cards ───────────────────────────────────────── */
.side-card {
  background: var(--night-panel);
  border: 1px solid var(--night-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.side-card-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--night-border);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.side-card-body { padding: 12px 14px; }
.side-port-label { font-size: 10px; color: var(--dirt-light); font-weight: 600; letter-spacing: 0; text-transform: none; font-family: var(--font-body); }

/* ── Driver Profile ──────────────────────────────────────── */
.profile-header {
  background: var(--night-mid);
  border-bottom: 1px solid var(--night-border);
  padding: 28px 24px;
}
.profile-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.profile-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--dirt-dark);
  border: 2px solid var(--dirt);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  color: var(--text);
  flex-shrink: 0;
}
.profile-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 36px;
  color: var(--text);
  line-height: 1;
}
.profile-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* ── Metric Cards ────────────────────────────────────────── */
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric-card {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.metric-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.metric-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  color: var(--text);
  line-height: 1;
}
.metric-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary { background: var(--dirt); color: var(--text); border-color: var(--dirt-light); }
.btn-primary:hover { background: var(--dirt-light); }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--night-border); }
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.2); background: var(--night-hover); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--night);
  border: 1px solid var(--night-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 12px;
  transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--dirt);
}
.form-select option { background: var(--night-panel); }
.form-textarea { resize: vertical; min-height: 80px; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 16px; font-size: 13px; }
.alert-success { background: var(--green-faint); border: 1px solid rgba(34,197,94,0.3); color: var(--green); }
.alert-error   { background: var(--red-faint);   border: 1px solid rgba(239,68,68,0.25); color: var(--red); }
.alert-warning { background: rgba(240,180,41,0.1); border: 1px solid rgba(240,180,41,0.3); color: var(--gold); }
.alert-info    { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.25); color: #60a5fa; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--night-mid);
  border-top: 1px solid var(--night-border);
  padding: 20px 24px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 16px;
  color: var(--dirt-light);
}
.footer-logo span { color: var(--text); }
.footer-links { display: flex; gap: 16px; flex: 1; }
.footer-links a { font-size: 12px; color: var(--text-dim); transition: color var(--transition); }
.footer-links a:hover { color: var(--text); }
.footer-meta { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.footer-meta a { color: var(--dirt-light); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-inner       { grid-template-columns: 1fr; }
  .main-grid        { grid-template-columns: 1fr; }
  .sidebar          { display: contents; }
  .hero-title       { font-size: 38px; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 52px; left: 0; right: 0; background: var(--night-mid); border-bottom: 1px solid var(--night-border); padding: 8px; z-index: 99; }
  .nav-mobile-toggle { display: flex; flex-direction: column; gap: 4px; cursor: pointer; padding: 6px; background: none; border: none; margin-left: 8px; }
  .nav-mobile-toggle span { width: 20px; height: 2px; background: var(--text-dim); border-radius: 2px; transition: all var(--transition); }
  .standings-table th:nth-child(n+6),
  .standings-table td:nth-child(n+6) { display: none; }
  .footer-links, .footer-meta { display: none; }
  .hero { padding: 20px 16px; }
  .page-wrap, .main-grid { padding: 16px; }
}

/* ── Utilities ───────────────────────────────────────────── */
.text-dim    { color: var(--text-dim); }
.text-gold   { color: var(--gold); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-dirt   { color: var(--dirt-light); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.flex   { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.font-display { font-family: var(--font-display); }
.font-bold    { font-weight: 700; }
.truncate     { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden       { display: none; }

/* ── Nav Dropdown ─────────────────────────────────────────── */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-caret {
  font-size: 10px;
  transition: transform var(--transition);
  display: inline-block;
}
.nav-dropdown.open .nav-caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--night-panel);
  border: 1px solid var(--night-border);
  border-radius: var(--radius-md);
  min-width: 200px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  overflow: hidden;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text-dim);
  transition: all var(--transition);
  text-decoration: none;
  cursor: pointer;
}
.nav-dropdown-item:hover { background: var(--night-hover); color: var(--text); }
.nav-dropdown-short {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--dirt-light);
  min-width: 44px;
}
.nav-dropdown-full { color: var(--text-dim); font-size: 12px; }
.nav-dropdown-divider { height: 1px; background: var(--night-border); margin: 4px 0; }
.nav-dropdown-all { color: var(--dirt-light) !important; font-size: 12px; font-weight: 600; }
.nav-dropdown-empty { color: var(--text-muted); font-size: 12px; font-style: italic; padding: 10px 14px; }

/* ── Driver Cards ─────────────────────────────────────────── */
.driver-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.driver-card {
  background: var(--night-panel);
  border: 1px solid var(--night-border);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.driver-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dirt-dark), var(--dirt));
  opacity: 0;
  transition: opacity var(--transition);
}
.driver-card:hover { border-color: rgba(192,84,26,0.3); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.driver-card:hover::before { opacity: 1; }
.driver-card-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--dirt-dark);
  border: 2px solid var(--dirt);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  color: var(--text);
  margin: 0 auto 12px;
}
.driver-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.driver-card-rating {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  color: var(--text);
  line-height: 1;
  margin: 8px 0 4px;
}
.driver-card-rating-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.driver-card-stats {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--night-border);
}
.driver-card-stat-val { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text); line-height: 1; }
.driver-card-stat-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }
.driver-card-series { font-size: 11px; color: var(--dirt-light); margin-top: 6px; }

/* ── Series Page ──────────────────────────────────────────── */
.series-hero {
  background: var(--night-mid);
  border-bottom: 1px solid var(--night-border);
  padding: 28px 24px;
}
.series-hero-inner { max-width: 1200px; margin: 0 auto; }
.series-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--dirt-faint);
  color: var(--dirt-light);
  border: 1px solid rgba(192,84,26,0.3);
  margin-bottom: 10px;
}
.series-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
}
.series-meta { font-size: 13px; color: var(--text-dim); display: flex; gap: 16px; flex-wrap: wrap; }
.series-meta-item { display: flex; align-items: center; gap: 5px; }

/* ── Schedule Table ───────────────────────────────────────── */
.schedule-table { width: 100%; border-collapse: collapse; }
.schedule-table th {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-dim);
  padding: 8px 16px; text-align: left;
  border-bottom: 1px solid var(--night-border);
  background: rgba(255,255,255,0.02);
}
.schedule-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
  vertical-align: middle;
}
.schedule-table tr:last-child td { border-bottom: none; }
.schedule-table tr:hover td { background: var(--night-hover); }
.schedule-table a { color: inherit; text-decoration: none; }
.round-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text-muted);
  width: 36px;
}
.round-num.complete { color: var(--green); }
.round-num.next     { color: var(--dirt-light); }

/* ── Crazy8s Page ─────────────────────────────────────────── */
.c8-hero {
  background: linear-gradient(135deg, var(--night-mid) 0%, #1a1420 100%);
  border-bottom: 1px solid var(--night-border);
  padding: 32px 24px;
  position: relative;
  overflow: hidden;
}
.c8-hero::after {
  content: '8';
  position: absolute;
  right: -20px; top: -30px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 220px;
  color: rgba(192,84,26,0.06);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.c8-hero-inner { max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.c8-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--dirt-light); margin-bottom: 8px;
}
.c8-title {
  font-family: var(--font-display);
  font-weight: 900; font-size: 52px; line-height: 0.95;
  color: var(--text); margin-bottom: 12px;
}
.c8-title span { color: var(--dirt-light); }
.c8-track-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(192,84,26,0.15);
  border: 1px solid rgba(192,84,26,0.35);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-top: 12px;
}
.c8-track-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--dirt-light); font-weight: 600; }
.c8-track-name  { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--text); }
.c8-category-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.c8-tab {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 700;
  padding: 7px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--night-border);
  color: var(--text-dim); background: var(--night-panel);
  cursor: pointer; transition: all var(--transition);
  text-transform: uppercase; letter-spacing: 0.5px;
  text-decoration: none; display: inline-block;
}
.c8-tab:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.c8-tab.active { background: var(--dirt-dark); border-color: var(--dirt); color: var(--text); }
.c8-rules-card {
  background: var(--night-panel);
  border: 1px solid var(--night-border);
  border-left: 3px solid var(--dirt);
  border-radius: var(--radius-md);
  padding: 16px;
}
.c8-rules-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--dirt-light); margin-bottom: 10px;
}
.c8-rule { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--text-dim); }
.c8-rule-icon { color: var(--dirt-light); flex-shrink: 0; font-size: 14px; }
.c8-rule:last-child { margin-bottom: 0; }
.c8-week-range { font-size: 11px; color: var(--text-dim); margin-bottom: 12px; }

/* ── Results Page ─────────────────────────────────────────── */
.result-session-block {
  background: var(--night-panel);
  border: 1px solid var(--night-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.result-session-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--night-border);
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,0.02);
}
.session-type-badge {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 3px;
}
.session-qualifying { background: rgba(59,130,246,0.12); color: #60a5fa; }
.session-heat       { background: rgba(234,179,8,0.12);  color: #fbbf24; }
.session-feature    { background: rgba(192,84,26,0.2);   color: var(--dirt-light); }
.session-b_main     { background: rgba(168,85,247,0.12); color: #c084fc; }
.session-other      { background: rgba(255,255,255,0.05); color: var(--text-dim); }

/* ── Profile Page ─────────────────────────────────────────── */
.rating-chart-wrap { height: 140px; position: relative; overflow: hidden; }
.rating-bar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 12px; }
.rating-bar-row:last-child { border-bottom: none; }
.rating-bar-track { flex: 1; height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.rating-bar-fill  { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--dirt-dark), var(--dirt-light)); transition: width 0.6s ease; }

/* ── Admin Panel ──────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; gap: 0; min-height: calc(100vh - 52px); }
.admin-sidebar {
  background: var(--night-mid);
  border-right: 1px solid var(--night-border);
  padding: 20px 0;
}
.admin-sidebar-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--text-muted); padding: 0 16px; margin-bottom: 6px; margin-top: 16px; }
.admin-sidebar-title:first-child { margin-top: 0; }
.admin-nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; font-size: 13px; color: var(--text-dim);
  transition: all var(--transition); text-decoration: none;
}
.admin-nav-link:hover  { color: var(--text); background: var(--night-hover); }
.admin-nav-link.active { color: var(--dirt-light); background: var(--dirt-faint); border-right: 2px solid var(--dirt); }
.admin-content { padding: 24px; overflow-y: auto; }
.admin-page-title { font-family: var(--font-display); font-weight: 700; font-size: 24px; color: var(--text); margin-bottom: 20px; }
