/* ==========================================================================
   RF SIGNAL DRIVE TRACKER - STYLING DESIGN SYSTEM (VANILLA CSS)
   ========================================================================== */

/* --- Custom Properties / Theme Variables --- */
:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Colors */
  --bg-base: #070a13;
  --bg-surface: rgba(13, 20, 38, 0.55);
  --bg-surface-hover: rgba(20, 30, 58, 0.7);
  --border-light: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(0, 242, 254, 0.4);
  
  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  
  /* Neon Accents */
  --neon-cyan: #00f2fe;
  --neon-blue: #3b82f6;
  --neon-purple: #a855f7;
  --neon-purple-glow: rgba(168, 85, 247, 0.4);
  --neon-cyan-glow: rgba(0, 242, 254, 0.4);
  
  /* Status Colors */
  --color-approved: #10b981;
  --color-approved-glow: rgba(16, 185, 129, 0.25);
  --color-pending: #f59e0b;
  --color-pending-glow: rgba(245, 158, 11, 0.25);
  --color-rejected: #ef4444;
  --color-rejected-glow: rgba(239, 68, 68, 0.25);
  
  /* Transition curve */
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-base);
  color: var(--color-text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

/* --- Network Grid & Glowing Spheres Background --- */
.network-grid {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -3;
  background-size: 50px 50px;
  background-image: 
    linear-gradient(to right, rgba(0, 242, 254, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 242, 254, 0.03) 1px, transparent 1px);
  pointer-events: none;
}

.network-grid::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%, transparent 10%, var(--bg-base) 80%);
}

.radial-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.15;
  z-index: -2;
  pointer-events: none;
  mix-blend-mode: screen;
}

.glow-blue {
  background: radial-gradient(circle, var(--neon-cyan) 0%, transparent 70%);
  top: -10%;
  left: 5%;
}

.glow-purple {
  background: radial-gradient(circle, var(--neon-purple) 0%, transparent 70%);
  bottom: -10%;
  right: 5%;
}

/* --- Login Portal Gateway --- */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
  z-index: 5;
  width: 100%;
}

.login-card {
  max-width: 440px;
  width: 100%;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  border: 1px solid rgba(0, 242, 254, 0.15);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.45), 0 0 25px rgba(0, 242, 254, 0.05);
  animation: fadeIn 0.5s ease-out;
}

.login-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

.login-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 40%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0.75rem;
}

