:root {
  --bg: #020614;
  --panel: rgba(9, 13, 33, 0.92);
  --panel-border: rgba(157, 255, 0, 0.08);
  --text: #f5f6fb;
  --muted: #7d859a;
  --accent: #d2ff4d;
  --accent-strong: #a3ff12;
  --danger: #ff5e7e;
  --success: #65f0b5;
  --card: rgba(255, 255, 255, 0.04);
  --blur: blur(20px);
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #081029 0%, #01030c 60%);
  color: var(--text);
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.4;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 32px 20px 80px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent), #4cf1c5);
  color: #020614;
  font-weight: 700;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
  box-shadow: 0 0 25px rgba(162, 255, 73, 0.4);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  margin: 0 0 8px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 32px;
}

.hero-copy {
  flex: 1 1 320px;
  max-width: 520px;
}

.hero-copy p {
  color: var(--muted);
  line-height: 1.6;
}

.hero-metrics {
  flex: 1 1 320px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.hero-metrics > div {
  padding: 18px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 20px 40px rgba(2, 6, 20, 0.6);
}

.metric-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.metric-value {
  font-size: 1.8rem;
  margin: 8px 0 0;
}

.metric-value.status {
  color: var(--accent);
}

.layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 30px 80px rgba(1, 3, 10, 0.7);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.panel h3 {
  font-size: 1.5rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

input,
textarea,
select {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

textarea {
  resize: none;
}

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

.map-wrapper {
  margin: 20px 0;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

#map {
  width: 100%;
  height: 280px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  touch-action: auto;
}

.map-controls {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.point-switch {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 10px 16px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 500;
}

.point-switch.active {
  border-color: var(--accent);
  color: #020614;
  background: var(--accent);
}

.class-gallery {
  margin: 20px 0;
  padding: 14px 0;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(90deg, rgba(162, 255, 72, 0.05), rgba(0, 255, 196, 0.07));
  overflow: hidden;
}

.gallery-track {
  display: inline-flex;
  gap: 16px;
  width: max-content;
  min-width: 200%;
  animation: gallery-scroll 26s linear infinite;
}

.gallery-track:hover {
  animation-play-state: paused;
}

.class-card {
  min-width: 180px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

.class-card:hover {
  transform: translateY(-4px);
}

.class-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(162, 255, 72, 0.35);
}

.class-card .price {
  color: var(--accent);
  font-size: 1.2rem;
  margin-top: 8px;
}

@keyframes gallery-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.price-widget {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.price-widget .label {
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}

.primary,
.ghost,
.pill {
  border: none;
  font-family: inherit;
  cursor: pointer;
}

.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-radius: 999px;
  color: #020614;
  padding: 14px 28px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 1rem;
}

.primary:hover {
  filter: brightness(1.05);
}

.primary.full {
  width: 100%;
}

.pill {
  border-radius: 999px;
}

.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
}

.neon {
  box-shadow: 0 0 18px rgba(162, 255, 73, 0.4);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timeline li {
  padding: 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.timeline .status-pill {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-list li {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

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

.driver-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

footer {
  margin-top: 48px;
  color: var(--muted);
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 20, 0.85);
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: rgba(6, 10, 28, 0.95);
  padding: 32px;
  border-radius: 28px;
  width: min(420px, 90%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.admin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 20, 0.9);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  z-index: 15;
}

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

.admin-card {
  background: rgba(5, 9, 26, 0.95);
  width: min(960px, 95%);
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 32px;
  position: relative;
}

.admin-card .close {
  position: absolute;
  top: 16px;
  right: 16px;
}

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

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.admin-stats .stat {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.table {
  max-height: 260px;
  overflow-y: auto;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.table-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.table-row:nth-child(odd) {
  background: rgba(255, 255, 255, 0.02);
}

.table-row.header {
  position: sticky;
  top: 0;
  background: rgba(5, 9, 26, 0.95);
  font-weight: 600;
}

.error {
  color: var(--danger);
  min-height: 20px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 9, 26, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px 24px;
  border-radius: 999px;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -8px);
}

.hidden {
  display: none !important;
}

@media (pointer: coarse) {
  html,
  body {
    touch-action: pan-y;
    overscroll-behavior: contain;
  }
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .panel {
    padding: 20px;
  }

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

  .map-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