.login-header .subtitle {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-error-message {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-rejected);
  border: 1px solid rgba(239, 68, 68, 0.25);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.auth-toggle-link {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

.auth-toggle-link a {
  color: var(--neon-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.auth-toggle-link a:hover {
  text-decoration: underline;
  color: var(--neon-blue);
}

.login-helper {
  border-top: 1px solid var(--border-light);
  padding-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.helper-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.login-helper ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.login-helper code {
  color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.06);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

/* --- App Container --- */
.app-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  min-height: calc(100vh - 60px);
  animation: fadeIn 0.4s ease-out;
}

/* --- Header Section --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-container {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 242, 254, 0.1);
  border: 1.5px solid var(--neon-cyan);
  border-radius: 14px;
  color: var(--neon-cyan);
  box-shadow: 0 0 15px var(--neon-cyan-glow);
}

.logo-icon {
  width: 28px;
  height: 28px;
}

.pulse-ring {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--neon-cyan);
  border-radius: 14px;
  animation: pulse-ring-anim 2.5s infinite;
  opacity: 0;
}

@keyframes pulse-ring-anim {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.25); opacity: 0; }
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #ffffff 30%, var(--neon-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text .subtitle {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* --- Logged-in User Session Panel --- */
.user-session-panel {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  padding: 0.45rem 1rem 0.45rem 0.5rem;
  border-radius: 30px;
}

.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #070a13;
}

.header-user-info {
  display: flex;
  flex-direction: column;
}

.header-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
}

.header-userrole {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.logout-btn {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--color-rejected);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.logout-btn:hover {
  background: var(--color-rejected);
  color: #fff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

/* --- Global Metric Cards --- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.metric-card {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 242, 254, 0.15);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: var(--transition-smooth);
}

.metric-card:hover::before {
  background: var(--neon-cyan);
}

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

.metric-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-secondary);
  border: 1px solid var(--border-light);
}

.metric-icon-box svg {
  width: 18px;
  height: 18px;
}

/* Accented glow icons */
.cyan-glow { color: var(--neon-cyan); border-color: rgba(0, 242, 254, 0.2); background: rgba(0, 242, 254, 0.05); }
.purple-glow { color: var(--neon-purple); border-color: rgba(168, 85, 247, 0.2); background: rgba(168, 85, 247, 0.05); }
.green-glow { color: var(--color-approved); border-color: rgba(16, 185, 129, 0.2); background: rgba(16, 185, 129, 0.05); }
.amber-glow { color: var(--color-pending); border-color: rgba(245, 158, 11, 0.2); background: rgba(245, 158, 11, 0.05); }

.metric-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.metric-trend {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* --- Main Layout Grid --- */
.dashboard-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.workspace-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Workspace Panels */
.workspace-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* --- Glassmorphic Cards --- */
.glass-card {
  background: var(--bg-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: 18px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.flex-header {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  transition: var(--transition-smooth);
}

.status-indicator.live-pulse {
  background: var(--color-approved);
  box-shadow: 0 0 10px var(--color-approved);
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 14px var(--color-approved); }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* --- Drive Telemetry Stopwatch Card Styles --- */
.telemetry-card {
  border-color: rgba(0, 242, 254, 0.15);
}
.telemetry-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: center;
  background: rgba(0,0,0,0.15);
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid var(--border-light);
}

.timer-display-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.timer-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timer-clock {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--neon-cyan);
  line-height: 1;
  letter-spacing: 0.05em;
  text-shadow: 0 0 15px rgba(0, 242, 254, 0.25);
  margin: 0.25rem 0;
}

.timer-hours-sub {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--neon-purple);
}

.telemetry-timestamps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-left: 1px solid var(--border-light);
  padding-left: 1.25rem;
}

.time-stamp-block {
  display: flex;
  flex-direction: column;
}

.ts-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
}

.ts-val {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.telemetry-actions {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
}

.session-btn {
  width: auto;
  min-width: 200px;
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.session-btn.start-state {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #070a13;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.session-btn.start-state:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  filter: brightness(1.05);
}

.session-btn.stop-state {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
  animation: stop-pulse 2s infinite;
}

.session-btn.stop-state:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
  filter: brightness(1.05);
}

@keyframes stop-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* --- Locked Drive Logger Form overlay state --- */
.form-disabled {
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

.timer-lock-badge {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-pending);
  border: 1px solid rgba(245, 158, 11, 0.2);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.input-locked {
  background: rgba(168, 85, 247, 0.05) !important;
  border-color: rgba(168, 85, 247, 0.2) !important;
  color: var(--neon-purple) !important;
  font-weight: 700;
  font-family: var(--font-display);
}

/* --- Forms & Styled Inputs --- */
.dashboard-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.input-style, .dropdown-style {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-light);
  color: var(--color-text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  outline: none;
  transition: var(--transition-smooth);
  width: 100%;
}

.input-style:focus, .dropdown-style:focus {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

.dropdown-style option {
  background-color: #0b0f19;
  color: var(--color-text-primary);
}

.numeric-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.numeric-input-wrapper input {
  padding-right: 3.5rem;
}

.input-unit {
  position: absolute;
  right: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.textarea-style {
  resize: vertical;
  min-height: 70px;
}

.submit-btn {
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-blue) 100%);
  color: #070a13;
  border: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.25);
  width: auto;
  min-width: 180px;
  align-self: center;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
  filter: brightness(1.05);
}

.submit-btn:active {
  transform: translateY(0);
}

/* --- Tables & Custom Scrollbars --- */
.table-container {
  overflow-x: auto;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

th {
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.95rem 1.25rem;
  border-bottom: 1.5px solid var(--border-light);
}

td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--color-text-primary);
}

tr:last-child td {
  border-bottom: none;
}

tr {
  transition: var(--transition-smooth);
}

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

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

/* Scrollbar Customization */
.table-container::-webkit-scrollbar,
.rankings-list::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.table-container::-webkit-scrollbar-track,
.rankings-list::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.1);
}

.table-container::-webkit-scrollbar-thumb,
.rankings-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover,
.rankings-list::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 242, 254, 0.2);
}

/* --- Badges --- */
.tester-name-badge {
  background: rgba(168, 85, 247, 0.1);
  color: var(--neon-purple);
  border: 1px solid rgba(168, 85, 247, 0.2);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
}

.tech-chip {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.2);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.signal-bar-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
}
.signal-bar {
  width: 3px;
  height: 10px;
  background: rgba(255,255,255,0.15);
  border-radius: 1px;
}
.signal-bar.active {
  background: var(--neon-cyan);
}
.sig-excellent .signal-bar:nth-child(-n+4) { background: var(--color-approved); }
.sig-good .signal-bar:nth-child(-n+3) { background: var(--neon-cyan); }
.sig-fair .signal-bar:nth-child(-n+2) { background: var(--color-pending); }
.sig-poor .signal-bar:nth-child(1) { background: var(--color-rejected); }

/* --- Leaderboard Panel UI --- */
.leaderboard-card {
  padding: 1.5rem;
  gap: 1rem;
}

.leaderboard-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trophy-icon {
  width: 22px;
  height: 22px;
  color: #fbbf24;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.4));
}

.leaderboard-metric-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 3px;
}

.metric-selector-btn {
  background: transparent;
  border: none;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--color-text-secondary);
  padding: 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.metric-selector-btn:hover {
  color: var(--color-text-primary);
}

.metric-selector-btn.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%);
  color: var(--color-text-primary);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.leaderboard-tabs {
  display: flex;
  border-bottom: 1.5px solid var(--border-light);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.5rem 0;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
}

.tab-btn:hover {
  color: var(--color-text-secondary);
}

.tab-btn.active {
  color: var(--neon-cyan);
  border-bottom-color: var(--neon-cyan);
}

/* Leaderboard Content - Top 3 Podium */
.podium-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  height: 165px;
}

.podium-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  flex: 1;
}

.podium-avatar-wrapper {
  position: relative;
  margin-bottom: 0.35rem;
}

.podium-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #070a13;
  font-size: 1rem;
}

.podium-crown {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) rotate(-5deg);
  font-size: 1.1rem;
}

.podium-rank-badge {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 1px solid var(--color-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
}

.podium-step-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-primary);
  text-align: center;
  max-width: 75px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-step-val {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.podium-pillar {
  width: 100%;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.03));
  border: 1.5px solid var(--border-light);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  margin-top: 0.35rem;
  transition: height 0.5s ease-out;
}

/* Height styling for steps */
.step-1st { height: 75px; border-color: rgba(251, 191, 36, 0.35); background: linear-gradient(to top, rgba(251, 191, 36, 0.01), rgba(251, 191, 36, 0.05)); }
.step-2nd { height: 50px; border-color: rgba(203, 213, 225, 0.35); background: linear-gradient(to top, rgba(203, 213, 225, 0.01), rgba(203, 213, 225, 0.05)); }
.step-3rd { height: 35px; border-color: rgba(180, 83, 9, 0.35); background: linear-gradient(to top, rgba(180, 83, 9, 0.01), rgba(180, 83, 9, 0.05)); }

.step-1st .podium-avatar { background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%); border: 2px solid #fbbf24; }
.step-1st .podium-rank-badge { border-color: #fbbf24; color: #fbbf24; }

.step-2nd .podium-avatar { background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 100%); border: 2px solid #cbd5e1; }
.step-2nd .podium-rank-badge { border-color: #cbd5e1; color: #cbd5e1; }

.step-3rd .podium-avatar { background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%); border: 2px solid #f59e0b; }
.step-3rd .podium-rank-badge { border-color: #f59e0b; color: #f59e0b; }

/* Leaderboard Content - List */
.rankings-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.35rem;
}

.rank-item {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition-smooth);
}

.rank-item:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.rank-item.logged-in-user {
  border-color: var(--neon-cyan);
  background: rgba(0, 242, 254, 0.04);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.05);
}

.rank-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rank-number {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted);
  width: 16px;
  text-align: center;
}

.rank-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  background: linear-gradient(135deg, var(--neon-purple) 0%, var(--neon-blue) 100%);
  color: #070a13;
}

/* highlight avatar for logged in user */
.logged-in-user .rank-avatar {
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-blue) 100%);
  box-shadow: 0 0 8px var(--neon-cyan-glow);
}

.rank-name-container {
  display: flex;
  flex-direction: column;
}

.rank-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.logged-in-user .rank-name {
  color: var(--neon-cyan);
  font-weight: 700;
}

.rank-role {
  font-size: 0.68rem;
  color: var(--color-text-muted);
}

.rank-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rank-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

.rank-badge-text {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.rb-champ { background: rgba(251, 191, 36, 0.1); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.2); }
.rb-runner { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.2); }
.rb-speed { background: rgba(16, 185, 129, 0.1); color: var(--color-approved); border: 1px solid rgba(16, 185, 129, 0.2); }

/* --- Footer --- */
.app-footer {
  text-align: center;
  padding: 1.5rem 0;
  margin-top: auto;
  border-top: 1px solid var(--border-light);
}

.app-footer p {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* --- Helper Classes --- */
.hidden {
  display: none !important;
}

.no-records-message {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1.25rem;
  }
  
  .user-session-panel {
    width: 100%;
    justify-content: space-between;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 580px) {
  .app-container {
    padding: 1rem;
    gap: 1.5rem;
  }

  .brand-text h1 {
    font-size: 1.3rem;
  }

  .logo-container {
    width: 44px;
    height: 44px;
  }

  .logo-icon {
    width: 24px;
    height: 24px;
  }

  .telemetry-body {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 1rem;
  }

  .timer-display-box {
    align-items: center;
    text-align: center;
  }

  .timer-clock {
    font-size: 2.2rem;
  }

  .telemetry-timestamps {
    border-left: none;
    border-top: 1px solid var(--border-light);
    padding-left: 0;
    padding-top: 1rem;
    flex-direction: row;
    justify-content: space-around;
    text-align: center;
  }

  .metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 1.5rem 1.25rem;
  }

  .login-header h2 {
    font-size: 1.4rem;
  }

  .glass-card {
    padding: 1.25rem;
  }

  td, th {
    padding: 0.6rem 0.75rem;
    font-size: 0.8rem;
  }

  .metric-card {
    padding: 1.25rem;
  }

  .metric-value {
    font-size: 1.8rem;
  }

  .session-btn {
    min-width: 100%;
  }

  .submit-btn {
    min-width: 100%;
  }
}

@media (max-width: 400px) {
  .podium-container {
    height: 140px;
    margin-bottom: 1rem;
  }

  .podium-avatar {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }

  .podium-step-name {
    max-width: 55px;
    font-size: 0.7rem;
  }

  .podium-step-val {
    font-size: 0.78rem;
  }

  .podium-pillar {
    margin-top: 0.25rem;
  }

  .step-1st .podium-pillar { height: 50px; }
  .step-2nd .podium-pillar { height: 32px; }
  .step-3rd .podium-pillar { height: 20px; }
}

/* ==========================================================================
   HIDDEN ADMIN PANEL ADDITIONS
   ========================================================================== */

/* Admin Header modifications */
.admin-header-border {
  border-bottom: 1.5px solid rgba(239, 68, 68, 0.2) !important;
}

.admin-logo-box {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: #ef4444 !important;
  color: #ef4444 !important;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.2) !important;
}

.admin-title-badge {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 0.5rem;
  letter-spacing: 0.05em;
}

.admin-badge-glow {
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.admin-avatar {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
  color: #fff !important;
}

.admin-logout-btn {
  background: rgba(239, 68, 68, 0.06);
  border-color: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.admin-logout-btn:hover {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

/* Admin Grid Layouts */
.admin-grid-layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.admin-main-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.admin-side-column {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Admin tab bars */
.admin-tabs-bar {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1.5px solid var(--border-light);
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
  overflow-x: auto;
}

.admin-tab-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  color: var(--color-text-secondary);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.admin-tab-btn:hover {
  color: var(--color-text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.admin-tab-btn.active {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.05);
}

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

/* System Analytics Grid */
.admin-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.analytics-stat-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  padding: 1.25rem;
  border-radius: 12px;
}

.analytics-stat-card h3 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.analytics-stat-card p {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--neon-cyan);
}

/* Region Summaries on Admin Panel */
.region-summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.region-summary-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.region-summary-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

/* Modal overlays */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  max-width: 480px;
  width: 100%;
  margin: 1.5rem;
  border: 1px solid var(--border-focus);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.75rem;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  color: #ef4444;
}

/* Admin Entrance Egg styling */
.admin-entrance-container {
  text-align: center;
  margin-top: 1.25rem;
  border-top: 1.5px dashed rgba(239, 68, 68, 0.15);
  padding-top: 1.25rem;
  animation: fadeIn 0.4s ease-out;
}

.admin-entrance-container a {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ef4444;
  text-decoration: none;
  transition: var(--transition-smooth);
  letter-spacing: 0.02em;
}

.admin-entrance-container a:hover {
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* Table modification action buttons */
.admin-action-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--color-text-secondary);
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-admin-edit:hover {
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
}

.btn-admin-delete:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* Responsive breakdowns for Admin dashboard */
@media (max-width: 1024px) {
  .admin-grid-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .admin-analytics-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
